summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authortytan6522022-01-01 07:20:38 +0100
committertytan6522022-01-01 07:20:45 +0100
commit5b39c6c2b78cb919aa03852b2c046fb99357cdad (patch)
tree0985b5e49b1182dd70e97576f5b44491c607da98
parentcd089207d28fbd4153d6a2204901ac322f7afaf1 (diff)
downloadaur-5b39c6c2b78cb919aa03852b2c046fb99357cdad.tar.gz
build: Update obs-deps and version checker
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD71
-rw-r--r--ffmpeg-obs.hook10
-rwxr-xr-xffmpeg-obs.sh19
4 files changed, 95 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2d4e0bf20b5b..b4bacc90912a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = ffmpeg-obs
pkgdesc = Complete solution to record, convert and stream audio and video with fixes for OBS Studio. And various options in the PKGBUILD
pkgver = 4.4.1
- pkgrel = 4
+ pkgrel = 5
url = https://ffmpeg.org/
arch = i686
arch = x86_64
@@ -12,11 +12,9 @@ pkgbase = ffmpeg-obs
makedepends = avisynthplus
makedepends = clang
makedepends = ffnvcodec-headers
- makedepends = git
makedepends = ladspa
makedepends = nasm
depends = alsa-lib
- depends = aom
depends = bzip2
depends = fontconfig
depends = fribidi
@@ -47,11 +45,8 @@ pkgbase = ffmpeg-obs
depends = libvidstab.so
depends = libvorbisenc.so
depends = libvorbis.so
- depends = libvpx.so
depends = libwebp
depends = libx11
- depends = libx264.so
- depends = libx265.so
depends = libxcb
depends = libxext
depends = libxml2
@@ -63,10 +58,14 @@ pkgbase = ffmpeg-obs
depends = opus
depends = sdl2
depends = speex
- depends = srt
depends = v4l-utils
depends = xz
depends = zlib
+ depends = aom
+ depends = libvpx.so
+ depends = libx264.so
+ depends = libx265.so
+ depends = srt
depends = librist
depends = libmfx
depends = svt-av1
@@ -86,7 +85,7 @@ pkgbase = ffmpeg-obs
provides = libswscale.so
conflicts = ffmpeg
source = ffmpeg::git+https://git.ffmpeg.org/ffmpeg.git#tag=7e0d640edf6c3eee1816b105c2f7498c4f948e74
- source = obs-deps::git+https://github.com/obsproject/obs-deps.git#tag=2021-12-22
+ source = obs-deps::git+https://github.com/obsproject/obs-deps.git#tag=15072cd42722d87c6b3ed1636b22e98c08575f20
source = vmaf-model-path.patch
sha256sums = SKIP
sha256sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index 9b45d0eae7c5..75557279cb87 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -55,16 +55,24 @@ if [[ -z "$FFMPEG_OBS_VULKAN" ]]; then
FFMPEG_OBS_VULKAN=OFF
fi
+# Version checks will only be added for the default package deps
+DISTRIB_ID=`lsb_release --id | cut -f2 -d$'\t'`
+
pkgname=ffmpeg-obs
pkgver=4.4.1
-pkgrel=4
+pkgrel=5
pkgdesc='Complete solution to record, convert and stream audio and video with fixes for OBS Studio. And various options in the PKGBUILD'
arch=('i686' 'x86_64' 'aarch64')
url=https://ffmpeg.org/
license=(GPL3)
+_aomver=3
+_libristver=0.2.6
+_libvpxsover=7
+_libx264ver=163
+_libx265ver=199
+_srtver=1.4.3
depends=(
alsa-lib
- aom
bzip2
fontconfig
fribidi
@@ -95,11 +103,8 @@ depends=(
libvidstab.so
libvorbisenc.so
libvorbis.so
- libvpx.so
libwebp
libx11
- libx264.so
- libx265.so
libxcb
libxext
libxml2
@@ -111,18 +116,35 @@ depends=(
opus
sdl2
speex
- srt
v4l-utils
xz
zlib
)
+# To manage dependency rebuild easily, this will prevent you to rebuild FFmpeg on non-updated system
+# For Manjaro user this feature is disabled
+if [[ $DISTRIB_ID == 'ManjaroLinux' ]]; then
+ depends+=(
+ 'aom'
+ 'libvpx.so'
+ 'libx264.so'
+ 'libx265.so'
+ 'srt'
+ )
+else
+ depends+=(
+ "aom>=$_aomver"
+ "libvpx.so>=$_libvpxsover"
+ "libx264.so>=$_libx264ver"
+ "libx265.so>=$_libx265ver"
+ "srt>=$_srtver"
+ )
+fi
makedepends=(
git
amf-headers
avisynthplus
clang
ffnvcodec-headers
- git
ladspa
nasm
)
@@ -144,7 +166,7 @@ provides=(
)
conflicts=(ffmpeg)
_tag=7e0d640edf6c3eee1816b105c2f7498c4f948e74
-_deps_tag=2021-12-22
+_deps_tag=15072cd42722d87c6b3ed1636b22e98c08575f20
source=(
"ffmpeg::git+https://git.ffmpeg.org/ffmpeg.git#tag=${_tag}"
"obs-deps::git+https://github.com/obsproject/obs-deps.git#tag=${_deps_tag}"
@@ -156,6 +178,17 @@ sha256sums=(
'8dff51f84a5f7460f8893f0514812f5d2bd668c3276ef7ab7713c99b71d7bd8d'
)
+if [[ $DISTRIB_ID == 'ManjaroLinux' ]]; then
+source+=(
+ "$pkgname.hook"
+ "$pkgname.sh"
+)
+sha256sums+=(
+ "39820f085e4366cfa24b7bf632d331d3bfa6e9f62f47df55892901218636a2fc"
+ "195ad5f134f02666d330342d04561c12a10e0522b3ace80cd36531d4092e1e4d"
+)
+fi
+
if [[ $FFMPEG_OBS_FULL == 'ON' ]]; then
FFMPEG_OBS_DEBUG=ON
FFMPEG_OBS_DECKLINK=ON
@@ -240,7 +273,13 @@ _args+=(
## Add OBS Studio needed feature
_args+=(--enable-librist)
-depends+=('librist')
+# To manage dependency rebuild easily, this will prevent you to rebuild FFmpeg on non-updated system
+# For Manjaro user this feature is disabled
+if [[ $DISTRIB_ID == 'ManjaroLinux' ]]; then
+ depends+=('librist')
+else
+ depends+=("librist>=$_libristver")
+fi
## Add upstream feature for x86_64 build
if [[ $CARCH == 'x86_64' ]]; then
@@ -419,6 +458,9 @@ prepare() {
# https://patchwork.ffmpeg.org/project/ffmpeg/patch/20211117141929.1164334-2-gijs@peskens.net/
patch -Np1 -i "${srcdir}"/obs-deps/CI/patches/FFmpeg-4.4.1-librist.patch
+ ## This patch applies a fix on AOM encoder
+ patch -Np1 -i "${srcdir}"/obs-deps/CI/patches/FFmpeg-4.4.1-libaomenc.patch
+
# Fix "error: unknown type name ‘bool’" made by the patch because stdbool.h is only added through librist from version 0.2.7
sed -i '49 a #if FF_LIBRIST_VERSION < FF_LIBRIST_VERSION_42\n#include <stdbool.h>\n#endif' libavformat/librist.c
@@ -457,7 +499,12 @@ package() {
make DESTDIR="${pkgdir}" -C ffmpeg install install-man
install -Dm 755 ffmpeg/tools/qt-faststart "${pkgdir}"/usr/bin/
-if [[ $_nonfree_enabled == 'ON' ]]; then
- install -D -m644 license_if_nonfree_enabled.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
-fi
+ if [[ $_nonfree_enabled == 'ON' ]]; then
+ install -D -m644 license_if_nonfree_enabled.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ fi
+
+ if [[ $DISTRIB_ID == 'ManjaroLinux' ]]; then
+ install -D -m644 "$srcdir/$pkgname.hook" -t "${pkgdir}"/usr/share/libalpm/hooks/
+ install -D -m755 "$srcdir/$pkgname.sh" -t "${pkgdir}"/usr/share/libalpm/scripts/
+ fi
}
diff --git a/ffmpeg-obs.hook b/ffmpeg-obs.hook
new file mode 100644
index 000000000000..c7faec438cdb
--- /dev/null
+++ b/ffmpeg-obs.hook
@@ -0,0 +1,10 @@
+[Trigger]
+Type = Package
+Operation = Install
+Operation = Upgrade
+Target = ffmpeg-obs
+
+[Action]
+Description = Warn Manjaro user about rebuild
+When = PostTransaction
+Exec = /usr/share/libalpm/scripts/ffmpeg-obs.sh
diff --git a/ffmpeg-obs.sh b/ffmpeg-obs.sh
new file mode 100755
index 000000000000..5009dd1e1fde
--- /dev/null
+++ b/ffmpeg-obs.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+msg() {
+ALL_OFF="\\e[1;0m"
+BOLD="\\e[1;1m"
+GREEN="${BOLD}\\e[1;32m"
+local mesg=$1; shift
+printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}" "$@" >&2
+}
+
+echo
+msg "Warning:
+ -> ffmpeg-obs does not support Manjaro officially.
+ -> Some dependency version checks are disabled to
+ -> allow the package to be built on it.
+ -> So the package may require to be rebuilt if some
+ -> dependency packages are updated. If not the
+ -> package could not work correctly.
+"