summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d4ed04fd50df303e704ffd89f06bbe134fe7132a (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
73
# Maintainer: b6b <b6bb at pm dot me>

pkgname=x264-tmod-git
_branch=t_mod_New
pkgver=159.r3046.g8f175b53
pkgrel=1
pkgdesc='Open Source H264/AVC video encoder (tmod git version)'
arch=(x86_64)
url=https://github.com/jpsdr/x264/tree/"${_branch}"
license=(GPL)
depends=(
  liblsmash.so
)
makedepends=(
  git
  l-smash-x264-tmod-git
  nasm
)
provides=(
  x264
  libx264
  libx264.so
)
replaces=(
  libx264
  libx264-10bit
  libx264-all
)
conflicts=(
  libx264
  libx264-10bit
  libx264-all
)
source=(git+https://github.com/jpsdr/x264.git#branch="${_branch}")
sha256sums=(SKIP)

prepare() {
  cd x264

  git checkout -b "$_branch" # to build with correct X264_VERSION/X264_POINTER
}

pkgver() {
  cd x264

  local _version
  local _revision
  local _shorthash

  _version="$(grep '#define X264_BUILD' x264.h | awk '{ print $3 }')"
  _revision="$(git rev-list --count HEAD)"
  _shorthash="$(git rev-parse --short HEAD)"

  printf '%s.r%s.g%s' "$_version" "$_revision" "$_shorthash"
}

build() {
  cd x264

  ./configure \
    --prefix=/usr \
    --enable-shared \
    --enable-pic \
    --enable-lto \
    --disable-avs \
    --disable-audio

  make
}

package() {
  make -C x264 DESTDIR="${pkgdir}" install-cli install-lib-shared
}