arch-packages/waifu2x-ncnn-vulkan/PKGBUILD

42 lines
1.3 KiB
Text
Raw Permalink Normal View History

pkgname=waifu2x-ncnn-vulkan
pkgver=20220728
pkgrel=1
pkgdesc='waifu2x converter ncnn version, runs fast on intel / amd / nvidia GPU with vulkan'
arch=('x86_64' 'aarch64')
url="https://github.com/nihui/$pkgname"
license=('MIT')
depends=('vulkan-icd-loader' 'libwebp')
makedepends=('cmake' 'glslang' 'vulkan-headers' 'ncnn')
source=("https://github.com/nihui/$pkgname/archive/$pkgver/$pkgname-$pkgver.tar.gz"
'model_path.patch')
sha512sums=('ea17cbbcb7318586793222c6c7139f67395c49c567b601969b829fc426eb517308509b7c1da69171fcbf8e68baa5cec3e52e98159e3c5e6c35ce47a8514dadb7'
'1a286730a7168f63c56544b334277234b84415bcc4c2956c8f8f39ef0d864f9de4ecb38cb9491da91c45b43d5ecdba0018931c2926fb6e2aea98edf3ca42657a')
prepare() {
cd $pkgname-$pkgver
# TODO: Make proper patch
patch -Np1 < '../model_path.patch'
}
build() {
cmake -B build -S "$pkgname-$pkgver/src" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DGLSLANG_TARGET_DIR=/usr/lib/cmake \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_SYSTEM_NCNN=on \
-DUSE_SYSTEM_WEBP=on
cmake --build build
}
package() {
install -Dm755 -t "$pkgdir/usr/bin" build/$pkgname
install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" $pkgname-$pkgver/LICENSE
cd $pkgname-$pkgver/models
for f in models-*/*; do
install -Dm644 "$f" "$pkgdir/usr/share/$pkgname/$f"
done
}