Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor PYO3_CROSS_* in rust build-helper #46086

Merged
merged 4 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions srcpkgs/python3-adblock/template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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"
makedepends="openssl-devel python3-devel rust-std"
depends="python3"
checkdepends="python3-pytest python3-toml"
short_desc="Brave's adblock library in Python"
Expand All @@ -17,12 +17,6 @@ changelog="https://raw.githubusercontent.com/ArniDagur/python-adblock/master/CHA
distfiles="${PYPI_SITE}/a/adblock/adblock-${version}.tar.gz"
checksum=11651e956c69b3ee571404754df665854717255b80f437e9dc323ee82b564e72

if [ "$CROSS_BUILD" ]; then
makedepends+=" rust-std"
export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
fi

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

Expand Down
8 changes: 1 addition & 7 deletions srcpkgs/python3-bcrypt/template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ revision=1
build_style=python3-pep517
build_helper="rust"
hostmakedepends="python3-setuptools-rust python3-wheel python3-cffi cargo"
makedepends="python3-devel"
makedepends="python3-devel rust-std"
depends="python3-cffi"
checkdepends="python3-pytest $depends"
short_desc="Modern password hashing for software and servers"
Expand All @@ -15,9 +15,3 @@ homepage="https://github.com/pyca/bcrypt"
changelog="https://github.com/pyca/bcrypt/blob/main/README.rst#changelog"
distfiles="${PYPI_SITE}/b/bcrypt/bcrypt-${version}.tar.gz"
checksum=27d375903ac8261cfe4047f6709d16f7d18d39b1ec92aaf72af989552a650ebd

if [ "$CROSS_BUILD" ]; then
makedepends+=" rust-std"
export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
fi
8 changes: 1 addition & 7 deletions srcpkgs/python3-cryptography/template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build_style=python3-module
build_helper="rust"
make_check_args="--ignore tests/bench/test_x509.py --ignore tests/bench/test_aead.py"
hostmakedepends="python3-setuptools-rust python3-cffi cargo pkg-config"
makedepends="python3-devel openssl-devel"
makedepends="python3-devel rust-std openssl-devel"
depends="python3-cffi"
checkdepends="python3-pytest-subtests python3-pytest-xdist
python3-iso8601 python3-pytz python3-cryptography_vectors
Expand All @@ -19,12 +19,6 @@ changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.
distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz"
checksum=6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34

if [ "$CROSS_BUILD" ]; then
makedepends+=" rust-std"
export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
fi

pre_check() {
vsed -i '/addopts/d' pyproject.toml
}
Expand Down
4 changes: 0 additions & 4 deletions srcpkgs/python3-mitmproxy_wireguard/template
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ distfiles="https://github.com/decathorpe/mitmproxy_wireguard/archive/${version}.
checksum=749b5b45222b629f4cced154cc4bf70ba7ae3061db02e2ea0ae45a4ae6246463

do_build() {
if [ "$CROSS_BUILD" ]; then
export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
fi
# Taken from ../python3-adblock/template
maturin build -o . --release --target "${RUST_TARGET}" --manylinux off
mkdir -p dist
Expand Down
Loading