summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO25
-rw-r--r--0001-avbin-remove-unwanted-optimization.patch24
-rw-r--r--0002-avbin-fix-link-and-add-full-relro.patch24
-rw-r--r--0003-avbin-faster-build.patch21
-rw-r--r--PKGBUILD79
-rw-r--r--avbin.pc10
6 files changed, 136 insertions, 47 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0821903aaf18..6f0a3d587563 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,26 @@
-# Generated by mksrcinfo v8
-# Wed Apr 27 18:23:42 UTC 2016
pkgbase = avbin
- pkgdesc = Cross-platform media decoding library
+ pkgdesc = A C library that provides a wrapper around Libav’s video and audio decoding functionality
pkgver = 10
- pkgrel = 2
- url = http://avbin.github.com/
- arch = i686
+ pkgrel = 3
+ url = https://avbin.github.io/
arch = x86_64
- license = LGPL
+ license = LGPL3
makedepends = git
makedepends = yasm
depends = bzip2
depends = zlib
- conflicts = avbin7
- options = !makeflags
- source = avbin::git+https://github.com/AVbin/AVbin.git
+ source = git+https://github.com/AVbin/AVbin.git#tag=avbin-10
+ source = libav-avbin::git+https://github.com/AVbin/libav.git
+ source = 0001-avbin-remove-unwanted-optimization.patch
+ source = 0002-avbin-fix-link-and-add-full-relro.patch
+ source = 0003-avbin-faster-build.patch
+ source = avbin.pc
sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = 8f8b20d6e57bdc6bf73723691740ae35b157785ebda5764a7611a68df427c30a
+ sha256sums = fa8f7263326b10f968836f5fe7ae9efef04cdce58a28cfd3f7cb93985fffb469
+ sha256sums = be5e45a35c35229c68adfc1606c31d479a4813926de1c022d3919c7592d92c8b
+ sha256sums = d43b24480805ede648a5851465b3071fde75d4114f8a6c84430902075767667f
pkgname = avbin
diff --git a/0001-avbin-remove-unwanted-optimization.patch b/0001-avbin-remove-unwanted-optimization.patch
new file mode 100644
index 000000000000..da283151dd02
--- /dev/null
+++ b/0001-avbin-remove-unwanted-optimization.patch
@@ -0,0 +1,24 @@
+diff -Naurp a/linux-x86-32.Makefile b/linux-x86-32.Makefile
+--- a/linux-x86-32.Makefile 2019-04-28 20:25:40.000000000 +0000
++++ b/linux-x86-32.Makefile 2019-04-28 20:32:41.972095497 +0000
+@@ -1,7 +1,7 @@
+ SONAME=libavbin.so.$(AVBIN_VERSION)
+ LIBNAME=$(OUTDIR)/$(SONAME)
+
+-CFLAGS += -fPIC -O3
++CFLAGS += -fPIC
+ LDFLAGS += -shared -soname $(SONAME) -zmuldefs
+
+ STATIC_LIBS = -whole-archive \
+diff -Naurp a/linux-x86-64.Makefile b/linux-x86-64.Makefile
+--- a/linux-x86-64.Makefile 2019-04-28 20:25:40.000000000 +0000
++++ b/linux-x86-64.Makefile 2019-04-28 20:32:47.072032317 +0000
+@@ -1,7 +1,7 @@
+ SONAME=libavbin.so.$(AVBIN_VERSION)
+ LIBNAME=$(OUTDIR)/$(SONAME)
+
+-CFLAGS += -fPIC -O3
++CFLAGS += -fPIC
+ LDFLAGS += -shared -soname $(SONAME) -Bsymbolic -zmuldefs
+
+ STATIC_LIBS = -whole-archive \
diff --git a/0002-avbin-fix-link-and-add-full-relro.patch b/0002-avbin-fix-link-and-add-full-relro.patch
new file mode 100644
index 000000000000..735a88b48073
--- /dev/null
+++ b/0002-avbin-fix-link-and-add-full-relro.patch
@@ -0,0 +1,24 @@
+diff -Naurp a/linux-x86-32.Makefile b/linux-x86-32.Makefile
+--- a/linux-x86-32.Makefile 2019-04-28 20:32:41.000000000 +0000
++++ b/linux-x86-32.Makefile 2019-04-28 20:36:08.000000000 +0000
+@@ -2,7 +2,7 @@ SONAME=libavbin.so.$(AVBIN_VERSION)
+ LIBNAME=$(OUTDIR)/$(SONAME)
+
+ CFLAGS += -fPIC
+-LDFLAGS += -shared -soname $(SONAME) -zmuldefs
++LDFLAGS += -shared -soname $(SONAME) -zmuldefs -O1 --sort-common --as-needed -z relro -z now -O1 --sort-common --as-needed -z relro -z now
+
+ STATIC_LIBS = -whole-archive \
+ $(BACKEND_DIR)/libavformat/libavformat.a \
+diff -Naurp a/linux-x86-64.Makefile b/linux-x86-64.Makefile
+--- a/linux-x86-64.Makefile 2019-04-28 20:32:47.000000000 +0000
++++ b/linux-x86-64.Makefile 2019-04-28 20:36:08.000000000 +0000
+@@ -2,7 +2,7 @@ SONAME=libavbin.so.$(AVBIN_VERSION)
+ LIBNAME=$(OUTDIR)/$(SONAME)
+
+ CFLAGS += -fPIC
+-LDFLAGS += -shared -soname $(SONAME) -Bsymbolic -zmuldefs
++LDFLAGS += -shared -soname $(SONAME) -Bsymbolic -zmuldefs -O1 --sort-common --as-needed -z relro -z now -O1 --sort-common --as-needed -z relro -z now
+
+ STATIC_LIBS = -whole-archive \
+ $(BACKEND_DIR)/libavformat/libavformat.a \
diff --git a/0003-avbin-faster-build.patch b/0003-avbin-faster-build.patch
new file mode 100644
index 000000000000..dec34fda6014
--- /dev/null
+++ b/0003-avbin-faster-build.patch
@@ -0,0 +1,21 @@
+diff -Naurp a/build.sh b/build.sh
+--- a/build.sh 2019-04-28 20:38:04.000000000 +0000
++++ b/build.sh 2019-04-28 20:40:47.942736577 +0000
+@@ -146,7 +146,7 @@ die_usage() {
+ echo
+ echo "Options"
+ echo " --clean Don't build, just clean up all generated files and directories."
+- echo " --fast Use 'make -j4' when compiling"
++ echo " --fast Use 'make -j<threads+1>' when compiling"
+ echo " --help Display this help text."
+ echo " --rebuild Don't reconfigure, just run make again."
+ echo
+@@ -164,7 +164,7 @@ die_usage() {
+ for arg in $* ; do
+ case $arg in
+ "--fast")
+- FAST="-j4" ;;
++ FAST="-j$(($(nproc)+1))" ;;
+ "--help")
+ die_usage ;;
+ "--rebuild")
diff --git a/PKGBUILD b/PKGBUILD
index 205ef3054eee..79a046ed2aa4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,51 +1,56 @@
-# Maintainer: Christopher Arndt <aur -at- chrisarndt -dot- de>
+# Maintainer : Daniel Bermond < gmail-com: danielbermond >
+# Contributor: Christopher Arndt <aur -at- chrisarndt -dot- de>
pkgname=avbin
pkgver=10
-pkgrel=2
-_gittag="$pkgname-$pkgver"
-_gitsubmodule="https://github.com/AVbin/libav.git"
-pkgdesc="Cross-platform media decoding library"
-arch=('i686' 'x86_64')
-url="http://avbin.github.com/"
-license=('LGPL')
+pkgrel=3
+pkgdesc='A C library that provides a wrapper around Libav’s video and audio decoding functionality'
+arch=('x86_64')
+url='https://avbin.github.io/'
+license=('LGPL3')
depends=('bzip2' 'zlib')
-conflicts=('avbin7')
makedepends=('git' 'yasm')
-options=('!makeflags')
-# The build script relies on being run in a git checkout,
-# the downloadable release tarball doesn't work with it
-source=("${pkgname}::git+https://github.com/AVbin/AVbin.git")
-sha256sums=('SKIP')
+source=("git+https://github.com/AVbin/AVbin.git#tag=avbin-${pkgver}"
+ 'libav-avbin'::'git+https://github.com/AVbin/libav.git'
+ '0001-avbin-remove-unwanted-optimization.patch'
+ '0002-avbin-fix-link-and-add-full-relro.patch'
+ '0003-avbin-faster-build.patch'
+ 'avbin.pc')
+sha256sums=('SKIP'
+ 'SKIP'
+ '8f8b20d6e57bdc6bf73723691740ae35b157785ebda5764a7611a68df427c30a'
+ 'fa8f7263326b10f968836f5fe7ae9efef04cdce58a28cfd3f7cb93985fffb469'
+ 'be5e45a35c35229c68adfc1606c31d479a4813926de1c022d3919c7592d92c8b'
+ 'd43b24480805ede648a5851465b3071fde75d4114f8a6c84430902075767667f')
prepare() {
- cd "${srcdir}/${pkgname}"
-
- if [ ! -e libav/Makefile ]; then
- git rm libav
- git submodule add --force ${_gitsubmodule} libav
- fi
-
- git checkout "${_gittag}"
- cd libav
- git checkout v9.5
+ cd AVbin
+
+ git submodule init
+ git config --local "submodule.libav.url" "${srcdir}/libav-avbin"
+ git submodule update
+
+ patch -Np1 -i "${srcdir}/0001-avbin-remove-unwanted-optimization.patch"
+ patch -Np1 -i "${srcdir}/0002-avbin-fix-link-and-add-full-relro.patch"
+ patch -Np1 -i "${srcdir}/0003-avbin-faster-build.patch"
}
build() {
- cd "${srcdir}/${pkgname}"
-
- target="linux-$(echo $CARCH | sed -e 's/_/-/')"
- msg "Building target ${target}..."
- # Linux Makefile uses LDFLAGS directly for ld command line
- export LDFLAGS="$(echo $LDFLAGS | sed -e 's/^-Wl,//')"
- bash -x build.sh --fast ${target}
+ cd AVbin
+
+ unset LDFLAGS # won't build if setted, modified by patch
+
+ ./build.sh --fast linux-x86-64
}
package() {
- cd "${srcdir}/${pkgname}"
-
- target="linux-$(echo $CARCH | sed -e 's/_/-/')"
- install -dm755 "$pkgdir/usr/lib"
- install -m644 "dist/${target}/libavbin.so.${pkgver}" "$pkgdir/usr/lib"
- ln -sf "libavbin.so.${pkgver}" "$pkgdir/usr/lib/libavbin.so"
+ # header
+ install -D -m644 AVbin/include/avbin.h -t "${pkgdir}/usr/include"
+
+ # library
+ install -D -m755 "AVbin/dist/linux-x86-64/libavbin.so.${pkgver}" -t "${pkgdir}/usr/lib"
+ ln -s "libavbin.so.${pkgver}" "${pkgdir}/usr/lib/libavbin.so"
+
+ # pkgconfig
+ install -D -m644 avbin.pc -t "${pkgdir}/usr/lib/pkgconfig"
}
diff --git a/avbin.pc b/avbin.pc
new file mode 100644
index 000000000000..6d83a1956dfc
--- /dev/null
+++ b/avbin.pc
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: AVbin
+Description: A C library that provides a wrapper around Libav’s video and audio decoding functionality
+Version: 10
+Libs: -L${libdir} -lavbin
+Cflags: -I${includedir}