_389-ds-base: use cargoSetupHook and remove hard-coded vendor path

This was not previously not using cargoSetupHook and therefore had a faulty configuration when building subpackages with vendored packages. This fixes that and removes a hard-coded vendor path from the source cargo config which was interfering with the generated configuration.
This commit is contained in:
azban
2026-04-10 00:44:56 -06:00
parent 9b678e5f85
commit 82c2735bb6
2 changed files with 31 additions and 6 deletions
@@ -0,0 +1,26 @@
From 815bf49134f9dc049080b0ec4eb2fd807c23086b Mon Sep 17 00:00:00 2001
From: azban <me@azban.net>
Date: Mon, 6 Apr 2026 19:49:19 -0600
Subject: [PATCH 1/2] remove hard-coded vendor paths
Hard-coded vendored sources is not compatible with fetchCargoVendor.
Signed-off-by: azban <me@azban.net>
---
.cargo/config.toml.in | 6 ------
1 file changed, 6 deletions(-)
diff --git a/.cargo/config.toml.in b/.cargo/config.toml.in
index d7d8ff4d4..e69de29bb 100644
--- a/.cargo/config.toml.in
+++ b/.cargo/config.toml.in
@@ -1,6 +0,0 @@
-[source.crates-io]
-registry = "https://github.com/rust-lang/crates.io-index"
-@rust_vendor_sources@
-
-[source.vendored-sources]
-directory = "./vendor"
--
2.51.2
+5 -6
View File
@@ -57,11 +57,13 @@ stdenv.mkDerivation (finalAttrs: {
url = "https://github.com/389ds/389-ds-base/commit/1701419551c246e9dc21778b118220eeb2258125.patch";
hash = "sha256-trzY/fDH3rs66DWbWI+PY46tIC9ShuVqspMHqEEKZYA=";
})
./0001-remove-hard-coded-vendor-paths.patch
];
cargoRoot = "src";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.src.name}/src";
inherit (finalAttrs) src cargoRoot;
name = "389-ds-base-${finalAttrs.version}";
hash = "sha256-pNzMQjeBpmzFg6oWCxhLDmKGUKIW6jGmZQWai5Yunjc=";
};
@@ -74,6 +76,7 @@ stdenv.mkDerivation (finalAttrs: {
python3
cargo
rustc
rustPlatform.cargoSetupHook
]
++ lib.optional withCockpit rsync;
@@ -106,10 +109,6 @@ stdenv.mkDerivation (finalAttrs: {
./autogen.sh --prefix="$out"
'';
preBuild = ''
ln -s ${finalAttrs.cargoDeps} ./vendor
'';
configureFlags = [
"--enable-rust-offline"
"--enable-autobind"