Initial upload: waifu2x-ncnn-vulkan 20220728-1

This commit is contained in:
Manuel 2022-12-12 22:12:31 +01:00
parent 1b7c8a975d
commit 4d63fd9c74
Signed by: Manuel
GPG key ID: 4085037435E1F07A
3 changed files with 89 additions and 0 deletions

View file

@ -0,0 +1,20 @@
pkgbase = waifu2x-ncnn-vulkan
pkgdesc = waifu2x converter ncnn version, runs fast on intel / amd / nvidia GPU with vulkan
pkgver = 20220728
pkgrel = 1
url = https://github.com/nihui/waifu2x-ncnn-vulkan
arch = x86_64
arch = aarch64
license = MIT
makedepends = cmake
makedepends = glslang
makedepends = vulkan-headers
makedepends = ncnn
depends = vulkan-icd-loader
depends = libwebp
source = https://github.com/nihui/waifu2x-ncnn-vulkan/archive/20220728/waifu2x-ncnn-vulkan-20220728.tar.gz
source = model_path.patch
sha512sums = ea17cbbcb7318586793222c6c7139f67395c49c567b601969b829fc426eb517308509b7c1da69171fcbf8e68baa5cec3e52e98159e3c5e6c35ce47a8514dadb7
sha512sums = 1a286730a7168f63c56544b334277234b84415bcc4c2956c8f8f39ef0d864f9de4ecb38cb9491da91c45b43d5ecdba0018931c2926fb6e2aea98edf3ca42657a
pkgname = waifu2x-ncnn-vulkan

View file

@ -0,0 +1,43 @@
# Maintainer: Manuel Hüsers <aur@huesers.de>
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
}

View file

@ -0,0 +1,26 @@
diff --git a/src/filesystem_utils.h b/src/filesystem_utils.h
index fdf172c..9706dc9 100644
--- a/src/filesystem_utils.h
+++ b/src/filesystem_utils.h
@@ -169,7 +169,7 @@ static path_t sanitize_filepath(const path_t& path)
if (filepath_is_readable(path))
return path;
- return get_executable_directory() + path;
+ return "/usr/share/waifu2x-ncnn-vulkan/" + path;
}
#endif // FILESYSTEM_UTILS_H
diff --git a/src/main.cpp b/src/main.cpp
index fa10e6f..5590b2f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -470,7 +470,7 @@ int main(int argc, char** argv)
int noise = 0;
int scale = 2;
std::vector<int> tilesize;
- path_t model = PATHSTR("models-cunet");
+ path_t model = PATHSTR("/usr/share/waifu2x-ncnn-vulkan/models-cunet");
std::vector<int> gpuid;
int jobs_load = 1;
std::vector<int> jobs_proc;