Source: renpy Version: 6.17.6-1.1 Severity: wishlist Tags: patch Usertags: reintroducing-ffmpeg
Dear maintainer, I am working on reintroducing FFmpeg to Debian [1-2]. In order to make FFmpeg co-installable with Libav, the libraries were renamed to lib*-ffmpeg. Thus using linker flags like '-lavcodec' doesn't work with the FFmpeg packages. To get the correct linking flags for both FFmpeg and Libav, one can (and should) use pkg-config. Attached patch achieves that for this package. Please apply it to facilitate building your package with FFmpeg in Debian. If you want to facilitate this even further, you can also add lib*-ffmpeg-dev alternatives to the Libav build-dependencies. While the FFmpeg package is still waiting in the NEW queue [3], it can already be built from the git repository [4]. The other patch is necessary to fix building against FFmpeg. Best regards, Andreas 1: https://lists.debian.org/debian-devel/2014/07/msg01010.html 2: https://bugs.debian.org/729203 3: https://ftp-master.debian.org/new/ffmpeg_7:2.3.1-1.html 4: https://anonscm.debian.org/cgit/collab-maint/ffmpeg.git
diff --git a/debian/patches/Replace-removed-macros.patch b/debian/patches/Replace-removed-macros.patch new file mode 100644 index 0000000..433073c --- /dev/null +++ b/debian/patches/Replace-removed-macros.patch @@ -0,0 +1,19 @@ +Description: Replace removed macros + Replace AVCODEC_MAX_AUDIO_FRAME_SIZE with its previous value 192000. + +Author: Andreas Cadhalpun <[email protected]> +Last-Update: <2014-04-25> + +--- renpy-6.16.5.orig/module/ffdecode.c ++++ renpy-6.16.5/module/ffdecode.c +@@ -101,8 +101,8 @@ typedef struct VideoState { + compensation */ + + #ifndef HAS_RESAMPLE +- uint8_t audio_buf1[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2] __attribute__ ((aligned (16))) ; +- uint8_t audio_buf2[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2] __attribute__ ((aligned (16))) ; ++ uint8_t audio_buf1[(192000 * 3) / 2] __attribute__ ((aligned (16))) ; ++ uint8_t audio_buf2[(192000 * 3) / 2] __attribute__ ((aligned (16))) ; + #else + uint8_t *audio_buf1; + #endif diff --git a/debian/patches/series b/debian/patches/series index 5722499..53ef794 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ 03_checkdir.patch 04_typo.patch 05_pxi_files.patch +Replace-removed-macros.patch
diff --git a/debian/patches/pkg-config.patch b/debian/patches/pkg-config.patch new file mode 100644 index 0000000..0319cde --- /dev/null +++ b/debian/patches/pkg-config.patch @@ -0,0 +1,69 @@ +Description: Use pkg-config to determine FFmpeg linker flags. + +Author: Andreas Cadhalpun <[email protected]> +Last-Update: <2014-05-15> + +--- renpy-6.16.5.orig/module/setup.py ++++ renpy-6.16.5/module/setup.py +@@ -3,6 +3,7 @@ + import platform + import sys + import os ++import subprocess + + # Change to the directory containing this file. + os.chdir(os.path.abspath(os.path.dirname(sys.argv[0]))) +@@ -34,11 +35,29 @@ include("GL/glew.h") + + library("SDL") + library("png") +-library("avformat") +-library("avcodec") +-library("avutil") +-has_avresample = library("avresample", optional=True) +-has_swscale = library("swscale", optional=True) ++ ++avf_name = subprocess.check_output(["pkg-config", "--libs", "libavformat"]).decode(encoding="utf8").lstrip('-l').rstrip(' \n') ++avc_name = subprocess.check_output(["pkg-config", "--libs", "libavcodec"]).decode(encoding="utf8").lstrip('-l').rstrip(' \n') ++avu_name = subprocess.check_output(["pkg-config", "--libs", "libavutil"]).decode(encoding="utf8").lstrip('-l').rstrip(' \n') ++ ++try: ++ avr_name = subprocess.check_output(["pkg-config", "--libs", "libavresample"]).decode(encoding="utf8").lstrip('-l').rstrip(' \n') ++except subprocess.CalledProcessError: ++ # Ignore errors that are caused by the library not being present. ++ avr_name = "avresample" ++ ++ ++try: ++ sws_name = subprocess.check_output(["pkg-config", "--libs", "libswscale"]).decode(encoding="utf8").lstrip('-l').rstrip(' \n') ++except subprocess.CalledProcessError: ++ # Ignore errors that are caused by the library not being present. ++ sws_name = "swscale" ++ ++library(avf_name) ++library(avc_name) ++library(avu_name) ++has_avresample = library(avr_name, optional=True) ++has_swscale = library(sws_name, optional=True) + library("freetype") + has_fribidi = library("fribidi", optional=True) + library("z") +@@ -69,15 +88,15 @@ pymodule("pysdlsound.__init__") + + if not android: + +- sound = [ "avformat", "avcodec", "avutil", "z" ] ++ sound = [ avf_name, avc_name, avu_name, "z" ] + macros = [ ] + + if has_avresample: +- sound.insert(0, "avresample") ++ sound.insert(0, avr_name) + macros.append(("HAS_RESAMPLE", 1)) + + if has_swscale: +- sound.insert(0, "swscale") ++ sound.insert(0, sws_name) + + cython( + "pysdlsound.sound", diff --git a/debian/patches/series b/debian/patches/series index 3da2d94..33b1dd4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,4 @@ 04_typo.patch 05_pxi_files.patch Replace-removed-macros.patch +pkg-config.patch

