summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4bce31c47e5a664aca74337e1c5b2b89489eb59d (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
# Maintainer: Frantic1048 <archer@frantic1048.com>
# Maintainer: Fredrick Brennan <admin@8chan.co>
pkgname=waifu2x-git
pkgver=r427.f89dd61
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' 'ocl-icd' 'opencv')
makedepends=('git' 'cmake' 'make')
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' 'waifu2x.1.gz')
noextract=('waifu2x.1.gz')
md5sums=('SKIP' 'bc1a849b7bc63dfa8d54497fa1297a00') #generate with 'makepkg -g'
gitreponame="waifu2x-converter-cpp"

prepare() {
  sed -i "s/waifu2x-converter-cpp/waifu2x/g" $gitreponame/CMakeLists.txt
}

build() {
  cd $gitreponame
  #
  # BUILD HERE
  #
  cmake -DCMAKE_INSTALL_PREFIX=/usr -DINSTALL_MODELS=on .
  make
}

package() {
  ## Waifu2x's Makefile has no `install`
  ## Just copy its binary, and some files it require...
  make DESTDIR=$pkgdir install -C$gitreponame
  install -D ./waifu2x.1.gz $pkgdir/usr/share/man/man1/waifu2x.1.gz
}

# 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() {
  msg 'Running Waifu2x'\''s test suite. Depending on your processor and GPU, this may take a while.'
  make test ARGS="-V" -C$gitreponame
}

# vim:set ts=2 sw=2 et: