Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-electronics/gazebo/files/, sci-electronics/gazebo/
Date: Mon, 21 Feb 2022 17:04:53
Message-Id: 1645463077.230459bb8b717563636a891c28f05d759bd2d282.aballier@gentoo
1 commit: 230459bb8b717563636a891c28f05d759bd2d282
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 19 13:30:45 2022 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 21 17:04:37 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=230459bb
7
8 sci-electronics/gazebo: bump to 11.10.1
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>
12
13 sci-electronics/gazebo/Manifest | 1 +
14 sci-electronics/gazebo/files/ffmpeg5.patch | 137 +++++++++++++++++++++++++++
15 sci-electronics/gazebo/gazebo-11.10.1.ebuild | 84 ++++++++++++++++
16 3 files changed, 222 insertions(+)
17
18 diff --git a/sci-electronics/gazebo/Manifest b/sci-electronics/gazebo/Manifest
19 index 8c6078be5b34..bfbca468808c 100644
20 --- a/sci-electronics/gazebo/Manifest
21 +++ b/sci-electronics/gazebo/Manifest
22 @@ -1 +1,2 @@
23 +DIST gazebo-11.10.1.tar.bz2 56483769 BLAKE2B 9d0aa1d8c21065fddc28d706632cc7bd1b8a3429c606ff51dcbe4657ec41fdfe60e2906dfd5efdcd8d6f1847694d8419957b386bc40aafac739e3277b7c577ab SHA512 ed78aebf0d53a7848dd0900f96082ae508f64bc8fe53277859b32880147643a1b1ff9c273cddfd9e34e8ec4ec53f93d13ba74f3edca16fdcf5e2a040509c5dc3
24 DIST gazebo-11.9.1.tar.bz2 56472954 BLAKE2B c7a1c3c4a03112a90e8a0cb35dde32f5bb478dafb0d8c582d8cbad15ff1f43699782df3d69a75c47efec44d8a15ad96730f1ae9c1b5b0b1ff2099fbc6b8f2e4e SHA512 51af82305ef0758950e2752624cd98bd31abe55469a1cad6432b1edde1a8f896798a554c672f8694c080f7076d13fe1aa91b182227e26f04cb99e9e0f3907694
25
26 diff --git a/sci-electronics/gazebo/files/ffmpeg5.patch b/sci-electronics/gazebo/files/ffmpeg5.patch
27 new file mode 100644
28 index 000000000000..e55bab3c311f
29 --- /dev/null
30 +++ b/sci-electronics/gazebo/files/ffmpeg5.patch
31 @@ -0,0 +1,137 @@
32 +Index: gazebo-11.10.1/gazebo/common/AudioDecoder.cc
33 +===================================================================
34 +--- gazebo-11.10.1.orig/gazebo/common/AudioDecoder.cc
35 ++++ gazebo-11.10.1/gazebo/common/AudioDecoder.cc
36 +@@ -113,8 +113,13 @@ bool AudioDecoder::Decode(uint8_t **_out
37 + # pragma GCC diagnostic push
38 + # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
39 + #endif
40 +- bytesDecoded = avcodec_decode_audio4(this->codecCtx, decodedFrame,
41 +- &gotFrame, &packet1);
42 ++ bytesDecoded = avcodec_send_packet(this->codecCtx, &packet1);
43 ++ if (bytesDecoded >= 0 || bytesDecoded == AVERROR_EOF) {
44 ++ bytesDecoded = avcodec_receive_frame(this->codecCtx, decodedFrame);
45 ++ gotFrame = bytesDecoded >= 0;
46 ++ if (bytesDecoded == AVERROR(EAGAIN) || bytesDecoded == AVERROR_EOF) bytesDecoded = 0;
47 ++ }
48 ++
49 + #ifndef _WIN32
50 + # pragma GCC diagnostic pop
51 + #endif
52 +@@ -214,7 +219,7 @@ bool AudioDecoder::SetFile(const std::st
53 + # pragma GCC diagnostic push
54 + # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
55 + #endif
56 +- if (this->formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
57 ++ if (this->formatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
58 + #ifndef _WIN32
59 + # pragma GCC diagnostic pop
60 + #endif
61 +@@ -238,7 +243,9 @@ bool AudioDecoder::SetFile(const std::st
62 + # pragma GCC diagnostic push
63 + # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
64 + #endif
65 +- this->codecCtx = this->formatCtx->streams[audioStream]->codec;
66 ++ this->codecCtx = avcodec_alloc_context3(nullptr);
67 ++ avcodec_parameters_to_context(this->codecCtx, this->formatCtx->streams[audioStream]->codecpar);
68 ++
69 + #ifndef _WIN32
70 + # pragma GCC diagnostic pop
71 + #endif
72 +Index: gazebo-11.10.1/gazebo/common/AudioDecoder.hh
73 +===================================================================
74 +--- gazebo-11.10.1.orig/gazebo/common/AudioDecoder.hh
75 ++++ gazebo-11.10.1/gazebo/common/AudioDecoder.hh
76 +@@ -75,7 +75,7 @@ namespace gazebo
77 + private: AVCodecContext *codecCtx;
78 +
79 + /// \brief libavcodec audio codec.
80 +- private: AVCodec *codec;
81 ++ private: const AVCodec *codec;
82 +
83 + /// \brief Index of the audio stream.
84 + private: int audioStream;
85 +Index: gazebo-11.10.1/gazebo/common/Video.cc
86 +===================================================================
87 +--- gazebo-11.10.1.orig/gazebo/common/Video.cc
88 ++++ gazebo-11.10.1/gazebo/common/Video.cc
89 +@@ -77,7 +77,7 @@ void Video::Cleanup()
90 + #ifdef HAVE_FFMPEG
91 + bool Video::Load(const std::string &_filename)
92 + {
93 +- AVCodec *codec = nullptr;
94 ++ const AVCodec *codec = nullptr;
95 + this->videoStream = -1;
96 +
97 + if (this->formatCtx || this->avFrame || this->codecCtx)
98 +@@ -107,7 +107,7 @@ bool Video::Load(const std::string &_fil
99 + # pragma GCC diagnostic push
100 + # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
101 + #endif
102 +- if (this->formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
103 ++ if (this->formatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
104 + #ifndef _WIN32
105 + # pragma GCC diagnostic pop
106 + #endif
107 +@@ -128,13 +128,14 @@ bool Video::Load(const std::string &_fil
108 + # pragma GCC diagnostic push
109 + # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
110 + #endif
111 +- this->codecCtx = this->formatCtx->streams[this->videoStream]->codec;
112 ++ this->codecCtx = avcodec_alloc_context3(nullptr);
113 ++ avcodec_parameters_to_context(this->codecCtx, this->formatCtx->streams[this->videoStream]->codecpar);
114 + #ifndef _WIN32
115 + # pragma GCC diagnostic pop
116 + #endif
117 +
118 + // Find the decoder for the video stream
119 +- codec = avcodec_find_decoder(this->codecCtx->codec_id);
120 ++ codec = avcodec_find_decoder(this->formatCtx->streams[this->videoStream]->codecpar->codec_id);
121 + if (codec == nullptr)
122 + {
123 + gzerr << "Codec not found\n";
124 +@@ -231,15 +232,19 @@ bool Video::GetNextFrame(unsigned char *
125 + # pragma GCC diagnostic push
126 + # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
127 + #endif
128 +- int processedLength = avcodec_decode_video2(this->codecCtx, this->avFrame,
129 +- &frameAvailable, &tmpPacket);
130 ++ int processedLength = avcodec_send_packet(this->codecCtx, !tmpPacket.data && !tmpPacket.size ? nullptr : &tmpPacket);
131 + #ifndef _WIN32
132 + # pragma GCC diagnostic pop
133 + #endif
134 ++ if (processedLength >= 0 || processedLength == AVERROR_EOF) {
135 ++ processedLength = avcodec_receive_frame(this->codecCtx, this->avFrame);
136 ++ frameAvailable = processedLength >= 0;
137 ++ if (processedLength == AVERROR(EAGAIN) || processedLength == AVERROR_EOF) processedLength = 0;
138 ++ }
139 + if (processedLength < 0)
140 + {
141 + gzerr << "Error while processing the data\n";
142 +- break;
143 ++ break;
144 + }
145 +
146 + tmpPacket.data = tmpPacket.data + processedLength;
147 +Index: gazebo-11.10.1/gazebo/common/VideoEncoder.cc
148 +===================================================================
149 +--- gazebo-11.10.1.orig/gazebo/common/VideoEncoder.cc
150 ++++ gazebo-11.10.1/gazebo/common/VideoEncoder.cc
151 +@@ -224,7 +224,7 @@ bool VideoEncoder::Start(const std::stri
152 +
153 + // The remainder of this function handles FFMPEG initialization of a video
154 + // stream
155 +- AVOutputFormat *outputFormat = nullptr;
156 ++ const AVOutputFormat *outputFormat = nullptr;
157 +
158 + // This 'if' and 'free' are just for safety. We chech the value of formatCtx
159 + // below.
160 +@@ -294,7 +294,7 @@ bool VideoEncoder::Start(const std::stri
161 + }
162 +
163 + // find the video encoder
164 +- AVCodec *encoder = avcodec_find_encoder(
165 ++ const AVCodec *encoder = avcodec_find_encoder(
166 + this->dataPtr->formatCtx->oformat->video_codec);
167 + if (!encoder)
168 + {
169
170 diff --git a/sci-electronics/gazebo/gazebo-11.10.1.ebuild b/sci-electronics/gazebo/gazebo-11.10.1.ebuild
171 new file mode 100644
172 index 000000000000..4641556896a7
173 --- /dev/null
174 +++ b/sci-electronics/gazebo/gazebo-11.10.1.ebuild
175 @@ -0,0 +1,84 @@
176 +# Copyright 1999-2022 Gentoo Authors
177 +# Distributed under the terms of the GNU General Public License v2
178 +
179 +EAPI=7
180 +
181 +inherit cmake flag-o-matic
182 +
183 +DESCRIPTION="A 3D multiple robot simulator with dynamics"
184 +HOMEPAGE="http://gazebosim.org/"
185 +SRC_URI="https://osrf-distributions.s3.amazonaws.com/gazebo/releases/${P}.tar.bz2"
186 +
187 +LICENSE="Apache-2.0"
188 +# Subslot = major version = soname of libs
189 +SLOT="0/11"
190 +KEYWORDS="~amd64"
191 +IUSE="cpu_flags_x86_sse2 test"
192 +RESTRICT="!test? ( test )"
193 +
194 +RDEPEND="
195 + >=dev-libs/protobuf-2:=
196 + virtual/opengl
197 + media-libs/openal
198 + net-misc/curl
199 + dev-libs/tinyxml
200 + >=dev-libs/tinyxml2-6:=
201 + dev-libs/libtar
202 + <dev-cpp/tbb-2021:=
203 + >=dev-games/ogre-1.7.4:=[freeimage]
204 + <dev-games/ogre-1.10
205 + >=media-libs/freeimage-3.15.4[png]
206 + sci-libs/libccd
207 + >=media-video/ffmpeg-2.6:0=
208 + sci-libs/gts
209 + >=sci-physics/bullet-2.82:=
210 + >=dev-libs/sdformat-9.1:=
211 + dev-qt/qtwidgets:5
212 + dev-qt/qtcore:5
213 + dev-qt/qtopengl:5
214 + dev-libs/boost:=[threads(+)]
215 + sci-libs/gdal:=
216 + virtual/libusb:1
217 + dev-libs/libspnav
218 + media-libs/freeimage
219 + sci-libs/hdf5:=[cxx]
220 + sys-apps/util-linux
221 + media-gfx/graphviz
222 + net-libs/ignition-msgs:5=
223 + sci-libs/ignition-math:6=
224 + net-libs/ignition-transport:8=
225 + sci-libs/ignition-common:3=
226 + sci-libs/ignition-fuel-tools:4=
227 + <x11-libs/qwt-6.2.0:6=[qt5(+)]
228 +"
229 +DEPEND="${RDEPEND}
230 + dev-qt/qttest:5
231 + x11-apps/mesa-progs
232 + test? ( dev-libs/libxslt )
233 +"
234 +BDEPEND="
235 + || ( app-text/ronn-ng app-text/ronn )
236 + app-arch/gzip
237 + virtual/pkgconfig
238 +"
239 +CMAKE_BUILD_TYPE=RelWithDebInfo
240 +PATCHES=(
241 + "${FILESDIR}/qwt.patch"
242 + "${FILESDIR}/cmake.patch"
243 + "${FILESDIR}/ffmpeg5.patch"
244 +)
245 +
246 +src_configure() {
247 + # find OGRE properly
248 + sed -e "s#lib/OGRE#$(get_libdir)/OGRE#" -i cmake/gazebo-config.cmake.in || die
249 +
250 + local mycmakeargs=(
251 + "-DUSE_UPSTREAM_CFLAGS=OFF"
252 + "-DSSE2_FOUND=$(usex cpu_flags_x86_sse2 TRUE FALSE)"
253 + "-DUSE_HOST_CFLAGS=FALSE"
254 + "-DBUILD_TESTING=$(usex test TRUE FALSE)"
255 + "-DENABLE_SCREEN_TESTS=FALSE"
256 + "-DUSE_EXTERNAL_TINYXML2=TRUE"
257 + )
258 + cmake_src_configure
259 +}