Unverified Commit 7b37e8d7 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

_389-ds-base: use cargoSetupHook and remove hard-coded vendor path (#508541)

parents 2af396c9 82c2735b
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
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
Original line number Diff line number Diff line
@@ -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"