From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 31FFF15806E for ; Wed, 31 May 2023 23:48:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4C59FE0950; Wed, 31 May 2023 23:48:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3091FE0950 for ; Wed, 31 May 2023 23:48:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 55B15340AB2 for ; Wed, 31 May 2023 23:48:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 166DEA67 for ; Wed, 31 May 2023 23:48:05 +0000 (UTC) From: "Nick Sarnie" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Nick Sarnie" Message-ID: <1685576832.d1b13d1f73246abe7be23ab4f2560ea18d5bffb2.sarnex@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/ffmpegsource/, media-libs/ffmpegsource/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-libs/ffmpegsource/ffmpegsource-2.40-r1.ebuild media-libs/ffmpegsource/files/ffmpegsource-2.40-Fix-build-with-ffmpeg-5.patch X-VCS-Directories: media-libs/ffmpegsource/ media-libs/ffmpegsource/files/ X-VCS-Committer: sarnex X-VCS-Committer-Name: Nick Sarnie X-VCS-Revision: d1b13d1f73246abe7be23ab4f2560ea18d5bffb2 X-VCS-Branch: master Date: Wed, 31 May 2023 23:48:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 5e034349-0b91-45d9-b04c-19c80d0d5163 X-Archives-Hash: edcdbe5e8743e22ed296af1ddcfe033d commit: d1b13d1f73246abe7be23ab4f2560ea18d5bffb2 Author: Nick Sarnie gentoo org> AuthorDate: Wed May 31 23:45:27 2023 +0000 Commit: Nick Sarnie gentoo org> CommitDate: Wed May 31 23:47:12 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1b13d1f media-libs/ffmpegsource: Fix build with ffmpeg 5 Signed-off-by: Nick Sarnie gentoo.org> .../ffmpegsource/ffmpegsource-2.40-r1.ebuild | 45 +++++++++ ...ffmpegsource-2.40-Fix-build-with-ffmpeg-5.patch | 106 +++++++++++++++++++++ 2 files changed, 151 insertions(+) diff --git a/media-libs/ffmpegsource/ffmpegsource-2.40-r1.ebuild b/media-libs/ffmpegsource/ffmpegsource-2.40-r1.ebuild new file mode 100644 index 000000000000..5b1170bad347 --- /dev/null +++ b/media-libs/ffmpegsource/ffmpegsource-2.40-r1.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +QA_PKGCONFIG_VERSION=$(ver_cut 1-2) +inherit autotools + +DESCRIPTION="A libav/ffmpeg based source library for easy frame accurate access" +HOMEPAGE="https://github.com/FFMS/ffms2" +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/FFMS/ffms2.git" + inherit git-r3 +else + SRC_URI="https://github.com/FFMS/ffms2/archive/${PV}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}"/ffms2-${PV} + + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="MIT" +SLOT="0/4" + +RDEPEND=" + >=media-video/ffmpeg-2.4:= + sys-libs/zlib +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES="${FILESDIR}/${P}-Fix-build-with-ffmpeg-5.patch" + +src_prepare() { + default + + # Cheesy hack from autogen.sh + mkdir src/config || die + eautoreconf +} + +src_install() { + default + + find "${ED}" -name '*.la' -delete || die +} diff --git a/media-libs/ffmpegsource/files/ffmpegsource-2.40-Fix-build-with-ffmpeg-5.patch b/media-libs/ffmpegsource/files/ffmpegsource-2.40-Fix-build-with-ffmpeg-5.patch new file mode 100644 index 000000000000..2a2cd0f0a5e1 --- /dev/null +++ b/media-libs/ffmpegsource/files/ffmpegsource-2.40-Fix-build-with-ffmpeg-5.patch @@ -0,0 +1,106 @@ +From 586d87de3f896d0c4ff01b21f572375e11f9c3f1 Mon Sep 17 00:00:00 2001 +From: Derek Buitenhuis +Date: Tue, 4 May 2021 14:20:47 +0100 +Subject: [PATCH] configure: Remove deprecated API use + +Signed-off-by: Derek Buitenhuis +--- + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b35ef80bcd..d19714d0f6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -102,10 +102,10 @@ CFLAGS="$_CFLAGS $FFMPEG_CFLAGS" + + AC_DEFUN([TEST_FFMPEG], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +- #include ++ #include + #include + ]],[[ +- avcodec_register_all(); ++ avformat_network_init(); + swscale_version(); + ]])], [eval $1=yes], [eval $1=no]) + ]) +From 45673149e9a2f5586855ad472e3059084eaa36b1 Mon Sep 17 00:00:00 2001 +From: Derek Buitenhuis +Date: Tue, 4 May 2021 14:41:21 +0100 +Subject: [PATCH] Use auto for AVCodec + +The geniuses over at FFmpeg decided to constify this API, so old +versions of the library will return AVCodec *, while new versions +of the libary will return const AVCodec *, which, in C++, are not +OK to convert between. + +Rather than use some macro hell in ffmscompat.h, we can work around +this by using auto. + +Gross. + +Signed-off-by: Derek Buitenhuis +--- + src/core/audiosource.cpp | 2 +- + src/core/indexing.cpp | 6 +++--- + src/core/videosource.cpp | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/core/audiosource.cpp b/src/core/audiosource.cpp +index e4ce97cdb..ac0966636 100644 +--- a/src/core/audiosource.cpp ++++ b/src/core/audiosource.cpp +@@ -469,7 +469,7 @@ void FFMS_AudioSource::OpenFile() { + + LAVFOpenFile(SourceFile.c_str(), FormatContext, TrackNumber); + +- AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id); ++ auto *Codec = avcodec_find_decoder(FormatContext->streams[TrackNumber]->codecpar->codec_id); + if (Codec == nullptr) + throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC, + "Audio codec not found"); +diff --git a/src/core/indexing.cpp b/src/core/indexing.cpp +index e547c5abf..59fb4e8ea 100644 +--- a/src/core/indexing.cpp ++++ b/src/core/indexing.cpp +@@ -384,7 +384,7 @@ FFMS_TrackType FFMS_Indexer::GetTrackType(int Track) { + } + + const char *FFMS_Indexer::GetTrackCodec(int Track) { +- AVCodec *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id); ++ auto *codec = avcodec_find_decoder(FormatContext->streams[Track]->codecpar->codec_id); + return codec ? codec->name : nullptr; + } + +@@ -402,7 +402,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() { + UseDTS); + + if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { +- AVCodec *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id); ++ auto *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id); + if (!VideoCodec) { + FormatContext->streams[i]->discard = AVDISCARD_ALL; + IndexMask.erase(i); +@@ -433,7 +433,7 @@ FFMS_Index *FFMS_Indexer::DoIndexing() { + IndexMask.insert(i); + } + } else if (IndexMask.count(i) && FormatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { +- AVCodec *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id); ++ auto *AudioCodec = avcodec_find_decoder(FormatContext->streams[i]->codecpar->codec_id); + if (AudioCodec == nullptr) + throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED, + "Audio codec not found"); +diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp +index b889970e2..8956c2256 100644 +--- a/src/core/videosource.cpp ++++ b/src/core/videosource.cpp +@@ -171,7 +171,7 @@ FFMS_VideoSource::FFMS_VideoSource(const char *SourceFile, FFMS_Index &Index, in + + LAVFOpenFile(SourceFile, FormatContext, VideoTrack); + +- AVCodec *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id); ++ auto *Codec = avcodec_find_decoder(FormatContext->streams[VideoTrack]->codecpar->codec_id); + if (Codec == nullptr) + throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC, + "Video codec not found");