summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 48b3ac2ded901e905b667c86253df6bef25760da (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: Martin Rys <https://rys.rs/contact>

pkgbase=vtracer
pkgname=(
	vtracer
	python-vtracer
)
# [2025-07-23]: The version is actually 0.6.11 but the GitHub releases vs tags vs actual file version(==PyPI version) is all over the place
#               Sent an email off to the maintainer about it
pkgver=0.6.6
pkgrel=1
pkgdesc="Convert PNG to SVG"
arch=(x86_64)
url="https://github.com/visioncortex/vtracer"
makedepends=(
	'rust'
	'python-build'
	'python-installer'
	'python-maturin'
)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/visioncortex/${pkgname}/archive/${pkgver}.tar.gz")
sha256sums=('db785c9ce3c991746ab09f58856acad6d1c3365d4c6c811377c3662680a8bd20')

prepare() {
	cd "${pkgname}-${pkgver}"

	export RUSTUP_TOOLCHAIN=stable
	# Upstream does not provide a lock file at the time of writing
	cargo fetch --target host-tuple # --locked
}

build() {
	cd "${pkgname}-${pkgver}"

	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release --all-features

	# Build Python bindings
	cd cmdapp
	python -m build --wheel --no-isolation
}

package_vtracer() {
	license=('MIT')
	depends=('gcc-libs')

	cd "${pkgbase}-${pkgver}"

	install -Dm755 \
		target/release/vtracer \
		"${pkgdir}/usr/bin/vtracer"

	install -Dm644 \
		LICENSE \
		"${pkgdir}/usr/share/licenses/vtracer/LICENSE"
}

package_python-vtracer() {
	pkgdesc="Python bindings for vtracer"
	license=('Apache-2.0 OR MIT')
	depends=('python')

	cd "${pkgbase}-${pkgver}/cmdapp"

	python -m installer \
		--destdir="${pkgdir}" \
		dist/*.whl

	install -Dm644 \
		LICENSE-APACHE \
		"${pkgdir}/usr/share/licenses/python-vtracer/LICENSE-APACHE"
	install -Dm644 \
		LICENSE-MIT \
		"${pkgdir}/usr/share/licenses/python-vtracer/LICENSE-MIT"
}