diff --git a/pkgs/development/compilers/strategoxt/libraries/stratego-libraries-0.17pre.nix b/pkgs/development/compilers/strategoxt/libraries/stratego-libraries-0.17pre.nix new file mode 100644 index 000000000000..5c4fa23bace0 --- /dev/null +++ b/pkgs/development/compilers/strategoxt/libraries/stratego-libraries-0.17pre.nix @@ -0,0 +1,22 @@ +{stdenv, fetchurl, pkgconfig, aterm}: + +stdenv.mkDerivation { + name = "stratego-libraries-0.17"; + src = + fetchurl { + url = http://www.cs.uu.nl/people/martin/stratego-libraries.tar.gz; + md5 = "e99ce18179400c8ef373e8e668a4c576"; + }; + + buildInputs = [pkgconfig aterm]; + + configureFlags = + if stdenv ? isMinGW && stdenv.isMinGW then "--with-std=C99" else ""; + + # avoids loads of warnings about too big description fields because of a broken debug format + CFLAGS = + if stdenv ? isMinGW && stdenv.isMinGW then "-O2" else null; + + # MinGW bootstrap pkg-config does not support the pkg-config setup-hook yet. + PKG_CONFIG_PATH = aterm + "/lib/pkgconfig"; +} diff --git a/pkgs/stdenv/mingw/default.nix b/pkgs/stdenv/mingw/default.nix index 8bfb40e386eb..1813c4feb76c 100644 --- a/pkgs/stdenv/mingw/default.nix +++ b/pkgs/stdenv/mingw/default.nix @@ -59,7 +59,10 @@ let { stdenvFinal = let { body = - stdenv // mkDerivationFun // { inherit fetchurl; }; + stdenv // mkDerivationFun // { + inherit fetchurl; + pkgconfig = pkgconfigBin; + }; shell = msys + /bin/sh + ".exe"; @@ -202,6 +205,12 @@ let { inherit fetchurl; }; + pkgconfigBin = + (import ./pkgs).pkgconfigBin { + stdenv = stdenvInit3; + inherit fetchurl; + }; + /** * Source packages, based on stdenvInit3 */ diff --git a/pkgs/stdenv/mingw/fix-builder.sh b/pkgs/stdenv/mingw/fix-builder.sh index 42c41dc3283b..70ec712f9077 100755 --- a/pkgs/stdenv/mingw/fix-builder.sh +++ b/pkgs/stdenv/mingw/fix-builder.sh @@ -10,6 +10,7 @@ if test -z "$out"; then succeedOnFailure=$SUCCEEDONFAILURE patches=$PATCHES doCheck=$DOCHECK + configureFlags=$CONFIGUREFLAGS fi source $@ diff --git a/pkgs/stdenv/mingw/pkgs/default.nix b/pkgs/stdenv/mingw/pkgs/default.nix index fb4fb10cbc25..d778c5f9a19c 100755 --- a/pkgs/stdenv/mingw/pkgs/default.nix +++ b/pkgs/stdenv/mingw/pkgs/default.nix @@ -114,6 +114,26 @@ rec { }; }; + /** + * We need a binary pkg-config to bootstrap the compilation of + * glib and pkg-config: pkg-config needs glib, glib needs pkg-config. + * + * This tarball contains pkg-config and all its dependencies. Once we + * have bootstrapped pkg-config we really need to use a statically linked + * pkg-config (and provide this .exe at the web: it is really missing + * on the web). + */ + pkgconfigBin = {stdenv, fetchurl} : + stdenv.mkDerivation { + name = "pkg-config-0.20"; + builder = ./bin-builder.sh; + src = + fetchurl { + url = http://www.cs.uu.nl/people/martin/pkg-config-0.20-bin.tar.gz; + md5 = "71f9595a022619b8e8b0f7853790c4c7"; + }; + }; + /* pkgs.coreutils pkgs.findutils diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c8cd39b1ed01..f46f6c783462 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -512,9 +512,14 @@ rec { m4 = gnum4; }; - pkgconfig = (import ../development/tools/misc/pkgconfig) { - inherit fetchurl stdenv; - }; + /** + * pkgconfig is optionally taken from the stdenv to allow bootstrapping + * of glib and pkgconfig itself on MinGW. + */ + pkgconfig = useFromStdenv (stdenv ? pkgconfig) stdenv.pkgconfig + (import ../development/tools/misc/pkgconfig { + inherit fetchurl stdenv; + }); pkgconfig017x = (import ../development/tools/misc/pkgconfig/pkgconfig-0.17.2.nix) { inherit fetchurl stdenv; @@ -856,6 +861,10 @@ rec { stdenv = overrideInStdenv stdenv [gnumake380]; }; + strategoLibraries = (import ../development/compilers/strategoxt/libraries/stratego-libraries-0.17pre.nix) { + inherit stdenv fetchurl pkgconfig aterm; + }; + strategoxtUtils = (import ../development/compilers/strategoxt/utils) { inherit fetchurl pkgconfig stdenv aterm sdf strategoxt; }; diff --git a/pkgs/top-level/mingw.nix b/pkgs/top-level/mingw.nix index 87f85b2d850b..6c744bfd8612 100755 --- a/pkgs/top-level/mingw.nix +++ b/pkgs/top-level/mingw.nix @@ -5,7 +5,23 @@ let { }; body = { - inherit (pkgs) zlib getopt realCurl aterm pkgconfig_latest; - inherit (pkgs.gtkLibs28) glib; + inherit (pkgs) + aterm + getopt + pkgconfig + realCurl + strategoLibraries + zlib; +# inherit profileTest; }; + +# profileTest = +# pkgs.stdenv.mkDerivation { +# name = "profile-test"; +# src = ./char-test.c; +# builder = ./profile-builder.sh; +# strlib = pkgs.strategoLibraries; +# aterm = pkgs.aterm; +# buildInputs = [pkgs.aterm pkgs.strategoLibraries]; +# }; }