summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrick Brennan2015-09-22 21:03:33 +0800
committerFredrick Brennan2015-09-22 21:03:33 +0800
commitca28467bf7ee0e15f1754659cc8021f6057bb159 (patch)
tree6cfaae778720ceaecff10472b487768b78fe90d9
downloadaur-ca28467bf7ee0e15f1754659cc8021f6057bb159.tar.gz
Initial import
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD64
-rw-r--r--arch_use_usr_share_for_models.patch39
3 files changed, 121 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c8e6826e9b4a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = waifu2x-git
+ pkgdesc = Image rescaling and noise reduction using the power of convolutional neural networks
+ pkgver = r250.ca65c93
+ pkgrel = 1
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ makedepends = cmake
+ depends = opencl-headers
+ depends = opencl-mesa
+ optdepends = cuda: Significantly speeds up operations, but only works with NVIDIA GPU
+ provides = waifu2x
+ provides = waifu2x-converter-cpp
+ source = git+https://github.com/tanakamura/waifu2x-converter-cpp.git
+ md5sums = SKIP
+
+pkgname = waifu2x-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c5acea25404f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,64 @@
+# Maintainer: Fredrick Brennan <admin@8chan.co>
+pkgname=waifu2x-git
+pkgver=r250.ca65c93
+pkgrel=1
+pkgdesc="Image rescaling and noise reduction using the power of convolutional neural networks"
+arch=('x86_64')
+url=""
+license=('MIT')
+groups=()
+depends=('opencl-headers' 'opencl-mesa') # If you have NVIDIA card, edit the PKGBUILD to use `opencl-nvidia` instead.
+makedepends=('git' 'cmake')
+optdepends=('cuda: Significantly speeds up operations, but only works with NVIDIA GPU')
+provides=('waifu2x' 'waifu2x-converter-cpp')
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=
+source=('git+https://github.com/tanakamura/waifu2x-converter-cpp.git')
+noextract=()
+md5sums=('SKIP') #generate with 'makepkg -g'
+gitreponame="waifu2x-converter-cpp"
+
+prepare() {
+ cd $gitreponame
+
+ patch -Np1 -i ../../arch_use_usr_share_for_models.patch
+}
+
+build() {
+ cd $gitreponame
+ #
+ # BUILD HERE
+ #
+ cmake .
+ make -j5
+}
+
+package() {
+ ## Waifu2x's Makefile has no `install`
+ ## Just copy its binary, and some files it require...
+ installpath='/usr/bin/waifu2x'
+ sharepath='/usr/share/waifu2x/'
+
+ mkdir -p $pkgdir/usr/bin || true
+ mkdir -p $pkgdir$sharepath || true
+ cp $gitreponame/$gitreponame $pkgdir$installpath
+ cp -r $gitreponame/models_rgb $pkgdir$sharepath
+ msg "Waifu2x will be installed as $installpath. It has no manpage, reading $installpath -h is probably a good idea."
+}
+
+# From https://wiki.archlinux.org/index.php/VCS_package_guidelines#Git
+pkgver() {
+ cd $gitreponame
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+check() {
+ cd $gitreponame
+ msg 'Running Waifu2x'\''s test suite. Depending on your processor and GPU, this may take a while.'
+ ./runtest
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/arch_use_usr_share_for_models.patch b/arch_use_usr_share_for_models.patch
new file mode 100644
index 000000000000..936f9d4cfe4c
--- /dev/null
+++ b/arch_use_usr_share_for_models.patch
@@ -0,0 +1,39 @@
+diff --git a/appendix/waifu2x-nocuda/lib/settings.lua b/appendix/waifu2x-nocuda/lib/settings.lua
+index 56f894d..3ea818c 100644
+--- a/appendix/waifu2x-nocuda/lib/settings.lua
++++ b/appendix/waifu2x-nocuda/lib/settings.lua
+@@ -21,7 +21,7 @@ cmd:text("Options:")
+ cmd:option("-seed", 11, 'fixed input seed')
+ cmd:option("-data_dir", "./data", 'data directory')
+ cmd:option("-test", "images/miku_small.png", 'test image file')
+-cmd:option("-model_dir", "./models", 'model directory')
++cmd:option("-model_dir", "/usr/share/waifu2x/models", 'model directory')
+ cmd:option("-method", "scale", '(noise|scale)')
+ cmd:option("-noise_level", 1, '(1|2)')
+ cmd:option("-scale", 2.0, 'scale')
+diff --git a/appendix/waifu2x-nocuda/waifu2x.lua b/appendix/waifu2x-nocuda/waifu2x.lua
+index 7afe284..d0b4f37 100644
+--- a/appendix/waifu2x-nocuda/waifu2x.lua
++++ b/appendix/waifu2x-nocuda/waifu2x.lua
+@@ -19,7 +19,7 @@ local function waifu2x()
+ cmd:text("Options:")
+ cmd:option("-i", "images/miku_small.png", 'path of input image')
+ cmd:option("-o", "(auto)", 'path of output')
+- cmd:option("-model_dir", "./models", 'model directory')
++ cmd:option("-model_dir", "/usr/share/waifu2x/models", 'model directory')
+ cmd:option("-m", "noise_scale", 'method (noise|scale|noise_scale)')
+ cmd:option("-noise_level", 1, '(1|2)')
+ cmd:option("-crop_size", 128, 'crop size')
+diff --git a/src/main.cpp b/src/main.cpp
+index ad1a2d4..b2a7ecc 100644
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -52,7 +52,7 @@ int main(int argc, char** argv) {
+
+ TCLAP::ValueArg<std::string> cmdModelPath("", "model_dir",
+ "path to custom model directory (don't append last / )", false,
+- "models_rgb", "string", cmd);
++ "/usr/share/waifu2x/models_rgb", "string", cmd);
+
+ TCLAP::ValueArg<int> cmdNumberOfJobs("j", "jobs",
+ "number of threads launching at the same time", false, 0, "integer",