diff --git a/pkgs/development/libraries/db4/cygwin.patch b/pkgs/development/libraries/db4/cygwin-4.4.patch similarity index 100% rename from pkgs/development/libraries/db4/cygwin.patch rename to pkgs/development/libraries/db4/cygwin-4.4.patch diff --git a/pkgs/development/libraries/db4/cygwin-4.5.patch b/pkgs/development/libraries/db4/cygwin-4.5.patch new file mode 100644 index 000000000000..410106722a6c --- /dev/null +++ b/pkgs/development/libraries/db4/cygwin-4.5.patch @@ -0,0 +1,22 @@ +diff -rc db-4.5.20-orig/os/os_flock.c db-4.5.20/os/os_flock.c +*** db-4.5.20-orig/os/os_flock.c 2006-10-13 12:36:12.000000000 +0200 +--- db-4.5.20/os/os_flock.c 2006-10-13 12:40:11.000000000 +0200 +*************** +*** 30,35 **** +--- 30,44 ---- + + DB_ASSERT(dbenv, F_ISSET(fhp, DB_FH_OPENED) && fhp->fd != -1); + ++ #ifdef __CYGWIN__ ++ /* ++ * Windows file locking interferes with read/write operations, so we ++ * map the ranges to an area past the end of the file. ++ */ ++ DB_ASSERT(offset < (off_t) 1 << 62); ++ offset += (off_t) 1 << 62; ++ #endif ++ + fl.l_start = offset; + fl.l_len = 1; + fl.l_type = acquire ? F_WRLCK : F_UNLCK; +Only in db-4.5.20/os: os_flock.c~ diff --git a/pkgs/development/libraries/db4/default.nix b/pkgs/development/libraries/db4/db4-4.4.nix similarity index 95% rename from pkgs/development/libraries/db4/default.nix rename to pkgs/development/libraries/db4/db4-4.4.nix index 2b4246ff4615..f17cc0ae24fa 100644 --- a/pkgs/development/libraries/db4/default.nix +++ b/pkgs/development/libraries/db4/db4-4.4.nix @@ -11,4 +11,4 @@ stdenv.mkDerivation ({ (if cxxSupport then "--enable-cxx" else "--disable-cxx") (if cxxSupport then "--enable-compat185" else "--disable-compat185") ]; -} // (if stdenv.system == "i686-cygwin" then {patches = [./cygwin.patch];} else {})) +} // (if stdenv.system == "i686-cygwin" then {patches = [./cygwin-4.4.patch];} else {})) diff --git a/pkgs/development/libraries/db4/db4-4.5.20.nix b/pkgs/development/libraries/db4/db4-4.5.nix similarity index 78% rename from pkgs/development/libraries/db4/db4-4.5.20.nix rename to pkgs/development/libraries/db4/db4-4.5.nix index 5c20b2f451ff..9134c7f483b4 100644 --- a/pkgs/development/libraries/db4/db4-4.5.20.nix +++ b/pkgs/development/libraries/db4/db4-4.5.nix @@ -1,6 +1,6 @@ {stdenv, fetchurl, cxxSupport ? true, compat185 ? true}: -stdenv.mkDerivation ({ +stdenv.mkDerivation { name = "db4-4.5.20"; builder = ./builder.sh; src = fetchurl { @@ -11,4 +11,5 @@ stdenv.mkDerivation ({ (if cxxSupport then "--enable-cxx" else "--disable-cxx") (if cxxSupport then "--enable-compat185" else "--disable-compat185") ]; -} // (if stdenv.system == "i686-cygwin" then {patches = [./cygwin.patch];} else {})) + patches = [./cygwin-4.5.patch]; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 385cfe8758dc..4ccad265e5c9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1076,7 +1076,13 @@ rec { inherit fetchurl stdenv; }; - db4 = (import ../development/libraries/db4) { + db4 = db44; + + db44 = import ../development/libraries/db4/db4-4.4.nix { + inherit fetchurl stdenv; + }; + + db45 = import ../development/libraries/db4/db4-4.5.nix { inherit fetchurl stdenv; }; @@ -2773,7 +2779,8 @@ rec { }; nix = (import ../misc/nix) { - inherit fetchurl stdenv aterm db4 perl curl bzip2; + inherit fetchurl stdenv aterm perl curl bzip2; + db4 = db44; }; nixUnstable = nix;