summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f44fe18462b7bb809e14c491eb2ba49ca08c4aa1 (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
#!/hint/bash
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
# shellcheck disable=SC2034,SC2154 # to allow unused/uninitialized variables.

pkgname=openimagedenoise-git
pkgver=2.2.0.r0.gdfa3b96
#_fragment="#tag=v${pkgver}"
pkgrel=1
pkgdesc="Intel(R) Open Image Denoise library"
arch=('x86_64')
url="https://www.openimagedenoise.org/"
license=('Apache')
depends=(intel-tbb python)
provides=("openimagedenoise=${pkgver%.r*}")
conflicts=(openimagedenoise)
makedepends=(git cmake 'ispc>=1.14' ninja)
source=("${pkgname%-git}::git+https://github.com/OpenImageDenoise/oidn.git${_fragment}"
        "git+https://github.com/OpenImageDenoise/mkl-dnn.git"
        "git+https://github.com/NVIDIA/cutlass"
        "git+https://github.com/ROCmSoftwarePlatform/composable_kernel"
        )
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

prepare() {
  git -C "${srcdir}"/${pkgname%-git} config submodule.mkl-dnn.url "${srcdir}"/mkl-dnn
  git -C "${srcdir}"/${pkgname%-git} config submodule.cutlass.url "${srcdir}"/cutlass
  git -C "${srcdir}"/${pkgname%-git} config submodule.external/composable_kernel.url "${srcdir}"/composable_kernel
  sed 's|../oidn-weights.git|https://github.com/OpenImageDenoise/oidn-weights.git|' -i "${srcdir}"/${pkgname%-git}/.gitmodules
  git -C "${srcdir}"/${pkgname%-git} -c protocol.file.allow=always submodule update --init --recursive # --remote
}

pkgver() {
  git -C "${srcdir}"/${pkgname%-git} describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cmake -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX=/usr/ \
        -G Ninja -B "build" -S "${srcdir}"/${pkgname%-git}
# shellcheck disable=SC2086 # to allow multiple flags in MAKEFLAGS variable.
  ninja -C "build" ${MAKEFLAGS:--j1} 
}

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

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