summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 63113078927604e44ab4fab33f20d24b6b231d6e (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
# Maintainer: BrainDamage
pkgname="zipunicode-git"
_dirname="${pkgname%-git}"
_basename="${pkgname%-git}"
pkgver=r10.412b942
pkgrel=1
pkgdesc="Extract zip file with correct encoding, standalone binary and python package"
arch=(any)
url="https://github.com/Dragon2fly/ZipUnicode"
license=("MIT")
depends=('python' 'python-chardet')
makedepends=(git python-build python-installer python-wheel)
source=("${_dirname}::git+https://github.com/Dragon2fly/ZipUnicode")
sha256sums=('SKIP')
# conflict/provide the same package as the non -git version
provides=("${_basename}")
conflicts=("${_basename}")

pkgver() {
	cd "${srcdir}/${_dirname}"

	(
		set -o pipefail
		git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
		printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	)
	# 0.9.9.r27.g2b039da # if tags exist
	# r1581.2b039da      # else fallback
}


build() {
	cd "${srcdir}/${_dirname}"
	export PYTHONHASHSEED=0
	python -m build --wheel --no-isolation
}

package() {
	cd "${srcdir}/${_dirname}"
	find dist -name '*.whl' -exec python -m installer --compile-bytecode 1 --destdir="${pkgdir}" {} \;
}