Github messages for voidlinux
 help / color / mirror / Atom feed
From: classabbyamp <classabbyamp@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically
Date: Mon, 14 Mar 2022 08:11:37 +0100	[thread overview]
Message-ID: <20220314071137.j2yvhPKHdD3E_fSKKNeYU8qE4Jv6CDQexIq-t_WmByY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-36125@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 2273 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages bindgen-fixes
https://github.com/void-linux/void-packages/pull/36125

fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically
<!-- Uncomment relevant sections and delete options which are not applicable -->

## **Don't merge until #35591 is merged**

This is a bit of a combo PR, but all the changes are interlinked so hear me out:

1. #35591 introduces a change to `common/build_helper/rust.sh` that fixes `bindgen` when it's run at build-time in `build.rs`. This fix is included in this PR temporarily until that PR is merged. This should apply that fix to the two other packages I could find that use `bindgen` in the same way
2. There was an update available for `rdedup`, so that was applied
3. When applying the bindgen fix to `rdedup`, I found that `libsodium-sys` failed to find `libsodium`. From there, I found that `libsodium-sys` was attempting to statically link and failing. Upstream provided the solution, `SODIUM_SHARED=1`
4. `pijul` is the other package that can cleaned up because of the `bindgen` fix, and it also confirms that the `libsodium` fix works (there are no other packages that use `libsodium-sys` in the repos that I could find)

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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/36125.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bindgen-fixes-36125.patch --]
[-- Type: text/x-diff, Size: 5080 bytes --]

From 297a134cd95c25a4cf36d422964aedf9b3d2382b Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@kb6.ee>
Date: Sun, 13 Mar 2022 20:51:03 -0400
Subject: [PATCH 1/3] common/build-helper/rust.sh: link to libsodium
 dynamically

without this envvar, libsodium-sys will attempt to link to libsodium
staticly, and may fail.
---
 common/build-helper/rust.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh
index 798083709c3e..272d03f52607 100644
--- a/common/build-helper/rust.sh
+++ b/common/build-helper/rust.sh
@@ -44,6 +44,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
 # sodium-sys
 export SODIUM_LIB_DIR="${XBPS_CROSS_BASE}/usr/include"
 export SODIUM_INC_DIR="${XBPS_CROSS_BASE}/usr/lib"
+export SODIUM_SHARED=1
 
 # openssl-sys
 export OPENSSL_NO_VENDOR=1

From b9988f15e560e74e227f201ef73af8b3f35c81ec Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@kb6.ee>
Date: Sun, 13 Mar 2022 20:53:07 -0400
Subject: [PATCH 2/3] rdedup: update to 3.2.1.

removes the need for patched/backported bindgen
---
 srcpkgs/rdedup/patches/bindgen-cross.patch | 12 ------------
 srcpkgs/rdedup/template                    | 21 +++++----------------
 2 files changed, 5 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/rdedup/patches/bindgen-cross.patch

diff --git a/srcpkgs/rdedup/patches/bindgen-cross.patch b/srcpkgs/rdedup/patches/bindgen-cross.patch
deleted file mode 100644
index 7eab10fd3d56..000000000000
--- a/srcpkgs/rdedup/patches/bindgen-cross.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-patch bindgen to use BINDGEN_EXTRA_CLANG_ARGS variable to set sysroot for cross builds
-https://github.com/jnbr/rust-bindgen/tree/0.37.4-clang_args
-
---- a/Cargo.toml	2019-06-15 13:18:05.509893680 +0200
-+++ b/Cargo.toml	2019-06-15 13:19:48.854887006 +0200
-@@ -53,3 +53,6 @@
- slog-term = "2"
- slog-async = "2"
- url = "1"
-+
-+[patch.crates-io]
-+bindgen = {git = 'https://github.com/jnbr/rust-bindgen', rev = '4afb05213b3e7e0ec928b84ea85d9f2b99477586'}
diff --git a/srcpkgs/rdedup/template b/srcpkgs/rdedup/template
index c392e3c0e2fc..6bd71cacfc46 100644
--- a/srcpkgs/rdedup/template
+++ b/srcpkgs/rdedup/template
@@ -1,25 +1,14 @@
 # Template file for 'rdedup'
 pkgname=rdedup
-version=3.1.1
-revision=6
-wrksrc=rdedup-rdedup-v${version}
+version=3.2.1
+revision=1
 build_style=cargo
+build_helper=rust
 hostmakedepends="pkg-config clang"
 makedepends="openssl-devel liblzma-devel libsodium-devel"
 short_desc="Data deduplication engine"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://github.com/dpc/rdedup"
-distfiles="https://github.com/dpc/rdedup/archive/rdedup-v${version}.tar.gz"
-checksum=5e7c09c40897cd2f2635e8c213c2ff0f5c4d7ceccbd22980cd4cb0a16f3dfc28
-
-if [ "$CROSS_BUILD" ]; then
-	export HOST_CC="$BUILD_CC"
-	export HOST_CFLAGS="$BUILD_CFLAGS"
-	export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=${XBPS_CROSS_BASE}"
-fi
-
-pre_build() {
-	cargo update --package openssl-sys --precise 0.9.58
-	cargo update --package openssl --precise 0.10.22
-}
+distfiles="https://github.com/dpc/rdedup/archive/v${version}.tar.gz"
+checksum=023b5576f30ebf75c1740dd244ac13b6ef3ad7f6d4a6ab6654e12130201eb923

From cb658c2f71f47c27300c9e53346dd6d5cc8acf4a Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@kb6.ee>
Date: Sun, 13 Mar 2022 20:54:55 -0400
Subject: [PATCH 3/3] pijul: remove unnecessary bindgen workarounds

---
 srcpkgs/pijul/patches/bindgen.patch | 3 +--
 srcpkgs/pijul/template              | 9 ++-------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/pijul/patches/bindgen.patch b/srcpkgs/pijul/patches/bindgen.patch
index 2457f1434d94..04ccc8381aae 100644
--- a/srcpkgs/pijul/patches/bindgen.patch
+++ b/srcpkgs/pijul/patches/bindgen.patch
@@ -1,10 +1,9 @@
 --- a/Cargo.toml
 +++ b/Cargo.toml
-@@ -133,3 +133,7 @@
+@@ -133,3 +133,6 @@
  version = "2.0"
  [target."cfg(unix)".dependencies.tokio-uds]
  version = "0.2"
 +
 +[patch.crates-io]
-+"bindgen" = {git = 'https://github.com/Duncaen/rust-bindgen', rev = "e70d9568887ffb6c2a7d7d165a71aed311a29129"}
 +"sequoia-rfc2822" = {path = '/builddir/sequoia-v0.9.0/rfc2822'}
diff --git a/srcpkgs/pijul/template b/srcpkgs/pijul/template
index 40df186b9387..581d77789c9c 100644
--- a/srcpkgs/pijul/template
+++ b/srcpkgs/pijul/template
@@ -1,8 +1,9 @@
 # Template file for 'pijul'
 pkgname=pijul
 version=0.12.2
-revision=4
+revision=5
 build_style=cargo
+build_helper=rust
 _sequoia_ver=0.9.0
 hostmakedepends="pkg-config clang"
 makedepends="libsodium-devel openssl-devel nettle-devel"
@@ -15,12 +16,6 @@ distfiles="https://crates.io/api/v1/crates/pijul/${version}/download>pijul-${ver
 checksum="f92a3f4063e780ca45c161ceb0f42baf34dfeddf3359ebf6c2e0442d9abb5889
  71823c88b9666611f3cfa6b1d923bd66fda92fa6a53368b195bd2f962fdf7f4b"
 
-if [ "$CROSS_BUILD" ]; then
-	export HOST_CC="$BUILD_CC"
-	export HOST_CFLAGS="$BUILD_CFLAGS"
-	export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=$XBPS_CROSS_BASE"
-fi
-
 # We only want to install the binary, so don't run cargo install
 do_install() {
 	vbin target/${RUST_TARGET}/release/pijul

  parent reply	other threads:[~2022-03-14  7:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14  1:09 [PR PATCH] " classabbyamp
2022-03-14  1:25 ` [PR PATCH] [Updated] " classabbyamp
2022-03-14  7:11 ` classabbyamp [this message]
2022-03-15 13:52 ` [PR PATCH] [Merged]: " leahneukirchen

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=20220314071137.j2yvhPKHdD3E_fSKKNeYU8qE4Jv6CDQexIq-t_WmByY@z \
    --to=classabbyamp@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).