Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: ffmpeg5-5.1.2
@ 2023-03-18 14:41 milgra
  2023-03-18 14:44 ` paper42
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: milgra @ 2023-03-18 14:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2480 bytes --]

There is a new pull request by milgra against master on the void-packages repository

https://github.com/milgra/void-packages ffmpeg5-branch
https://github.com/void-linux/void-packages/pull/42840

New package: ffmpeg5-5.1.2
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)

#### Doesn't install with xi, help needed on that

After checking out [36315](https://github.com/void-linux/void-packages/pull/36315) and [41470](https://github.com/void-linux/void-packages/pull/41470) I've decided to create a separate ffmpeg5 package. There are a few good reasons for this :

- This is a clean and safe way to have ffmpeg5 in the source packages without breaking the other packages using the current ffmpeg ( 4.1.2 )

- I have problems with [41470](https://github.com/void-linux/void-packages/pull/41470), testing program compatibility by just compiling is not safe. ffmpeg 5 introduced major breaking changes, it should be the program creator who makes sure that the program works well with an updated dependency. With the ffmpeg5 package we can go through all packages one by one and and check if they are already using ffmpeg5 or not, and we can update them

- Since the ffmpeg project increases the major version every year and introduces breaking changes and the current version is 6.x, we will need a separate ffmpeg5 package anyway in the next year

- Since ffmpeg is a very important package used by lots of programs and they are changing major versions very quickly it seems better to have versioned packages and the versionless just links to the latest or most stable one. We are already doing this with libvpx for example.

I went through ffmpeg 5's makefile and linked and enabled all the dependencies that are available for void and recent enough for ffmpeg 5.

It compiles fine on a clean void install and the binaries are there but for some reason 'xi ffmpeg' is not working, the -devel package misses the compiled dependencies, I don't know how to tell xbps-src to install the libraries first, I would like to ask for help in this topic. I also couldn't test if the new shared objects break the packages linking to the old shared objects. 

A patch file from https://github.com/void-linux/void-packages/pull/42840.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ffmpeg5-branch-42840.patch --]
[-- Type: text/x-diff, Size: 11092 bytes --]

From f2480e09a849a96e34bd0f82405245c425847d65 Mon Sep 17 00:00:00 2001
From: Milan Toth <milgra@milgra.com>
Date: Mon, 6 Mar 2023 22:09:03 +0100
Subject: [PATCH] New package: ffmpeg5-5.1.2

---
 common/shlibs            |   8 +
 srcpkgs/ffmpeg5-devel    |   1 +
 srcpkgs/ffmpeg5/template | 330 +++++++++++++++++++++++++++++++++++++++
 srcpkgs/ffplay5          |   1 +
 srcpkgs/libavcodec5      |   1 +
 srcpkgs/libavdevice5     |   1 +
 srcpkgs/libavfilter5     |   1 +
 srcpkgs/libavformat5     |   1 +
 srcpkgs/libavutil5       |   1 +
 srcpkgs/libpostproc5     |   1 +
 srcpkgs/libswresample5   |   1 +
 srcpkgs/libswscale5      |   1 +
 12 files changed, 348 insertions(+)
 create mode 120000 srcpkgs/ffmpeg5-devel
 create mode 100644 srcpkgs/ffmpeg5/template
 create mode 120000 srcpkgs/ffplay5
 create mode 120000 srcpkgs/libavcodec5
 create mode 120000 srcpkgs/libavdevice5
 create mode 120000 srcpkgs/libavfilter5
 create mode 120000 srcpkgs/libavformat5
 create mode 120000 srcpkgs/libavutil5
 create mode 120000 srcpkgs/libpostproc5
 create mode 120000 srcpkgs/libswresample5
 create mode 120000 srcpkgs/libswscale5

diff --git a/common/shlibs b/common/shlibs
index 538ff08ce5ff..ac46121efc28 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -398,6 +398,14 @@ libpostproc.so.55 libpostproc-4.0_1
 libavcodec.so.58 libavcodec-4.0_1
 libavutil.so.56 libavutil-4.0_1
 libavfilter.so.7 libavfilter-4.0_1
+libavdevice.so.59 libavdevice-5.1.2_1
+libavformat.so.59 libavformat-5.1.2_1
+libswscale.so.6 libswscale-5.1.2_1
+libswresample.so.4 libswresample-5.1.2_1
+libpostproc.so.56 libpostproc-5.1.2_1
+libavcodec.so.59 libavcodec-5.1.2_1
+libavutil.so.57 libavutil-5.1.2_1
+libavfilter.so.8 libavfilter-5.1.2_1
 libSDL-1.2.so.0 SDL-1.2.14_1
 libSDL_image-1.2.so.0 SDL_image-1.2.10_1
 libx264.so.157 x264-20190507.2245_1
diff --git a/srcpkgs/ffmpeg5-devel b/srcpkgs/ffmpeg5-devel
new file mode 120000
index 000000000000..adaa9105abf1
--- /dev/null
+++ b/srcpkgs/ffmpeg5-devel
@@ -0,0 +1 @@
+ffmpeg5
\ No newline at end of file
diff --git a/srcpkgs/ffmpeg5/template b/srcpkgs/ffmpeg5/template
new file mode 100644
index 000000000000..bc0eb4554532
--- /dev/null
+++ b/srcpkgs/ffmpeg5/template
@@ -0,0 +1,330 @@
+# Template file for 'ffmpeg5'
+# audacity also needs to be bumped when a new ffmpeg version bumps libavformat's soname!
+pkgname=ffmpeg5
+version=5.1.2
+revision=1
+short_desc="Decoding, encoding and streaming software"
+maintainer="Milan Toth <milgra@milgra.com>"
+license="GPL-3.0-or-later"
+homepage="https://www.ffmpeg.org"
+changelog="https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog"
+distfiles="https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"
+checksum=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
+
+hostmakedepends="
+pkg-config
+perl
+yasm
+"
+# going through all library groups in ffmpeg 5's makefile
+
+# EXTERNAL_AUTODETECT_LIBRARY_LIST
+
+makedepends="
+alsa-lib-devel
+bzip2-devel
+libxcb-devel
+liblzma-devel
+SDL2-devel
+sndio-devel
+zlib-devel"
+
+# EXTERNAL_LIBRARY_GPL_LIST
+
+makedepends+="
+frei0r-plugins
+libcdio-paranoia-devel
+rubberband-devel
+libvidstab-devel
+x264-devel
+x265-devel
+xvidcore-devel"
+
+# EXTERNAL_LIBRARY_NONFREE_LIST
+
+makedepends+="
+fdk-aac-devel
+libtls-devel"
+
+# EXTERNAL_LIBRARY_VERSION3_LIST
+
+makedepends+="
+gmp-devel"
+
+# EXTERNAL_LIBRARY_LIST
+
+makedepends+="
+chromaprint-devel
+libgcrypt-devel
+ladspa-sdk
+lcms2-devel
+libaom-devel
+libass-devel
+libbluray-devel
+libcaca-devel
+celt-devel
+codec2-devel
+libdav1d-devel
+libdrm-devel
+fontconfig-devel
+freetype-devel
+fribidi-devel
+glslang-devel
+SPIRV-Tools-devel
+libgme-devel
+libgsm-devel
+jack-devel
+libmodplug-devel
+lame-devel
+libopencv4-devel
+libopenjpeg2-devel
+libopenmpt-devel
+opus-devel
+libplacebo-devel
+libpulseaudio
+rabbitmq-c-devel
+librist-devel
+librsvg-devel
+librtmp-devel
+snappy-devel
+libsoxr-devel
+speex-devel
+srt-devel
+libssh-devel
+libtheora-devel
+twolame-devel
+libvorbis-devel
+libvpx6-devel
+libwebp-devel
+libxml2-devel
+zimg-devel
+lilv-devel
+lv2
+libopenal-devel
+mesa
+openssl-devel
+vapoursynth-devel
+ocl-icd-devel
+libmysofa-devel
+vulkan-loader
+$(vopt_if vaapi libva-devel)
+$(vopt_if vdpau libvdpau-devel)
+$(vopt_if nvenc nv-codec-headers)
+$(vopt_if nvdec nv-codec-headers)
+$(vopt_if svtav1 libsvt-av1-devel)
+"
+
+depends="ffplay>=${version}_${revision}"
+
+build_options="vaapi vdpau nvenc nvdec svtav1"
+build_options_default=""
+
+case "$XBPS_TARGET_MACHINE" in
+	i686*|x86_64*) build_options_default+=" vaapi vdpau nvenc nvdec";;
+	ppc64*) build_options_default+=" vaapi vdpau";;
+	mips*) CFLAGS="-mnan=legacy";;
+esac
+
+if [ "$XBPS_TARGET_WORDSIZE" != "32" ]; then
+	build_options_default+=" svtav1"
+fi
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+do_configure() {
+	# Fix gcc on x86_64-musl only
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
+		sed -i configure -e "s;_cflags_speed='-O3';_cflags_speed='-O2';"
+	fi
+
+	if [ "$CROSS_BUILD" ]; then
+		case "$XBPS_TARGET_MACHINE" in
+			arm*) _arch="arm";;
+			aarch64*) _arch="aarch64";;
+			mips*) _arch="mips";;
+			ppc64*) _arch="ppc64";;
+			ppc*) _arch="ppc";;
+			*) _arch="${XBPS_TARGET_MACHINE%%-musl}";;
+		esac
+
+		_args+=" --enable-cross-compile
+			--sysroot=$XBPS_CROSS_BASE
+			--cross-prefix=${XBPS_CROSS_TRIPLET}-
+			--target-os=linux --arch=${_arch}"
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		ppc|ppc-musl) _args+=" --disable-altivec";;
+	esac
+
+	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+		_args+=" --extra-libs=-latomic"
+	fi
+
+	./configure \
+		--prefix='/usr' \
+		--extra-cflags='-I/opt/cuda/include' \
+		--extra-ldflags='-L/opt/cuda/lib64' \
+		--disable-stripping \
+		--enable-shared \
+		--enable-static \
+		--enable-nonfree \
+		--enable-gpl \
+		--enable-version3 \
+		--enable-libxcb \
+		\
+		--enable-frei0r \
+		--enable-libcdio \
+		--enable-librubberband \
+		--enable-libvidstab \
+		--enable-libx264 \
+		--enable-libx265 \
+		--enable-libxvid \
+		\
+		--enable-libfdk-aac \
+		--enable-libtls \
+		\
+		--enable-gmp \
+		\
+		--enable-chromaprint \
+		--enable-gcrypt \
+		--enable-ladspa \
+		--enable-lcms2 \
+		--enable-libaom \
+		--enable-libass \
+		--enable-libbluray \
+		--enable-libcaca \
+		--enable-libcelt \
+		--enable-libcodec2 \
+		--enable-libdav1d \
+		--enable-libdrm \
+		--enable-libfontconfig \
+		--enable-libfreetype \
+		--enable-libfribidi \
+		--enable-libglslang \
+		--enable-libgme \
+		--enable-libgsm \
+		--enable-vapoursynth \
+		--enable-openssl \
+		--enable-opengl \
+		--enable-openal \
+		--enable-lv2 \
+		--enable-libzimg \
+		--enable-libxml2 \
+		--enable-libwebp \
+		--enable-libvorbis \
+		--enable-libtwolame \
+		--enable-libtheora \
+		--enable-libssh \
+		--enable-libsrt \
+		--enable-libspeex \
+		--enable-libsoxr \
+		--enable-librtmp \
+		--enable-librsvg \
+		--enable-librist \
+		--enable-librabbitmq \
+		--enable-libpulse \
+		--enable-libplacebo \
+		--enable-libopus \
+		--enable-libopenmpt \
+		--enable-libopenjpeg \
+		--enable-libmp3lame \
+		--enable-libmodplug \
+		--enable-libjack \
+		--enable-opencl \
+		--enable-libvpx \
+		--enable-libmysofa \
+		$(vopt_enable vaapi) \
+		$(vopt_enable vdpau) \
+		$(vopt_if nvenc '--enable-nvenc') \
+		$(vopt_if nvdec '--enable-nvdec') \
+		$(vopt_enable svtav1 libsvtav1)
+}
+
+do_build() {
+	make ${makejobs}
+	make doc/ff{mpeg,play}.1
+}
+
+do_install() {
+	make DESTDIR=${DESTDIR} install install-man
+}
+
+libavcodec5_package() {
+	short_desc="FFmpeg codec library"
+	pkg_install() {
+		vmove "usr/lib/libavcodec.so.*"
+	}
+}
+libavdevice5_package() {
+	short_desc="FFmpeg device handling library"
+	pkg_install() {
+		vmove "usr/lib/libavdevice.so.*"
+	}
+}
+libavformat5_package() {
+	short_desc="FFmpeg file format library"
+	pkg_install() {
+		vmove "usr/lib/libavformat.so.*"
+	}
+}
+libavutil5_package() {
+	short_desc="FFmpeg utility library"
+	pkg_install() {
+		vmove "usr/lib/libavutil.so.*"
+	}
+}
+libavfilter5_package() {
+	short_desc="FFmpeg audio/video filter library"
+	pkg_install() {
+		vmove "usr/lib/libavfilter.so.*"
+	}
+}
+libpostproc5_package() {
+	short_desc="FFmpeg video postprocessing library"
+	pkg_install() {
+		vmove "usr/lib/libpostproc.so.*"
+	}
+}
+libswscale5_package() {
+	short_desc="FFmpeg video scaling library"
+	pkg_install() {
+		vmove "usr/lib/libswscale.so.*"
+	}
+}
+libswresample5_package() {
+	short_desc="FFmpeg video resampling library"
+	pkg_install() {
+		vmove "usr/lib/libswresample.so.*"
+	}
+}
+ffmpeg5-devel_package() {
+	depends="
+		libavcodec5>=${version}_${revision}
+		libavdevice5>=${version}_${revision}
+		libavformat5>=${version}_${revision}
+		libavutil5>=${version}_${revision}
+		libavfilter5>=${version}_${revision}
+		libpostproc5>=${version}_${revision}
+		libswscale5>=${version}_${revision}
+		libswresample5>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/*.a
+		vmove usr/lib/*.so
+		vmove usr/share/ffmpeg/examples
+		vmove usr/share/man/man3
+	}
+}
+
+ffplay5_package() {
+	short_desc="Simple media player using FFmpeg and SDL2"
+	pkg_install() {
+		vmove usr/bin/ffplay
+		vmove "usr/share/man/man1/ffplay*"
+	}
+}
diff --git a/srcpkgs/ffplay5 b/srcpkgs/ffplay5
new file mode 120000
index 000000000000..adaa9105abf1
--- /dev/null
+++ b/srcpkgs/ffplay5
@@ -0,0 +1 @@
+ffmpeg5
\ No newline at end of file
diff --git a/srcpkgs/libavcodec5 b/srcpkgs/libavcodec5
new file mode 120000
index 000000000000..adaa9105abf1
--- /dev/null
+++ b/srcpkgs/libavcodec5
@@ -0,0 +1 @@
+ffmpeg5
\ No newline at end of file
diff --git a/srcpkgs/libavdevice5 b/srcpkgs/libavdevice5
new file mode 120000
index 000000000000..adaa9105abf1
--- /dev/null
+++ b/srcpkgs/libavdevice5
@@ -0,0 +1 @@
+ffmpeg5
\ No newline at end of file
diff --git a/srcpkgs/libavfilter5 b/srcpkgs/libavfilter5
new file mode 120000
index 000000000000..adaa9105abf1
--- /dev/null
+++ b/srcpkgs/libavfilter5
@@ -0,0 +1 @@
+ffmpeg5
\ No newline at end of file
diff --git a/srcpkgs/libavformat5 b/srcpkgs/libavformat5
new file mode 120000
index 000000000000..adaa9105abf1
--- /dev/null
+++ b/srcpkgs/libavformat5
@@ -0,0 +1 @@
+ffmpeg5
\ No newline at end of file
diff --git a/srcpkgs/libavutil5 b/srcpkgs/libavutil5
new file mode 120000
index 000000000000..adaa9105abf1
--- /dev/null
+++ b/srcpkgs/libavutil5
@@ -0,0 +1 @@
+ffmpeg5
\ No newline at end of file
diff --git a/srcpkgs/libpostproc5 b/srcpkgs/libpostproc5
new file mode 120000
index 000000000000..adaa9105abf1
--- /dev/null
+++ b/srcpkgs/libpostproc5
@@ -0,0 +1 @@
+ffmpeg5
\ No newline at end of file
diff --git a/srcpkgs/libswresample5 b/srcpkgs/libswresample5
new file mode 120000
index 000000000000..adaa9105abf1
--- /dev/null
+++ b/srcpkgs/libswresample5
@@ -0,0 +1 @@
+ffmpeg5
\ No newline at end of file
diff --git a/srcpkgs/libswscale5 b/srcpkgs/libswscale5
new file mode 120000
index 000000000000..adaa9105abf1
--- /dev/null
+++ b/srcpkgs/libswscale5
@@ -0,0 +1 @@
+ffmpeg5
\ No newline at end of file

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-01  2:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-18 14:41 [PR PATCH] New package: ffmpeg5-5.1.2 milgra
2023-03-18 14:44 ` paper42
2023-03-18 14:45 ` paper42
2023-06-17  1:56 ` github-actions
2023-07-01  2:09 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).