summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDet2017-07-29 22:07:23 +0300
committerDet2017-07-29 22:07:23 +0300
commit47f549bcc062672a5e1c9c80bb2b1be93636fefd (patch)
treef3176ccfcdf8fbcc3ac1b95389d03c102f686834
parent5121968bb208b88a6c407f49b82cf0f5b2c20040 (diff)
downloadaur-47f549bcc062672a5e1c9c80bb2b1be93636fefd.tar.gz
Sync with [extra]
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD128
2 files changed, 84 insertions, 70 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 481570fde39..ba80d8b5888 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,11 +1,11 @@
pkgbase = x264-git
pkgver = 152.20170626.r2851
pkgrel = 1
- url = http://www.videolan.org/developers/x264.html
+ url = https://www.videolan.org/developers/x264.html
arch = i686
arch = x86_64
license = GPL
- makedepends = yasm
+ makedepends = nasm
makedepends = git
makedepends = ffmpeg
makedepends = l-smash
@@ -20,28 +20,28 @@ pkgname = x264-git
depends = libavutil.so
depends = liblsmash.so
depends = libswscale.so
- provides = x264-10bit
provides = x264
- conflicts = x264-10bit
+ provides = x264-
conflicts = x264
- replaces = x264-10bit
pkgname = libx264-git
- pkgdesc = Library for encoding H264/AVC video streams (Git)
+ pkgdesc = Library for encoding H264/AVC video streams (8bit depth) (Git)
+ provides = libx264-8bit
provides = libx264.so
- provides = x264-dev
provides = libx264
- conflicts = x264-dev
conflicts = libx264
- replaces = x264-dev
pkgname = libx264-10bit-git
- pkgdesc = Library for encoding H264/AVC video streams - 10bit-depth (Git)
- provides = libx264.so
+ pkgdesc = Library for encoding H264/AVC video streams (10bit depth) (Git)
provides = libx264
- provides = x264-dev
+ provides = libx264.so
provides = libx264-10bit
conflicts = libx264
- conflicts = x264-dev
conflicts = libx264-10bit
+pkgname = libx264-all-git
+ pkgdesc = Library for encoding H264/AVC video streams (all depths) (Git)
+ provides = libx264-all
+ provides = libx264-.so
+ conflicts = libx264-all
+
diff --git a/PKGBUILD b/PKGBUILD
index 04cc1605c65..ccc7abf750c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,37 +5,35 @@
# Contributor: pressh <pressh[at]gmail>
# Based on extra/x264's trunk: https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/x264
-# Build 10-bit x264 instead of 8-bit? (Better quality, but slower.)
+# Build 8bit or 10bit x264? (10bit = Better quality, but slower)
# For comparison, see, e.g.: https://gist.github.com/l4n9th4n9/4459997
+_build=0 # 0 = Conflict after 1st build (default)
+ # 1 = 8bit
+ # 2 = 10bit
+ # (Auto-detected later based on installed version)
-_10bit=0 # "1" to enable. (This will be auto-detected afterwards.)
-
-# To revert, uninstall 'libx264-10bit-git', or use:
-
-_8bit=0
-
-pkgname=('x264-git' 'libx264-git' 'libx264-10bit-git')
+pkgname=('x264-git' 'libx264-git' 'libx264-10bit-git' 'libx264-all-git')
_pkgname=x264
pkgver=152.20170626.r2851
pkgrel=1
arch=('i686' 'x86_64')
-url='http://www.videolan.org/developers/x264.html'
+url='https://www.videolan.org/developers/x264.html'
license=('GPL')
depends=('glibc')
-makedepends=('yasm' 'git' 'ffmpeg' 'l-smash')
+makedepends=('nasm' 'git' 'ffmpeg' 'l-smash')
source=("git+https://git.videolan.org/git/x264.git")
sha256sums=('SKIP')
-# Use the 10-bit version?
-if [[ ${_10bit} = 1 ]] || ([[ ${_8bit} != 1 ]] && pacman -Q libx264-10bit-git &>/dev/null); then
- pkgname=('x264-git' 'libx264-10bit-git')
- _10bit=1
-elif [[ ${_8bit} = 1 ]] || pacman -Q libx264-git &>/dev/null; then
- pkgname=('x264-git' 'libx264-git')
+# 8bit or 10bit?
+if [[ ${_build} = 1 ]] || pacman -Q libx264-git &>/dev/null; then
+ pkgname=('x264-git' 'libx264-git' 'libx264-all-git')
+elif [[ ${_build} = 2 ]] || pacman -Q libx264-10bit-git &>/dev/null; then
+ pkgname=('x264-git' 'libx264-10bit-git' 'libx264-all-git')
fi
pkgver() {
cd ${_pkgname}
+
_ver=$(grep '#define X264_BUILD' x264.h | cut -d' ' -f3)
_date=$(git log -1 --format="%cd" --date=short | tr -d -)
_commits=$(git rev-list --count HEAD)
@@ -44,65 +42,81 @@ pkgver() {
}
prepare() {
- rm -rf ${_pkgname}-10bit
-
- cp -r ${_pkgname} ${_pkgname}-10bit
+ rm -rf build-{8,10}bit
+ mkdir build-{8,10}bit
}
build() {
- cd ${_pkgname}
-
- msg2 "Configuring x264..."
- ./configure \
- --prefix='/usr' \
- --enable-shared \
- --enable-pic
-
- msg2 "Making x264..."
- make
-
- cd ../${_pkgname}-10bit
-
- msg2 "Configuring x264 (10-bit)..."
- ./configure \
- --prefix='/usr' \
- --enable-shared \
- --enable-pic \
- --bit-depth='10'
-
- msg2 "Making x264 (10-bit)..."
- make
+ for _b in 8 10; do (
+ cd build-${_b}bit
+
+ msg2 "Configuring (${_b}bit)..."
+ ../${_pkgname}/configure \
+ --prefix='/usr' \
+ --enable-shared \
+ --enable-pic \
+ --enable-lto \
+ --bit-depth="${_b}"
+
+ msg2 "Making (${_b}bit)..."
+ make
+ ) done
}
package_x264-git() {
pkgdesc='CLI tools for encoding H264/AVC video streams (Git)'
depends=('libavcodec.so' 'libavformat.so' 'libavutil.so' 'liblsmash.so'
'libswscale.so')
- provides=('x264-10bit' 'x264')
- conflicts=('x264-10bit' 'x264')
- replaces=('x264-10bit')
+ provides=('x264')
+ conflicts=('x264')
+
+ for _b in {8,10}bit; do
+ provides+=("x264-${_b}")
+
+ msg2 "Make-installing (${_b}bit)..."
+ make -C build-${_b} DESTDIR="${pkgdir}" install-cli
+ mv "${pkgdir}"/usr/bin/x264{,-${_b}}
+ done
- make -C ${_pkgname} DESTDIR="${pkgdir}" install-cli
- install -m 755 ${_pkgname}-10bit/x264 "${pkgdir}"/usr/bin/x264-10bit
+ ln -s x264-8bit "${pkgdir}"/usr/bin/x264
}
package_libx264-git() {
- pkgdesc='Library for encoding H264/AVC video streams (Git)'
- provides=('libx264.so' 'x264-dev' 'libx264')
- conflicts=('x264-dev' 'libx264')
- replaces=('x264-dev')
+ pkgdesc='Library for encoding H264/AVC video streams (8bit depth) (Git)'
+ provides=('libx264-8bit' 'libx264.so' 'libx264')
+ conflicts=('libx264')
- install -dm 755 "${pkgdir}"/usr/lib
- make -C ${_pkgname} DESTDIR="${pkgdir}" install-lib-shared
+ msg2 "Make-installing..."
+ make -C build-8bit DESTDIR=${pkgdir} install-lib-shared
}
package_libx264-10bit-git() {
- pkgdesc='Library for encoding H264/AVC video streams - 10bit-depth (Git)'
- provides=('libx264.so' 'libx264' 'x264-dev' 'libx264-10bit')
- conflicts=('libx264' 'x264-dev' 'libx264-10bit')
+ pkgdesc='Library for encoding H264/AVC video streams (10bit depth) (Git)'
+ provides=('libx264' 'libx264.so' 'libx264-10bit')
+ conflicts=('libx264' 'libx264-10bit')
+
+ msg2 "Make-installing..."
+ make -C build-10bit DESTDIR=${pkgdir} install-lib-shared
+}
+
+package_libx264-all-git() {
+ pkgdesc="Library for encoding H264/AVC video streams (all depths) (Git)"
+ provides=('libx264-all')
+ conflicts=('libx264-all')
+
+ install -d "${pkgdir}"/usr/lib/x264
+
+ for _b in {8,10}bit; do
+ provides+=("libx264-${_b}.so")
+
+ msg2 "Make-installing (${_b}bit)..."
+ make -C build-${_b} DESTDIR="${pkgdir}" install-lib-shared
+
+ mv "${pkgdir}"/usr/lib/libx264.so.${_ver} "${pkgdir}"/usr/lib/x264/libx264-${_b}.so.${_ver}
+ rm -r "${pkgdir}"/usr/{include,lib/libx264.so,lib/pkgconfig}
- install -dm 755 "${pkgdir}"/usr/lib
- make -C ${_pkgname}-10bit DESTDIR="${pkgdir}" install-lib-shared
+ ln -sr "${pkgdir}"/usr/lib/x264/libx264-${_b}.so{.${_ver},}
+ done
}
# vim: ts=2 sw=2 et: \ No newline at end of file