diff options
author | Alexis Ballier <aballier@gentoo.org> | 2022-02-19 14:30:45 +0100 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2022-02-21 18:04:37 +0100 |
commit | 230459bb8b717563636a891c28f05d759bd2d282 (patch) | |
tree | 05d3ee7c5cfe61cc1d67cfe8e342ace9a1a75a61 /sci-electronics | |
parent | sci-electronics/gazebo: Remove old (diff) | |
download | gentoo-230459bb8b717563636a891c28f05d759bd2d282.tar.gz gentoo-230459bb8b717563636a891c28f05d759bd2d282.tar.bz2 gentoo-230459bb8b717563636a891c28f05d759bd2d282.zip |
sci-electronics/gazebo: bump to 11.10.1
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Alexis Ballier <aballier@gentoo.org>
Diffstat (limited to 'sci-electronics')
-rw-r--r-- | sci-electronics/gazebo/Manifest | 1 | ||||
-rw-r--r-- | sci-electronics/gazebo/files/ffmpeg5.patch | 137 | ||||
-rw-r--r-- | sci-electronics/gazebo/gazebo-11.10.1.ebuild | 84 |
3 files changed, 222 insertions, 0 deletions
diff --git a/sci-electronics/gazebo/Manifest b/sci-electronics/gazebo/Manifest index 8c6078be5b34..bfbca468808c 100644 --- a/sci-electronics/gazebo/Manifest +++ b/sci-electronics/gazebo/Manifest @@ -1 +1,2 @@ +DIST gazebo-11.10.1.tar.bz2 56483769 BLAKE2B 9d0aa1d8c21065fddc28d706632cc7bd1b8a3429c606ff51dcbe4657ec41fdfe60e2906dfd5efdcd8d6f1847694d8419957b386bc40aafac739e3277b7c577ab SHA512 ed78aebf0d53a7848dd0900f96082ae508f64bc8fe53277859b32880147643a1b1ff9c273cddfd9e34e8ec4ec53f93d13ba74f3edca16fdcf5e2a040509c5dc3 DIST gazebo-11.9.1.tar.bz2 56472954 BLAKE2B c7a1c3c4a03112a90e8a0cb35dde32f5bb478dafb0d8c582d8cbad15ff1f43699782df3d69a75c47efec44d8a15ad96730f1ae9c1b5b0b1ff2099fbc6b8f2e4e SHA512 51af82305ef0758950e2752624cd98bd31abe55469a1cad6432b1edde1a8f896798a554c672f8694c080f7076d13fe1aa91b182227e26f04cb99e9e0f3907694 diff --git a/sci-electronics/gazebo/files/ffmpeg5.patch b/sci-electronics/gazebo/files/ffmpeg5.patch new file mode 100644 index 000000000000..e55bab3c311f --- /dev/null +++ b/sci-electronics/gazebo/files/ffmpeg5.patch @@ -0,0 +1,137 @@ +Index: gazebo-11.10.1/gazebo/common/AudioDecoder.cc +=================================================================== +--- gazebo-11.10.1.orig/gazebo/common/AudioDecoder.cc ++++ gazebo-11.10.1/gazebo/common/AudioDecoder.cc +@@ -113,8 +113,13 @@ bool AudioDecoder::Decode(uint8_t **_out + # pragma GCC diagnostic push + # pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif +- bytesDecoded = avcodec_decode_audio4(this->codecCtx, decodedFrame, +- &gotFrame, &packet1); ++ bytesDecoded = avcodec_send_packet(this->codecCtx, &packet1); ++ if (bytesDecoded >= 0 || bytesDecoded == AVERROR_EOF) { ++ bytesDecoded = avcodec_receive_frame(this->codecCtx, decodedFrame); ++ gotFrame = bytesDecoded >= 0; ++ if (bytesDecoded == AVERROR(EAGAIN) || bytesDecoded == AVERROR_EOF) bytesDecoded = 0; ++ } ++ + #ifndef _WIN32 + # pragma GCC diagnostic pop + #endif +@@ -214,7 +219,7 @@ bool AudioDecoder::SetFile(const std::st + # pragma GCC diagnostic push + # pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif +- if (this->formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) ++ if (this->formatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) + #ifndef _WIN32 + # pragma GCC diagnostic pop + #endif +@@ -238,7 +243,9 @@ bool AudioDecoder::SetFile(const std::st + # pragma GCC diagnostic push + # pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif +- this->codecCtx = this->formatCtx->streams[audioStream]->codec; ++ this->codecCtx = avcodec_alloc_context3(nullptr); ++ avcodec_parameters_to_context(this->codecCtx, this->formatCtx->streams[audioStream]->codecpar); ++ + #ifndef _WIN32 + # pragma GCC diagnostic pop + #endif +Index: gazebo-11.10.1/gazebo/common/AudioDecoder.hh +=================================================================== +--- gazebo-11.10.1.orig/gazebo/common/AudioDecoder.hh ++++ gazebo-11.10.1/gazebo/common/AudioDecoder.hh +@@ -75,7 +75,7 @@ namespace gazebo + private: AVCodecContext *codecCtx; + + /// \brief libavcodec audio codec. +- private: AVCodec *codec; ++ private: const AVCodec *codec; + + /// \brief Index of the audio stream. + private: int audioStream; +Index: gazebo-11.10.1/gazebo/common/Video.cc +=================================================================== +--- gazebo-11.10.1.orig/gazebo/common/Video.cc ++++ gazebo-11.10.1/gazebo/common/Video.cc +@@ -77,7 +77,7 @@ void Video::Cleanup() + #ifdef HAVE_FFMPEG + bool Video::Load(const std::string &_filename) + { +- AVCodec *codec = nullptr; ++ const AVCodec *codec = nullptr; + this->videoStream = -1; + + if (this->formatCtx || this->avFrame || this->codecCtx) +@@ -107,7 +107,7 @@ bool Video::Load(const std::string &_fil + # pragma GCC diagnostic push + # pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif +- if (this->formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) ++ if (this->formatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) + #ifndef _WIN32 + # pragma GCC diagnostic pop + #endif +@@ -128,13 +128,14 @@ bool Video::Load(const std::string &_fil + # pragma GCC diagnostic push + # pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif +- this->codecCtx = this->formatCtx->streams[this->videoStream]->codec; ++ this->codecCtx = avcodec_alloc_context3(nullptr); ++ avcodec_parameters_to_context(this->codecCtx, this->formatCtx->streams[this->videoStream]->codecpar); + #ifndef _WIN32 + # pragma GCC diagnostic pop + #endif + + // Find the decoder for the video stream +- codec = avcodec_find_decoder(this->codecCtx->codec_id); ++ codec = avcodec_find_decoder(this->formatCtx->streams[this->videoStream]->codecpar->codec_id); + if (codec == nullptr) + { + gzerr << "Codec not found\n"; +@@ -231,15 +232,19 @@ bool Video::GetNextFrame(unsigned char * + # pragma GCC diagnostic push + # pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif +- int processedLength = avcodec_decode_video2(this->codecCtx, this->avFrame, +- &frameAvailable, &tmpPacket); ++ int processedLength = avcodec_send_packet(this->codecCtx, !tmpPacket.data && !tmpPacket.size ? nullptr : &tmpPacket); + #ifndef _WIN32 + # pragma GCC diagnostic pop + #endif ++ if (processedLength >= 0 || processedLength == AVERROR_EOF) { ++ processedLength = avcodec_receive_frame(this->codecCtx, this->avFrame); ++ frameAvailable = processedLength >= 0; ++ if (processedLength == AVERROR(EAGAIN) || processedLength == AVERROR_EOF) processedLength = 0; ++ } + if (processedLength < 0) + { + gzerr << "Error while processing the data\n"; +- break; ++ break; + } + + tmpPacket.data = tmpPacket.data + processedLength; +Index: gazebo-11.10.1/gazebo/common/VideoEncoder.cc +=================================================================== +--- gazebo-11.10.1.orig/gazebo/common/VideoEncoder.cc ++++ gazebo-11.10.1/gazebo/common/VideoEncoder.cc +@@ -224,7 +224,7 @@ bool VideoEncoder::Start(const std::stri + + // The remainder of this function handles FFMPEG initialization of a video + // stream +- AVOutputFormat *outputFormat = nullptr; ++ const AVOutputFormat *outputFormat = nullptr; + + // This 'if' and 'free' are just for safety. We chech the value of formatCtx + // below. +@@ -294,7 +294,7 @@ bool VideoEncoder::Start(const std::stri + } + + // find the video encoder +- AVCodec *encoder = avcodec_find_encoder( ++ const AVCodec *encoder = avcodec_find_encoder( + this->dataPtr->formatCtx->oformat->video_codec); + if (!encoder) + { diff --git a/sci-electronics/gazebo/gazebo-11.10.1.ebuild b/sci-electronics/gazebo/gazebo-11.10.1.ebuild new file mode 100644 index 000000000000..4641556896a7 --- /dev/null +++ b/sci-electronics/gazebo/gazebo-11.10.1.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake flag-o-matic + +DESCRIPTION="A 3D multiple robot simulator with dynamics" +HOMEPAGE="http://gazebosim.org/" +SRC_URI="https://osrf-distributions.s3.amazonaws.com/gazebo/releases/${P}.tar.bz2" + +LICENSE="Apache-2.0" +# Subslot = major version = soname of libs +SLOT="0/11" +KEYWORDS="~amd64" +IUSE="cpu_flags_x86_sse2 test" +RESTRICT="!test? ( test )" + +RDEPEND=" + >=dev-libs/protobuf-2:= + virtual/opengl + media-libs/openal + net-misc/curl + dev-libs/tinyxml + >=dev-libs/tinyxml2-6:= + dev-libs/libtar + <dev-cpp/tbb-2021:= + >=dev-games/ogre-1.7.4:=[freeimage] + <dev-games/ogre-1.10 + >=media-libs/freeimage-3.15.4[png] + sci-libs/libccd + >=media-video/ffmpeg-2.6:0= + sci-libs/gts + >=sci-physics/bullet-2.82:= + >=dev-libs/sdformat-9.1:= + dev-qt/qtwidgets:5 + dev-qt/qtcore:5 + dev-qt/qtopengl:5 + dev-libs/boost:=[threads(+)] + sci-libs/gdal:= + virtual/libusb:1 + dev-libs/libspnav + media-libs/freeimage + sci-libs/hdf5:=[cxx] + sys-apps/util-linux + media-gfx/graphviz + net-libs/ignition-msgs:5= + sci-libs/ignition-math:6= + net-libs/ignition-transport:8= + sci-libs/ignition-common:3= + sci-libs/ignition-fuel-tools:4= + <x11-libs/qwt-6.2.0:6=[qt5(+)] +" +DEPEND="${RDEPEND} + dev-qt/qttest:5 + x11-apps/mesa-progs + test? ( dev-libs/libxslt ) +" +BDEPEND=" + || ( app-text/ronn-ng app-text/ronn ) + app-arch/gzip + virtual/pkgconfig +" +CMAKE_BUILD_TYPE=RelWithDebInfo +PATCHES=( + "${FILESDIR}/qwt.patch" + "${FILESDIR}/cmake.patch" + "${FILESDIR}/ffmpeg5.patch" +) + +src_configure() { + # find OGRE properly + sed -e "s#lib/OGRE#$(get_libdir)/OGRE#" -i cmake/gazebo-config.cmake.in || die + + local mycmakeargs=( + "-DUSE_UPSTREAM_CFLAGS=OFF" + "-DSSE2_FOUND=$(usex cpu_flags_x86_sse2 TRUE FALSE)" + "-DUSE_HOST_CFLAGS=FALSE" + "-DBUILD_TESTING=$(usex test TRUE FALSE)" + "-DENABLE_SCREEN_TESTS=FALSE" + "-DUSE_EXTERNAL_TINYXML2=TRUE" + ) + cmake_src_configure +} |