@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl }:
1+{ stdenv, lib, buildPlatform, fetchurl }:
22
33stdenv.mkDerivation rec {
44 name = "gdbm-1.13";
@@ -10,9 +10,22 @@ stdenv.mkDerivation rec {
1010
1111 doCheck = true;
1212
13+ # Linking static stubs on cygwin requires correct ordering.
14+ # Consider upstreaming this.
15+
16+ # Disable dbmfetch03.at test because it depends on unlink()
17+ # failing on a link in a chmod -w directory, which cygwin
18+ # apparently allows.
19+ postPatch = lib.optionalString buildPlatform.isCygwin ''
20+ substituteInPlace tests/Makefile.in --replace \
21+ '_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la' \
22+ '_LDADD = ../compat/libgdbm_compat.la ../src/libgdbm.la'
23+ substituteInPlace tests/testsuite.at --replace \
24+ 'm4_include([dbmfetch03.at])' ""
25+ '';
1326 configureFlags = [ "--enable-libgdbm-compat" ];
1427
15− meta = with stdenv.lib; {
28+ meta = with lib; {
1629 description = "GNU dbm key/value database library";
1730
1831 longDescription =