From a76023f25608951bd0e4a5193e959976d0bc05ee Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 6 Jul 2023 16:45:12 -0600 Subject: [PATCH] db: make patches and autoreconfHook unconditional --- pkgs/development/libraries/db/db-4.8.nix | 7 +++++-- pkgs/development/libraries/db/db-5.3.nix | 7 +++++-- pkgs/development/libraries/db/db-6.0.nix | 7 +++++-- pkgs/development/libraries/db/db-6.2.nix | 7 +++++-- pkgs/development/libraries/db/generic.nix | 11 ++++------- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/pkgs/development/libraries/db/db-4.8.nix b/pkgs/development/libraries/db/db-4.8.nix index 9f2a916317e..81705374381 100644 --- a/pkgs/development/libraries/db/db-4.8.nix +++ b/pkgs/development/libraries/db/db-4.8.nix @@ -3,8 +3,11 @@ import ./generic.nix (args // { version = "4.8.30"; sha256 = "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0"; - extraPatches = [ ./clang-4.8.patch ./CVE-2017-10140-4.8-cwd-db_config.patch ] - ++ lib.optionals stdenv.isDarwin [ ./darwin-mutexes-4.8.patch ]; + extraPatches = [ + ./clang-4.8.patch + ./CVE-2017-10140-4.8-cwd-db_config.patch + ./darwin-mutexes-4.8.patch + ]; drvArgs.hardeningDisable = [ "format" ]; drvArgs.doCheck = false; diff --git a/pkgs/development/libraries/db/db-5.3.nix b/pkgs/development/libraries/db/db-5.3.nix index 3fd08c510c2..2362cc9eecb 100644 --- a/pkgs/development/libraries/db/db-5.3.nix +++ b/pkgs/development/libraries/db/db-5.3.nix @@ -3,6 +3,9 @@ import ./generic.nix (args // { version = "5.3.28"; sha256 = "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"; - extraPatches = [ ./clang-5.3.patch ./CVE-2017-10140-cwd-db_config.patch ] - ++ lib.optionals stdenv.isDarwin [ ./darwin-mutexes.patch ]; + extraPatches = [ + ./clang-5.3.patch + ./CVE-2017-10140-cwd-db_config.patch + ./darwin-mutexes.patch + ]; }) diff --git a/pkgs/development/libraries/db/db-6.0.nix b/pkgs/development/libraries/db/db-6.0.nix index a9b748e3490..94c8d897613 100644 --- a/pkgs/development/libraries/db/db-6.0.nix +++ b/pkgs/development/libraries/db/db-6.0.nix @@ -4,6 +4,9 @@ import ./generic.nix (args // { version = "6.0.20"; sha256 = "00r2aaglq625y8r9xd5vw2y070plp88f1mb2gbq3kqsl7128lsl0"; license = lib.licenses.agpl3; - extraPatches = [ ./clang-6.0.patch ./CVE-2017-10140-cwd-db_config.patch ] - ++ lib.optionals stdenv.isDarwin [ ./darwin-mutexes.patch ]; + extraPatches = [ + ./clang-6.0.patch + ./CVE-2017-10140-cwd-db_config.patch + ./darwin-mutexes.patch + ]; }) diff --git a/pkgs/development/libraries/db/db-6.2.nix b/pkgs/development/libraries/db/db-6.2.nix index 4b3a3c6129a..e526555b06e 100644 --- a/pkgs/development/libraries/db/db-6.2.nix +++ b/pkgs/development/libraries/db/db-6.2.nix @@ -4,6 +4,9 @@ import ./generic.nix (args // { version = "6.2.23"; sha256 = "1isxx4jfmnh913jzhp8hhfngbk6dsg46f4kjpvvc56maj64jqqa7"; license = lib.licenses.agpl3; - extraPatches = [ ./clang-6.0.patch ./CVE-2017-10140-cwd-db_config.patch ] - ++ lib.optionals stdenv.isDarwin [ ./darwin-mutexes.patch ]; + extraPatches = [ + ./clang-6.0.patch + ./CVE-2017-10140-cwd-db_config.patch + ./darwin-mutexes.patch + ]; }) diff --git a/pkgs/development/libraries/db/generic.nix b/pkgs/development/libraries/db/generic.nix index 5bd5ed44b34..d715c1ffc8b 100644 --- a/pkgs/development/libraries/db/generic.nix +++ b/pkgs/development/libraries/db/generic.nix @@ -10,9 +10,6 @@ , drvArgs ? {} }: -let - shouldReconfigure = stdenv.cc.isClang; -in stdenv.mkDerivation (rec { pname = "db"; inherit version; @@ -24,16 +21,16 @@ stdenv.mkDerivation (rec { # The provided configure script features `main` returning implicit `int`, which causes # configure checks to work incorrectly with clang 16. - nativeBuildInputs = lib.optionals stdenv.cc.isClang [ autoreconfHook ]; + nativeBuildInputs = [ autoreconfHook ]; patches = extraPatches; outputs = [ "bin" "out" "dev" ]; # Required when regenerated the configure script to make sure the vendored macros are found. - autoreconfFlags = lib.optionalString shouldReconfigure [ "-fi" "-Iaclocal" "-Iaclocal_java" ]; + autoreconfFlags = [ "-fi" "-Iaclocal" "-Iaclocal_java" ]; - preAutoreconf = lib.optionalString shouldReconfigure '' + preAutoreconf = '' pushd dist # Upstream’s `dist/s_config` cats everything into `aclocal.m4`, but that doesn’t work with # autoreconfHook, so cat `config.m4` to another file. Otherwise, it won’t be found by `aclocal`. @@ -43,7 +40,7 @@ stdenv.mkDerivation (rec { # This isn’t pretty. The version information is kept separate from the configure script. # After the configure script is regenerated, the version information has to be replaced with the # contents of `dist/RELEASE`. - postAutoreconf = lib.optionalString shouldReconfigure '' + postAutoreconf = '' ( declare -a vars=( "DB_VERSION_FAMILY"