Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge remote-tracking branch 'upstream/master' into staging

+787 -293
+5 -1
pkgs/development/compilers/ghc/6.10.2-binary.nix
··· 96 [ $(./main) == "yes" ] 97 ''; 98 99 - passthru = { targetPrefix = ""; }; 100 101 meta = { 102 homepage = http://haskell.org/ghc;
··· 96 [ $(./main) == "yes" ] 97 ''; 98 99 + passthru = { 100 + targetPrefix = ""; 101 + # Our Cabal compiler name 102 + haskellCompilerName = "ghc"; 103 + }; 104 105 meta = { 106 homepage = http://haskell.org/ghc;
+6 -1
pkgs/development/compilers/ghc/6.10.4.nix
··· 25 26 NIX_CFLAGS_COMPILE = "-fomit-frame-pointer"; 27 28 - passthru = { targetPrefix = ""; }; 29 30 meta = { 31 homepage = http://haskell.org/ghc;
··· 25 26 NIX_CFLAGS_COMPILE = "-fomit-frame-pointer"; 27 28 + passthru = { 29 + targetPrefix = ""; 30 + 31 + # Our Cabal compiler name 32 + haskellCompilerName = "ghc"; 33 + }; 34 35 meta = { 36 homepage = http://haskell.org/ghc;
+7 -2
pkgs/development/compilers/ghc/6.12.3.nix
··· 23 ''; 24 25 preConfigure = '' 26 - echo "${buildMK}" > mk/build.mk 27 ''; 28 29 configureFlags = [ ··· 36 # that in turn causes GHCi to abort 37 stripDebugFlags=["-S" "--keep-file-symbols"]; 38 39 - passthru = { targetPrefix = ""; }; 40 41 meta = { 42 homepage = http://haskell.org/ghc;
··· 23 ''; 24 25 preConfigure = '' 26 + echo -n "${buildMK}" > mk/build.mk 27 ''; 28 29 configureFlags = [ ··· 36 # that in turn causes GHCi to abort 37 stripDebugFlags=["-S" "--keep-file-symbols"]; 38 39 + passthru = { 40 + targetPrefix = ""; 41 + 42 + # Our Cabal compiler name 43 + haskellCompilerName = "ghc"; 44 + }; 45 46 meta = { 47 homepage = http://haskell.org/ghc;
+6 -1
pkgs/development/compilers/ghc/7.0.4-binary.nix
··· 134 [ $(./main) == "yes" ] 135 ''; 136 137 - passthru = { targetPrefix = ""; }; 138 139 meta.license = stdenv.lib.licenses.bsd3; 140 meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
··· 134 [ $(./main) == "yes" ] 135 ''; 136 137 + passthru = { 138 + targetPrefix = ""; 139 + 140 + # Our Cabal compiler name 141 + haskellCompilerName = "ghc"; 142 + }; 143 144 meta.license = stdenv.lib.licenses.bsd3; 145 meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
+7 -2
pkgs/development/compilers/ghc/7.0.4.nix
··· 28 ''; 29 30 preConfigure = '' 31 - echo "${buildMK}" > mk/build.mk 32 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 33 '' + stdenv.lib.optionalString stdenv.isDarwin '' 34 find . -name '*.hs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' ··· 45 # that in turn causes GHCi to abort 46 stripDebugFlags=["-S" "--keep-file-symbols"]; 47 48 - passthru = { targetPrefix = ""; }; 49 50 meta = { 51 homepage = http://haskell.org/ghc;
··· 28 ''; 29 30 preConfigure = '' 31 + echo -n "${buildMK}" > mk/build.mk 32 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 33 '' + stdenv.lib.optionalString stdenv.isDarwin '' 34 find . -name '*.hs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' ··· 45 # that in turn causes GHCi to abort 46 stripDebugFlags=["-S" "--keep-file-symbols"]; 47 48 + passthru = { 49 + targetPrefix = ""; 50 + 51 + # Our Cabal compiler name 52 + haskellCompilerName = "ghc"; 53 + }; 54 55 meta = { 56 homepage = http://haskell.org/ghc;
+100 -15
pkgs/development/compilers/ghc/7.10.3.nix
··· 2 , buildPlatform, hostPlatform, targetPlatform 3 4 # build-tools 5 - , bootPkgs, hscolour, llvm_35 6 , coreutils, fetchurl, fetchpatch, perl 7 , docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt 8 9 - , libiconv ? null, ncurses 10 11 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 12 # library instead of the faster but GPLed integer-gmp library. 13 enableIntegerSimple ? false, gmp ? null 14 }: 15 16 assert !enableIntegerSimple -> gmp != null; ··· 28 sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0"; 29 }; 30 31 in 32 33 stdenv.mkDerivation rec { ··· 39 sha256 = "1vsgmic8csczl62ciz51iv8nhrkm72lyhbz7p7id13y2w7fcx46g"; 40 }; 41 42 patches = [ 43 docFixes 44 ./relocation.patch 45 ]; 46 47 - buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ] ++ stdenv.lib.optionals targetPlatform.isArm [ llvm_35 ]; 48 - 49 - enableParallelBuilding = true; 50 - 51 - outputs = [ "out" "doc" ]; 52 - 53 preConfigure = '' 54 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 55 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 56 - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 57 '' + stdenv.lib.optionalString stdenv.isDarwin '' 58 export NIX_LDFLAGS+=" -no_dtrace_dof" 59 - '' + stdenv.lib.optionalString enableIntegerSimple '' 60 - echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk 61 ''; 62 63 configureFlags = [ 64 - "--with-gcc=${stdenv.cc}/bin/cc" 65 - "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 66 "--datadir=$doc/share/doc/ghc" 67 - ] ++ stdenv.lib.optional (! enableIntegerSimple) [ 68 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" 69 - ] ++ stdenv.lib.optional stdenv.isDarwin [ 70 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 71 ]; 72 73 # required, because otherwise all symbols from HSffi.o are stripped, and 74 # that in turn causes GHCi to abort 75 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; ··· 88 89 passthru = { 90 inherit bootPkgs targetPrefix; 91 }; 92 93 meta = { ··· 96 maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ]; 97 inherit (ghc.meta) license platforms; 98 }; 99 }
··· 2 , buildPlatform, hostPlatform, targetPlatform 3 4 # build-tools 5 + , bootPkgs, hscolour 6 , coreutils, fetchurl, fetchpatch, perl 7 , docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt 8 9 + , libffi, libiconv ? null, ncurses 10 + 11 + , useLLVM ? !targetPlatform.isx86 12 + , # LLVM is conceptually a run-time-only depedendency, but for 13 + # non-x86, we need LLVM to bootstrap later stages, so it becomes a 14 + # build-time dependency too. 15 + buildLlvmPackages, llvmPackages 16 17 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 18 # library instead of the faster but GPLed integer-gmp library. 19 enableIntegerSimple ? false, gmp ? null 20 + 21 + , # If enabled, use -fPIC when compiling static libs. 22 + enableRelocatedStaticLibs ? targetPlatform != hostPlatform 23 + 24 + , # Whether to build dynamic libs for the standard library (on the target 25 + # platform). Static libs are always built. 26 + enableShared ? true 27 }: 28 29 assert !enableIntegerSimple -> gmp != null; ··· 41 sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0"; 42 }; 43 44 + buildMK = '' 45 + DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 46 + '' + stdenv.lib.optionalString enableIntegerSimple '' 47 + INTEGER_LIBRARY = integer-simple 48 + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 49 + BuildFlavour = perf-cross 50 + Stage1Only = YES 51 + HADDOCK_DOCS = NO 52 + '' + stdenv.lib.optionalString enableRelocatedStaticLibs '' 53 + GhcLibHcOpts += -fPIC 54 + GhcRtsHcOpts += -fPIC 55 + ''; 56 + 57 + # Splicer will pull out correct variations 58 + libDeps = platform: [ ncurses ] 59 + ++ stdenv.lib.optional (!enableIntegerSimple) gmp 60 + ++ stdenv.lib.optional (platform.libc != "glibc") libiconv; 61 + 62 + toolsForTarget = 63 + if hostPlatform == buildPlatform then 64 + [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm 65 + else assert targetPlatform == hostPlatform; # build != host == target 66 + [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; 67 + 68 + targetCC = builtins.head toolsForTarget; 69 + 70 in 71 72 stdenv.mkDerivation rec { ··· 78 sha256 = "1vsgmic8csczl62ciz51iv8nhrkm72lyhbz7p7id13y2w7fcx46g"; 79 }; 80 81 + enableParallelBuilding = true; 82 + 83 + outputs = [ "out" "doc" ]; 84 + 85 patches = [ 86 docFixes 87 ./relocation.patch 88 ]; 89 90 + # GHC is a bit confused on its cross terminology. 91 preConfigure = '' 92 + for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do 93 + export "''${env#TARGET_}=''${!env}" 94 + done 95 + # GHC is a bit confused on its cross terminology, as these would normally be 96 + # the *host* tools. 97 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 98 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 99 + export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld" 100 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 101 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 102 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 103 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 104 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 105 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 106 + echo -n "${buildMK}" > mk/build.mk 107 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 108 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 109 + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" 110 '' + stdenv.lib.optionalString stdenv.isDarwin '' 111 export NIX_LDFLAGS+=" -no_dtrace_dof" 112 ''; 113 114 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 115 + configurePlatforms = [ "build" "host" ] 116 + ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 117 + # `--with` flags for libraries needed for RTS linker 118 configureFlags = [ 119 "--datadir=$doc/share/doc/ghc" 120 + "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 121 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [ 122 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" 123 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [ 124 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 125 + ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ 126 + "--enable-bootstrap-with-devel-snapshot" 127 + ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [ 128 + # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 129 + "--disable-large-address-space" 130 ]; 131 132 + # Hack to make sure we never to the relaxation `$PATH` and hooks support for 133 + # compatability. This will be replaced with something clearer in a future 134 + # masss-rebuild. 135 + crossConfig = true; 136 + 137 + nativeBuildInputs = [ 138 + ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour 139 + ]; 140 + 141 + # For building runtime libs 142 + depsBuildTarget = toolsForTarget; 143 + 144 + buildInputs = libDeps hostPlatform; 145 + 146 + propagatedBuildInputs = [ targetPackages.stdenv.cc ] 147 + ++ stdenv.lib.optional useLLVM llvmPackages.llvm; 148 + 149 + depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); 150 + depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); 151 + 152 # required, because otherwise all symbols from HSffi.o are stripped, and 153 # that in turn causes GHCi to abort 154 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; ··· 167 168 passthru = { 169 inherit bootPkgs targetPrefix; 170 + 171 + inherit llvmPackages; 172 + 173 + # Our Cabal compiler name 174 + haskellCompilerName = "ghc"; 175 }; 176 177 meta = { ··· 180 maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ]; 181 inherit (ghc.meta) license platforms; 182 }; 183 + 184 }
+8 -3
pkgs/development/compilers/ghc/7.2.2.nix
··· 31 libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" 32 ''} 33 '' + (if enableIntegerSimple then '' 34 - INTEGER_LIBRARY=integer-simple 35 '' else '' 36 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" 37 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" 38 ''); 39 40 preConfigure = '' 41 - echo "${buildMK}" > mk/build.mk 42 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 43 '' + stdenv.lib.optionalString stdenv.isDarwin '' 44 find . -name '*.hs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' ··· 55 # that in turn causes GHCi to abort 56 stripDebugFlags=["-S" "--keep-file-symbols"]; 57 58 - passthru = { targetPrefix = ""; }; 59 60 meta = { 61 homepage = http://haskell.org/ghc;
··· 31 libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" 32 ''} 33 '' + (if enableIntegerSimple then '' 34 + INTEGER_LIBRARY = integer-simple 35 '' else '' 36 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" 37 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" 38 ''); 39 40 preConfigure = '' 41 + echo -n "${buildMK}" > mk/build.mk 42 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 43 '' + stdenv.lib.optionalString stdenv.isDarwin '' 44 find . -name '*.hs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' ··· 55 # that in turn causes GHCi to abort 56 stripDebugFlags=["-S" "--keep-file-symbols"]; 57 58 + passthru = { 59 + targetPprefix = ""; 60 + 61 + # Our Cabal compiler name 62 + haskellCompilerName = "ghc"; 63 + }; 64 65 meta = { 66 homepage = http://haskell.org/ghc;
+6 -1
pkgs/development/compilers/ghc/7.4.2-binary.nix
··· 136 [ $(./main) == "yes" ] 137 ''; 138 139 - passthru = { targetPrefix = ""; }; 140 141 meta.license = stdenv.lib.licenses.bsd3; 142 meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
··· 136 [ $(./main) == "yes" ] 137 ''; 138 139 + passthru = { 140 + targetPrefix = ""; 141 + 142 + # Our Cabal compiler name 143 + haskellCompilerName = "ghc"; 144 + }; 145 146 meta.license = stdenv.lib.licenses.bsd3; 147 meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
+9 -4
pkgs/development/compilers/ghc/7.4.2.nix
··· 32 libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" 33 ''} 34 '' + (if enableIntegerSimple then '' 35 - INTEGER_LIBRARY=integer-simple 36 '' else '' 37 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" 38 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" 39 ''); 40 41 preConfigure = '' 42 - echo "${buildMK}" > mk/build.mk 43 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 44 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 45 - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 46 '' + stdenv.lib.optionalString stdenv.isDarwin '' 47 find . -name '*.hs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' 48 find . -name '*.lhs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' ··· 56 # that in turn causes GHCi to abort 57 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols"; 58 59 - passthru = { targetPrefix = ""; }; 60 61 meta = { 62 homepage = http://haskell.org/ghc;
··· 32 libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" 33 ''} 34 '' + (if enableIntegerSimple then '' 35 + INTEGER_LIBRARY = integer-simple 36 '' else '' 37 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" 38 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" 39 ''); 40 41 preConfigure = '' 42 + echo -n "${buildMK}" > mk/build.mk 43 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 44 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 45 + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" 46 '' + stdenv.lib.optionalString stdenv.isDarwin '' 47 find . -name '*.hs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' 48 find . -name '*.lhs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' ··· 56 # that in turn causes GHCi to abort 57 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols"; 58 59 + passthru = { 60 + targetPrefix = ""; 61 + 62 + # Our Cabal compiler name 63 + haskellCompilerName = "ghc"; 64 + }; 65 66 meta = { 67 homepage = http://haskell.org/ghc;
+9 -4
pkgs/development/compilers/ghc/7.6.3.nix
··· 43 SRC_HC_OPTS += ${ghcFlags} 44 SRC_CC_OPTS += ${cFlags} 45 '' + (if enableIntegerSimple then '' 46 - INTEGER_LIBRARY=integer-simple 47 '' else '' 48 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" 49 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" 50 ''); 51 52 preConfigure = '' 53 - echo "${buildMK}" > mk/build.mk 54 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 55 56 '' + stdenv.lib.optionalString stdenv.isLinux '' ··· 58 sed -i -e 's|"\$topdir"|"\$topdir" ${ghcFlags}|' ghc/ghc.wrapper 59 60 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 61 - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 62 '' + stdenv.lib.optionalString stdenv.isDarwin '' 63 find . -name '*.hs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' 64 find . -name '*.lhs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' ··· 82 # that in turn causes GHCi to abort 83 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols"; 84 85 - passthru = { targetPrefix = ""; }; 86 87 meta = { 88 homepage = http://haskell.org/ghc;
··· 43 SRC_HC_OPTS += ${ghcFlags} 44 SRC_CC_OPTS += ${cFlags} 45 '' + (if enableIntegerSimple then '' 46 + INTEGER_LIBRARY = integer-simple 47 '' else '' 48 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" 49 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" 50 ''); 51 52 preConfigure = '' 53 + echo -n "${buildMK}" > mk/build.mk 54 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 55 56 '' + stdenv.lib.optionalString stdenv.isLinux '' ··· 58 sed -i -e 's|"\$topdir"|"\$topdir" ${ghcFlags}|' ghc/ghc.wrapper 59 60 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 61 + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" 62 '' + stdenv.lib.optionalString stdenv.isDarwin '' 63 find . -name '*.hs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' 64 find . -name '*.lhs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' ··· 82 # that in turn causes GHCi to abort 83 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols"; 84 85 + passthru = { 86 + targetPrefix = ""; 87 + 88 + # Our Cabal compiler name 89 + haskellCompilerName = "ghc"; 90 + }; 91 92 meta = { 93 homepage = http://haskell.org/ghc;
+49 -26
pkgs/development/compilers/ghc/7.8.4.nix
··· 1 - { stdenv, fetchurl, ghc, perl, ncurses, libiconv 2 3 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 4 # library instead of the faster but GPLed integer-gmp library. ··· 9 assert stdenv.targetPlatform == stdenv.hostPlatform; 10 assert !enableIntegerSimple -> gmp != null; 11 12 - stdenv.mkDerivation (rec { 13 - version = "7.8.4"; 14 - name = "ghc-${version}"; 15 - 16 - src = fetchurl { 17 - url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz"; 18 - sha256 = "1i4254akbb4ym437rf469gc0m40bxm31blp6s1z1g15jmnacs6f3"; 19 - }; 20 - 21 - patches = [ ./relocation.patch ]; 22 - 23 - buildInputs = [ ghc perl ncurses ] 24 - ++ stdenv.lib.optional (!enableIntegerSimple) gmp; 25 - 26 - enableParallelBuilding = true; 27 - 28 buildMK = '' 29 libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include" 30 libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib" 31 DYNAMIC_BY_DEFAULT = NO 32 - ${stdenv.lib.optionalString stdenv.isDarwin '' 33 libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include" 34 libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" 35 ''} 36 '' + (if enableIntegerSimple then '' 37 - INTEGER_LIBRARY=integer-simple 38 '' else '' 39 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" 40 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" 41 ''); 42 43 preConfigure = '' 44 - echo "${buildMK}" > mk/build.mk 45 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 46 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 47 - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 48 '' + stdenv.lib.optionalString stdenv.isDarwin '' 49 export NIX_LDFLAGS+=" -no_dtrace_dof" 50 ''; 51 52 # required, because otherwise all symbols from HSffi.o are stripped, and 53 # that in turn causes GHCi to abort 54 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols"; 55 56 - passthru = { targetPrefix = ""; }; 57 58 meta = { 59 homepage = http://haskell.org/ghc; ··· 62 inherit (ghc.meta) license platforms; 63 }; 64 65 - } // stdenv.lib.optionalAttrs stdenv.isDarwin { 66 - # https://ghc.haskell.org/trac/ghc/ticket/9762 67 - patches = [ ./hpc-7.8.4.patch ]; 68 - })
··· 1 + { stdenv, targetPackages 2 + 3 + , fetchurl, ghc, perl 4 + , libffi, libiconv ? null, ncurses 5 6 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 7 # library instead of the faster but GPLed integer-gmp library. ··· 12 assert stdenv.targetPlatform == stdenv.hostPlatform; 13 assert !enableIntegerSimple -> gmp != null; 14 15 + let 16 buildMK = '' 17 libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include" 18 libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib" 19 DYNAMIC_BY_DEFAULT = NO 20 + ${stdenv.lib.optionalString (stdenv.hostPlatform.libc != "glibc") '' 21 libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include" 22 libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" 23 ''} 24 '' + (if enableIntegerSimple then '' 25 + INTEGER_LIBRARY = integer-simple 26 '' else '' 27 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" 28 libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" 29 ''); 30 31 + # Splicer will pull out correct variations 32 + libDeps = [ ncurses ] 33 + ++ stdenv.lib.optional (!enableIntegerSimple) gmp 34 + ++ stdenv.lib.optional (stdenv.hostPlatform.libc != "glibc") libiconv; 35 + 36 + in 37 + 38 + stdenv.mkDerivation rec { 39 + version = "7.8.4"; 40 + name = "ghc-${version}"; 41 + 42 + src = fetchurl { 43 + url = "http://www.haskell.org/ghc/dist/${version}/${name}-src.tar.xz"; 44 + sha256 = "1i4254akbb4ym437rf469gc0m40bxm31blp6s1z1g15jmnacs6f3"; 45 + }; 46 + 47 + enableParallelBuilding = true; 48 + 49 + patches = [ ./relocation.patch ] 50 + ++ stdenv.lib.optional stdenv.isDarwin ./hpc-7.8.4.patch; 51 + 52 preConfigure = '' 53 + echo -n "${buildMK}" > mk/build.mk 54 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 55 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 56 + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" 57 '' + stdenv.lib.optionalString stdenv.isDarwin '' 58 export NIX_LDFLAGS+=" -no_dtrace_dof" 59 ''; 60 61 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 62 + configurePlatforms = [ "build" "host" ]; 63 + 64 + nativeBuildInputs = [ ghc perl ]; 65 + depsBuildTarget = [ targetPackages.stdenv.cc ]; 66 + 67 + buildInputs = libDeps; 68 + propagatedBuildInputs = [ targetPackages.stdenv.cc ]; 69 + 70 + depsTargetTarget = map stdenv.lib.getDev libDeps; 71 + depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") libDeps; 72 + 73 # required, because otherwise all symbols from HSffi.o are stripped, and 74 # that in turn causes GHCi to abort 75 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols"; 76 77 + passthru = { 78 + targetPrefix = ""; 79 + 80 + # Our Cabal compiler name 81 + haskellCompilerName = "ghc"; 82 + }; 83 84 meta = { 85 homepage = http://haskell.org/ghc; ··· 88 inherit (ghc.meta) license platforms; 89 }; 90 91 + }
+105 -16
pkgs/development/compilers/ghc/8.0.2.nix
··· 2 , buildPlatform, hostPlatform, targetPlatform 3 4 # build-tools 5 - , bootPkgs, hscolour, llvm_37 6 - , coreutils, fetchurl, fetchpatch, patchutils, perl, sphinx 7 8 - , libiconv ? null, ncurses 9 10 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 11 # library instead of the faster but GPLed integer-gmp library. 12 enableIntegerSimple ? false, gmp ? null 13 }: 14 15 assert !enableIntegerSimple -> gmp != null; ··· 21 targetPrefix = stdenv.lib.optionalString 22 (targetPlatform != hostPlatform) 23 "${targetPlatform.config}-"; 24 in 25 stdenv.mkDerivation rec { 26 version = "8.0.2"; ··· 31 sha256 = "1c8qc4fhkycynk4g1f9hvk53dj6a1vvqi6bklqznns6hw59m8qhi"; 32 }; 33 34 - patches = [ ./ghc-gold-linker.patch ] 35 - ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch 36 - ++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch; 37 - 38 - buildInputs = [ ghc perl hscolour sphinx ] ++ stdenv.lib.optionals (stdenv.isArm || stdenv.isAarch64) [ llvm_37 ]; 39 - 40 enableParallelBuilding = true; 41 42 outputs = [ "out" "man" "doc" ]; 43 44 preConfigure = '' 45 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 46 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 47 - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 48 '' + stdenv.lib.optionalString stdenv.isDarwin '' 49 export NIX_LDFLAGS+=" -no_dtrace_dof" 50 - '' + stdenv.lib.optionalString enableIntegerSimple '' 51 - echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk 52 ''; 53 54 configureFlags = [ 55 - "--with-gcc=${stdenv.cc}/bin/cc" 56 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 57 - "--datadir=$doc/share/doc/ghc" 58 - ] ++ stdenv.lib.optional (! enableIntegerSimple) [ 59 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" 60 - ] ++ stdenv.lib.optional stdenv.isDarwin [ 61 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 62 ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [ 63 # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 64 "--disable-large-address-space" 65 ]; 66 67 # required, because otherwise all symbols from HSffi.o are stripped, and 68 # that in turn causes GHCi to abort 69 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; 70 71 postInstall = '' 72 paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"} 73 ··· 84 85 passthru = { 86 inherit bootPkgs targetPrefix; 87 }; 88 89 meta = {
··· 2 , buildPlatform, hostPlatform, targetPlatform 3 4 # build-tools 5 + , bootPkgs, hscolour 6 + , coreutils, fetchpatch, fetchurl, perl, sphinx 7 8 + , libffi, libiconv ? null, ncurses 9 + 10 + , useLLVM ? !targetPlatform.isx86 11 + , # LLVM is conceptually a run-time-only depedendency, but for 12 + # non-x86, we need LLVM to bootstrap later stages, so it becomes a 13 + # build-time dependency too. 14 + buildLlvmPackages, llvmPackages 15 16 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 17 # library instead of the faster but GPLed integer-gmp library. 18 enableIntegerSimple ? false, gmp ? null 19 + 20 + , # If enabled, use -fPIC when compiling static libs. 21 + enableRelocatedStaticLibs ? targetPlatform != hostPlatform 22 + 23 + , # Whether to build dynamic libs for the standard library (on the target 24 + # platform). Static libs are always built. 25 + enableShared ? true 26 }: 27 28 assert !enableIntegerSimple -> gmp != null; ··· 34 targetPrefix = stdenv.lib.optionalString 35 (targetPlatform != hostPlatform) 36 "${targetPlatform.config}-"; 37 + 38 + buildMK = '' 39 + DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 40 + '' + stdenv.lib.optionalString enableIntegerSimple '' 41 + INTEGER_LIBRARY = integer-simple 42 + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 43 + BuildFlavour = perf-cross 44 + Stage1Only = YES 45 + HADDOCK_DOCS = NO 46 + '' + stdenv.lib.optionalString enableRelocatedStaticLibs '' 47 + GhcLibHcOpts += -fPIC 48 + GhcRtsHcOpts += -fPIC 49 + ''; 50 + 51 + # Splicer will pull out correct variations 52 + libDeps = platform: [ ncurses ] 53 + ++ stdenv.lib.optional (!enableIntegerSimple) gmp 54 + ++ stdenv.lib.optional (platform.libc != "glibc") libiconv; 55 + 56 + toolsForTarget = 57 + if hostPlatform == buildPlatform then 58 + [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm 59 + else assert targetPlatform == hostPlatform; # build != host == target 60 + [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; 61 + 62 + targetCC = builtins.head toolsForTarget; 63 + 64 in 65 stdenv.mkDerivation rec { 66 version = "8.0.2"; ··· 71 sha256 = "1c8qc4fhkycynk4g1f9hvk53dj6a1vvqi6bklqznns6hw59m8qhi"; 72 }; 73 74 enableParallelBuilding = true; 75 76 outputs = [ "out" "man" "doc" ]; 77 78 + patches = [ 79 + ./ghc-gold-linker.patch 80 + (fetchpatch { # Unreleased 1.24.x commit 81 + url = "https://github.com/haskell/cabal/commit/6394cb0b6eba91a8692a3d04b2b56935aed7cccd.patch"; 82 + sha256 = "14xxjg0nb1j1pw0riac3v385ka92qhxxblfmwyvbghz7kry6axy0"; 83 + stripLen = 1; 84 + extraPrefix = "libraries/Cabal/"; 85 + }) 86 + ] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch 87 + ++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch; 88 + 89 + # GHC is a bit confused on its cross terminology. 90 preConfigure = '' 91 + for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do 92 + export "''${env#TARGET_}=''${!env}" 93 + done 94 + # GHC is a bit confused on its cross terminology, as these would normally be 95 + # the *host* tools. 96 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 97 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 98 + export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld" 99 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 100 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 101 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 102 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 103 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 104 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 105 + echo -n "${buildMK}" > mk/build.mk 106 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 107 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 108 + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" 109 '' + stdenv.lib.optionalString stdenv.isDarwin '' 110 export NIX_LDFLAGS+=" -no_dtrace_dof" 111 ''; 112 113 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 114 + configurePlatforms = [ "build" "host" ] 115 + ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 116 + # `--with` flags for libraries needed for RTS linker 117 configureFlags = [ 118 + "--datadir=$doc/share/doc/ghc" 119 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 120 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [ 121 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" 122 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [ 123 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 124 + ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ 125 + "--enable-bootstrap-with-devel-snapshot" 126 ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [ 127 # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 128 "--disable-large-address-space" 129 ]; 130 131 + # Hack to make sure we never to the relaxation `$PATH` and hooks support for 132 + # compatability. This will be replaced with something clearer in a future 133 + # masss-rebuild. 134 + crossConfig = true; 135 + 136 + nativeBuildInputs = [ ghc perl hscolour sphinx ]; 137 + 138 + # For building runtime libs 139 + depsBuildTarget = toolsForTarget; 140 + 141 + buildInputs = libDeps hostPlatform; 142 + 143 + propagatedBuildInputs = [ targetPackages.stdenv.cc ] 144 + ++ stdenv.lib.optional useLLVM llvmPackages.llvm; 145 + 146 + depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); 147 + depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); 148 + 149 # required, because otherwise all symbols from HSffi.o are stripped, and 150 # that in turn causes GHCi to abort 151 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; 152 153 + # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't 154 + # treat that as a unary `{x,y,z,..}` repetition. 155 postInstall = '' 156 paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"} 157 ··· 168 169 passthru = { 170 inherit bootPkgs targetPrefix; 171 + 172 + inherit llvmPackages; 173 + 174 + # Our Cabal compiler name 175 + haskellCompilerName = "ghc"; 176 }; 177 178 meta = {
+121 -48
pkgs/development/compilers/ghc/8.2.2.nix
··· 1 { stdenv, targetPackages 2 , buildPlatform, hostPlatform, targetPlatform 3 - , selfPkgs, cross ? null 4 5 # build-tools 6 - , bootPkgs, alex, happy, hscolour, llvm_39 7 - , autoconf, automake, coreutils, fetchurl, perl, python3, sphinx 8 9 - , libiconv ? null, ncurses 10 11 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 12 # library instead of the faster but GPLed integer-gmp library. 13 enableIntegerSimple ? false, gmp ? null 14 }: 15 16 assert !enableIntegerSimple -> gmp != null; ··· 22 targetPrefix = stdenv.lib.optionalString 23 (targetPlatform != hostPlatform) 24 "${targetPlatform.config}-"; 25 in 26 - stdenv.mkDerivation (rec { 27 version = "8.2.2"; 28 name = "${targetPrefix}ghc-${version}"; 29 ··· 32 sha256 = "1z05vkpaj54xdypmaml50hgsdpw29dhbs2r7magx0cm199iw73mv"; 33 }; 34 35 postPatch = "patchShebangs ."; 36 37 preConfigure = '' 38 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 39 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 40 - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 41 '' + stdenv.lib.optionalString stdenv.isDarwin '' 42 export NIX_LDFLAGS+=" -no_dtrace_dof" 43 - '' + stdenv.lib.optionalString enableIntegerSimple '' 44 - echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk 45 - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 46 - sed 's|#BuildFlavour = quick-cross|BuildFlavour = perf-cross|' mk/build.mk.sample > mk/build.mk 47 ''; 48 49 - buildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ] ++ stdenv.lib.optionals (targetPlatform.isArm || targetPlatform.isAarch64) [ llvm_39 ]; 50 - 51 - enableParallelBuilding = true; 52 - 53 configureFlags = [ 54 - "CC=${stdenv.cc}/bin/cc" 55 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 56 - "--datadir=$doc/share/doc/ghc" 57 - ] ++ stdenv.lib.optional (! enableIntegerSimple) [ 58 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" 59 - ] ++ stdenv.lib.optional stdenv.isDarwin [ 60 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 61 - ] ++ stdenv.lib.optional stdenv.isArm [ 62 - "LD=${stdenv.cc}/bin/ld.gold" 63 ]; 64 65 # required, because otherwise all symbols from HSffi.o are stripped, and 66 # that in turn causes GHCi to abort 67 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; 68 69 checkTarget = "test"; 70 71 postInstall = '' 72 paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"} 73 ··· 82 done 83 ''; 84 85 - outputs = [ "out" "doc" ]; 86 - 87 passthru = { 88 inherit bootPkgs targetPrefix; 89 - } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) { 90 - crossCompiler = selfPkgs.ghc.override { 91 - cross = targetPlatform; 92 - bootPkgs = selfPkgs; 93 - }; 94 }; 95 96 meta = { ··· 100 inherit (ghc.meta) license platforms; 101 }; 102 103 - } // stdenv.lib.optionalAttrs (cross != null) { 104 - configureFlags = [ 105 - "CC=${stdenv.cc}/bin/${cross.config}-cc" 106 - "LD=${stdenv.cc.bintools}/bin/${cross.config}-ld" 107 - "AR=${stdenv.cc.bintools}/bin/${cross.config}-ar" 108 - "NM=${stdenv.cc.bintools}/bin/${cross.config}-nm" 109 - "RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib" 110 - "--target=${cross.config}" 111 - "--enable-bootstrap-with-devel-snapshot" 112 - ] ++ 113 - # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 114 - stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space"; 115 - 116 - configurePlatforms = []; 117 - 118 - passthru = { 119 - inherit bootPkgs cross; 120 - cc = "${stdenv.cc}/bin/${cross.config}-cc"; 121 - ld = "${stdenv.cc}/bin/${cross.config}-ld"; 122 - }; 123 - })
··· 1 { stdenv, targetPackages 2 , buildPlatform, hostPlatform, targetPlatform 3 4 # build-tools 5 + , bootPkgs, alex, happy, hscolour 6 + , autoconf, autoreconfHook, automake, coreutils, fetchurl, fetchpatch, perl, python3, sphinx 7 8 + , libffi, libiconv ? null, ncurses 9 + 10 + , useLLVM ? !targetPlatform.isx86 11 + , # LLVM is conceptually a run-time-only depedendency, but for 12 + # non-x86, we need LLVM to bootstrap later stages, so it becomes a 13 + # build-time dependency too. 14 + buildLlvmPackages, llvmPackages 15 16 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 17 # library instead of the faster but GPLed integer-gmp library. 18 enableIntegerSimple ? false, gmp ? null 19 + 20 + , # If enabled, use -fPIC when compiling static libs. 21 + enableRelocatedStaticLibs ? targetPlatform != hostPlatform 22 + 23 + , # Whether to build dynamic libs for the standard library (on the target 24 + # platform). Static libs are always built. 25 + enableShared ? 26 + !(targetPlatform.isDarwin 27 + # On iOS, dynamic linking is not supported 28 + && (targetPlatform.isAarch64 || targetPlatform.isArm)) 29 }: 30 31 assert !enableIntegerSimple -> gmp != null; ··· 37 targetPrefix = stdenv.lib.optionalString 38 (targetPlatform != hostPlatform) 39 "${targetPlatform.config}-"; 40 + 41 + buildMK = '' 42 + DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 43 + '' + stdenv.lib.optionalString enableIntegerSimple '' 44 + INTEGER_LIBRARY = integer-simple 45 + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 46 + BuildFlavour = perf-cross 47 + Stage1Only = YES 48 + HADDOCK_DOCS = NO 49 + BUILD_SPHINX_HTML = NO 50 + BUILD_SPHINX_PDF = NO 51 + '' + stdenv.lib.optionalString enableRelocatedStaticLibs '' 52 + GhcLibHcOpts += -fPIC 53 + GhcRtsHcOpts += -fPIC 54 + ''; 55 + 56 + # Splicer will pull out correct variations 57 + libDeps = platform: [ ncurses ] 58 + ++ stdenv.lib.optional (!enableIntegerSimple) gmp 59 + ++ stdenv.lib.optional (platform.libc != "glibc") libiconv; 60 + 61 + toolsForTarget = 62 + if hostPlatform == buildPlatform then 63 + [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm 64 + else assert targetPlatform == hostPlatform; # build != host == target 65 + [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; 66 + 67 + targetCC = builtins.head toolsForTarget; 68 + 69 in 70 + stdenv.mkDerivation rec { 71 version = "8.2.2"; 72 name = "${targetPrefix}ghc-${version}"; 73 ··· 76 sha256 = "1z05vkpaj54xdypmaml50hgsdpw29dhbs2r7magx0cm199iw73mv"; 77 }; 78 79 + enableParallelBuilding = true; 80 + 81 + outputs = [ "out" "doc" ]; 82 + 83 + patches = [ 84 + (fetchpatch { # Fix STRIP to be substituted from configure 85 + url = "https://git.haskell.org/ghc.git/commitdiff_plain/2fc8ce5f0c8c81771c26266ac0b150ca9b75c5f3"; 86 + sha256 = "03253ci40np1v6k0wmi4aypj3nmj3rdyvb1k6rwqipb30nfc719f"; 87 + }) 88 + ]; 89 + 90 postPatch = "patchShebangs ."; 91 92 + # GHC is a bit confused on its cross terminology. 93 preConfigure = '' 94 + for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do 95 + export "''${env#TARGET_}=''${!env}" 96 + done 97 + # GHC is a bit confused on its cross terminology, as these would normally be 98 + # the *host* tools. 99 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 100 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 101 + # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 102 + export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isArm ".gold"}" 103 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 104 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 105 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 106 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 107 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 108 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 109 + 110 + echo -n "${buildMK}" > mk/build.mk 111 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 112 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 113 + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" 114 '' + stdenv.lib.optionalString stdenv.isDarwin '' 115 export NIX_LDFLAGS+=" -no_dtrace_dof" 116 ''; 117 118 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 119 + configurePlatforms = [ "build" "host" ] 120 + ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 121 + # `--with` flags for libraries needed for RTS linker 122 configureFlags = [ 123 + "--datadir=$doc/share/doc/ghc" 124 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 125 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [ 126 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" 127 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [ 128 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 129 + ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ 130 + "--enable-bootstrap-with-devel-snapshot" 131 + ] ++ stdenv.lib.optionals (targetPlatform.isArm) [ 132 + "CFLAGS=-fuse-ld=gold" 133 + "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" 134 + "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" 135 + ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [ 136 + # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 137 + "--disable-large-address-space" 138 ]; 139 140 + # Hack to make sure we never to the relaxation `$PATH` and hooks support for 141 + # compatability. This will be replaced with something clearer in a future 142 + # masss-rebuild. 143 + crossConfig = true; 144 + 145 + nativeBuildInputs = [ alex autoconf autoreconfHook automake ghc happy hscolour perl python3 sphinx ]; 146 + 147 + # For building runtime libs 148 + depsBuildTarget = toolsForTarget; 149 + 150 + buildInputs = libDeps hostPlatform; 151 + 152 + propagatedBuildInputs = [ targetPackages.stdenv.cc ] 153 + ++ stdenv.lib.optional useLLVM llvmPackages.llvm; 154 + 155 + depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); 156 + depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); 157 + 158 # required, because otherwise all symbols from HSffi.o are stripped, and 159 # that in turn causes GHCi to abort 160 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; 161 162 checkTarget = "test"; 163 164 + # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't 165 + # treat that as a unary `{x,y,z,..}` repetition. 166 postInstall = '' 167 paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"} 168 ··· 177 done 178 ''; 179 180 passthru = { 181 inherit bootPkgs targetPrefix; 182 + 183 + inherit llvmPackages; 184 + 185 + # Our Cabal compiler name 186 + haskellCompilerName = "ghc"; 187 }; 188 189 meta = { ··· 193 inherit (ghc.meta) license platforms; 194 }; 195 196 + }
+113 -49
pkgs/development/compilers/ghc/8.4.1.nix
··· 1 { stdenv, targetPackages 2 , buildPlatform, hostPlatform, targetPlatform 3 - , selfPkgs, cross ? null 4 5 # build-tools 6 , bootPkgs, alex, happy 7 , autoconf, automake, coreutils, fetchgit, perl, python3 8 9 - , libiconv ? null, ncurses 10 11 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 12 # library instead of the faster but GPLed integer-gmp library. 13 enableIntegerSimple ? false, gmp ? null 14 15 , version ? "8.4.20180115" 16 }: 17 ··· 20 let 21 inherit (bootPkgs) ghc; 22 23 - rev = "3e3a096885c0fcd0703edbeffb4e47f5cbd8f4cc"; 24 - 25 # TODO(@Ericson2314) Make unconditional 26 targetPrefix = stdenv.lib.optionalString 27 (targetPlatform != hostPlatform) 28 "${targetPlatform.config}-"; 29 in 30 - stdenv.mkDerivation (rec { 31 - inherit version rev; 32 name = "${targetPrefix}ghc-${version}"; 33 34 src = fetchgit { 35 url = "git://git.haskell.org/ghc.git"; 36 - inherit rev; 37 sha256 = "06slymbsd7vsfp4hh40v7cxf7nmp0kvlni2wfq7ag5wlqh04slgs"; 38 }; 39 40 postPatch = "patchShebangs ."; 41 42 preConfigure = '' 43 echo ${version} >VERSION 44 - echo ${rev} >GIT_COMMIT_ID 45 ./boot 46 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 47 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 48 - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 49 '' + stdenv.lib.optionalString stdenv.isDarwin '' 50 export NIX_LDFLAGS+=" -no_dtrace_dof" 51 - '' + stdenv.lib.optionalString enableIntegerSimple '' 52 - echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk 53 - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 54 - sed 's|#BuildFlavour = quick-cross|BuildFlavour = perf-cross|' mk/build.mk.sample > mk/build.mk 55 ''; 56 57 - buildInputs = [ ghc perl autoconf automake happy alex python3 ]; 58 - 59 - enableParallelBuilding = true; 60 - 61 configureFlags = [ 62 - "CC=${stdenv.cc}/bin/cc" 63 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 64 - "--datadir=$doc/share/doc/ghc" 65 - ] ++ stdenv.lib.optional (! enableIntegerSimple) [ 66 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" 67 - ] ++ stdenv.lib.optional stdenv.isDarwin [ 68 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 69 ]; 70 71 # required, because otherwise all symbols from HSffi.o are stripped, and 72 # that in turn causes GHCi to abort 73 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; 74 75 checkTarget = "test"; 76 77 postInstall = '' 78 paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"} 79 ··· 88 done 89 ''; 90 91 - outputs = [ "out" "doc" ]; 92 - 93 passthru = { 94 inherit bootPkgs targetPrefix; 95 - } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) { 96 - crossCompiler = selfPkgs.ghc.override { 97 - cross = targetPlatform; 98 - bootPkgs = selfPkgs; 99 - }; 100 }; 101 102 meta = { ··· 106 inherit (ghc.meta) license platforms; 107 }; 108 109 - } // stdenv.lib.optionalAttrs (cross != null) { 110 - configureFlags = [ 111 - "CC=${stdenv.cc}/bin/${cross.config}-cc" 112 - "LD=${stdenv.cc.bintools}/bin/${cross.config}-ld" 113 - "AR=${stdenv.cc.bintools}/bin/${cross.config}-ar" 114 - "NM=${stdenv.cc.bintools}/bin/${cross.config}-nm" 115 - "RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib" 116 - "--target=${cross.config}" 117 - "--enable-bootstrap-with-devel-snapshot" 118 - ] ++ 119 - # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 120 - stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space"; 121 - 122 - configurePlatforms = []; 123 - 124 - passthru = { 125 - inherit bootPkgs cross; 126 - cc = "${stdenv.cc}/bin/${cross.config}-cc"; 127 - ld = "${stdenv.cc}/bin/${cross.config}-ld"; 128 - }; 129 - })
··· 1 { stdenv, targetPackages 2 , buildPlatform, hostPlatform, targetPlatform 3 4 # build-tools 5 , bootPkgs, alex, happy 6 , autoconf, automake, coreutils, fetchgit, perl, python3 7 8 + , libffi, libiconv ? null, ncurses 9 + 10 + , useLLVM ? !targetPlatform.isx86 11 + , # LLVM is conceptually a run-time-only depedendency, but for 12 + # non-x86, we need LLVM to bootstrap later stages, so it becomes a 13 + # build-time dependency too. 14 + buildLlvmPackages, llvmPackages 15 16 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 17 # library instead of the faster but GPLed integer-gmp library. 18 enableIntegerSimple ? false, gmp ? null 19 20 + , # If enabled, use -fPIC when compiling static libs. 21 + enableRelocatedStaticLibs ? targetPlatform != hostPlatform 22 + 23 + , # Whether to build dynamic libs for the standard library (on the target 24 + # platform). Static libs are always built. 25 + enableShared ? true 26 + 27 , version ? "8.4.20180115" 28 }: 29 ··· 32 let 33 inherit (bootPkgs) ghc; 34 35 # TODO(@Ericson2314) Make unconditional 36 targetPrefix = stdenv.lib.optionalString 37 (targetPlatform != hostPlatform) 38 "${targetPlatform.config}-"; 39 + 40 + buildMK = '' 41 + DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 42 + '' + stdenv.lib.optionalString enableIntegerSimple '' 43 + INTEGER_LIBRARY = integer-simple 44 + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 45 + BuildFlavour = perf-cross 46 + Stage1Only = YES 47 + HADDOCK_DOCS = NO 48 + BUILD_SPHINX_HTML = NO 49 + BUILD_SPHINX_PDF = NO 50 + '' + stdenv.lib.optionalString enableRelocatedStaticLibs '' 51 + GhcLibHcOpts += -fPIC 52 + GhcRtsHcOpts += -fPIC 53 + ''; 54 + 55 + # Splicer will pull out correct variations 56 + libDeps = platform: [ ncurses ] 57 + ++ stdenv.lib.optional (!enableIntegerSimple) gmp 58 + ++ stdenv.lib.optional (platform.libc != "glibc") libiconv; 59 + 60 + toolsForTarget = 61 + if hostPlatform == buildPlatform then 62 + [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm 63 + else assert targetPlatform == hostPlatform; # build != host == target 64 + [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; 65 + 66 + targetCC = builtins.head toolsForTarget; 67 + 68 in 69 + stdenv.mkDerivation rec { 70 + inherit version; 71 + inherit (src) rev; 72 name = "${targetPrefix}ghc-${version}"; 73 74 src = fetchgit { 75 url = "git://git.haskell.org/ghc.git"; 76 + rev = "3e3a096885c0fcd0703edbeffb4e47f5cbd8f4cc"; 77 sha256 = "06slymbsd7vsfp4hh40v7cxf7nmp0kvlni2wfq7ag5wlqh04slgs"; 78 }; 79 80 + enableParallelBuilding = true; 81 + 82 + outputs = [ "out" "doc" ]; 83 + 84 postPatch = "patchShebangs ."; 85 86 + # GHC is a bit confused on its cross terminology. 87 preConfigure = '' 88 + for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do 89 + export "''${env#TARGET_}=''${!env}" 90 + done 91 + # GHC is a bit confused on its cross terminology, as these would normally be 92 + # the *host* tools. 93 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 94 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 95 + # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 96 + export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isArm ".gold"}" 97 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 98 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 99 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 100 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 101 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 102 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 103 + 104 + echo -n "${buildMK}" > mk/build.mk 105 echo ${version} >VERSION 106 + echo ${src.rev} >GIT_COMMIT_ID 107 ./boot 108 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 109 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 110 + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" 111 '' + stdenv.lib.optionalString stdenv.isDarwin '' 112 export NIX_LDFLAGS+=" -no_dtrace_dof" 113 ''; 114 115 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 116 + configurePlatforms = [ "build" "host" ] 117 + ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 118 + # `--with` flags for libraries needed for RTS linker 119 configureFlags = [ 120 + "--datadir=$doc/share/doc/ghc" 121 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 122 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [ 123 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" 124 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [ 125 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 126 + ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ 127 + "--enable-bootstrap-with-devel-snapshot" 128 + ] ++ stdenv.lib.optionals (targetPlatform.isArm) [ 129 + "CFLAGS=-fuse-ld=gold" 130 + "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" 131 + "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" 132 + ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [ 133 + # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 134 + "--disable-large-address-space" 135 ]; 136 137 + # Hack to make sure we never to the relaxation `$PATH` and hooks support for 138 + # compatability. This will be replaced with something clearer in a future 139 + # masss-rebuild. 140 + crossConfig = true; 141 + 142 + nativeBuildInputs = [ ghc perl autoconf automake happy alex python3 ]; 143 + 144 + # For building runtime libs 145 + depsBuildTarget = toolsForTarget; 146 + 147 + buildInputs = libDeps hostPlatform; 148 + 149 + propagatedBuildInputs = [ targetPackages.stdenv.cc ] 150 + ++ stdenv.lib.optional useLLVM llvmPackages.llvm; 151 + 152 + depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); 153 + depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); 154 + 155 # required, because otherwise all symbols from HSffi.o are stripped, and 156 # that in turn causes GHCi to abort 157 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; 158 159 checkTarget = "test"; 160 161 + # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't 162 + # treat that as a unary `{x,y,z,..}` repetition. 163 postInstall = '' 164 paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"} 165 ··· 174 done 175 ''; 176 177 passthru = { 178 inherit bootPkgs targetPrefix; 179 + 180 + inherit llvmPackages; 181 + 182 + # Our Cabal compiler name 183 + haskellCompilerName = "ghc"; 184 }; 185 186 meta = { ··· 190 inherit (ghc.meta) license platforms; 191 }; 192 193 + }
+115 -51
pkgs/development/compilers/ghc/head.nix
··· 1 { stdenv, targetPackages 2 , buildPlatform, hostPlatform, targetPlatform 3 - , selfPkgs, cross ? null 4 5 # build-tools 6 , bootPkgs, alex, happy 7 , autoconf, automake, coreutils, fetchgit, perl, python3 8 9 - , libiconv ? null, ncurses 10 11 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 12 # library instead of the faster but GPLed integer-gmp library. 13 enableIntegerSimple ? false, gmp ? null 14 15 - , version ? "8.5.20171209" 16 }: 17 18 assert !enableIntegerSimple -> gmp != null; ··· 20 let 21 inherit (bootPkgs) ghc; 22 23 - rev = "4335c07ca7e64624819b22644d7591853826bd75"; 24 - 25 # TODO(@Ericson2314) Make unconditional 26 targetPrefix = stdenv.lib.optionalString 27 (targetPlatform != hostPlatform) 28 "${targetPlatform.config}-"; 29 in 30 - stdenv.mkDerivation (rec { 31 - inherit version rev; 32 name = "${targetPrefix}ghc-${version}"; 33 34 src = fetchgit { 35 url = "git://git.haskell.org/ghc.git"; 36 - inherit rev; 37 - sha256 = "19csad94sk0bw2nj97ppmnwh4c193jg0jmg5w2sx9rqm9ih4yg85"; 38 }; 39 40 postPatch = "patchShebangs ."; 41 42 preConfigure = '' 43 echo ${version} >VERSION 44 - echo ${rev} >GIT_COMMIT_ID 45 ./boot 46 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 47 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 48 - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 49 '' + stdenv.lib.optionalString stdenv.isDarwin '' 50 export NIX_LDFLAGS+=" -no_dtrace_dof" 51 - '' + stdenv.lib.optionalString enableIntegerSimple '' 52 - echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk 53 - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 54 - sed 's|#BuildFlavour = quick-cross|BuildFlavour = perf-cross|' mk/build.mk.sample > mk/build.mk 55 ''; 56 57 - buildInputs = [ ghc perl autoconf automake happy alex python3 ]; 58 - 59 - enableParallelBuilding = true; 60 - 61 configureFlags = [ 62 - "CC=${stdenv.cc}/bin/cc" 63 - "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 64 "--datadir=$doc/share/doc/ghc" 65 - ] ++ stdenv.lib.optional (! enableIntegerSimple) [ 66 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" 67 - ] ++ stdenv.lib.optional stdenv.isDarwin [ 68 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 69 ]; 70 71 # required, because otherwise all symbols from HSffi.o are stripped, and 72 # that in turn causes GHCi to abort 73 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; 74 75 checkTarget = "test"; 76 77 postInstall = '' 78 paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"} 79 ··· 88 done 89 ''; 90 91 - outputs = [ "out" "doc" ]; 92 - 93 passthru = { 94 inherit bootPkgs targetPrefix; 95 - } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) { 96 - crossCompiler = selfPkgs.ghc.override { 97 - cross = targetPlatform; 98 - bootPkgs = selfPkgs; 99 - }; 100 }; 101 102 meta = { ··· 106 inherit (ghc.meta) license platforms; 107 }; 108 109 - } // stdenv.lib.optionalAttrs (cross != null) { 110 - configureFlags = [ 111 - "CC=${stdenv.cc}/bin/${cross.config}-cc" 112 - "LD=${stdenv.cc.bintools}/bin/${cross.config}-ld" 113 - "AR=${stdenv.cc.bintools}/bin/${cross.config}-ar" 114 - "NM=${stdenv.cc.bintools}/bin/${cross.config}-nm" 115 - "RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib" 116 - "--target=${cross.config}" 117 - "--enable-bootstrap-with-devel-snapshot" 118 - ] ++ 119 - # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 120 - stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space"; 121 - 122 - configurePlatforms = []; 123 - 124 - passthru = { 125 - inherit bootPkgs cross; 126 - cc = "${stdenv.cc}/bin/${cross.config}-cc"; 127 - ld = "${stdenv.cc}/bin/${cross.config}-ld"; 128 - }; 129 - })
··· 1 { stdenv, targetPackages 2 , buildPlatform, hostPlatform, targetPlatform 3 4 # build-tools 5 , bootPkgs, alex, happy 6 , autoconf, automake, coreutils, fetchgit, perl, python3 7 8 + , libffi, libiconv ? null, ncurses 9 + 10 + , useLLVM ? !targetPlatform.isx86 11 + , # LLVM is conceptually a run-time-only depedendency, but for 12 + # non-x86, we need LLVM to bootstrap later stages, so it becomes a 13 + # build-time dependency too. 14 + buildLlvmPackages, llvmPackages 15 16 , # If enabled, GHC will be built with the GPL-free but slower integer-simple 17 # library instead of the faster but GPLed integer-gmp library. 18 enableIntegerSimple ? false, gmp ? null 19 20 + , # If enabled, use -fPIC when compiling static libs. 21 + enableRelocatedStaticLibs ? targetPlatform != hostPlatform 22 + 23 + , # Whether to build dynamic libs for the standard library (on the target 24 + # platform). Static libs are always built. 25 + enableShared ? true 26 + 27 + , version ? "8.5.20180118" 28 }: 29 30 assert !enableIntegerSimple -> gmp != null; ··· 32 let 33 inherit (bootPkgs) ghc; 34 35 # TODO(@Ericson2314) Make unconditional 36 targetPrefix = stdenv.lib.optionalString 37 (targetPlatform != hostPlatform) 38 "${targetPlatform.config}-"; 39 + 40 + buildMK = '' 41 + DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 42 + '' + stdenv.lib.optionalString enableIntegerSimple '' 43 + INTEGER_LIBRARY = integer-simple 44 + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 45 + BuildFlavour = perf-cross 46 + Stage1Only = YES 47 + HADDOCK_DOCS = NO 48 + BUILD_SPHINX_HTML = NO 49 + BUILD_SPHINX_PDF = NO 50 + '' + stdenv.lib.optionalString enableRelocatedStaticLibs '' 51 + GhcLibHcOpts += -fPIC 52 + GhcRtsHcOpts += -fPIC 53 + ''; 54 + 55 + # Splicer will pull out correct variations 56 + libDeps = platform: [ ncurses ] 57 + ++ stdenv.lib.optional (!enableIntegerSimple) gmp 58 + ++ stdenv.lib.optional (platform.libc != "glibc") libiconv; 59 + 60 + toolsForTarget = 61 + if hostPlatform == buildPlatform then 62 + [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm 63 + else assert targetPlatform == hostPlatform; # build != host == target 64 + [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; 65 + 66 + targetCC = builtins.head toolsForTarget; 67 + 68 in 69 + stdenv.mkDerivation rec { 70 + inherit version; 71 + inherit (src) rev; 72 name = "${targetPrefix}ghc-${version}"; 73 74 src = fetchgit { 75 url = "git://git.haskell.org/ghc.git"; 76 + rev = "e1d4140be4d2a1508015093b69e1ef53516e1eb6"; 77 + sha256 = "1gdcr10dd968d40qgljdwx9vfkva3yrvjm9a4nis7whaaac3ag58"; 78 }; 79 80 + enableParallelBuilding = true; 81 + 82 + outputs = [ "out" "doc" ]; 83 + 84 postPatch = "patchShebangs ."; 85 86 + # GHC is a bit confused on its cross terminology. 87 preConfigure = '' 88 + for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do 89 + export "''${env#TARGET_}=''${!env}" 90 + done 91 + # GHC is a bit confused on its cross terminology, as these would normally be 92 + # the *host* tools. 93 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 94 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 95 + # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 96 + export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isArm ".gold"}" 97 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 98 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 99 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 100 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 101 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 102 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 103 + 104 + echo -n "${buildMK}" > mk/build.mk 105 echo ${version} >VERSION 106 + echo ${src.rev} >GIT_COMMIT_ID 107 ./boot 108 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 109 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 110 + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" 111 '' + stdenv.lib.optionalString stdenv.isDarwin '' 112 export NIX_LDFLAGS+=" -no_dtrace_dof" 113 ''; 114 115 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 116 + configurePlatforms = [ "build" "host" ] 117 + ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 118 + # `--with` flags for libraries needed for RTS linker 119 configureFlags = [ 120 "--datadir=$doc/share/doc/ghc" 121 + "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 122 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [ 123 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" 124 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [ 125 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 126 + ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ 127 + "--enable-bootstrap-with-devel-snapshot" 128 + ] ++ stdenv.lib.optionals (targetPlatform.isArm) [ 129 + "CFLAGS=-fuse-ld=gold" 130 + "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" 131 + "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" 132 + ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [ 133 + # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 134 + "--disable-large-address-space" 135 ]; 136 137 + # Hack to make sure we never to the relaxation `$PATH` and hooks support for 138 + # compatability. This will be replaced with something clearer in a future 139 + # masss-rebuild. 140 + crossConfig = true; 141 + 142 + nativeBuildInputs = [ ghc perl autoconf automake happy alex python3 ]; 143 + 144 + # For building runtime libs 145 + depsBuildTarget = toolsForTarget; 146 + 147 + buildInputs = libDeps hostPlatform; 148 + 149 + propagatedBuildInputs = [ targetPackages.stdenv.cc ] 150 + ++ stdenv.lib.optional useLLVM llvmPackages.llvm; 151 + 152 + depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); 153 + depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); 154 + 155 # required, because otherwise all symbols from HSffi.o are stripped, and 156 # that in turn causes GHCi to abort 157 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; 158 159 checkTarget = "test"; 160 161 + # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't 162 + # treat that as a unary `{x,y,z,..}` repetition. 163 postInstall = '' 164 paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"} 165 ··· 174 done 175 ''; 176 177 passthru = { 178 inherit bootPkgs targetPrefix; 179 + 180 + inherit llvmPackages; 181 + 182 + # Our Cabal compiler name 183 + haskellCompilerName = "ghc"; 184 }; 185 186 meta = { ··· 190 inherit (ghc.meta) license platforms; 191 }; 192 193 + }
+2 -1
pkgs/development/haskell-modules/default.nix
··· 1 { pkgs, stdenv, lib, haskellLib, ghc, all-cabal-hashes 2 , compilerConfig ? (self: super: {}) 3 , packageSetConfig ? (self: super: {}) 4 , overrides ? (self: super: {}) ··· 14 15 haskellPackages = pkgs.callPackage makePackageSet { 16 package-set = initialPackages; 17 - inherit stdenv haskellLib ghc extensible-self; 18 }; 19 20 commonConfiguration = configurationCommon { inherit pkgs haskellLib; };
··· 1 { pkgs, stdenv, lib, haskellLib, ghc, all-cabal-hashes 2 + , buildHaskellPackages 3 , compilerConfig ? (self: super: {}) 4 , packageSetConfig ? (self: super: {}) 5 , overrides ? (self: super: {}) ··· 15 16 haskellPackages = pkgs.callPackage makePackageSet { 17 package-set = initialPackages; 18 + inherit stdenv haskellLib ghc buildHaskellPackages extensible-self; 19 }; 20 21 commonConfiguration = configurationCommon { inherit pkgs haskellLib; };
+15 -11
pkgs/development/haskell-modules/generic-builder.nix
··· 1 - { stdenv, buildPackages, ghc 2 , jailbreak-cabal, hscolour, cpphs, nodejs 3 , buildPlatform, hostPlatform 4 }: ··· 81 then "package-db" 82 else "package-conf"; 83 84 - nativeGhc = if isCross || isGhcjs then ghc.bootPkgs.ghc else ghc; 85 nativePackageDbFlag = if versionOlder "7.6" nativeGhc.version 86 then "package-db" 87 else "package-conf"; ··· 147 ] ++ crossCabalFlags); 148 149 setupCompileFlags = [ 150 - (optionalString (!coreSetup) "-${packageDbFlag}=$packageConfDir") 151 - (optionalString isGhcjs "-build-runner") 152 (optionalString (isGhcjs || isHaLVM || versionOlder "7.8" ghc.version) "-j$NIX_BUILD_CORES") 153 # https://github.com/haskell/cabal/issues/2398 154 (optionalString (versionOlder "7.10" ghc.version && !isHaLVM) "-threaded") ··· 160 allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++ 161 optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends; 162 163 - nativeBuildInputs = optional (allPkgconfigDepends != []) pkgconfig ++ 164 - buildTools ++ libraryToolDepends ++ executableToolDepends ++ [ removeReferencesTo ]; 165 propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends; 166 otherBuildInputs = setupHaskellDepends ++ extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++ 167 optionals (allPkgconfigDepends != []) allPkgconfigDepends ++ 168 optionals doCheck (testDepends ++ testHaskellDepends ++ testSystemDepends ++ testToolDepends) ++ 169 - # ghcjs's hsc2hs calls out to the native hsc2hs 170 - optional isGhcjs nativeGhc ++ 171 optionals doBenchmark (benchmarkDepends ++ benchmarkHaskellDepends ++ benchmarkSystemDepends ++ benchmarkToolDepends); 172 allBuildInputs = propagatedBuildInputs ++ otherBuildInputs; 173 ··· 176 177 ghcEnv = ghc.withPackages (p: haskellBuildInputs); 178 179 - setupBuilder = if isCross then "${nativeGhc}/bin/ghc" else ghcCommand; 180 setupCommand = "./Setup"; 181 ghcCommand' = if isGhcjs then "ghcjs" else "ghc"; 182 ghcCommand = "${ghc.targetPrefix}${ghcCommand'}"; 183 ghcCommandCaps= toUpper ghcCommand'; 184 185 in 186 187 assert allPkgconfigDepends != [] -> pkgconfig != null; ··· 220 runHook preSetupCompilerEnvironment 221 222 echo "Build with ${ghc}." 223 - export PATH="${ghc}/bin:$PATH" 224 ${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"} 225 226 packageConfDir="$TMPDIR/package.conf.d" ··· 271 done 272 273 echo setupCompileFlags: $setupCompileFlags 274 - ${setupBuilder} $setupCompileFlags --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i 275 276 runHook postCompileBuildDriver 277 ''; 278 279 inherit configureFlags; 280 281 configurePhase = ''
··· 1 + { stdenv, buildPackages, buildHaskellPackages, ghc 2 , jailbreak-cabal, hscolour, cpphs, nodejs 3 , buildPlatform, hostPlatform 4 }: ··· 81 then "package-db" 82 else "package-conf"; 83 84 + # GHC used for building Setup.hs 85 + # 86 + # Same as our GHC, unless we're cross, in which case it is native GHC with the 87 + # same version, or ghcjs, in which case its the ghc used to build ghcjs. 88 + nativeGhc = buildHaskellPackages.ghc; 89 nativePackageDbFlag = if versionOlder "7.6" nativeGhc.version 90 then "package-db" 91 else "package-conf"; ··· 151 ] ++ crossCabalFlags); 152 153 setupCompileFlags = [ 154 + (optionalString (!coreSetup) "-${nativePackageDbFlag}=$packageConfDir") 155 (optionalString (isGhcjs || isHaLVM || versionOlder "7.8" ghc.version) "-j$NIX_BUILD_CORES") 156 # https://github.com/haskell/cabal/issues/2398 157 (optionalString (versionOlder "7.10" ghc.version && !isHaLVM) "-threaded") ··· 163 allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++ 164 optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends; 165 166 + nativeBuildInputs = [ ghc nativeGhc removeReferencesTo ] ++ optional (allPkgconfigDepends != []) pkgconfig ++ 167 + buildTools ++ libraryToolDepends ++ executableToolDepends; 168 propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends; 169 otherBuildInputs = setupHaskellDepends ++ extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++ 170 optionals (allPkgconfigDepends != []) allPkgconfigDepends ++ 171 optionals doCheck (testDepends ++ testHaskellDepends ++ testSystemDepends ++ testToolDepends) ++ 172 optionals doBenchmark (benchmarkDepends ++ benchmarkHaskellDepends ++ benchmarkSystemDepends ++ benchmarkToolDepends); 173 allBuildInputs = propagatedBuildInputs ++ otherBuildInputs; 174 ··· 177 178 ghcEnv = ghc.withPackages (p: haskellBuildInputs); 179 180 setupCommand = "./Setup"; 181 + 182 ghcCommand' = if isGhcjs then "ghcjs" else "ghc"; 183 ghcCommand = "${ghc.targetPrefix}${ghcCommand'}"; 184 ghcCommandCaps= toUpper ghcCommand'; 185 186 + nativeGhcCommand = "${nativeGhc.targetPrefix}ghc"; 187 + 188 in 189 190 assert allPkgconfigDepends != [] -> pkgconfig != null; ··· 223 runHook preSetupCompilerEnvironment 224 225 echo "Build with ${ghc}." 226 ${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"} 227 228 packageConfDir="$TMPDIR/package.conf.d" ··· 273 done 274 275 echo setupCompileFlags: $setupCompileFlags 276 + ${nativeGhcCommand} $setupCompileFlags --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i 277 278 runHook postCompileBuildDriver 279 ''; 280 281 + # Cabal takes flags like `--configure-option=--host=...` instead 282 + configurePlatforms = []; 283 inherit configureFlags; 284 285 configurePhase = ''
+9 -8
pkgs/development/haskell-modules/make-package-set.nix
··· 4 { # package-set used for build tools (all of nixpkgs) 5 buildPackages 6 7 , # package-set used for non-haskell dependencies (all of nixpkgs) 8 pkgs 9 ··· 18 , # compiler to use 19 ghc 20 21 - , # A function that takes `{ pkgs, stdenv, callPackage }` as the first arg and `self` 22 - # as second, and returns a set of haskell packages 23 package-set 24 25 , # The final, fully overriden package set usable with the nixpkgs fixpoint ··· 36 inherit (stdenv.lib) fix' extends makeOverridable; 37 inherit (haskellLib) overrideCabal; 38 39 - buildHaskellPackages = if hostPlatform != buildPlatform 40 - then self.ghc.bootPkgs 41 - else self; 42 - 43 mkDerivationImpl = pkgs.callPackage ./generic-builder.nix { 44 inherit stdenv; 45 nodejs = buildPackages.nodejs-slim; 46 inherit (buildHaskellPackages) jailbreak-cabal; 47 - inherit (self) ghc; 48 hscolour = overrideCabal buildHaskellPackages.hscolour (drv: { 49 isLibrary = false; 50 doHaddock = false; ··· 119 installPhase = '' 120 export HOME="$TMP" 121 mkdir -p "$out" 122 - cabal2nix --compiler=${self.ghc.name} --system=${stdenv.system} ${sha256Arg} "${src}" > "$out/default.nix" 123 ''; 124 }; 125
··· 4 { # package-set used for build tools (all of nixpkgs) 5 buildPackages 6 7 + , # A haskell package set for Setup.hs, compiler plugins, and similar 8 + # build-time uses. 9 + buildHaskellPackages 10 + 11 , # package-set used for non-haskell dependencies (all of nixpkgs) 12 pkgs 13 ··· 22 , # compiler to use 23 ghc 24 25 + , # A function that takes `{ pkgs, stdenv, callPackage }` as the first arg and 26 + # `self` as second, and returns a set of haskell packages 27 package-set 28 29 , # The final, fully overriden package set usable with the nixpkgs fixpoint ··· 40 inherit (stdenv.lib) fix' extends makeOverridable; 41 inherit (haskellLib) overrideCabal; 42 43 mkDerivationImpl = pkgs.callPackage ./generic-builder.nix { 44 inherit stdenv; 45 nodejs = buildPackages.nodejs-slim; 46 + inherit buildHaskellPackages; 47 + inherit (self) ghc; 48 inherit (buildHaskellPackages) jailbreak-cabal; 49 hscolour = overrideCabal buildHaskellPackages.hscolour (drv: { 50 isLibrary = false; 51 doHaddock = false; ··· 120 installPhase = '' 121 export HOME="$TMP" 122 mkdir -p "$out" 123 + cabal2nix --compiler=${ghc.haskellCompilerName} --system=${stdenv.system} ${sha256Arg} "${src}" > "$out/default.nix" 124 ''; 125 }; 126
+13
pkgs/tools/misc/ckb/ckb-modprobe.patch
···
··· 1 + diff --git a/src/ckb-daemon/usb_linux.c b/src/ckb-daemon/usb_linux.c 2 + index 8673f86..4714305 100644 3 + --- a/src/ckb-daemon/usb_linux.c 4 + +++ b/src/ckb-daemon/usb_linux.c 5 + @@ -440,7 +440,7 @@ static void udev_enum(){ 6 + 7 + int usbmain(){ 8 + // Load the uinput module (if it's not loaded already) 9 + - if(system("modprobe uinput") != 0) 10 + + if(system("@kmod@/bin/modprobe uinput") != 0) 11 + ckb_warn("Failed to load uinput module\n"); 12 + 13 + // Create the udev object
+6 -1
pkgs/tools/misc/ckb/default.nix
··· 1 - { stdenv, fetchFromGitHub, libudev, pkgconfig, qtbase, qmake, zlib }: 2 3 stdenv.mkDerivation rec { 4 version = "0.2.8"; ··· 24 25 patches = [ 26 ./ckb-animations-location.patch 27 ]; 28 29 doCheck = false;
··· 1 + { stdenv, fetchFromGitHub, substituteAll, libudev, pkgconfig, qtbase, qmake, zlib, kmod }: 2 3 stdenv.mkDerivation rec { 4 version = "0.2.8"; ··· 24 25 patches = [ 26 ./ckb-animations-location.patch 27 + (substituteAll { 28 + name = "ckb-modprobe.patch"; 29 + src = ./ckb-modprobe.patch; 30 + inherit kmod; 31 + }) 32 ]; 33 34 doCheck = false;
+59 -48
pkgs/top-level/haskell-packages.nix
··· 1 - { pkgs, lib, newScope, stdenv, buildPlatform, targetPlatform, cabal-install }: 2 3 let 4 # These are attributes in compiler and packages that don't support integer-simple. ··· 65 ghc7103 = callPackage ../development/compilers/ghc/7.10.3.nix rec { 66 bootPkgs = packages.ghc7103Binary; 67 inherit (bootPkgs) hscolour; 68 }; 69 ghc802 = callPackage ../development/compilers/ghc/8.0.2.nix rec { 70 bootPkgs = packages.ghc7103Binary; 71 inherit (bootPkgs) hscolour; 72 sphinx = pkgs.python27Packages.sphinx; 73 }; 74 ghc822 = callPackage ../development/compilers/ghc/8.2.2.nix rec { 75 bootPkgs = packages.ghc821Binary; 76 inherit (bootPkgs) hscolour alex happy; 77 inherit buildPlatform targetPlatform; 78 sphinx = pkgs.python3Packages.sphinx; 79 - selfPkgs = packages.ghc822; 80 }; 81 ghc841 = callPackage ../development/compilers/ghc/8.4.1.nix rec { 82 bootPkgs = packages.ghc821Binary; 83 inherit (bootPkgs) alex happy; 84 - inherit buildPlatform targetPlatform; 85 - selfPkgs = packages.ghc841; 86 }; 87 ghcHEAD = callPackage ../development/compilers/ghc/head.nix rec { 88 bootPkgs = packages.ghc821Binary; 89 inherit (bootPkgs) alex happy; 90 - inherit buildPlatform targetPlatform; 91 - selfPkgs = packages.ghcHEAD; 92 }; 93 ghcjs = packages.ghc7103.callPackage ../development/compilers/ghcjs { 94 bootPkgs = packages.ghc7103; 95 - inherit cabal-install; 96 }; 97 ghcjsHEAD = packages.ghc802.callPackage ../development/compilers/ghcjs/head.nix { 98 bootPkgs = packages.ghc802; 99 - inherit cabal-install; 100 }; 101 ghcHaLVM240 = callPackage ../development/compilers/halvm/2.4.0.nix rec { 102 bootPkgs = packages.ghc7103Binary; ··· 110 111 # The integer-simple attribute set contains all the GHC compilers 112 # build with integer-simple instead of integer-gmp. 113 - integer-simple = 114 - let integerSimpleGhcNames = 115 - pkgs.lib.filter (name: ! builtins.elem name integerSimpleExcludes) 116 - (pkgs.lib.attrNames compiler); 117 - integerSimpleGhcs = pkgs.lib.genAttrs integerSimpleGhcNames 118 - (name: compiler."${name}".override { enableIntegerSimple = true; }); 119 - in pkgs.recurseIntoAttrs (integerSimpleGhcs // { 120 - ghcHEAD = integerSimpleGhcs.ghcHEAD.override { selfPkgs = packages.integer-simple.ghcHEAD; }; 121 - }); 122 - 123 }; 124 125 - packages = { 126 127 ghc7103 = callPackage ../development/haskell-modules { 128 - ghc = compiler.ghc7103; 129 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; 130 }; 131 ghc7103Binary = callPackage ../development/haskell-modules { 132 - ghc = compiler.ghc7103Binary; 133 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; 134 }; 135 ghc802 = callPackage ../development/haskell-modules { 136 - ghc = compiler.ghc802; 137 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { }; 138 }; 139 - ghc822 = callPackage ../development/haskell-modules { 140 - ghc = compiler.ghc822; 141 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.2.x.nix { }; 142 }; 143 - ghc821Binary = callPackage ../development/haskell-modules { 144 - ghc = compiler.ghc821Binary; 145 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.2.x.nix { }; 146 }; 147 ghc841 = callPackage ../development/haskell-modules { 148 - ghc = compiler.ghc841; 149 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.4.x.nix { }; 150 }; 151 ghcHEAD = callPackage ../development/haskell-modules { 152 - ghc = compiler.ghcHEAD; 153 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { }; 154 }; 155 - # TODO Support for multiple variants here 156 - ghcCross = callPackage ../development/haskell-modules { 157 - ghc = compiler.ghcHEAD.crossCompiler; 158 - compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { }; 159 - }; 160 - ghcjs = callPackage ../development/haskell-modules { 161 - ghc = compiler.ghcjs; 162 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; 163 packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { }; 164 }; 165 - ghcjsHEAD = callPackage ../development/haskell-modules { 166 - ghc = compiler.ghcjsHEAD; 167 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { }; 168 packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { }; 169 }; 170 ghcHaLVM240 = callPackage ../development/haskell-modules { 171 - ghc = compiler.ghcHaLVM240; 172 compilerConfig = callPackage ../development/haskell-modules/configuration-halvm-2.4.0.nix { }; 173 }; 174 175 # The integer-simple attribute set contains package sets for all the GHC compilers 176 # using integer-simple instead of integer-gmp. 177 - integer-simple = 178 - let integerSimpleGhcNames = 179 - pkgs.lib.filter (name: ! builtins.elem name integerSimpleExcludes) 180 - (pkgs.lib.attrNames packages); 181 - in pkgs.lib.genAttrs integerSimpleGhcNames (name: packages."${name}".override { 182 - ghc = compiler.integer-simple."${name}"; 183 - overrides = _self : _super : { 184 - integer-simple = null; 185 - integer-gmp = null; 186 - }; 187 }); 188 189 };
··· 1 + { buildPackages, pkgs 2 + , newScope, stdenv 3 + , buildPlatform, targetPlatform 4 + }: 5 6 let 7 # These are attributes in compiler and packages that don't support integer-simple. ··· 68 ghc7103 = callPackage ../development/compilers/ghc/7.10.3.nix rec { 69 bootPkgs = packages.ghc7103Binary; 70 inherit (bootPkgs) hscolour; 71 + buildLlvmPackages = buildPackages.llvmPackages_35; 72 + llvmPackages = pkgs.llvmPackages_35; 73 }; 74 ghc802 = callPackage ../development/compilers/ghc/8.0.2.nix rec { 75 bootPkgs = packages.ghc7103Binary; 76 inherit (bootPkgs) hscolour; 77 sphinx = pkgs.python27Packages.sphinx; 78 + buildLlvmPackages = buildPackages.llvmPackages_37; 79 + llvmPackages = pkgs.llvmPackages_37; 80 }; 81 ghc822 = callPackage ../development/compilers/ghc/8.2.2.nix rec { 82 bootPkgs = packages.ghc821Binary; 83 inherit (bootPkgs) hscolour alex happy; 84 inherit buildPlatform targetPlatform; 85 sphinx = pkgs.python3Packages.sphinx; 86 + buildLlvmPackages = buildPackages.llvmPackages_39; 87 + llvmPackages = pkgs.llvmPackages_39; 88 }; 89 ghc841 = callPackage ../development/compilers/ghc/8.4.1.nix rec { 90 bootPkgs = packages.ghc821Binary; 91 inherit (bootPkgs) alex happy; 92 + buildLlvmPackages = buildPackages.llvmPackages_5; 93 + llvmPackages = pkgs.llvmPackages_5; 94 }; 95 ghcHEAD = callPackage ../development/compilers/ghc/head.nix rec { 96 bootPkgs = packages.ghc821Binary; 97 inherit (bootPkgs) alex happy; 98 + buildLlvmPackages = buildPackages.llvmPackages_5; 99 + llvmPackages = pkgs.llvmPackages_5; 100 }; 101 ghcjs = packages.ghc7103.callPackage ../development/compilers/ghcjs { 102 bootPkgs = packages.ghc7103; 103 + inherit (pkgs) cabal-install; 104 }; 105 ghcjsHEAD = packages.ghc802.callPackage ../development/compilers/ghcjs/head.nix { 106 bootPkgs = packages.ghc802; 107 + inherit (pkgs) cabal-install; 108 }; 109 ghcHaLVM240 = callPackage ../development/compilers/halvm/2.4.0.nix rec { 110 bootPkgs = packages.ghc7103Binary; ··· 118 119 # The integer-simple attribute set contains all the GHC compilers 120 # build with integer-simple instead of integer-gmp. 121 + integer-simple = let 122 + integerSimpleGhcNames = pkgs.lib.filter 123 + (name: ! builtins.elem name integerSimpleExcludes) 124 + (pkgs.lib.attrNames compiler); 125 + in pkgs.recurseIntoAttrs (pkgs.lib.genAttrs 126 + integerSimpleGhcNames 127 + (name: compiler."${name}".override { enableIntegerSimple = true; })); 128 }; 129 130 + # Always get compilers from `buildPackages` 131 + packages = let bh = buildPackages.haskell; in { 132 133 ghc7103 = callPackage ../development/haskell-modules { 134 + buildHaskellPackages = bh.packages.ghc7103; 135 + ghc = bh.compiler.ghc7103; 136 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; 137 }; 138 ghc7103Binary = callPackage ../development/haskell-modules { 139 + buildHaskellPackages = bh.packages.ghc7103Binary; 140 + ghc = bh.compiler.ghc7103Binary; 141 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; 142 }; 143 ghc802 = callPackage ../development/haskell-modules { 144 + buildHaskellPackages = bh.packages.ghc802; 145 + ghc = bh.compiler.ghc802; 146 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { }; 147 }; 148 + ghc821Binary = callPackage ../development/haskell-modules { 149 + buildHaskellPackages = bh.packages.ghc821Binary; 150 + ghc = bh.compiler.ghc821Binary; 151 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.2.x.nix { }; 152 }; 153 + ghc822 = callPackage ../development/haskell-modules { 154 + buildHaskellPackages = bh.packages.ghc822; 155 + ghc = bh.compiler.ghc822; 156 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.2.x.nix { }; 157 }; 158 ghc841 = callPackage ../development/haskell-modules { 159 + buildHaskellPackages = bh.packages.ghc841; 160 + ghc = bh.compiler.ghc841; 161 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.4.x.nix { }; 162 }; 163 ghcHEAD = callPackage ../development/haskell-modules { 164 + buildHaskellPackages = bh.packages.ghcHEAD; 165 + ghc = bh.compiler.ghcHEAD; 166 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { }; 167 }; 168 + ghcjs = callPackage ../development/haskell-modules rec { 169 + buildHaskellPackages = ghc.bootPkgs; 170 + ghc = bh.compiler.ghcjs; 171 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; 172 packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { }; 173 }; 174 + ghcjsHEAD = callPackage ../development/haskell-modules rec { 175 + buildHaskellPackages = ghc.bootPkgs; 176 + ghc = bh.compiler.ghcjsHEAD; 177 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { }; 178 packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { }; 179 }; 180 ghcHaLVM240 = callPackage ../development/haskell-modules { 181 + buildHaskellPackages = bh.packages.ghcHaLVM240; 182 + ghc = bh.compiler.ghcHaLVM240; 183 compilerConfig = callPackage ../development/haskell-modules/configuration-halvm-2.4.0.nix { }; 184 }; 185 186 # The integer-simple attribute set contains package sets for all the GHC compilers 187 # using integer-simple instead of integer-gmp. 188 + integer-simple = let 189 + integerSimpleGhcNames = pkgs.lib.filter 190 + (name: ! builtins.elem name integerSimpleExcludes) 191 + (pkgs.lib.attrNames packages); 192 + in pkgs.lib.genAttrs integerSimpleGhcNames (name: packages."${name}".override { 193 + ghc = compiler.integer-simple."${name}"; 194 + overrides = _self : _super : { 195 + integer-simple = null; 196 + integer-gmp = null; 197 + }; 198 }); 199 200 };
+12
pkgs/top-level/perl-packages.nix
··· 8402 buildInputs = [ParseRecDescent]; 8403 }; 8404 8405 MailRFC822Address = buildPerlPackage { 8406 name = "Mail-RFC822-Address-0.3"; 8407 src = fetchurl {
··· 8402 buildInputs = [ParseRecDescent]; 8403 }; 8404 8405 + MailPOP3Client = buildPerlPackage rec { 8406 + name = "Mail-POP3Client-2.19"; 8407 + src = fetchurl { 8408 + url = "mirror://cpan/authors/id/S/SD/SDOWD/${name}.tar.gz"; 8409 + sha256 = "1142d6247a93cb86b23ed8835553bb2d227ff8213ee2743e4155bb93f47acb59"; 8410 + }; 8411 + meta = { 8412 + description = "Perl 5 module to talk to a POP3 (RFC1939) server"; 8413 + license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; 8414 + }; 8415 + }; 8416 + 8417 MailRFC822Address = buildPerlPackage { 8418 name = "Mail-RFC822-Address-0.3"; 8419 src = fetchurl {
+5
pkgs/top-level/release-cross.nix
··· 21 gnuCommon = lib.recursiveUpdate common { 22 buildPackages.gcc = nativePlatforms; 23 coreutils = nativePlatforms; 24 }; 25 26 linuxCommon = lib.recursiveUpdate gnuCommon { ··· 119 mpg123 = nativePlatforms; 120 }); 121 122 123 /* Cross-built bootstrap tools for every supported platform */ 124 bootstrapTools = let
··· 21 gnuCommon = lib.recursiveUpdate common { 22 buildPackages.gcc = nativePlatforms; 23 coreutils = nativePlatforms; 24 + haskell.packages.ghcHEAD.hello = nativePlatforms; 25 + haskell.packages.ghc822.hello = nativePlatforms; 26 }; 27 28 linuxCommon = lib.recursiveUpdate gnuCommon { ··· 121 mpg123 = nativePlatforms; 122 }); 123 124 + /* Linux on Aarch64 (TODO make android for real) */ 125 + android = mapTestOnCross lib.systems.examples.aarch64-multiplatform (linuxCommon // { 126 + }); 127 128 /* Cross-built bootstrap tools for every supported platform */ 129 bootstrapTools = let