Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically
@ 2022-03-14  1:09 classabbyamp
  2022-03-14  1:25 ` [PR PATCH] [Updated] " classabbyamp
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: classabbyamp @ 2022-03-14  1:09 UTC (permalink / raw)
  To: ml

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

There is a new 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 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: 4806 bytes --]

From f22c9ba9973692a5d0803677e5768362fa9974c0 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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh
index 431cb5f0fd43..272d03f52607 100644
--- a/common/build-helper/rust.sh
+++ b/common/build-helper/rust.sh
@@ -23,6 +23,9 @@ if [ "$CROSS_BUILD" ]; then
 	# innocuous flags are used here just to disable its defaults
 	export HOST_CC="gcc"
 	export HOST_CFLAGS="-O2"
+
+	# Crates that use bindgen via build.rs are not cross-aware unless these are set
+	export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=${XBPS_CROSS_BASE} -I${XBPS_CROSS_BASE}/usr/include"
 else
 	unset CARGO_BUILD_TARGET
 fi
@@ -41,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 4e1e19fa32cf96314823f4a9968ea67c6243e8df 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 8e36f2a5423389f67f9bac3dc027ea2fedc9fd6e 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 cross envvars

---
 srcpkgs/pijul/template | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically
  2022-03-14  1:09 [PR PATCH] fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically classabbyamp
@ 2022-03-14  1:25 ` classabbyamp
  2022-03-14  7:11 ` classabbyamp
  2022-03-15 13:52 ` [PR PATCH] [Merged]: " leahneukirchen
  2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2022-03-14  1:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2204 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 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: 5462 bytes --]

From f22c9ba9973692a5d0803677e5768362fa9974c0 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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh
index 431cb5f0fd43..272d03f52607 100644
--- a/common/build-helper/rust.sh
+++ b/common/build-helper/rust.sh
@@ -23,6 +23,9 @@ if [ "$CROSS_BUILD" ]; then
 	# innocuous flags are used here just to disable its defaults
 	export HOST_CC="gcc"
 	export HOST_CFLAGS="-O2"
+
+	# Crates that use bindgen via build.rs are not cross-aware unless these are set
+	export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=${XBPS_CROSS_BASE} -I${XBPS_CROSS_BASE}/usr/include"
 else
 	unset CARGO_BUILD_TARGET
 fi
@@ -41,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 4e1e19fa32cf96314823f4a9968ea67c6243e8df 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 4fe1c017bd07a19a3b73233a5d1d7649f454b458 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically
  2022-03-14  1:09 [PR PATCH] fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically classabbyamp
  2022-03-14  1:25 ` [PR PATCH] [Updated] " classabbyamp
@ 2022-03-14  7:11 ` classabbyamp
  2022-03-15 13:52 ` [PR PATCH] [Merged]: " leahneukirchen
  2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2022-03-14  7:11 UTC (permalink / raw)
  To: ml

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Merged]: fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically
  2022-03-14  1:09 [PR PATCH] fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically classabbyamp
  2022-03-14  1:25 ` [PR PATCH] [Updated] " classabbyamp
  2022-03-14  7:11 ` classabbyamp
@ 2022-03-15 13:52 ` leahneukirchen
  2 siblings, 0 replies; 4+ messages in thread
From: leahneukirchen @ 2022-03-15 13:52 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically
https://github.com/void-linux/void-packages/pull/36125

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

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 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
-->


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-15 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14  1:09 [PR PATCH] fix cross for packages with bindgen (rdedup, pijul), update rdedup, make libsodium-sys link dynamically classabbyamp
2022-03-14  1:25 ` [PR PATCH] [Updated] " classabbyamp
2022-03-14  7:11 ` classabbyamp
2022-03-15 13:52 ` [PR PATCH] [Merged]: " leahneukirchen

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).