diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-08-20 14:43:41 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2018-08-30 17:20:32 -0400 |
commit | 0828e2d8c369604c56219bd7085256b984087280 (patch) | |
tree | 507e0429674ad3a42bf5dcd11413d3c834f95c74 /pkgs/development/haskell-modules/generic-builder.nix | |
parent | 2c2f1e37d4374ea61caefd9389927ea03df4ce31 (diff) |
treewide: Remove usage of remaining redundant platform compatability stuff
Want to get this out of here for 18.09, so it can be deprecated
thereafter.
Diffstat (limited to 'pkgs/development/haskell-modules/generic-builder.nix')
-rw-r--r-- | pkgs/development/haskell-modules/generic-builder.nix | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 0786238040b6..1b33954662db 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -1,10 +1,9 @@ { stdenv, buildPackages, buildHaskellPackages, ghc , jailbreak-cabal, hscolour, cpphs, nodejs -, buildPlatform, hostPlatform }: let - isCross = buildPlatform != hostPlatform; + isCross = stdenv.buildPlatform != stdenv.hostPlatform; inherit (buildPackages) fetchurl removeReferencesTo pkgconfig coreutils gnugrep gnused glibcLocales; @@ -32,8 +31,8 @@ in , enableSharedExecutables ? false , enableSharedLibraries ? (ghc.enableShared or false) , enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin -, enableStaticLibraries ? !hostPlatform.isWindows -, enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4" +, enableStaticLibraries ? !stdenv.hostPlatform.isWindows +, enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4" , extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? [] # On macOS, statically linking against system frameworks is not supported; # see https://developer.apple.com/library/content/qa/qa1118/_index.html @@ -79,7 +78,7 @@ assert editedCabalFile != null -> revision != null; # --enable-static does not work on windows. This is a bug in GHC. # --enable-static will pass -staticlib to ghc, which only works for mach-o and elf. -assert hostPlatform.isWindows -> enableStaticLibraries == false; +assert stdenv.hostPlatform.isWindows -> enableStaticLibraries == false; let @@ -144,7 +143,7 @@ let (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") - (enableFeature (enableDeadCodeElimination && !hostPlatform.isAarch32 && !hostPlatform.isAarch64 && (versionAtLeast "8.0.1" ghc.version)) "split-objs") + (enableFeature (enableDeadCodeElimination && !stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64 && (versionAtLeast "8.0.1" ghc.version)) "split-objs") (enableFeature enableLibraryProfiling "library-profiling") (optionalString ((enableExecutableProfiling || enableLibraryProfiling) && versionOlder "8" ghc.version) "--profiling-detail=${profilingDetail}") (enableFeature enableExecutableProfiling (if versionOlder ghc.version "8" then "executable-profiling" else "profiling")) @@ -163,7 +162,7 @@ let ] ++ optionals isGhcjs [ "--ghcjs" ] ++ optionals isCross ([ - "--configure-option=--host=${hostPlatform.config}" + "--configure-option=--host=${stdenv.hostPlatform.config}" ] ++ crossCabalFlags); setupCompileFlags = [ @@ -285,7 +284,7 @@ stdenv.mkDerivation ({ fi '' # It is not clear why --extra-framework-dirs does work fine on Linux - + optionalString (!buildPlatform.isDarwin || versionAtLeast nativeGhc.version "8.0") '' + + optionalString (!stdenv.buildPlatform.isDarwin || versionAtLeast nativeGhc.version "8.0") '' if [[ -d "$p/Library/Frameworks" ]]; then configureFlags+=" --extra-framework-dirs=$p/Library/Frameworks" fi @@ -486,5 +485,5 @@ stdenv.mkDerivation ({ // optionalAttrs (postFixup != "") { inherit postFixup; } // optionalAttrs (dontStrip) { inherit dontStrip; } // optionalAttrs (hardeningDisable != []) { inherit hardeningDisable; } -// optionalAttrs (buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; } +// optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; } ) |