summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4f0b2f158da9ffd43a8b03644dabf5d8c977a4fe (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Maintainer : jopejoe1 <johannes@joens.email>

_pkgname=realsr-ncnn-vulkan
pkgname=python-$_pkgname-git
pkgver=1.0.6.r0.g71b1943
pkgrel=1
pkgdesc="A Python FFI of nihui/$_pkgname achieved with SWIG "
url="https://github.com/media2x/$_pkgname-python"
arch=("any")
license=("MIT")
depends=(
	"python"
	"vulkan-headers"
	"vulkan-icd-loader"
	"swig"
	"python-pillow"
)
makedepends=(
	"cmake"
	"git"
	"python-setuptools"
	"python-requests"
	"python-cmake-build-extension"
)
provides=('python-realsr-ncnn-vulkan')
conflicts=('python-realsr-ncnn-vulkan')
source=(
	"git+https://github.com/media2x/$_pkgname-python.git"
	"git+https://github.com/nihui/$_pkgname.git"
	"git+https://github.com/Tencent/ncnn.git"
	"git+https://github.com/webmproject/libwebp.git"
	"git+https://github.com/pybind/pybind11.git"
	"git+https://github.com/KhronosGroup/glslang.git"
)
sha256sums=(
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
)

pkgver() {
	cd $_pkgname-python
	echo $(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
}

prepare() {
  cd $_pkgname-python
  git submodule init
  git config submodule.realsr_ncnn_vulkan_python/$_pkgname.url "$srcdir/$_pkgname"
  git submodule update

  cd realsr_ncnn_vulkan_python/$_pkgname
  git submodule init
  git config submodule.src/ncnn.url "$srcdir/ncnn"
  git config submodule.src/libwebp.url "$srcdir/libwebp"
  git submodule update

  cd src/ncnn
  git submodule init
  git config submodule.glslang.url "$srcdir/glslang"
  git config submodule.python/pybind11.url "$srcdir/pybind11"
  git submodule update
}

build() {
	cd $_pkgname-python
	python setup.py build
}

package() {
	cd $_pkgname-python
	python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
}