PKGBUILDs/extra/x264/PKGBUILD

104 lines
2.6 KiB
Bash
Raw Normal View History

2013-11-17 18:42:39 +00:00
# $Id$
2016-02-27 15:06:22 +00:00
# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
2011-01-19 00:41:46 +00:00
# Contributor: damir <damir@archlinux.org>
# Contributor: Paul Mattal <paul@archlinux.org>
2012-02-07 13:45:40 +00:00
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2015-07-16 05:19:14 +00:00
# - configure needs --disable-asm to build on non-AArch64
2017-05-19 13:37:03 +00:00
# - --disable-lto
2011-01-19 00:41:46 +00:00
2017-05-19 12:55:51 +00:00
pkgname=('x264' 'libx264' 'libx264-10bit' 'libx264-all')
2018-01-11 13:41:14 +00:00
pkgver=152.20171224
2018-05-12 16:44:26 +00:00
pkgrel=2
2015-03-08 21:18:22 +00:00
epoch=2
2018-01-11 13:41:14 +00:00
arch=('x86_64')
2017-05-19 12:55:51 +00:00
url='https://www.videolan.org/developers/x264.html'
2011-01-19 00:41:46 +00:00
license=('GPL')
depends=('glibc')
2018-01-11 13:41:14 +00:00
makedepends=('git' 'ffmpeg' 'l-smash' 'nasm')
_commit='e9a5903edf8ca59ef20e6f4894c196f135af735e'
2017-05-19 12:55:51 +00:00
source=("git+https://git.videolan.org/git/x264.git#commit=${_commit}")
2016-02-27 15:06:22 +00:00
sha256sums=('SKIP')
2011-01-19 00:41:46 +00:00
2014-03-29 16:21:56 +00:00
pkgver() {
2016-02-27 15:06:22 +00:00
cd ${pkgbase}
2014-03-29 16:21:56 +00:00
local _ver=$(grep '#define X264_BUILD' x264.h | cut -d' ' -f3)
local _date=$(git log -1 --format="%cd" --date=short | tr -d -)
echo ${_ver}.${_date}
}
2014-08-07 11:07:38 +00:00
prepare() {
2017-05-19 12:55:51 +00:00
mkdir build-{8,10}bit
2014-08-07 11:07:38 +00:00
}
2013-08-01 13:02:31 +00:00
build() {
2015-07-16 05:19:14 +00:00
[[ $CARCH != "aarch64" ]] && CONFIG="--disable-asm"
2017-05-19 12:55:51 +00:00
for _b in 8 10; do (
cd build-${_b}bit
../${pkgbase}/configure \
--prefix='/usr' \
--enable-shared \
--enable-pic \
2017-05-19 13:37:03 +00:00
--disable-lto \
2017-05-19 12:55:51 +00:00
--bit-depth="${_b}" $CONFIG
make
) done
2012-02-07 13:45:40 +00:00
}
2013-08-01 13:02:31 +00:00
2014-06-05 00:23:45 +00:00
package_x264() {
2014-08-07 11:07:38 +00:00
pkgdesc='CLI tools for encoding H264/AVC video streams'
2016-07-20 00:10:35 +00:00
depends+=('libavcodec.so' 'libavformat.so' 'libavutil.so' 'liblsmash.so'
'libswscale.so')
2014-06-05 00:23:45 +00:00
2017-05-19 12:55:51 +00:00
for _b in {8,10}bit; do
provides+=("x264-${_b}")
make -C build-${_b} DESTDIR="${pkgdir}" install-cli
mv "${pkgdir}"/usr/bin/x264{,-${_b}}
done
ln -s x264-8bit "${pkgdir}"/usr/bin/x264
2014-06-05 00:23:45 +00:00
}
2014-06-05 21:18:57 +00:00
package_libx264() {
2017-05-19 12:55:51 +00:00
pkgdesc='Library for encoding H264/AVC video streams (8bit depth)'
provides=('libx264-8bit' 'libx264.so')
conflicts=('libx264')
2014-06-05 00:23:45 +00:00
2017-05-19 12:55:51 +00:00
make -C build-8bit DESTDIR=${pkgdir} install-lib-shared
2014-06-05 00:23:45 +00:00
}
2014-06-05 21:18:57 +00:00
package_libx264-10bit() {
2017-05-19 12:55:51 +00:00
pkgdesc='Library for encoding H264/AVC video streams (10bit depth)'
provides=('libx264' 'libx264.so')
conflicts=('libx264')
make -C build-10bit DESTDIR=${pkgdir} install-lib-shared
}
package_libx264-all() {
pkgdesc="Library for encoding H264/AVC video streams (all depths)"
local _ver=$(grep '#define X264_BUILD' "${pkgbase}"/x264.h | cut -d' ' -f3)
install -d "${pkgdir}"/usr/lib/x264
for _b in {8,10}bit; do
provides+=("libx264-${_b}.so")
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}
2014-06-05 00:23:45 +00:00
2017-05-19 12:55:51 +00:00
ln -sr "${pkgdir}"/usr/lib/x264/libx264-${_b}.so{.${_ver},}
done
2011-01-19 00:41:46 +00:00
}
2016-02-27 15:06:22 +00:00
# vim: ts=2 sw=2 et: