Skip to content

Commit 1e1837c

Browse files
committed
[python-amaranth] add
1 parent 0e124a6 commit 1e1837c

File tree

8 files changed

+265
-0
lines changed

8 files changed

+265
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Maintainer: xiretza <xiretza+aur@xiretza.xyz>
2+
# Contributor: Scott Alfter <scott@alfter.us>
3+
4+
_pkgname=amaranth-boards
5+
pkgname="python-$_pkgname-git"
6+
pkgver=r258.c26a72e
7+
pkgrel=1
8+
pkgdesc="Board definitions for Amaranth HDL"
9+
arch=(any)
10+
url="https://github.com/amaranth-lang/$_pkgname"
11+
license=('BSD-2-Clause')
12+
depends=('python')
13+
makedepends=('git' 'python-build' 'python-installer' 'python-wheel'
14+
'python-setuptools' 'python-setuptools-scm' 'python-pdm-backend')
15+
depends=('python-amaranth')
16+
provides=("python-nmigen-boards=$pkgver" "python-$_pkgname=$pkgver")
17+
conflicts=('python-nmigen-boards' "python-$_pkgname")
18+
replaces=('python-nmigen-boards-git')
19+
source=("git+$url.git")
20+
sha256sums=('SKIP')
21+
22+
pkgver() {
23+
cd "$_pkgname"
24+
25+
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
26+
}
27+
28+
build() {
29+
cd "$_pkgname"
30+
31+
python -m build --wheel --no-isolation
32+
}
33+
34+
package() {
35+
cd "$_pkgname"
36+
37+
python -m installer --destdir="$pkgdir" dist/*.whl
38+
39+
install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
40+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
maintainers:
2+
- github: yuyichao
3+
4+
pre_build: vcs_update
5+
post_build: git_pkgbuild_commit
6+
repo_depends:
7+
- python-amaranth
8+
9+
update_on:
10+
- source: github
11+
github: amaranth-lang/amaranth
12+
branch: master
13+
- alias: python
14+
- source: manual
15+
manual: 1

archlinuxcn/python-amaranth/PKGBUILD

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Maintainer: Scott Alfter <scott@alfter.us>
2+
# Contributor: xiretza <xiretza+aur@xiretza.xyz>
3+
4+
_pkgname=amaranth
5+
pkgname="python-$_pkgname"
6+
pkgver=0.5.6
7+
pkgrel=1
8+
pkgdesc="A modern hardware definition language and toolchain based on Python (formerly nMigen)"
9+
arch=(any)
10+
url="https://github.com/amaranth-lang/amaranth"
11+
license=('BSD-2-Clause')
12+
depends=('python' 'python-jinja' 'python-pyvcd' 'python-jschon')
13+
makedepends=('git' 'python-build' 'python-installer' 'python-wheel'
14+
'python-setuptools-scm' 'python-packaging' 'python-pdm-backend')
15+
optdepends=('python-paramiko: for remote builds')
16+
provides=("python-nmigen=$pkgver" "python-$_pkgname=$pkgver")
17+
conflicts=('python-nmigen' "python-nmigen-git" "python-$_pkgname-git")
18+
replaces=('python-nmigen')
19+
source=(
20+
"${pkgname}-${pkgver}.tar.gz::https://github.com/amaranth-lang/amaranth/archive/refs/tags/v${pkgver}.tar.gz"
21+
)
22+
sha512sums=('84fe631b12160c0f42bf39d926d9e9f87240969578036ae3b68b4523bda65f4182e130b75f9aeaec658ca4ef87059a30ac6abcbc5e7ba80d7d8a1ae04bdd8b38')
23+
24+
prepare() {
25+
cd "${_pkgname}-${pkgver}"
26+
27+
sed -i -e "s/pdm\\.backend\\._vendor\\.//" pdm_build.py
28+
sed -i -e 's/"pdm-backend~=2.3.0",//' pyproject.toml
29+
}
30+
31+
build() {
32+
cd "${_pkgname}-${pkgver}"
33+
34+
python -m build --wheel --no-isolation
35+
}
36+
37+
package() {
38+
cd "${_pkgname}-${pkgver}"
39+
40+
python -m installer --destdir="$pkgdir" dist/*.whl
41+
42+
install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
43+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
maintainers:
2+
- github: yuyichao
3+
4+
pre_build_script: update_pkgver_and_pkgrel(_G.newver.lstrip('v'))
5+
post_build: git_pkgbuild_commit
6+
7+
update_on:
8+
- source: github
9+
github: amaranth-lang/amaranth
10+
use_max_tag: true
11+
include_regex: 'v(\d+.\d+.\d+)'
12+
- alias: python
13+
- source: manual
14+
manual: 1

archlinuxcn/python-jschon/PKGBUILD

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Maintainer: Claudia Pellegrino <aur ät cpellegrino.de>
2+
3+
pkgname=python-jschon
4+
_gitpkgname=jschon
5+
pkgver=0.11.1
6+
pkgrel=2
7+
pkgdesc='Object-oriented JSON Schema implementation for Python'
8+
arch=('any')
9+
url='https://github.com/marksparkza/jschon'
10+
license=('MIT')
11+
depends=(
12+
'python'
13+
'python-requests'
14+
'python-rfc3986'
15+
)
16+
makedepends=(
17+
'python-build'
18+
'python-installer'
19+
'python-setuptools'
20+
'python-sphinx'
21+
'python-sphinx_rtd_theme'
22+
'python-wheel'
23+
'stylelint'
24+
)
25+
checkdepends=(
26+
'python-hypothesis'
27+
'python-pytest'
28+
'python-pytest-httpserver'
29+
)
30+
31+
source=(
32+
"${_gitpkgname}-${pkgver}.tar.gz::https://github.com/marksparkza/jschon/archive/v${pkgver}.tar.gz"
33+
)
34+
35+
sha512sums=(
36+
'a4b3c559501189efcfdd5a3dfca96594c7d5bbea0e7343524c2cea6bb661790704956401ea3901ff13d5bf15d15843ee2724c14061a3f1ee47a08dbbb0c9c2ab'
37+
)
38+
39+
prepare() {
40+
local _schemas_basedir
41+
42+
cd "${_gitpkgname}-${pkgver}"
43+
44+
echo >&2 'Linking stable JSON schema specs'
45+
_schemas_basedir='/usr/lib/node_modules/stylelint/node_modules/table/node_modules/ajv/dist/refs'
46+
rmdir -v jschon/catalog/json-schema-{2019-09,2020-12}
47+
ln -nsv "${_schemas_basedir}"/json-schema-{2019-09,2020-12} jschon/catalog/
48+
49+
echo >&2 'Disabling verification for unstable, unversioned schema specs'
50+
# shellcheck disable=SC2016 # Not meant to be expanded
51+
sed -i -e 's/, ``next``//' -e 's/, _next//' -e '/_next\.initialize/d' jschon/__init__.py
52+
sed -i -e "s/, 'next'//" tests/{conftest,test_catalog,test_metaschema}.py
53+
}
54+
55+
build() {
56+
local _site_packages
57+
cd "${_gitpkgname}-${pkgver}"
58+
59+
echo >&2 'Building wheel'
60+
python -m build --wheel --no-isolation
61+
62+
echo >&2 'Generating HTML documentation'
63+
_site_packages="$(python -c 'import site; print(site.getsitepackages()[0])')"
64+
python -m installer --destdir=tmp_install dist/*.whl
65+
PYTHONPATH="${PWD}/tmp_install/${_site_packages}" \
66+
make -C docs singlehtml
67+
}
68+
69+
check() {
70+
cd "${_gitpkgname}-${pkgver}"
71+
72+
echo >&2 'Running unit tests'
73+
# Excluding `next` tests due to missing unstable schema
74+
# Excluding benchmark tests, which are not relevant for system packaging
75+
# Excluding test_hierarchical_output: missing validation output schema
76+
pytest -k 'not [next] and not test_benchmarks and not test_hierarchical_output'
77+
}
78+
79+
package() {
80+
cd "${_gitpkgname}-${pkgver}"
81+
82+
echo >&2 'Packaging the wheel'
83+
python -I -m installer --destdir="${pkgdir}" dist/*.whl
84+
85+
echo >&2 'Packaging the documentation'
86+
install -D -m 644 -t "${pkgdir}/usr/share/doc/${pkgname}" \
87+
README.rst
88+
cp -R --preserve=mode -t "${pkgdir}/usr/share/doc/${pkgname}" \
89+
docs/_build/singlehtml/{index.html,_static}
90+
91+
echo >&2 'Packaging the license'
92+
install -D -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" \
93+
LICENSE
94+
}

archlinuxcn/python-jschon/lilac.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
maintainers:
2+
- github: yuyichao
3+
4+
pre_build_script: update_pkgver_and_pkgrel(_G.newver.lstrip('v'))
5+
post_build: git_pkgbuild_commit
6+
7+
update_on:
8+
- source: github
9+
github: marksparkza/jschon
10+
use_max_tag: true
11+
include_regex: 'v(\d+.\d+.\d+)'
12+
- alias: python
13+
- source: manual
14+
manual: 1

archlinuxcn/python-pyvcd/PKGBUILD

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributor: Filipe Laíns (FFY00) <lains@archlinux.org>
2+
3+
_pkgname=pyvcd
4+
pkgname=python-$_pkgname
5+
pkgver=0.4.1
6+
pkgrel=1
7+
pkgdesc='Python package for writing Value Change Dump (VCD) files'
8+
arch=('any')
9+
url='https://github.com/SanDisk-Open-Source/pyvcd'
10+
license=('MIT')
11+
depends=('python')
12+
makedepends=('python-setuptools-scm' 'python-setuptools' 'python-build'
13+
'python-installer' 'python-wheel')
14+
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
15+
sha512sums=('3ae5e965bde0fc5e70b8b5f0b5fddd9019f9e545949c987177ff2bc7749df2efaf579990c36c0f8eb550892389995c1e0345b9654061030e3a00700c2f1bd382')
16+
17+
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
18+
19+
build() {
20+
cd $_pkgname-$pkgver
21+
22+
python -m build --wheel --no-isolation
23+
}
24+
25+
package() {
26+
cd $_pkgname-$pkgver
27+
28+
python -m installer --destdir="$pkgdir" dist/*.whl
29+
30+
install -Dm 644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
31+
}

archlinuxcn/python-pyvcd/lilac.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
maintainers:
2+
- github: yuyichao
3+
4+
pre_build_script: update_pkgver_and_pkgrel(_G.newver)
5+
post_build: git_pkgbuild_commit
6+
7+
update_on:
8+
- source: github
9+
github: SanDisk-Open-Source/pyvcd
10+
use_max_tag: true
11+
include_regex: '(\d+.\d+.\d+)'
12+
- alias: python
13+
- source: manual
14+
manual: 1

0 commit comments

Comments
 (0)