summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 15e02ea8d4c7d6ae3ae73ca263c9ca39b3a9228d (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: Mitch Bigelow <ipha00@gmail.com>
#

pkgname=srmd-ncnn-vulkan-git
pkgver=20200606.r0.g1a7c13e
pkgrel=1
pkgdesc="SRMD super resolution implemented with ncnn library"
url="https://github.com/nihui/srmd-ncnn-vulkan"
license=('MIT')
depends=('vulkan-icd-loader' 'vulkan-driver')
makedepends=('git' 'cmake' 'glslang' 'vulkan-headers')
conflicts=('srmd-ncnn-vulkan')
provides=('srmd-ncnn-vulkan')
arch=('i686' 'x86_64')
source=(
    "git://github.com/nihui/srmd-ncnn-vulkan.git"
)
sha256sums=(
    'SKIP'
)

pkgver() {
    cd "${srcdir}/srmd-ncnn-vulkan"
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "${srcdir}/srmd-ncnn-vulkan"

    # init ncnn submodule
    git submodule update --init --recursive

    # Fix default model path
    sed -i 's|path_t model = PATHSTR("models-srmd")|path_t model = PATHSTR("/usr/share/srmd-ncnn-vulkan/models-srmd")|' src/main.cpp
}

build() {
    cd "${srcdir}/srmd-ncnn-vulkan/src"
    mkdir -p build
    cd build
    cmake \
        -DCMAKE_INSTALL_PREFIX=/usr \
        ..
    make
}

package() {

    cd "${srcdir}/srmd-ncnn-vulkan"
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

    install -Dm755 "src/build/srmd-ncnn-vulkan" "${pkgdir}/usr/bin/srmd-ncnn-vulkan"

    cd "${srcdir}/srmd-ncnn-vulkan/models"
    for f in models-*/*; do
        install -Dm 644 "$f" ${pkgdir}/usr/share/srmd-ncnn-vulkan/"$f"
    done
}