summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 28fec2c59e1f580335f89ad0cf5f619192718580 (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
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>

function download_git-lfs {
  local url dir
  url=${1#git-lfs+}
  download_git "$url"
  dir="$SRCDEST/$(get_filename "$url")"
  git -C "$dir" lfs install
  git -C "$dir" lfs fetch
}

function extract_git-lfs {
  url=${1/git-lfs/https}
  extract_git "$url"
}

pkgname=openimagedenoise-develop
pkgver=1.2.3
_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*}")
makedepends=(git git-lfs cmake 'ispc>=1.14' ninja)
source=("${pkgname}::git+https://github.com/OpenImageDenoise/oidn.git${_fragment}"
        "git+https://github.com/OpenImageDenoise/mkl-dnn.git"
        "git-lfs+https://github.com/OpenImageDenoise/oidn-weights.git"
        )
sha256sums=('SKIP'
            'SKIP'
            'SKIP')

prepare() {
  git -C "${srcdir}"/${pkgname%-git} config submodule.mkl-dnn.url "${srcdir}"/mkl-dnn
  git -C "${srcdir}"/${pkgname%-git} config submodule.weights.url "${srcdir}"/oidn-weights
  git -C "${srcdir}"/${pkgname%-git} submodule update --init --recursive # --remote
}

#pkgver() {
#  cd ${srcdir}/${pkgname}
#  git describe --long --tags | sed '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: