diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index aca96f58ed97d..ed8d41be806a6 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -40,7 +40,7 @@ let libc_lib = if libc == null then null else getLib libc; cc_solib = getLib cc; # The wrapper scripts use 'cat' and 'grep', so we may need coreutils. - coreutils_bin = if nativeTools then "" else getBin coreutils; + coreutils_bin = if (nativeTools || targetPlatform.isWindows) then "" else getBin coreutils; default_cxx_stdlib_compile = optionalString (targetPlatform.isLinux && !(cc.isGNU or false) && !nativeTools && cc ? gcc) "-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)"; diff --git a/pkgs/development/compilers/ghc/8.4.3.nix b/pkgs/development/compilers/ghc/8.4.3.nix index 0f5a43d57eda4..fae5dfce1cf3c 100644 --- a/pkgs/development/compilers/ghc/8.4.3.nix +++ b/pkgs/development/compilers/ghc/8.4.3.nix @@ -32,6 +32,8 @@ ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" }: +assert !enableIntegerSimple -> gmp != null; + let inherit (bootPkgs) ghc; @@ -46,8 +48,7 @@ let include mk/flavours/\$(BuildFlavour).mk endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} - '' + stdenv.lib.optionalString enableIntegerSimple '' - INTEGER_LIBRARY = integer-simple + INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} @@ -133,9 +134,11 @@ stdenv.mkDerivation (rec { configureFlags = [ "--datadir=$doc/share/doc/ghc" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [ + ] ++ (if (targetPlatform == hostPlatform && !enableIntegerSimple) then [ "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ + ] else [ + "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" + ]) ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ "--enable-bootstrap-with-devel-snapshot" diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index d1304c7969499..e9d95d5e3f52c 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -112,7 +112,7 @@ let main = defaultMain ''; - hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling); + hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling || hostPlatform.isWindows); # We cannot enable -j parallelism for libraries because GHC is far more # likely to generate a non-determistic library ID in that case. Further @@ -138,12 +138,12 @@ let buildFlagsString = optionalString (buildFlags != []) (" " + concatStringsSep " " buildFlags); defaultConfigureFlags = [ - "--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$pkgid" + "--verbose" "--prefix=$out" "--libdir=\\$prefix/\\$compiler" "--libsubdir=\\$pkgid" (optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}") (optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}") "--with-gcc=$CC" # Clang won't work without that extra information. "--package-db=$packageConfDir" - (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}") + (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/${ghc.name}/${pname}-${version}") (optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names") (optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES") (optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp") @@ -209,8 +209,8 @@ let nativeGhcCommand = "${nativeGhc.targetPrefix}ghc"; buildPkgDb = ghcName: packageConfDir: '' - if [ -d "$p/lib/${ghcName}/package.conf.d" ]; then - cp -f "$p/lib/${ghcName}/package.conf.d/"*.conf ${packageConfDir}/ + if [ -d "$p/${ghcName}/package.conf.d" ]; then + cp -f "$p/${ghcName}/package.conf.d/"*.conf ${packageConfDir}/ continue fi ''; @@ -294,14 +294,14 @@ stdenv.mkDerivation ({ '' # only use the links hack if we're actually building dylibs. otherwise, the # "dynamic-library-dirs" point to nonexistent paths, and the ln command becomes - # "ln -s $out/lib/links", which tries to recreate the links dir and fails + # "ln -s $out/lib-links", which tries to recreate the links dir and fails + (optionalString (stdenv.isDarwin && (enableSharedLibraries || enableSharedExecutables)) '' # Work around a limit in the macOS Sierra linker on the number of paths # referenced by any one dynamic library: # # Create a local directory with symlinks of the *.dylib (macOS shared # libraries) from all the dependencies. - local dynamicLinksDir="$out/lib/links" + local dynamicLinksDir="$out/lib-links" mkdir -p $dynamicLinksDir for d in $(grep dynamic-library-dirs "$packageConfDir/"*|awk '{print $2}'|sort -u); do ln -s "$d/"*.dylib $dynamicLinksDir @@ -379,7 +379,7 @@ stdenv.mkDerivation ({ ${if !hasActiveLibrary then "${setupCommand} install" else '' ${setupCommand} copy - local packageConfDir="$out/lib/${ghc.name}/package.conf.d" + local packageConfDir="$out/${ghc.name}/package.conf.d" local packageConfFile="$packageConfDir/${pname}-${version}.conf" mkdir -p "$packageConfDir" ${setupCommand} register --gen-pkg-config=$packageConfFile @@ -404,7 +404,7 @@ stdenv.mkDerivation ({ ${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"} ${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && stdenv.lib.versionOlder ghc.version "7.10") '' for exe in "$out/bin/"* ; do - install_name_tool -add_rpath "$out/lib/ghc-${ghc.version}/${pname}-${version}" "$exe" + install_name_tool -add_rpath "$out/ghc-${ghc.version}/${pname}-${version}" "$exe" done ''} diff --git a/pkgs/development/haskell-modules/lib.nix b/pkgs/development/haskell-modules/lib.nix index c9dc7254800e8..d5e36981ba352 100644 --- a/pkgs/development/haskell-modules/lib.nix +++ b/pkgs/development/haskell-modules/lib.nix @@ -234,7 +234,7 @@ rec { enableSharedExecutables = false; isLibrary = false; doHaddock = false; - postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc"; + postFixup = "rm -rf $out/ghc* $out/nix-support $out/share/doc"; }); /* Build a source distribution tarball instead of using the source files diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 589c58d0acc02..b13ba656a8a91 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -10,6 +10,7 @@ assert aclSupport -> acl != null; assert selinuxSupport -> libselinux != null && libsepol != null; +assert hostPlatform.libc != "msvcrt"; with lib;