From 26832cd4ec0cc488492e062ffd1f84f2ef8d9bc9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 15 Jun 2006 12:51:15 +0000 Subject: [PATCH] * Patch for BDB on Cygwin. svn path=/nixpkgs/trunk/; revision=5454 --- pkgs/development/libraries/cygwin.patch | 21 +++++++++++++++++++++ pkgs/development/libraries/db4/default.nix | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/cygwin.patch diff --git a/pkgs/development/libraries/cygwin.patch b/pkgs/development/libraries/cygwin.patch new file mode 100644 index 000000000000..3f9d658b5dac --- /dev/null +++ b/pkgs/development/libraries/cygwin.patch @@ -0,0 +1,21 @@ +diff -rc db-4.4.20.NC-old/os/os_flock.c db-4.4.20.NC/os/os_flock.c +*** db-4.4.20.NC-old/os/os_flock.c Mon Jun 20 16:59:01 2005 +--- db-4.4.20.NC/os/os_flock.c Wed Jun 7 17:01:49 2006 +*************** +*** 36,41 **** +--- 36,50 ---- + + DB_ASSERT(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 ++ + #ifdef HAVE_FCNTL + fl.l_start = offset; + fl.l_len = 1; diff --git a/pkgs/development/libraries/db4/default.nix b/pkgs/development/libraries/db4/default.nix index e780ccf65971..ee7e974e71df 100644 --- a/pkgs/development/libraries/db4/default.nix +++ b/pkgs/development/libraries/db4/default.nix @@ -1,6 +1,6 @@ {stdenv, fetchurl, cxxSupport ? true, compat185 ? true}: -stdenv.mkDerivation { +stdenv.mkDerivation ({ name = "db4-4.4.20"; builder = ./builder.sh; src = fetchurl { @@ -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 {}))