From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] Refactor PYO3_CROSS_* in rust build-helper
Date: Sat, 16 Sep 2023 17:04:17 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-46086@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]
There is a new pull request by tornaria against master on the void-packages repository
https://github.com/tornaria/void-packages pyo3-refactor
https://github.com/void-linux/void-packages/pull/46086
Refactor PYO3_CROSS_* in rust build-helper
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/46086.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pyo3-refactor-46086.patch --]
[-- Type: text/x-diff, Size: 6207 bytes --]
From 02690f80580dade1c9057636ea455317d22c90cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:49:40 -0300
Subject: [PATCH 1/5] common/build-helper/rust.sh: fix cross for pyo3
---
common/build-helper/rust.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh
index f689f7c7f9d96..96ec351d545d9 100644
--- a/common/build-helper/rust.sh
+++ b/common/build-helper/rust.sh
@@ -33,6 +33,10 @@ fi
# For cross-compiling rust -sys crates
export PKG_CONFIG_ALLOW_CROSS=1
+# For cross-compiling pyo3 bindings
+export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
+export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
+
# gettext-rs
export GETTEXT_BIN_DIR=/usr/bin
export GETTEXT_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib/gettext"
From eaf7f8aa01fd9af3ca31b30c60578ca6cc2f309d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:15 -0300
Subject: [PATCH 2/5] python3-adblock: refactor PYO3_CROSS_*
---
srcpkgs/python3-adblock/template | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/srcpkgs/python3-adblock/template b/srcpkgs/python3-adblock/template
index 52736e7cbf819..de50cfe87bdc1 100644
--- a/srcpkgs/python3-adblock/template
+++ b/srcpkgs/python3-adblock/template
@@ -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"
@@ -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
From dd8bf1468267e9b661968c5bd6ee94538822b848 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:23 -0300
Subject: [PATCH 3/5] python3-bcrypt: refactor PYO3_CROSS_*
---
srcpkgs/python3-bcrypt/template | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/srcpkgs/python3-bcrypt/template b/srcpkgs/python3-bcrypt/template
index f70c39db3e288..90e727aeac53f 100644
--- a/srcpkgs/python3-bcrypt/template
+++ b/srcpkgs/python3-bcrypt/template
@@ -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"
@@ -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
From dca4eb13745f88a87758addc2b7a7318a30ea602 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:34 -0300
Subject: [PATCH 4/5] python3-cryptography: refactor PYO3_CROSS_*
---
srcpkgs/python3-cryptography/template | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/srcpkgs/python3-cryptography/template b/srcpkgs/python3-cryptography/template
index b183104aa66e8..672c194423c3f 100644
--- a/srcpkgs/python3-cryptography/template
+++ b/srcpkgs/python3-cryptography/template
@@ -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
@@ -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
}
From 7cb25e94eec0a7eebead29f52b6ad8ae5bbab528 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:49 -0300
Subject: [PATCH 5/5] python3-mitmproxy_wireguard: refactor PYO3_CROSS_*
---
srcpkgs/python3-mitmproxy_wireguard/template | 4 ----
1 file changed, 4 deletions(-)
diff --git a/srcpkgs/python3-mitmproxy_wireguard/template b/srcpkgs/python3-mitmproxy_wireguard/template
index bfa34a389a294..13c515928839a 100644
--- a/srcpkgs/python3-mitmproxy_wireguard/template
+++ b/srcpkgs/python3-mitmproxy_wireguard/template
@@ -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
next reply other threads:[~2023-09-16 15:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-16 15:04 tornaria [this message]
2023-09-26 18:49 ` ahesford
2023-09-26 18:50 ` ahesford
2023-09-26 19:12 ` [PR PATCH] [Updated] " tornaria
2023-09-26 19:12 ` tornaria
2023-09-26 19:34 ` [PR PATCH] [Merged]: " ahesford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-46086@inbox.vuxu.org \
--to=tornaria@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).