Skip to content

Commit

Permalink
db: make patches and autoreconfHook unconditional
Browse files Browse the repository at this point in the history
  • Loading branch information
reckenrode committed Jul 7, 2023
1 parent 2b9656e commit a76023f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
7 changes: 5 additions & 2 deletions pkgs/development/libraries/db/db-4.8.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions pkgs/development/libraries/db/db-5.3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
})
7 changes: 5 additions & 2 deletions pkgs/development/libraries/db/db-6.0.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
})
7 changes: 5 additions & 2 deletions pkgs/development/libraries/db/db-6.2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
})
11 changes: 4 additions & 7 deletions pkgs/development/libraries/db/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
, drvArgs ? {}
}:

let
shouldReconfigure = stdenv.cc.isClang;
in
stdenv.mkDerivation (rec {
pname = "db";
inherit version;
Expand All @@ -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`.
Expand All @@ -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"
Expand Down

0 comments on commit a76023f

Please sign in to comment.