blob: 1db150f324c5d786d9b1f6e2a16dcffb40f0df4e (
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
# Maintainer: Carl Smedstad <carsme@archlinux.org>
pkgbase=minijinja
pkgname=(
minijinja-cli
python-minijinja
)
pkgver=2.0.1
_commit=c89b5da9e5d6e52ce7447ec1591af5404ce1b70c
pkgrel=1
pkgdesc="A powerful but minimal dependency template engine for Rust compatible with Jinja/Jinja2"
url="https://github.com/mitsuhiko/minijinja"
arch=(x86_64)
license=(Apache-2.0)
makedepends=(
cargo
git
python-build
python-installer
python-markupsafe
python-maturin
python-wheel
)
checkdepends=(python-pytest)
source=("git+$url.git#commit=$_commit")
sha256sums=('1b92ab0f86f262380b3edf551b425f4982a1ede237662b5eec44d5ca2102339a')
_archive="$pkgbase"
pkgver() {
cd "$_archive"
git describe --tags
}
prepare() {
cd "$_archive"
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd "$_archive"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release --all-features --package minijinja-cli
cd minijinja-py
python -m build --wheel --no-isolation --skip-dependency-check
}
check() {
cd "$_archive"
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen --all-features
cd minijinja-py
rm -rf tmp_install
python -m installer --destdir=tmp_install dist/*.whl
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
export PYTHONPATH="$PWD/tmp_install/$site_packages"
pytest
}
package_minijinja-cli() {
pkgdesc+=" (CLI utility)"
depends=(
gcc-libs
glibc
)
cd "$_archive"
install -Dm755 -t "$pkgdir/usr/bin" target/release/minijinja-cli
install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" ./*.md
}
package_python-minijinja() {
pkgdesc+=" (Python bindings)"
depends=(
gcc-libs
glibc
python
python-markupsafe
)
cd "$_archive/minijinja-py"
python -m installer --destdir="$pkgdir" dist/*.whl
}
|