aboutsummaryrefslogtreecommitdiff
path: root/srcpkgs/python3-adblock/template
blob: 71aeb5c9a84c4a2d21221b71e7e8e5a531a9b1af (plain) (blame)
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
# Template file for 'python3-adblock'
pkgname=python3-adblock
version=0.6.0
revision=4
build_style=python3-pep517
build_helper="rust"
#XXX: Does statically link against openssl
hostmakedepends="maturin pkg-config cargo openssl-devel"
makedepends="openssl-devel python3-devel rust-std"
depends="python3"
checkdepends="python3-pytest python3-toml"
short_desc="Brave's adblock library in Python"
maintainer="Andrew J. Hesford <ajh@sideband.org>"
license="Apache-2.0, MIT"
homepage="https://github.com/ArniDagur/python-adblock"
changelog="https://raw.githubusercontent.com/ArniDagur/python-adblock/master/CHANGELOG.md"
distfiles="${PYPI_SITE}/a/adblock/adblock-${version}.tar.gz"
checksum=11651e956c69b3ee571404754df665854717255b80f437e9dc323ee82b564e72

do_build() {
	maturin build -o . --release --target "${RUST_TARGET}" --manylinux off

	# Drop platform specifiers from the wheel; pip will refuse to install,
	# e.g., an armv7l wheel on an aarch64 system even if the masterdir is
	# armv7l. The wheel is correct; no need for name compatibility checks.
	mkdir -p dist
	mv adblock-${version}-*.whl dist/adblock-${version}-py3-none-any.whl
}

post_install() {
	vlicense LICENSE-MIT
	chmod 755 ${DESTDIR}/${py3_sitelib}/adblock/*.so
}