about summary refs log tree commit diff
path: root/pkgs/development/libraries/gdbm
diff options
context:
space:
mode:
authorDavid McFarland <corngood@gmail.com>2017-06-06 10:15:02 -0300
committerDavid McFarland <corngood@gmail.com>2017-06-26 09:33:32 -0300
commitf4a2351b2b8f89797528fd6d40d502c23d132e44 (patch)
treed28869d1554a3e1c2357959cd8552bbd452a4099 /pkgs/development/libraries/gdbm
parentf81117e324501530ce8ecec6a94846fae78e413e (diff)
downloadnixlib-f4a2351b2b8f89797528fd6d40d502c23d132e44.tar
nixlib-f4a2351b2b8f89797528fd6d40d502c23d132e44.tar.gz
nixlib-f4a2351b2b8f89797528fd6d40d502c23d132e44.tar.bz2
nixlib-f4a2351b2b8f89797528fd6d40d502c23d132e44.tar.lz
nixlib-f4a2351b2b8f89797528fd6d40d502c23d132e44.tar.xz
nixlib-f4a2351b2b8f89797528fd6d40d502c23d132e44.tar.zst
nixlib-f4a2351b2b8f89797528fd6d40d502c23d132e44.zip
gdbm: fix cygwin build
Diffstat (limited to 'pkgs/development/libraries/gdbm')
-rw-r--r--pkgs/development/libraries/gdbm/default.nix17
1 files changed, 15 insertions, 2 deletions
diff --git a/pkgs/development/libraries/gdbm/default.nix b/pkgs/development/libraries/gdbm/default.nix
index de77b4c99b8b..86d9bd649881 100644
--- a/pkgs/development/libraries/gdbm/default.nix
+++ b/pkgs/development/libraries/gdbm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ stdenv, lib, buildPlatform, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "gdbm-1.13";
@@ -10,9 +10,22 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  # Linking static stubs on cygwin requires correct ordering.
+  # Consider upstreaming this.
+
+  # Disable dbmfetch03.at test because it depends on unlink()
+  # failing on a link in a chmod -w directory, which cygwin
+  # apparently allows.
+  postPatch = lib.optionalString buildPlatform.isCygwin ''
+      substituteInPlace tests/Makefile.in --replace \
+        '_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la' \
+        '_LDADD = ../compat/libgdbm_compat.la ../src/libgdbm.la'
+      substituteInPlace tests/testsuite.at --replace \
+        'm4_include([dbmfetch03.at])' ""
+  '';
   configureFlags = [ "--enable-libgdbm-compat" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GNU dbm key/value database library";
 
     longDescription =