summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2ce37ad35aa6bb63d8378d56999cb53d46ac2c1b (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
# Maintainer : Daniel Bermond <dbermond@archlinux.org>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: kfgz <kfgz@interia.pl>
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>

pkgname=x265-hg
pkgver=3.4.r25404.e31211b2f00c
pkgrel=1
pkgdesc='Open source H.265/HEVC video encoder (mercurial version)'
arch=('x86_64')
url='https://www.videolan.org/developers/x265.html'
license=('GPL')
depends=('gcc-libs')
makedepends=('mercurial' 'cmake' 'nasm')
provides=('x265' 'libx265.so')
conflicts=('x265')
source=('hg+http://hg.videolan.org/x265')
sha256sums=('SKIP')

pkgver() {
    printf '%s.r%s.%s' "$(hg -R x265 tags | sed '/_RC/d;/tip/d' | sort -rV | awk 'NR==1 { print $1 }')" \
                       "$(hg -R x265 identify -n)" \
                       "$(hg -R x265 log -r. --template '{node|short}')"
}

build() {
    cmake -S x265/source -B build-12 \
        -DCMAKE_INSTALL_PREFIX='/usr' \
        -DHIGH_BIT_DEPTH='ON' \
        -DMAIN12='ON' \
        -DEXPORT_C_API='OFF' \
        -DENABLE_CLI='OFF' \
        -DENABLE_SHARED='OFF' \
        -Wno-dev
    make -C build-12
    
    cmake -S x265/source -B build-10 \
        -DCMAKE_INSTALL_PREFIX='/usr' \
        -DHIGH_BIT_DEPTH='ON' \
        -DEXPORT_C_API='OFF' \
        -DENABLE_CLI='OFF' \
        -DENABLE_SHARED='OFF' \
        -Wno-dev
    make -C build-10
    
    cmake -S x265/source -B build \
        -DCMAKE_INSTALL_PREFIX:PATH='/usr' \
        -DENABLE_SHARED='ON' \
        -DENABLE_HDR10_PLUS='ON' \
        -DEXTRA_LIB='x265_main10.a;x265_main12.a' \
        -DEXTRA_LINK_FLAGS='-L.' \
        -DLINKED_10BIT='ON' \
        -DLINKED_12BIT='ON' \
        -Wno-dev
    ln -s ../build-10/libx265.a build/libx265_main10.a
    ln -s ../build-12/libx265.a build/libx265_main12.a
    make -C build
}

package() {
    make -C build DESTDIR="$pkgdir" install
}