From: ahesford <ahesford@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: python3-adblock-0.4.2
Date: Wed, 03 Feb 2021 23:06:52 +0100 [thread overview]
Message-ID: <20210203220652.qcM7Cv0jA-6fksFLcOq2UWHuS-nVvmSrMpRBZkMyU4c@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-28396@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 1494 bytes --]
There is an updated pull request by ahesford against master on the void-packages repository
https://github.com/ahesford/void-packages adblock
https://github.com/void-linux/void-packages/pull/28396
New package: python3-adblock-0.4.2
This supersedes #28380 and #27490.
Compiles natively on `x86_64*`, `aarch64` and `armv7l`. Works as expected on `x86_64` and `aarch64`. I haven't tried the other ARM architectures.
I can't figure out what happens with `openssl-sys` when cross-compiling; the flags passed to GCC include `-m64`, which are rejected by the ARM compilers. On `i686`, the build fails with SIGABRT when trying to build the `psl` crate. The `openssl-sys` issue appears even if I try using the built-in `cargo` build style rather than `maturin`, so this is some configuration problem that extends beyond `maturin`.
Any help fixing these issue would be appreciated. If we can't sort them out, `broken` on `i686` and `nocross` will be sufficient for now.
#### General
- [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
A patch file from https://github.com/void-linux/void-packages/pull/28396.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-adblock-28396.patch --]
[-- Type: text/x-diff, Size: 3706 bytes --]
From 29eecdef1ceeb342c78e5995d48d5772b6b04588 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 1 Feb 2021 11:13:44 +0300
Subject: [PATCH 1/2] New package: maturin-0.9.0
---
srcpkgs/maturin/template | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 srcpkgs/maturin/template
diff --git a/srcpkgs/maturin/template b/srcpkgs/maturin/template
new file mode 100644
index 00000000000..fefdd2b1757
--- /dev/null
+++ b/srcpkgs/maturin/template
@@ -0,0 +1,32 @@
+# Template file for 'maturin'
+pkgname=maturin
+version=0.9.0
+revision=1
+build_style=cargo
+hostmakedepends="python3-setuptools python3-toml"
+depends="python3-toml"
+short_desc="Build and publish crates as python packages"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="Apache-2.0, MIT"
+homepage="https://github.com/PyO3/maturin"
+distfiles="${homepage}/archive/v${version}.tar.gz"
+checksum=22e8082a743e1dc11f5909b596f9053deb7dc1a56336003677381ba02cf67da8
+
+post_patch() {
+ # setup.py is broken, just use it for the pure python part
+ vsed -e 's/cmdclass.*/packages=["maturin"],/' -i setup.py
+}
+
+post_build() {
+ # python package is pure; the cross environment is not relevant
+ python3 setup.py build
+}
+
+do_check() {
+ : tests fail to build
+}
+
+post_install() {
+ vlicense license-mit LICENSE-MIT
+ python3 setup.py install --prefix=/usr --root=${DESTDIR}
+}
From 8ce64bd0ac07bfc51047c239362944cf938cb0ab Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 1 Feb 2021 13:50:32 +0300
Subject: [PATCH 2/2] New package: python3-adblock-0.4.2
---
srcpkgs/python3-adblock/template | 51 ++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
create mode 100644 srcpkgs/python3-adblock/template
diff --git a/srcpkgs/python3-adblock/template b/srcpkgs/python3-adblock/template
new file mode 100644
index 00000000000..f3c02883768
--- /dev/null
+++ b/srcpkgs/python3-adblock/template
@@ -0,0 +1,51 @@
+# Template file for 'python3-adblock'
+pkgname=python3-adblock
+version=0.4.2
+revision=1
+wrksrc="${pkgname/python3/python}-${version}"
+build_style=python3-pep517
+build_helper="rust"
+hostmakedepends="maturin pkg-config cargo libressl-devel"
+makedepends="libressl-devel python3-devel"
+depends="python3"
+checkdepends="python3-pytest"
+short_desc="Brave's adblock library in Python"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="Apache-2.0, MIT"
+homepage="https://github.com/ArniDagur/python-adblock"
+distfiles="${homepage}/archive/${version}.tar.gz"
+checksum=06de6074e6cfe889fc0383cc929a5a2306570251c14e51abbfcedd328b83e0e9
+
+case "$XBPS_TARGET_MACHINE" in
+ i686*) broken="compiler throws SIGABRT on the psl crate" ;;
+esac
+
+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"
+
+ # openssl-sys tries to build for host, but without HOST_CC and
+ # HOST_CFLAGS, it mixes host flags with target compiler
+ export HOST_CC=gcc
+ export HOST_CFLAGS=-O2
+fi
+
+do_build() {
+ maturin build -o . --release --target "${RUST_TARGET}" --manylinux off
+
+ # Drop platform specifiers from the wheel; pip will refuse to install,
+ # e.g., an armv7l wheel on an aarch64 system even if the masterdir is
+ # armv7l. The wheel is correct; no need for name compatibility checks.
+ mv adblock-${version}-*.whl adblock-${version}-py3-none-any.whl
+}
+
+pre_check() {
+ # Tests require the compiled extension
+ cp target/${RUST_TARGET}/release/libadblock.so adblock/adblock.so
+}
+
+post_install() {
+ vlicense LICENSE-MIT
+ chmod 755 ${DESTDIR}/${py3_sitelib}/adblock/*.so
+}
next prev parent reply other threads:[~2021-02-03 22:06 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-01 21:01 [PR PATCH] " ahesford
2021-02-01 21:02 ` ahesford
2021-02-01 21:09 ` [PR REVIEW] " ericonr
2021-02-01 21:10 ` ahesford
2021-02-01 21:14 ` ericonr
2021-02-01 21:15 ` ericonr
2021-02-01 21:22 ` ericonr
2021-02-01 21:23 ` ericonr
2021-02-01 21:24 ` ericonr
2021-02-01 21:25 ` ericonr
2021-02-01 21:35 ` ericonr
2021-02-01 21:46 ` ericonr
2021-02-01 21:48 ` ericonr
2021-02-02 1:42 ` ericonr
2021-02-02 15:34 ` [PR PATCH] [Updated] " ahesford
2021-02-02 15:49 ` ahesford
2021-02-03 22:06 ` ahesford [this message]
2021-02-04 1:23 ` [PR REVIEW] " ericonr
2021-02-04 1:23 ` ericonr
2021-02-04 1:23 ` ericonr
2021-02-04 1:23 ` ericonr
2021-02-04 1:34 ` ericonr
2021-02-04 4:21 ` [PR PATCH] [Updated] " ahesford
2021-02-04 4:22 ` ahesford
2021-02-04 4:25 ` ahesford
2021-02-04 5:33 ` [PR PATCH] [Closed]: " 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=20210203220652.qcM7Cv0jA-6fksFLcOq2UWHuS-nVvmSrMpRBZkMyU4c@z \
--to=ahesford@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).