summaryrefslogtreecommitdiff
path: root/extra/x264/PKGBUILD
blob: 52f6de3f7f6915a28ca799eaf5acab991418afd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# $Id: PKGBUILD 214298 2014-06-05 12:34:40Z bpiotrowski $
# Maintainer:  Ionut Biru <ibiru@archlinux.org>
# Maintainer:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: damir <damir@archlinux.org>
# Contributor: Paul Mattal <paul@archlinux.org>

pkgname=('x264' 'libx264' 'libx264-10bit')
pkgver=142.20140311
pkgrel=4
epoch=1
arch=('i686' 'x86_64')
url='http://www.videolan.org/developers/x264.html'
license=('GPL')
depends=('glibc')
makedepends=('yasm' 'git')
source=(git://git.videolan.org/x264.git#commit=b7a50c16)
md5sums=('SKIP')

prepare() {
  sed -i 's/install-lib-dev$//g' $pkgname/Makefile
  cp -r $pkgname $pkgname-10bit
}

pkgver() {
  cd $pkgname
  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}
}

build() {
  cd $pkgname
  ./configure --prefix=/usr \
    --enable-shared --enable-pic
  make

  cd ../$pkgname-10bit
  ./configure --prefix=/usr \
    --enable-shared --enable-pic \
    --bit-depth=10
  make
}

package_x264() {
  pkgdesc='CLI tools for encoding H264/AVC video streams.'
  depends=('glibc' 'libx264')
  provides=('x264-dev' 'x264-10bit')
  conflicts=('x264-dev' 'x264-10bit')
  replaces=('x264-dev' 'x264-10bit')

  make -C $pkgbase DESTDIR="$pkgdir" install-cli install-lib-dev
  install -Dm755 $pkgbase-10bit/x264 "$pkgdir"/usr/bin/x264-10bit
}

package_libx264() {
  pkgdesc='Library for encoding H264/AVC video streams.'
  depends=('glibc')

  install -d "$pkgdir"/usr/lib
  make -C $pkgbase DESTDIR="$pkgdir" install-lib-shared
}

package_libx264-10bit() {
  pkgdesc='Library for encoding H264/AVC video streams. 10bit-depth.'
  depends=('glibc')
  provides=('libx264')
  conflicts=('libx264')

  install -d "$pkgdir"/usr/lib
  make -C $pkgbase-10bit DESTDIR="$pkgdir" install-lib-shared
}