summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2018-08-17 21:31:34 +0000
committerDaniel Bermond2018-08-17 21:31:34 +0000
commit0f521ea433b1e9ff3bf312d9ff90d08af7c34f64 (patch)
tree1bbcc163fa2e0f88f5fca4577952a46ac63aa423
parent6a02c239f4c464b09221489e3c0243dec15926a1 (diff)
downloadaur-0f521ea433b1e9ff3bf312d9ff90d08af7c34f64.tar.gz
Change to single package providing everything
This will match the latest changes in package x264 from [extra] official repository. Although x264 package is not related to this one, the base source code template and build system are very similar. Being such, x264 package from [extra] serves as a basis for this package. This change simplifies things by eliminating the need of multiple little correlated xavs2 packages, sticking with the Arch KISS principle. References ---------- https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/x264&id=c2411345dd7a39390ce4019cea0bfbdd363feb1d
-rw-r--r--.SRCINFO29
-rw-r--r--PKGBUILD153
-rw-r--r--xavs2-1.0-disable-10bit.patch23
3 files changed, 103 insertions, 102 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bf646a05e19f..6ddb1f9364ab 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,7 @@
pkgbase = xavs2
+ pkgdesc = Open-Source encoder of AVS2-P2/IEEE1857.4 video coding standard
pkgver = 1.0
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/pkuvcl/xavs2/
arch = i686
arch = x86_64
@@ -9,25 +10,17 @@ pkgbase = xavs2
makedepends = yasm
makedepends = l-smash
depends = glibc
+ depends = liblsmash.so
+ provides = libxavs2
+ provides = libxavs2.so
+ conflicts = xavs2-git
+ conflicts = libxavs2
+ conflicts = libxavs2-git
+ replaces = libxavs2
source = xavs2-1.0.tar.gz::https://github.com/pkuvcl/xavs2/archive/1.0.tar.gz
+ source = xavs2-1.0-disable-10bit.patch
sha256sums = 0e7f682ad20dc783864ff0c483d03b2fbcd70d2fbd098e18c8d06ab6341da71d
+ sha256sums = e4893da3e1f22e85f8a8f50e58ecaff037d729a3ed64b71794aab6f359c0370c
pkgname = xavs2
- pkgdesc = CLI tool for the open-source encoder of AVS2-P2/IEEE1857.4 video coding standard
- depends = glibc
- depends = l-smash
- provides =
- provides = xavs2-bit
- provides = xavs2-bit
- conflicts =
- conflicts = xavs2-bit-git
-
-pkgname = libxavs2
- pkgdesc = Library for the open-source encoder of AVS2-P2/IEEE1857.4 video coding standard (8bit depth)
- provides = libxavs2-8bit
- provides = libxavs2
- provides = libxavs2.so
- conflicts = libxavs2-8bit-git
- conflicts = libxavs2-10bit
- conflicts = libxavs2-10bit-git
diff --git a/PKGBUILD b/PKGBUILD
index 8aed8654c33a..4648bb8a4038 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,113 +1,98 @@
# Maintainer : Daniel Bermond < yahoo-com: danielbermond >
# NOTE:
-# - 10-bit depth currently fails to build
-# - 10-bit sections are commented out until it works
+# 10-bit depth currently fails to build
+# https://github.com/pkuvcl/xavs2/issues/9
-pkgbase=xavs2
-pkgname=('xavs2' 'libxavs2') #'libxavs2-10bit' 'libxavs2-all')
+pkgname=xavs2
pkgver=1.0
-pkgrel=1
+pkgrel=2
arch=('i686' 'x86_64')
+pkgdesc='Open-Source encoder of AVS2-P2/IEEE1857.4 video coding standard'
url='https://github.com/pkuvcl/xavs2/'
license=('GPL')
-depends=('glibc')
+depends=('glibc' 'liblsmash.so')
makedepends=('gcc7' 'yasm' 'l-smash')
-source=("${pkgbase}-${pkgver}.tar.gz"::"https://github.com/pkuvcl/${pkgname}/archive/${pkgver}.tar.gz")
-sha256sums=('0e7f682ad20dc783864ff0c483d03b2fbcd70d2fbd098e18c8d06ab6341da71d')
+provides=('libxavs2' 'libxavs2.so')
+conflicts=('xavs2-git' 'libxavs2' 'libxavs2-git')
+replaces=('libxavs2')
+source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/pkuvcl/${pkgname}/archive/${pkgver}.tar.gz"
+ 'xavs2-1.0-disable-10bit.patch')
+sha256sums=('0e7f682ad20dc783864ff0c483d03b2fbcd70d2fbd098e18c8d06ab6341da71d'
+ 'e4893da3e1f22e85f8a8f50e58ecaff037d729a3ed64b71794aab6f359c0370c')
prepare() {
- cd "${pkgbase}-${pkgver}"
+ cd "${pkgname}-${pkgver}"
# use gcc7 (it does not build with gcc8)
sed -i 's/gcc/gcc-7/' build/linux/configure
- # must copy the entire source tree for each build or it will not work
- cd "$srcdir"
- cp -af "${pkgbase}-${pkgver}" build-8bit
- #cp -af "${pkgbase}-${pkgver}" build-10bit
+ # disable 10-bit in configure to avoid misleading errors
+ patch -Np1 -i "${srcdir}/xavs2-1.0-disable-10bit.patch"
}
build() {
- for _depth in 8 #10
- do
- msg2 "Building for ${_depth}-bit..."
-
- cd "build-${_depth}bit/build/linux"
-
- ./configure \
- --prefix='/usr' \
- --enable-shared \
- --bit-depth="$_depth" \
- --chroma-format='all' \
- --enable-lto \
- --enable-pic \
- --disable-swscale \
- --disable-lavf \
- --disable-ffms \
- --disable-gpac
-
+ # must copy the entire source tree for each build or it will not work
+ cd "$srcdir"
+ cp -af "${pkgname}-${pkgver}" build-8bit
+ cp -af "${pkgname}-${pkgver}" build-10bit
+
+ msg2 'Building for 8-bit...'
+ cd build-8bit/build/linux
+ ./configure \
+ --prefix='/usr' \
+ --enable-shared \
+ --bit-depth='8' \
+ --chroma-format='all' \
+ --enable-lto \
+ --enable-pic \
+ --disable-swscale \
+ --disable-lavf \
+ --disable-ffms \
+ --disable-gpac
+ make
+
+ msg2 'Building for 10-bit...'
+ cd "${srcdir}/build-10bit/build/linux"
+ if ./configure \
+ --prefix='/usr' \
+ --libdir='/usr/lib/xavs2-10bit' \
+ --includedir='/usr/include/xavs2-10bit' \
+ --enable-shared \
+ --bit-depth='10' \
+ --chroma-format='all' \
+ --enable-lto \
+ --enable-pic \
+ --disable-swscale \
+ --disable-lavf \
+ --disable-ffms \
+ --disable-gpac
+ then
make
-
+ else
cd "$srcdir"
- done
+ rm -rf build-10bit
+ fi
}
-package_xavs2() {
- pkgdesc='CLI tool for the open-source encoder of AVS2-P2/IEEE1857.4 video coding standard'
- depends+=('l-smash')
+package() {
+ local _depth
- for _depth in 8 #10
+ for _depth in 10 8
do
- provides+=("xavs2-${_depth}bit" "xavs2-${_depth}bit")
- conflicts+=("xavs2-${_depth}bit-git")
+ msg2 "Installing for ${_depth}-bit..."
- msg2 "Installing CLI for ${_depth}-bit..."
+ if [ "$_depth" -eq '10' ] && ! [ -d 'build-10bit' ]
+ then
+ printf '%s\n' 'BitDepth 10 not supported currently.'
+ continue
+ fi
- make -C "build-${_depth}bit/build/linux" DESTDIR="$pkgdir" install-cli
+ make -C "build-${_depth}bit/build/linux" DESTDIR="$pkgdir" install-cli install-lib-shared
- mv "$pkgdir"/usr/bin/xavs2 "$pkgdir"/usr/bin/xavs2-${_depth}bit
- done
-
- ln -sf xavs2-8bit "${pkgdir}"/usr/bin/xavs2
-}
-
-package_libxavs2() {
- pkgdesc='Library for the open-source encoder of AVS2-P2/IEEE1857.4 video coding standard (8bit depth)'
- provides=('libxavs2-8bit' 'libxavs2' 'libxavs2.so')
- conflicts=('libxavs2-8bit-git' 'libxavs2-10bit' 'libxavs2-10bit-git')
-
- make -C build-8bit/build/linux DESTDIR="$pkgdir" install-lib-shared
-}
-
-# bash block-comment
-:<<'10-bit-pkgs'
-package_libxavs2-10bit() {
- pkgdesc='Library for the open-source encoder of AVS2-P2/IEEE1857.4 video coding standard (10bit depth)'
- provides=('libxavs2' 'libxavs2.so')
- conflicts=('libxavs2-10bit-git' 'libxavs2-8bit' 'libxavs2-8bit-git' 'libxavs2-git')
-
- make -C build-8bit/build/linux DESTDIR="$pkgdir" install-lib-shared
-}
-
-package_libxavs2-all() {
- pkgdesc="Library for the open-source encoder of AVS2-P2/IEEE1857.4 video coding standard (all depths)"
-
- local _ver="$(grep '^#define[[:space:]]XAVS2_BUILD' "${pkgbase}-${pkgver}/source/xavs2.h" | awk -F' ' '{ print $3 }' | sed 's/[^[:alnum:]]$//')"
-
- install -d "${pkgdir}/usr/lib/xavs2"
-
- for _depth in 8 10
- do
- provides+=("libxavs2-${_depth}bit.so")
-
- make -C build-${_depth}bit/build/linux DESTDIR="$pkgdir" install-lib-shared
-
- mv "${pkgdir}"/usr/lib/libxavs2.so.${_ver} "${pkgdir}"/usr/lib/xavs2/libxavs2-${_depth}bit.so.${_ver}
-
- rm -r "${pkgdir}"/usr/{include,lib/libxavs2.so,lib/pkgconfig}
-
- ln -sfr "${pkgdir}"/usr/lib/xavs2/libxavs2-${_depth}bit.so{.${_ver},}
+ if [ "$_depth" -eq '10' ]
+ then
+ mv "${pkgdir}/usr/bin/xavs2" "${pkgdir}/usr/bin/xavs2-${_depth}bit"
+ fi
done
}
-10-bit-pkgs
diff --git a/xavs2-1.0-disable-10bit.patch b/xavs2-1.0-disable-10bit.patch
new file mode 100644
index 000000000000..cf40ff42677f
--- /dev/null
+++ b/xavs2-1.0-disable-10bit.patch
@@ -0,0 +1,23 @@
+From 074a1cb4a5b01ddf6577cbb6cf511d15f298855a Mon Sep 17 00:00:00 2001
+From: luofl <falei.luo@gmail.com>
+Date: Sat, 28 Jul 2018 18:50:51 +0800
+Subject: [PATCH] Disable `10-bit` in configure to avoid misleading errors.
+
+---
+ build/linux/configure | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/build/linux/configure b/build/linux/configure
+index 6aacf67..637188e 100755
+--- a/build/linux/configure
++++ b/build/linux/configure
+@@ -496,6 +496,9 @@ for opt do
+ if [ "$bit_depth" -lt "8" -o "$bit_depth" -gt "10" ]; then
+ echo "Supplied bit depth must be in range [8,10]."
+ exit 1
++ elif [[ "$bit_depth" = "9" || "$bit_depth" = "10" ]]; then
++ echo "BitDepth $bit_depth not supported currently."
++ exit 1
+ fi
+ bit_depth=`expr $bit_depth + 0`
+ ;;