summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3fd0696be5ff155ecf84006ce5188b4a0fe1c2f9 (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
# Maintainer: Daniel Bermond <dbermond@archlinux.org>

pkgbase=level-zero-legacy
pkgname=('level-zero-headers-legacy' 'level-zero-loader-legacy')
pkgver=1.17.42
pkgrel=2
pkgdesc='API for accessing low level interfaces in oneAPI platform devices (legacy platforms)'
arch=('x86_64')
url='https://spec.oneapi.com/versions/latest/elements/l0/source/index.html'
license=('MIT')
makedepends=('git' 'cmake' 'opencl-headers')
source=("https://github.com/oneapi-src/level-zero/archive/v${pkgver}/${pkgbase}-${pkgver}.tar.gz")
sha256sums=('16ba86e9fee6699c5300bb0ef09cb0852cd261e2ddd9960f88df93d4d04a4829')

prepare() {
    printf '%s\n' "${pkgver##*.}" > "level-zero-${pkgver}/VERSION_PATCH"
}

build() {
    cmake -B build -S "level-zero-${pkgver}" \
        -G 'Unix Makefiles' \
        -DCMAKE_BUILD_TYPE:STRING='None' \
        -DCMAKE_INSTALL_PREFIX:PATH='/usr' \
        -DSYSTEM_SPDLOG:BOOL='OFF' \
        -Wno-dev
    cmake --build build
}

package_level-zero-headers-legacy() {
    pkgdesc="$(sed 's/)/; headers)/' <<< "$pkgdesc")"
    arch=('any')
    provides=("level-zero-headers=${pkgver}")
    conflicts=('level-zero-headers')
    
    DESTDIR="$pkgdir" cmake --install build
    install -D -m644 "level-zero-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
    
    # remove loader files
    [ -d 'loader' ] && rm -rf loader
    install -d loader/lib
    mv "${pkgdir}/usr/lib"/*so* loader/lib
}

package_level-zero-loader-legacy() {
    pkgdesc="$(sed 's/)/; loader)/' <<< "$pkgdesc")"
    depends=('gcc-libs')
    provides=("level-zero-loader=${pkgver}")
    conflicts=('level-zero-loader')
    
    mv loader "${pkgdir}/usr"
    install -D -m644 "level-zero-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}