summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6c49db2e725b8a379692ad18790b691a074b52cf (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Maintainer: Daniel Bermond < gmail-com: danielbermond >

# To enable the Instrumentation and Tracing Technology API (ittnotify):
#   - install the package intel-seapi
#   - in build(), change '-DENABLE_ITT:BOOL=' from 'OFF' to 'ON'
#   - and then build intel-media-sdk-git
# intel-seapi will be autodetected by the build system, serving as a makedepend.
# Currently it will not be a mandatory makedepend.

pkgname=intel-media-sdk-git
pkgver=2019.3.pre3.r25.g4311844c
pkgrel=3
pkgdesc='API to access hardware-accelerated video decode, encode and filtering on Intel platforms with integrated graphics (git version)'
arch=('x86_64')
url='https://github.com/Intel-Media-SDK/MediaSDK/'
license=('MIT')
depends=(
    # official repositories:
        'gcc-libs' 'libdrm' 'wayland' 'intel-media-driver'
    # AUR:
        'libva-git'
)
optdepends=('ocl-icd: for rotate_opencl plugin'
            'intel-compute-runtime: for rotate_opencl plugin')
makedepends=('git' 'git-lfs' 'cmake' 'libpciaccess' 'libx11' 'libxcb'
             'python' 'opencl-headers' 'ocl-icd' 'intel-compute-runtime')
provides=('intel-media-sdk' 'libmfx')
conflicts=('intel-media-sdk')
install="${pkgname}.install"
source=('git+https://github.com/Intel-Media-SDK/MediaSDK.git'
        'intel-media-sdk-git.conf'
        'intel-media-sdk-git.sh')
sha256sums=('SKIP'
            '12a37e6e12d93fac5829082773b9f010a3c6c763ddeee177618b8e1a0547fbbc'
            '315ea6f304cf2b7b6a8aaabb0b8f71fcd480677c7fb9c8cbfa51c7830bb159bc')

export GIT_LFS_SKIP_SMUDGE='1'

prepare() {
    cd MediaSDK
    
    git lfs install --local
    git lfs pull "${source[0]/git+/}"
    
    mkdir -p build
}

pkgver() {
    cd MediaSDK
    
    local _prefix='intel-mediasdk-'
    
    # git, tags available
    git describe --long --tags | sed "s/^${_prefix}//;s/^[0-9]\{2\}/20&/;s/\([^-]*-g\)/r\1/;s/-/./g;s/^v//"
}

build() {
    cd MediaSDK/build
    
    cmake \
        -DCMAKE_BUILD_TYPE='None' \
        -DBUILD_ALL:BOOL='ON' \
        -DBUILD_TOOLS:BOOL='ON' \
        -DENABLE_ITT:BOOL='OFF' \
        -DENABLE_OPENCL:BOOL='ON' \
        -DENABLE_WAYLAND:BOOL='ON' \
        -DENABLE_X11_DRI3:BOOL='ON' \
        -Wno-dev \
        ..
        
    make
}

check() {
    cd MediaSDK/build
    
    make test
}

package() {
    cd MediaSDK/build
    
    make DESTDIR="$pkgdir" install
    
    # metrics_monitor
    install -D -m755 __bin/None/libcttmetrics.so -t "${pkgdir}/opt/intel/mediasdk/share/mfx/samples"
    install -D -m755 __bin/None/metrics_monitor  -t "${pkgdir}/opt/intel/mediasdk/share/mfx/samples"
    ln -s ../share/mfx/samples/libcttmetrics.so "${pkgdir}/opt/intel/mediasdk/lib/libcttmetrics.so"
    
    # ld.so and profile configuration files
    cd "$srcdir"
    install -D -m644 intel-media-sdk-git.conf -t "${pkgdir}/etc/ld.so.conf.d"
    install -D -m755 intel-media-sdk-git.sh   -t "${pkgdir}/etc/profile.d"
    
    # license
    cd "${srcdir}/MediaSDK"
    install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}