From 9ec52d632302ad6267a83b563de9927f886e1817 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Thu, 29 May 2014 14:47:07 +0200 Subject: [PATCH 1/2] Fixes to make basic builds on Cygwin work again + additions to support x86_64-cygwin --- lib/platforms.nix | 2 +- pkgs/development/interpreters/perl/5.16/default.nix | 8 +++++++- pkgs/development/libraries/openssl/default.nix | 7 ++++++- pkgs/stdenv/generic/default.nix | 3 ++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/platforms.nix b/lib/platforms.nix index 76df389deacd..c1b79d3aceb4 100644 --- a/lib/platforms.nix +++ b/lib/platforms.nix @@ -7,7 +7,7 @@ rec { freebsd = ["i686-freebsd" "x86_64-freebsd"]; openbsd = ["i686-openbsd" "x86_64-openbsd"]; netbsd = ["i686-netbsd" "x86_64-netbsd"]; - cygwin = ["i686-cygwin"]; + cygwin = ["i686-cygwin" "x86_64-cygwin"]; unix = linux ++ darwin ++ freebsd ++ openbsd; all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd; none = []; diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix index bbd9e003b2c7..b7a27d4f478c 100644 --- a/pkgs/development/interpreters/perl/5.16/default.nix +++ b/pkgs/development/interpreters/perl/5.16/default.nix @@ -54,6 +54,12 @@ stdenv.mkDerivation rec { ${optionalString stdenv.isArm '' configureFlagsArray=(-Dldflags="-lm -lrt") ''} + + ${optionalString stdenv.isCygwin '' + cp cygwin/cygwin{,.bak} + echo "#define PERLIO_NOT_STDIO 0" > tmp + cat tmp cygwin/cygwin.c.bak > cygwin/cygwin.c + ''} ''; preBuild = optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools)) @@ -64,7 +70,7 @@ stdenv.mkDerivation rec { setupHook = ./setup-hook.sh; - doCheck = !stdenv.isDarwin; + doCheck = stdenv.isLinux; # some network-related tests don't work, mostly probably due to our sandboxing testsToSkip = '' diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 7217c876bfd9..130ab6b205fd 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -60,7 +60,12 @@ stdenv.mkDerivation { else "./config"; configureFlags = "shared --libdir=lib --openssldir=etc/ssl" + - stdenv.lib.optionalString withCryptodev " -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"; + stdenv.lib.optionalString withCryptodev " -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS" + + stdenv.lib.optionalString (stdenv.system == "x86_64-cygwin") " no-asm"; + + preBuild = stdenv.lib.optionalString (stdenv.system == "x86_64-cygwin") '' + sed -i -e "s|-march=i486|-march=x86-64|g" Makefile + ''; makeFlags = "MANDIR=$(out)/share/man"; diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 14da127b9e05..ce0fd3a1dc2c 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -127,7 +127,8 @@ let || system == "x86_64-kfreebsd-gnu"; isSunOS = system == "i686-solaris" || system == "x86_64-solaris"; - isCygwin = system == "i686-cygwin"; + isCygwin = system == "i686-cygwin" + || system == "x86_64-cygwin"; isFreeBSD = system == "i686-freebsd" || system == "x86_64-freebsd"; isOpenBSD = system == "i686-openbsd" From 86e18c965f1fd66f72bcadc065e6e5350f11ba0f Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Sat, 31 May 2014 14:25:46 +0200 Subject: [PATCH 2/2] Fix perl compilation --- pkgs/development/interpreters/perl/5.16/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix index b7a27d4f478c..403bd91870de 100644 --- a/pkgs/development/interpreters/perl/5.16/default.nix +++ b/pkgs/development/interpreters/perl/5.16/default.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { ''} ${optionalString stdenv.isCygwin '' - cp cygwin/cygwin{,.bak} + cp cygwin/cygwin.c{,.bak} echo "#define PERLIO_NOT_STDIO 0" > tmp cat tmp cygwin/cygwin.c.bak > cygwin/cygwin.c ''}