From 665b62f834d28e924bdcd805cc3dc224deca9a08 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Mon, 8 Feb 2021 10:35:05 -0500 Subject: [PATCH] New package: python3-setuptools-rust-0.11.6 --- .../patches/preserve_rustflags.patch | 27 +++++++++++++++++++ srcpkgs/python3-setuptools-rust/template | 23 ++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch create mode 100644 srcpkgs/python3-setuptools-rust/template diff --git a/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch b/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch new file mode 100644 index 00000000000..00be144d52c --- /dev/null +++ b/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch @@ -0,0 +1,27 @@ +From cbd30fda8c6f7cc0d304728413f2cbf488da096b Mon Sep 17 00:00:00 2001 +From: "Andrew J. Hesford" +Date: Mon, 8 Feb 2021 12:58:58 -0500 +Subject: [PATCH] Augment, rather than replace, existing RUSTFLAGS when + building + +Some complex environments, like Void's cross-compilation environment, +use RUSTFLAGS to control the behavior of rust compilation. Rather than +overwriting RUSTFLAGS with custom flags, augment any existing RUSTFLAGS +to preserve these environments. +--- + setuptools_rust/build.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git setuptools_rust/build.py setuptools_rust/build.py +index 40d8e42..60eddfa 100644 +--- setuptools_rust/build.py ++++ setuptools_rust/build.py +@@ -186,7 +186,7 @@ def build_extension(self, ext): + rustflags += " -C target-cpu=native" + + if rustflags: +- env["RUSTFLAGS"] = rustflags ++ env["RUSTFLAGS"] = (env.get("RUSTFLAGS", "") + " " + rustflags).strip() + + # Execute cargo + try: diff --git a/srcpkgs/python3-setuptools-rust/template b/srcpkgs/python3-setuptools-rust/template new file mode 100644 index 00000000000..07ad5d97d1b --- /dev/null +++ b/srcpkgs/python3-setuptools-rust/template @@ -0,0 +1,23 @@ +# Template file for 'python3-setuptools-rust' +pkgname=python3-setuptools-rust +version=0.11.6 +revision=1 +wrksrc="${pkgname#python3-}-${version}" +build_style=python3-module +hostmakedepends="python3-setuptools_scm python3-toml" +depends="python3-semanticversion python3-toml python3-setuptools" +short_desc="Setuptools plugin for Rust support" +maintainer="Andrew J. Hesford " +license="MIT" +homepage="https://github.com/PyO3/setuptools-rust" +changelog="https://raw.githubusercontent.com/PyO3/setuptools-rust/master/CHANGELOG.md" +distfiles="${PYPI_SITE}/s/setuptools-rust/setuptools-rust-${version}.tar.gz" +checksum=a5b5954909cbc5d66b914ee6763f81fa2610916041c7266105a469f504a7c4ca + +do_check() { + echo "Tests have unpackaged dependencies; skipping" +} + +post_install() { + vlicense LICENSE +}