From aa7d855d6318a039d0af1df507b5bd76179f5b53 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 8 Feb 2025 12:13:36 +0100 Subject: [PATCH] openldap: fix static Closes: https://github.com/NixOS/nixpkgs/pull/235270 --- pkgs/by-name/op/openldap/package.nix | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/op/openldap/package.nix b/pkgs/by-name/op/openldap/package.nix index c353a4422d4c..ccf8dcbc1635 100644 --- a/pkgs/by-name/op/openldap/package.nix +++ b/pkgs/by-name/op/openldap/package.nix @@ -12,6 +12,10 @@ systemdMinimal, libxcrypt, + # options + withModules ? !stdenv.hostPlatform.isStatic, + withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal, + # passthru nixosTests, }: @@ -25,6 +29,14 @@ stdenv.mkDerivation rec { hash = "sha256-LLfcc+nINA3/DZk1f7qleKvzDMZhnwUhlyxVVoHmsv8="; }; + patches = [ + (fetchurl { + name = "test069-sleep.patch"; + url = "https://bugs.openldap.org/attachment.cgi?id=1051"; + hash = "sha256-9LcFTswMQojrwHD+PRvlnSrwrISCFcboHypBwoDIZc0="; + }) + ]; + # TODO: separate "out" and "bin" outputs = [ "out" @@ -46,12 +58,16 @@ stdenv.mkDerivation rec { (cyrus_sasl.override { inherit openssl; }) - libsodium libtool openssl ] ++ lib.optionals (stdenv.hostPlatform.isLinux) [ libxcrypt # causes linking issues on *-darwin + ] + ++ lib.optionals withModules [ + libsodium + ] + ++ lib.optionals withSystemd [ systemdMinimal ]; @@ -61,10 +77,10 @@ stdenv.mkDerivation rec { configureFlags = [ - "--enable-argon2" "--enable-crypt" - "--enable-modules" "--enable-overlays" + (lib.enableFeature withModules "argon2") + (lib.enableFeature withModules "modules") ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--with-yielding_select=yes" @@ -126,7 +142,7 @@ stdenv.mkDerivation rec { "INSTALL=install" ]; - postInstall = '' + postInstall = lib.optionalString withModules '' for module in $extraContribModules; do make $installFlags install -C contrib/slapd-modules/$module done