summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ba73d225f9d07385d02d1e9419f6a7b2fc035138 (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
# Maintainer : Karl-Felix Glatzer <karl.glatzer@gmx.de>
pkgname=mingw-w64-x264
pkgver=0.164.r3108.31e19f9
pkgrel=1
epoch=3
pkgdesc='Open Source H264/AVC video encoder (mingw-w64)'
arch=('any')
url='http://www.videolan.org/developers/x264.html'
license=('GPL')
depends=('mingw-w64-crt' 'mingw-w64-l-smash')
#provides=('mingw-w64-libx264.so')
options=(!strip !buildflags staticlibs)
makedepends=('mingw-w64-gcc' 'git' 'nasm')
_commit=31e19f92f00c7003fa115047ce50978bc98c3a0d
source=(git+https://code.videolan.org/videolan/x264.git#commit=${_commit})
sha256sums=(SKIP)
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

pkgver() {
  cd x264

  ./version.sh | grep X264_POINTVER | sed -r 's/^#define X264_POINTVER "([0-9]+\.[0-9]+)\.([0-9]+) (.*)"$/\1.r\2.\3/'
}

build() {
  for _arch in ${_architectures}; do
    mkdir -p ${srcdir}/build-${_arch} && cd ${srcdir}/build-${_arch}

    unset LDFLAGS CPPFLAGS
    ${srcdir}/x264/configure --host=${_arch} \
      --cross-prefix="${_arch}-" \
      --enable-shared \
      --enable-static \
      --disable-avs

    make
  done
}

package() {
  for _arch in ${_architectures}; do
    cd ${srcdir}/build-${_arch}
    make DESTDIR="$pkgdir" \
      bindir=/usr/${_arch}/bin \
      libdir=/usr/${_arch}/lib \
      includedir=/usr/${_arch}/include \
      install install-cli install-lib-shared

    ${_arch}-strip -s ${pkgdir}/usr/${_arch}/bin/*.exe
    ${_arch}-strip --strip-unneeded ${pkgdir}/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g ${pkgdir}/usr/${_arch}/lib/*.a
  done
}

# vim:set ts=2 sw=2 et: