on iko/ghcjs-patch-master help sign in
Use `pkgs.lib` instead of `stdenv.lib` (#1031)

Fixes: Warning: `stdenv.lib` is deprecated and will be removed in the next release. Please use `pkgs.lib` instead. For more information see https://github.com/NixOS/nixpkgs/issues/108938

commit89f50a96dd45481ef00b6859c7fcddcce563fa76 authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateThu 11 Feb 2021, 01:07 (6 years ago) parent1498e70
62 files changed+270−233
build.nix+2−2 builder/comp-builder.nix+1−1 builder/setup-builder.nix+1−1 compiler/bootstrap/cabal-install.nix+2−2 compiler/ghc/configured-src.nix+19−19 compiler/ghc/default.nix+28−28 compiler/old-ghc-nix/default.nix−10 compiler/old-ghc-nix/old-ghc-nix.json−7 docs/tutorials/cross-compilation.md+1−1 nix/sources.json+14 nix/sources.nix+86−46 overlays/armv6l-linux.nix+7−7 overlays/bootstrap.nix+1−1 overlays/emscripten/binaryen.nix+3−3 overlays/emscripten/default.nix+3−3 overlays/emscripten/fastcomp/default.nix+2−2 overlays/emscripten/fastcomp/emscripten-fastcomp.nix+4−4 overlays/emscripten/upstream/default.nix+2−2 overlays/emscripten/upstream/emscripten-upstream.nix+4−4 overlays/haskell.nix+1−1 overlays/windows.nix+10−10 scripts/check-closure-size.nix+2−2 scripts/check-hydra.nix+2−2 scripts/check-materialization-concurrency/check.nix+2−2 scripts/check-path-support.nix+2−2 scripts/update-docs.nix+2−2 scripts/update-external.nix+2−2 scripts/update-hackage.nix+1−1 scripts/update-index-state-hashes.nix+2−2 scripts/update-pins.nix+2−2 scripts/update-stackage.nix+1−1 test/buildable/default.nix+2−2 test/builder-haddock/default.nix+2−2 test/cabal-22/default.nix+2−2 test/cabal-hpack/default.nix+2−2 test/cabal-simple-prof/default.nix+2−2 test/cabal-simple/default.nix+2−2 test/cabal-source-repo-comments/default.nix+2−2 test/cabal-source-repo/default.nix+2−2 test/cabal-sublib/default.nix+2−2 test/call-cabal-project-to-nix/default.nix+2−2 test/call-stack-to-nix/default.nix+2−2 test/compiler-nix-name/default.nix+2−2 test/coverage-golden/default.nix+2−2 test/coverage-no-libs/default.nix+2−2 test/coverage/default.nix+2−2 test/exe-only/default.nix+2−2 test/extra-hackage/default.nix+2−2 test/fully-static/default.nix+2−2 test/ghc-options/cabal.nix+2−2 test/ghc-options/stack.nix+2−2 test/githash/default.nix+2−2 test/index-state/default.nix+2−2 test/project-flags/cabal.nix+2−2 test/project-flags/stack.nix+2−2 test/setup-deps/default.nix+1−1 test/shell-for-setup-deps/default.nix+2−2 test/shell-for/default.nix+2−2 test/snapshots/default.nix+2−2 test/stack-simple/default.nix+2−2 test/sublib-docs/default.nix+2−2 test/with-packages/default.nix+2−2
build.nix+2−2
@@ -33,7 +33,7 @@ in rec {
3333 # are not pure).
3434 maintainer-scripts = pkgs.dontRecurseIntoAttrs {
3535 update-hackage = import ./scripts/update-hackage.nix {
36− inherit (pkgs) stdenv writeScript coreutils glibc git
36+ inherit (pkgs) stdenv lib writeScript coreutils glibc git
3737 openssh nix-prefetch-git gawk bash curl findutils;
3838 # Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
3939 nix-tools = haskell.internal-nix-tools;
@@ -41,7 +41,7 @@ in rec {
4141 inherit (haskell) update-index-state-hashes;
4242 };
4343 update-stackage = haskell.callPackage ./scripts/update-stackage.nix {
44− inherit (pkgs) stdenv writeScript coreutils glibc git
44+ inherit (pkgs) stdenv lib writeScript coreutils glibc git
4545 openssh nix-prefetch-git gawk bash curl findutils;
4646 # Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
4747 nix-tools = haskell.internal-nix-tools;
builder/comp-builder.nix+1−1
@@ -296,7 +296,7 @@ let
296296 homepage = package.homepage or "";
297297 description = package.synopsis or "";
298298 license = haskellLib.cabalToNixpkgsLicense package.license;
299− platforms = if platforms == null then stdenv.lib.platforms.all else platforms;
299+ platforms = if platforms == null then lib.platforms.all else platforms;
300300 };
301301
302302 propagatedBuildInputs =
builder/setup-builder.nix+1−1
@@ -56,7 +56,7 @@ let
5656 homepage = package.homepage or "";
5757 description = package.synopsis or "";
5858 license = haskellLib.cabalToNixpkgsLicense package.license;
59− platforms = if component.platforms == null then stdenv.lib.platforms.all else component.platforms;
59+ platforms = if component.platforms == null then lib.platforms.all else component.platforms;
6060 };
6161
6262 phases = ["unpackPhase" "patchPhase" "buildPhase" "installPhase"];
compiler/bootstrap/cabal-install.nix+2−2
@@ -1,4 +1,4 @@
1−{ fetchurl, hackage, stdenv, ghc, zlib, src, version }:
1+{ fetchurl, hackage, stdenv, lib, ghc, zlib, src, version }:
22let dependencies =
33 [ { name = "deepseq"; version = "1.4.3.0"; }
44 { name = "binary"; version = "0.8.5.1"; }
@@ -42,7 +42,7 @@ in stdenv.mkDerivation ({
4242 };
4343
4444 meta = {
45− platforms = stdenv.lib.platforms.all;
45+ platforms = lib.platforms.all;
4646 };
4747
4848 nativeBuildInputs = [ ghc zlib ];
compiler/ghc/configured-src.nix+19−19
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl
1+{ stdenv, lib, fetchurl
22, ghc-version, ghc-version-date, ghc-patches, src-spec
33, targetPrefix
44, targetPlatform, hostPlatform
@@ -25,7 +25,7 @@ stdenv.mkDerivation (rec {
2525 nativeBuildInputs = [
2626 perl autoconf automake m4 python3 sphinx
2727 ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
28− ] ++ stdenv.lib.optional (patches != []) autoreconfHook;
28+ ] ++ lib.optional (patches != []) autoreconfHook;
2929
3030 # For building runtime libs
3131 depsBuildTarget = toolsForTarget;
@@ -33,10 +33,10 @@ stdenv.mkDerivation (rec {
3333 buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
3434
3535 propagatedBuildInputs = [ targetPackages.stdenv.cc ]
36− ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
36+ ++ lib.optional useLLVM llvmPackages.llvm;
3737
38− depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
39− depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
38+ depsTargetTarget = map lib.getDev (libDeps targetPlatform);
39+ depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
4040
4141 postPatch = "patchShebangs .";
4242
@@ -54,7 +54,7 @@ stdenv.mkDerivation (rec {
5454 export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
5555 export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
5656 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
57− export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
57+ export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString targetPlatform.isAarch32 ".gold"}"
5858 export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
5959 export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
6060 export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@@ -64,13 +64,13 @@ stdenv.mkDerivation (rec {
6464
6565 echo -n "${buildMK}" > mk/build.mk
6666 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
67− '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
67+ '' + lib.optionalString (!stdenv.isDarwin) ''
6868 export NIX_LDFLAGS+=" -rpath $out/lib/${targetPrefix}ghc-${version}"
69− '' + stdenv.lib.optionalString stdenv.isDarwin ''
69+ '' + lib.optionalString stdenv.isDarwin ''
7070 export NIX_LDFLAGS+=" -no_dtrace_dof"
71− '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
71+ '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
7272 sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
73− '' + stdenv.lib.optionalString targetPlatform.isMusl ''
73+ '' + lib.optionalString targetPlatform.isMusl ''
7474 echo "patching llvm-targets for musl targets..."
7575 echo "Cloning these existing '*-linux-gnu*' targets:"
7676 grep linux-gnu llvm-targets | sed 's/^/ /'
@@ -86,10 +86,10 @@ stdenv.mkDerivation (rec {
8686 --replace '*-android*|*-gnueabi*)' \
8787 '*-android*|*-gnueabi*|*-musleabi*)'
8888 done
89− '' + stdenv.lib.optionalString (src-spec.version != ghc-version) ''
89+ '' + lib.optionalString (src-spec.version != ghc-version) ''
9090 substituteInPlace configure --replace 'RELEASE=YES' 'RELEASE=NO'
9191 echo '${ghc-version}' > VERSION
92− '' + stdenv.lib.optionalString (ghc-version-date != null) ''
92+ '' + lib.optionalString (ghc-version-date != null) ''
9393 substituteInPlace configure --replace 'RELEASE=YES' 'RELEASE=NO'
9494 echo '${ghc-version-date}' > VERSION_DATE
9595 '';
@@ -99,16 +99,16 @@ stdenv.mkDerivation (rec {
9999 configureFlags = [
100100 "--datadir=$doc/share/doc/ghc"
101101 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
102− ] ++ stdenv.lib.optionals (targetLibffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetLibffi.dev}/include" "--with-ffi-libraries=${targetLibffi.out}/lib"
103− ] ++ stdenv.lib.optional (!enableIntegerSimple) [
102+ ] ++ lib.optionals (targetLibffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetLibffi.dev}/include" "--with-ffi-libraries=${targetLibffi.out}/lib"
103+ ] ++ lib.optional (!enableIntegerSimple) [
104104 "--with-gmp-includes=${targetGmp.dev}/include" "--with-gmp-libraries=${targetGmp.out}/lib"
105− ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
105+ ] ++ lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
106106 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
107− ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
107+ ] ++ lib.optionals (targetPlatform != hostPlatform) [
108108 "--enable-bootstrap-with-devel-snapshot"
109− ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
109+ ] ++ lib.optionals (disableLargeAddressSpace) [
110110 "--disable-large-address-space"
111− ] ++ stdenv.lib.optionals (targetPlatform.isAarch32) [
111+ ] ++ lib.optionals (targetPlatform.isAarch32) [
112112 "CFLAGS=-fuse-ld=gold"
113113 "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
114114 "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
@@ -116,7 +116,7 @@ stdenv.mkDerivation (rec {
116116
117117 outputs = [ "out" ];
118118 phases = [ "unpackPhase" "patchPhase" ]
119− ++ stdenv.lib.optional (ghc-patches != []) "autoreconfPhase"
119+ ++ lib.optional (ghc-patches != []) "autoreconfPhase"
120120 ++ [ "configurePhase" "installPhase" ];
121121 installPhase = "cp -r . $out";
122122})
compiler/ghc/default.nix+28−28
@@ -3,7 +3,7 @@
33# haskell.nix ships its own version of the ghc expression as it needs more
44# control over the expression to isolate it against varying <nixpkgs> and
55# allow us to customize it to the way haskell.nix works.
6−{ stdenv, haskell-nix, targetPackages
6+{ stdenv, lib, haskell-nix, targetPackages
77
88# build-tools
99, bootPkgs
@@ -26,7 +26,7 @@
2626
2727, # If enabled, GHC will be built with the GPL-free but slower integer-simple
2828 # library instead of the faster but GPLed integer-gmp library.
29− enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
29+ enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
3030
3131, # If enabled, use -fPIC when compiling static libs.
3232 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform && !stdenv.targetPlatform.isAarch32
@@ -42,7 +42,7 @@
4242
4343, # What flavour to build. An empty string indicates no
4444 # specific flavour and falls back to ghc default values.
45− ghcFlavour ? stdenv.lib.optionalString haskell-nix.haskellLib.isCrossTarget (
45+ ghcFlavour ? lib.optionalString haskell-nix.haskellLib.isCrossTarget (
4646 if useLLVM
4747 then "perf-cross"
4848 else "perf-cross-ncg"
@@ -82,7 +82,7 @@ let
8282 targetGmp = targetPackages.gmp or gmp;
8383
8484 # TODO(@Ericson2314) Make unconditional
85− targetPrefix = stdenv.lib.optionalString
85+ targetPrefix = lib.optionalString
8686 (targetPlatform != hostPlatform)
8787 "${targetPlatform.config}-";
8888
@@ -93,52 +93,52 @@ let
9393 endif
9494 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
9595 INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
96− '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
96+ '' + lib.optionalString (targetPlatform != hostPlatform) ''
9797 CrossCompilePrefix = ${targetPrefix}
98− '' + stdenv.lib.optionalString isCrossTarget ''
98+ '' + lib.optionalString isCrossTarget ''
9999 Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
100100 HADDOCK_DOCS = NO
101101 BUILD_SPHINX_HTML = NO
102102 BUILD_SPHINX_PDF = NO
103− '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
103+ '' + lib.optionalString enableRelocatedStaticLibs ''
104104 GhcLibHcOpts += -fPIC
105105 GhcRtsHcOpts += -fPIC
106− '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
106+ '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
107107 EXTRA_CC_OPTS += -std=gnu99
108− '' + stdenv.lib.optionalString (!enableTerminfo) ''
108+ '' + lib.optionalString (!enableTerminfo) ''
109109 WITH_TERMINFO=NO
110110 ''
111111 # musl doesn't have a system-linker. Only on x86, and on x86 we need it, as
112112 # our elf linker for x86_64 is broken.
113− + stdenv.lib.optionalString (targetPlatform.isMusl && !targetPlatform.isx86) ''
113+ + lib.optionalString (targetPlatform.isMusl && !targetPlatform.isx86) ''
114114 compiler_CONFIGURE_OPTS += --flags=-dynamic-system-linker
115115 ''
116116 # While split sections are now enabled by default in ghc 8.8 for windows,
117117 # the seem to lead to `too many sections` errors when building base for
118118 # profiling.
119− + stdenv.lib.optionalString targetPlatform.isWindows ''
119+ + lib.optionalString targetPlatform.isWindows ''
120120 SplitSections = NO
121− '' + stdenv.lib.optionalString (!enableLibraryProfiling) ''
121+ '' + lib.optionalString (!enableLibraryProfiling) ''
122122 BUILD_PROF_LIBS = NO
123123 '';
124124
125125 # Splicer will pull out correct variations
126− libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
126+ libDeps = platform: lib.optional enableTerminfo [ ncurses ]
127127 ++ [targetLibffi]
128− ++ stdenv.lib.optional (!enableIntegerSimple) gmp
129− ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv
130− ++ stdenv.lib.optional (platform.isLinux && !platform.isAarch32) numactl;
128+ ++ lib.optional (!enableIntegerSimple) gmp
129+ ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv
130+ ++ lib.optional (platform.isLinux && !platform.isAarch32) numactl;
131131
132132 toolsForTarget =
133133 if hostPlatform == buildPlatform then
134− [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm
134+ [ targetPackages.stdenv.cc ] ++ lib.optional useLLVM llvmPackages.llvm
135135 else assert targetPlatform == hostPlatform; # build != host == target
136− [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
136+ [ stdenv.cc ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
137137
138138 targetCC = builtins.head toolsForTarget;
139139
140140 configured-src = import ./configured-src.nix {
141− inherit stdenv fetchurl
141+ inherit stdenv lib fetchurl
142142 ghc-version ghc-version-date ghc-patches src-spec
143143 targetPrefix
144144 targetPlatform hostPlatform
@@ -212,7 +212,7 @@ stdenv.mkDerivation (rec {
212212 nativeBuildInputs = [
213213 perl autoconf automake m4 python3 sphinx
214214 ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
215− ] ++ stdenv.lib.optional (patches != []) autoreconfHook;
215+ ] ++ lib.optional (patches != []) autoreconfHook;
216216
217217 # For building runtime libs
218218 depsBuildTarget = toolsForTarget;
@@ -220,14 +220,14 @@ stdenv.mkDerivation (rec {
220220 buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
221221
222222 propagatedBuildInputs = [ targetPackages.stdenv.cc ]
223− ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
223+ ++ lib.optional useLLVM llvmPackages.llvm;
224224
225− depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
226− depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
225+ depsTargetTarget = map lib.getDev (libDeps targetPlatform);
226+ depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
227227
228228 # required, because otherwise all symbols from HSffi.o are stripped, and
229229 # that in turn causes GHCi to abort
230− stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
230+ stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
231231
232232 # See #63511 - the only unstripped file is the debug rts which isn't meant to
233233 # be stripped.
@@ -236,8 +236,8 @@ stdenv.mkDerivation (rec {
236236 checkTarget = "test";
237237
238238 hardeningDisable = [ "format" ]
239− ++ stdenv.lib.optional stdenv.targetPlatform.isAarch32 "pic"
240− ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
239+ ++ lib.optional stdenv.targetPlatform.isAarch32 "pic"
240+ ++ lib.optional stdenv.targetPlatform.isMusl "pie";
241241
242242 postInstall = ''
243243 # Install the bash completion file.
@@ -250,7 +250,7 @@ stdenv.mkDerivation (rec {
250250 # The ghcprog fixup is for musl (where runhaskell script just needs to point to the correct
251251 # ghc program to work).
252252 sed -i \
253− -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' \
253+ -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' \
254254 -e 's/ghcprog="ghc-/ghcprog="${targetPrefix}ghc-/' \
255255 $i
256256 done
@@ -324,7 +324,7 @@ stdenv.mkDerivation (rec {
324324 inherit (ghc.meta) license platforms;
325325 };
326326
327−} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
327+} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
328328 dontStrip = true;
329329 dontPatchELF = true;
330330 noAuditTmpdir = true;
compiler/old-ghc-nix/default.nixdeleted−10
@@ -1,10 +0,0 @@
1−{ pkgs ? import <nixpkgs> {} }:
2−let
3− fetch = jsonFile:
4− with builtins;
5− let spec = fromJSON (readFile jsonFile);
6− in pkgs.fetchgit {
7− name = "old-ghc-nix";
8− inherit (spec) sha256 url rev;
9− };
10−in import (fetch ./old-ghc-nix.json) { inherit pkgs; }
compiler/old-ghc-nix/old-ghc-nix.jsondeleted−7
@@ -1,7 +0,0 @@
1−{
2− "url": "https://github.com/angerman/old-ghc-nix",
3− "rev": "2a41a09127f6dc7a6384823d1acd51ba257f95bd",
4− "date": "2020-06-03T12:50:09+08:00",
5− "sha256": "1cp6aksb6ldgjb5zyqikyjrjij79n9z7wd86migph0wp19vmszkf",
6− "fetchSubmodules": false
7−}
docs/tutorials/cross-compilation.md+1−1
@@ -90,7 +90,7 @@ executables you must add package overrides to:
9090```nix
9191{
9292 packages.bench.components.exes.bench.configureFlags =
93− stdenv.lib.optionals stdenv.hostPlatform.isMusl [
93+ lib.optionals stdenv.hostPlatform.isMusl [
9494 "--disable-executable-dynamic"
9595 "--disable-shared"
9696 "--ghc-option=-optl=-pthread"
nix/sources.json+14
@@ -119,6 +119,7 @@
119119 },
120120 "nixpkgs-unstable": {
121121 "branch": "nixpkgs-unstable",
122+ "builtin": false,
122123 "description": "Nix Packages collection",
123124 "homepage": "",
124125 "owner": "NixOS",
@@ -128,5 +129,18 @@
128129 "type": "tarball",
129130 "url": "https://github.com/NixOS/nixpkgs/archive/410bbd828cdc6156aecd5bc91772ad3a6b1099c7.tar.gz",
130131 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
132+ },
133+ "old-ghc-nix": {
134+ "branch": "master",
135+ "builtin": false,
136+ "description": "Old and New GHC",
137+ "homepage": null,
138+ "owner": "angerman",
139+ "repo": "old-ghc-nix",
140+ "rev": "131ce9ae27d7b7afdd1d3ce8c3a74483e60b91bb",
141+ "sha256": "0n62qr7hrqmy6h80736ji47ln759sk845g43f9cprpmcs9m4wl9i",
142+ "type": "tarball",
143+ "url": "https://github.com/angerman/old-ghc-nix/archive/131ce9ae27d7b7afdd1d3ce8c3a74483e60b91bb.tar.gz",
144+ "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
131145 }
132146}
nix/sources.nix+86−46
@@ -6,52 +6,63 @@ let
66 # The fetchers. fetch_<type> fetches specs of type <type>.
77 #
88
9− fetch_file = pkgs: spec:
10− if spec.builtin or true then
11− builtins_fetchurl { inherit (spec) url sha256; }
12− else
13− pkgs.fetchurl { inherit (spec) url sha256; };
14−
15− fetch_tarball = pkgs: spec:
16− if spec.builtin or true then
17− builtins_fetchTarball { inherit (spec) url sha256; }
18− else
19− pkgs.fetchzip { inherit (spec) url sha256; };
9+ fetch_file = pkgs: name: spec:
10+ let
11+ name' = sanitizeName name + "-src";
12+ in
13+ if spec.builtin or true then
14+ builtins_fetchurl { inherit (spec) url sha256; name = name'; }
15+ else
16+ pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
2017
21− fetch_git = pkgs: spec:
22− pkgs.fetchgit { url = spec.repo; inherit (spec) rev deepClone sha256; };
18+ fetch_tarball = pkgs: name: spec:
19+ let
20+ name' = sanitizeName name + "-src";
21+ in
22+ if spec.builtin or true then
23+ builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
24+ else
25+ pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
2326
24− fetch_builtin-tarball = spec:
25− builtins.trace
26− ''
27− WARNING:
28− The niv type "builtin-tarball" will soon be deprecated. You should
29− instead use `builtin = true`.
27+ fetch_git = name: spec:
28+ let
29+ ref =
30+ if spec ? ref then spec.ref else
31+ if spec ? branch then "refs/heads/${spec.branch}" else
32+ if spec ? tag then "refs/tags/${spec.tag}" else
33+ abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
34+ in
35+ builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
3036
31− $ niv modify <package> -a type=tarball -a builtin=true
32− ''
33− builtins_fetchTarball { inherit (spec) url sha256; };
37+ fetch_local = spec: spec.path;
3438
35− fetch_builtin-url = spec:
36− builtins.trace
37− ''
38− WARNING:
39− The niv type "builtin-url" will soon be deprecated. You should
40− instead use `builtin = true`.
39+ fetch_builtin-tarball = name: throw
40+ ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
41+ $ niv modify ${name} -a type=tarball -a builtin=true'';
4142
42− $ niv modify <package> -a type=file -a builtin=true
43− ''
44− (builtins_fetchurl { inherit (spec) url sha256; });
43+ fetch_builtin-url = name: throw
44+ ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
45+ $ niv modify ${name} -a type=file -a builtin=true'';
4546
4647 #
4748 # Various helpers
4849 #
4950
51+ # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
52+ sanitizeName = name:
53+ (
54+ concatMapStrings (s: if builtins.isList s then "-" else s)
55+ (
56+ builtins.split "[^[:alnum:]+._?=-]+"
57+ ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
58+ )
59+ );
60+
5061 # The set of packages used when specs are fetched using non-builtins.
51− mkPkgs = sources:
62+ mkPkgs = sources: system:
5263 let
5364 sourcesNixpkgs =
54− import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {};
65+ import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
5566 hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
5667 hasThisAsNixpkgsPath = <nixpkgs> == ./.;
5768 in
@@ -71,14 +82,27 @@ let
7182
7283 if ! builtins.hasAttr "type" spec then
7384 abort "ERROR: niv spec ${name} does not have a 'type' attribute"
74− else if spec.type == "file" then fetch_file pkgs spec
75− else if spec.type == "tarball" then fetch_tarball pkgs spec
76− else if spec.type == "git" then fetch_git pkgs spec
77− else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec
78− else if spec.type == "builtin-url" then fetch_builtin-url spec
85+ else if spec.type == "file" then fetch_file pkgs name spec
86+ else if spec.type == "tarball" then fetch_tarball pkgs name spec
87+ else if spec.type == "git" then fetch_git name spec
88+ else if spec.type == "local" then fetch_local spec
89+ else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
90+ else if spec.type == "builtin-url" then fetch_builtin-url name
7991 else
8092 abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
8193
94+ # If the environment variable NIV_OVERRIDE_${name} is set, then use
95+ # the path directly as opposed to the fetched source.
96+ replace = name: drv:
97+ let
98+ saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
99+ ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
100+ in
101+ if ersatz == "" then drv else
102+ # this turns the string into an actual Nix path (for both absolute and
103+ # relative paths)
104+ if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
105+
82106 # Ports of functions for older nix versions
83107
84108 # a Nix version of mapAttrs if the built-in doesn't exist
@@ -87,23 +111,37 @@ let
87111 listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
88112 );
89113
114+ # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
115+ range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
116+
117+ # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
118+ stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
119+
120+ # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
121+ stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
122+ concatMapStrings = f: list: concatStrings (map f list);
123+ concatStrings = builtins.concatStringsSep "";
124+
125+ # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
126+ optionalAttrs = cond: as: if cond then as else {};
127+
90128 # fetchTarball version that is compatible between all the versions of Nix
91− builtins_fetchTarball = { url, sha256 }@attrs:
129+ builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
92130 let
93131 inherit (builtins) lessThan nixVersion fetchTarball;
94132 in
95133 if lessThan nixVersion "1.12" then
96− fetchTarball { inherit url; }
134+ fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
97135 else
98136 fetchTarball attrs;
99137
100138 # fetchurl version that is compatible between all the versions of Nix
101− builtins_fetchurl = { url, sha256 }@attrs:
139+ builtins_fetchurl = { url, name ? null, sha256 }@attrs:
102140 let
103141 inherit (builtins) lessThan nixVersion fetchurl;
104142 in
105143 if lessThan nixVersion "1.12" then
106− fetchurl { inherit url; }
144+ fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
107145 else
108146 fetchurl attrs;
109147
@@ -115,14 +153,15 @@ let
115153 then abort
116154 "The values in sources.json should not have an 'outPath' attribute"
117155 else
118− spec // { outPath = fetch config.pkgs name spec; }
156+ spec // { outPath = replace name (fetch config.pkgs name spec); }
119157 ) config.sources;
120158
121159 # The "config" used by the fetchers
122160 mkConfig =
123− { sourcesFile ? ./sources.json
124− , sources ? builtins.fromJSON (builtins.readFile sourcesFile)
125− , pkgs ? mkPkgs sources
161+ { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
162+ , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
163+ , system ? builtins.currentSystem
164+ , pkgs ? mkPkgs sources system
126165 }: rec {
127166 # The sources, i.e. the attribute set of spec name to spec
128167 inherit sources;
@@ -130,5 +169,6 @@ let
130169 # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
131170 inherit pkgs;
132171 };
172+
133173in
134174mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
overlays/armv6l-linux.nix+7−7
@@ -34,16 +34,16 @@ final: prev:
3434 in {
3535 packages = {
3636 # clock 0.7.2 needs to be patched to support cross compilation.
37− clock.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isAarch32 [ ({ version, revision }: (if version == "0.7.2" then ./patches/clock-0.7.2.patch else null)) ];
37+ clock.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isAarch32 [ ({ version, revision }: (if version == "0.7.2" then ./patches/clock-0.7.2.patch else null)) ];
3838 # nix calls this package crypto
39− # cryptonite-openssl.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.7" then ./patches/cryptonite-openssl-0.7.patch else null) ];
39+ # cryptonite-openssl.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.7" then ./patches/cryptonite-openssl-0.7.patch else null) ];
4040
41− # http-client.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.5.14" then ./patches/http-client-0.5.14.patch else null) ];
41+ # http-client.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.5.14" then ./patches/http-client-0.5.14.patch else null) ];
4242
43− # conduit.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if builtins.compareVersions version "1.3.1.1" < 0 then ./patches/conduit-1.3.0.2.patch else null) ];
44− # streaming-commons.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/streaming-commons-0.2.0.0.patch ];
45− # x509-system.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/x509-system-1.6.6.patch ];
46− # file-embed-lzma.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/file-embed-lzma-0.patch ];
43+ # conduit.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if builtins.compareVersions version "1.3.1.1" < 0 then ./patches/conduit-1.3.0.2.patch else null) ];
44+ # streaming-commons.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/streaming-commons-0.2.0.0.patch ];
45+ # x509-system.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/x509-system-1.6.6.patch ];
46+ # file-embed-lzma.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/file-embed-lzma-0.patch ];
4747
4848 # Set all of these to [], as these form the
4949 # dependency graph of the libiserv, iserv-proxy, and iserv-remote
overlays/bootstrap.nix+1−1
@@ -735,7 +735,7 @@ in {
735735 isHaskellNixBootCompiler = true;
736736 }
737737 )
738− (import ../compiler/old-ghc-nix { pkgs = final; });
738+ (import sources.old-ghc-nix { pkgs = final; });
739739
740740 packages = {
741741 # now that we have nix-tools and hpack, we can just
overlays/emscripten/binaryen.nix+3−3
@@ -1,4 +1,4 @@
1−{ stdenv, cmake, python3, fetchFromGitHub, emscriptenRev ? null, substituteAll }:
1+{ stdenv, lib, cmake, python3, fetchFromGitHub, emscriptenRev ? null, substituteAll }:
22
33let
44 defaultVersion = "93";
@@ -29,14 +29,14 @@ stdenv.mkDerivation rec {
2929 inherit rev;
3030 };
3131
32− patches = stdenv.lib.optional (emscriptenRev != null) (substituteAll {
32+ patches = lib.optional (emscriptenRev != null) (substituteAll {
3333 src = ./0001-Get-rid-of-git-dependency.patch;
3434 emscriptenv = "1.39.1";
3535 });
3636
3737 nativeBuildInputs = [ cmake python3 ];
3838
39− meta = with stdenv.lib; {
39+ meta = with lib; {
4040 homepage = "https://github.com/WebAssembly/binaryen";
4141 description = "Compiler infrastructure and toolchain library for WebAssembly, in C++";
4242 platforms = platforms.all;
overlays/emscripten/default.nix+3−3
@@ -1,4 +1,4 @@
1−{ emscriptenVersion, stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler
1+{ emscriptenVersion, stdenv, lib, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler
22, jre, binaryen, enableWasm ? true , cmake, emscriptenBackend ? emscriptenfastcomp
33}:
44
@@ -45,7 +45,7 @@ stdenv.mkDerivation {
4545 echo "SPIDERMONKEY_ENGINE = []" >> $out/${appdir}/config
4646 echo "EMCC_FAST_COMPILER = 0" >> $out/${appdir}/config
4747 ''
48− + stdenv.lib.optionalString enableWasm ''
48+ + lib.optionalString enableWasm ''
4949 echo "BINARYEN_ROOT = '${binaryenVersioned}'" >> $out/share/emscripten/config
5050 ''
5151 +
@@ -61,7 +61,7 @@ stdenv.mkDerivation {
6161 echo "--------------- /running test -----------------"
6262 '';
6363
64− meta = with stdenv.lib; {
64+ meta = with lib; {
6565 homepage = "https://github.com/emscripten-core/emscripten";
6666 description = "An LLVM-to-JavaScript Compiler";
6767 platforms = platforms.all;
overlays/emscripten/fastcomp/default.nix+2−2
@@ -1,4 +1,4 @@
1−{ newScope, stdenv, binutils, wrapCCWith, symlinkJoin }:
1+{ newScope, stdenv, lib, binutils, wrapCCWith, symlinkJoin }:
22let
33 callPackage = newScope (self // {inherit stdenv;});
44
@@ -15,7 +15,7 @@ let
1515 '';
1616 };
1717 emscriptenfastcomp = symlinkJoin {
18− name = "emscriptenfastcomp-${stdenv.lib.getVersion self.emscriptenfastcomp-unwrapped}";
18+ name = "emscriptenfastcomp-${lib.getVersion self.emscriptenfastcomp-unwrapped}";
1919 paths = [ self.emscriptenfastcomp-wrapped self.emscriptenfastcomp-unwrapped ];
2020 preferLocalBuild = false;
2121 allowSubstitutes = true;
overlays/emscripten/fastcomp/emscripten-fastcomp.nix+4−4
@@ -1,4 +1,4 @@
1−{ emscriptenVersion, stdenv, fetchFromGitHub, cmake, python, gtest, ... }:
1+{ emscriptenVersion, stdenv, lib, fetchFromGitHub, cmake, python, gtest, ... }:
22
33let
44 rev = emscriptenVersion;
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
3434 #"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
3535 "-DLLVM_BUILD_TESTS=ON"
3636 "-DCLANG_INCLUDE_TESTS=ON"
37− ] ++ (stdenv.lib.optional stdenv.isLinux
37+ ] ++ (lib.optional stdenv.isLinux
3838 # necessary for clang to find crtend.o
3939 "-DGCC_INSTALL_PREFIX=${gcc}"
4040 );
@@ -45,11 +45,11 @@ stdenv.mkDerivation rec {
4545 inherit gcc;
4646 };
4747
48− meta = with stdenv.lib; {
48+ meta = with lib; {
4949 homepage = "https://github.com/emscripten-core/emscripten-fastcomp";
5050 description = "Emscripten LLVM";
5151 platforms = platforms.all;
5252 maintainers = with maintainers; [ qknight matthewbauer ];
53− license = stdenv.lib.licenses.ncsa;
53+ license = lib.licenses.ncsa;
5454 };
5555}
overlays/emscripten/upstream/default.nix+2−2
@@ -1,4 +1,4 @@
1−{ newScope, stdenv, binutils, wrapCCWith, symlinkJoin }:
1+{ newScope, stdenv, lib, binutils, wrapCCWith, symlinkJoin }:
22let
33 callPackage = newScope (self // {inherit stdenv;});
44
@@ -15,7 +15,7 @@ let
1515 '';
1616 };
1717 emscriptenupstream = symlinkJoin {
18− name = "emscriptenupstream-${stdenv.lib.getVersion self.emscriptenupstream-unwrapped}";
18+ name = "emscriptenupstream-${lib.getVersion self.emscriptenupstream-unwrapped}";
1919 paths = [ self.emscriptenupstream-wrapped self.emscriptenupstream-unwrapped ];
2020 preferLocalBuild = false;
2121 allowSubstitutes = true;
overlays/emscripten/upstream/emscripten-upstream.nix+4−4
@@ -1,4 +1,4 @@
1−{ emscriptenVersion, stdenv, fetchFromGitHub, cmake, python, gtest, ... }:
1+{ emscriptenVersion, stdenv, lib, fetchFromGitHub, cmake, python, gtest, ... }:
22
33let
44 gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
3939 #"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
4040 "-DLLVM_BUILD_TESTS=ON"
4141 "-DCLANG_INCLUDE_TESTS=OFF"
42− ] ++ (stdenv.lib.optional stdenv.isLinux
42+ ] ++ (lib.optional stdenv.isLinux
4343 # necessary for clang to find crtend.o
4444 "-DGCC_INSTALL_PREFIX=${gcc}"
4545 );
@@ -50,11 +50,11 @@ stdenv.mkDerivation rec {
5050 inherit gcc;
5151 };
5252
53− meta = with stdenv.lib; {
53+ meta = with lib; {
5454 homepage = "http://github.com/llvm/llvm-project";
5555 description = "LLVM";
5656 platforms = platforms.all;
5757 maintainers = with maintainers; [ ];
58− license = stdenv.lib.licenses.ncsa;
58+ license = lib.licenses.ncsa;
5959 };
6060}
overlays/haskell.nix+1−1
@@ -266,7 +266,7 @@ final: prev: {
266266
267267 update-index-state-hashes = import ../scripts/update-index-state-hashes.nix {
268268 inherit (final.haskell-nix) indexStateHashesPath;
269− inherit (final) coreutils nix writeShellScriptBin stdenv curl;
269+ inherit (final) coreutils nix writeShellScriptBin stdenv lib curl;
270270 # Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
271271 nix-tools = final.haskell-nix.internal-nix-tools;
272272 };
overlays/windows.nix+10−10
@@ -17,11 +17,11 @@ final: prev:
1717 # });
1818
1919 mfpr = prev.mfpr.overrideAttrs (drv: {
20− configureFlags = (drv.configureFlags or []) ++ prev.stdenv.lib.optional prev.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
20+ configureFlags = (drv.configureFlags or []) ++ prev.lib.optional prev.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
2121 });
2222
2323 libmpc = prev.libmpc.overrideAttrs (drv: {
24− configureFlags = (drv.configureFlags or []) ++ prev.stdenv.lib.optional prev.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
24+ configureFlags = (drv.configureFlags or []) ++ prev.lib.optional prev.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
2525 });
2626
2727 binutils-unwrapped = prev.binutils-unwrapped.overrideAttrs (attrs: {
@@ -72,7 +72,7 @@ final: prev:
7272 # figuring out which libraries we need for the build (walking the
7373 # dependencies) and then placing them somewhere where wine+remote-iserv
7474 # will find them.
75− remote-iserv.postInstall = pkgs.stdenv.lib.optionalString pkgs.stdenv.hostPlatform.isWindows (
75+ remote-iserv.postInstall = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isWindows (
7676 let extra-libs = [ pkgs.openssl.bin pkgs.libffi pkgs.gmp pkgs.libsodium ]; in ''
7777 for p in ${lib.concatStringsSep " "extra-libs}; do
7878 find "$p" -iname '*.dll' -exec cp {} $out/bin/ \;
@@ -91,20 +91,20 @@ final: prev:
9191 # else null)) ];
9292
9393 # clock 0.7.2 needs to be patched to support cross compilation.
94− clock.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: (if version == "0.7.2" then ./patches/clock-0.7.2.patch else null)) ];
94+ clock.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: (if version == "0.7.2" then ./patches/clock-0.7.2.patch else null)) ];
9595 # nix calls this package crypto
96− cryptonite-openssl.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.7" then ./patches/cryptonite-openssl-0.7.patch else null) ];
96+ cryptonite-openssl.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.7" then ./patches/cryptonite-openssl-0.7.patch else null) ];
9797
9898 # this patch seems to be rather flaky and highly dependent on
9999 # the network library. I think we might need to respin that in
100100 # a better way that doesn't just delete some code, but makes
101101 # the bounds checks stricter.
102− # http-client.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.5.14" then ./patches/http-client-0.5.14.patch else null) ];
102+ # http-client.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.5.14" then ./patches/http-client-0.5.14.patch else null) ];
103103
104− conduit.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if builtins.compareVersions version "1.3.1.1" < 0 then ./patches/conduit-1.3.0.2.patch else null) ];
105− streaming-commons.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/streaming-commons-0.2.0.0.patch ];
106− x509-system.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/x509-system-1.6.6.patch ];
107− file-embed-lzma.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/file-embed-lzma-0.patch ];
104+ conduit.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if builtins.compareVersions version "1.3.1.1" < 0 then ./patches/conduit-1.3.0.2.patch else null) ];
105+ streaming-commons.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/streaming-commons-0.2.0.0.patch ];
106+ x509-system.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/x509-system-1.6.6.patch ];
107+ file-embed-lzma.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/file-embed-lzma-0.patch ];
108108
109109 # Set all of these to [], as these form the
110110 # dependency graph of the libiserv, iserv-proxy, and iserv-remote
scripts/check-closure-size.nix+2−2
@@ -1,9 +1,9 @@
1−{ stdenv, writeScript, coreutils, gawk, nix
1+{ stdenv, lib, writeScript, coreutils, gawk, nix
22, nix-tools
33, limitMB ? 525
44}:
55
6−with stdenv.lib;
6+with lib;
77
88writeScript "check-closure-size.sh" ''
99 #!${stdenv.shell}
scripts/check-hydra.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, writeScript, coreutils, time, gnutar, gzip, hydra-migration, jq }:
1+{ stdenv, lib, writeScript, coreutils, time, gnutar, gzip, hydra-migration, jq }:
22
3−with stdenv.lib;
3+with lib;
44
55writeScript "check-hydra.sh" ''
66 #!${stdenv.shell}
scripts/check-materialization-concurrency/check.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, writeScript }:
1+{ stdenv, lib, writeScript }:
22
3−with stdenv.lib;
3+with lib;
44
55writeScript "check-materialization-concurrency.sh" ''
66 #!${stdenv.shell}
scripts/check-path-support.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, writeScript, coreutils, gnutar, gzip, nix }:
1+{ stdenv, lib, writeScript, coreutils, gnutar, gzip, nix }:
22
3−with stdenv.lib;
3+with lib;
44
55writeScript "check-path-supprot.sh" ''
66 #!${stdenv.shell}
scripts/update-docs.nix+2−2
@@ -1,7 +1,7 @@
1−{ stdenv, writeScript, coreutils, glibc, git, openssh, gnused, mkdocs
1+{ stdenv, lib, writeScript, coreutils, glibc, git, openssh, gnused, mkdocs
22, generatedOptions }:
33
4−with stdenv.lib;
4+with lib;
55
66let
77 repo = "git@github.com:input-output-hk/haskell.nix.git";
scripts/update-external.nix+2−2
@@ -1,10 +1,10 @@
1−{ stdenv, writeScript, glibc, coreutils, git, openssh
1+{ stdenv, lib, writeScript, glibc, coreutils, git, openssh
22, nix-tools, cabal-install, nix-prefetch-git
33, bash, curl, findutils, gawk }:
44
55{ name, script }:
66
7−with stdenv.lib;
7+with lib;
88
99let
1010 repoHTTPS = "https://github.com/input-output-hk/${name}.nix";
scripts/update-hackage.nix+1−1
@@ -1,4 +1,4 @@
1−{ stdenv, writeScript, coreutils, glibc, git, openssh
1+{ stdenv, lib, writeScript, coreutils, glibc, git, openssh
22, nix-tools, cabal-install, nix-prefetch-git
33, gawk, bash, curl, findutils
44, update-index-state-hashes }@args:
scripts/update-index-state-hashes.nix+2−2
@@ -1,6 +1,6 @@
1−{ indexStateHashesPath, nix-tools, coreutils, nix, writeShellScriptBin, stdenv, curl }:
1+{ indexStateHashesPath, nix-tools, coreutils, nix, writeShellScriptBin, stdenv, lib, curl }:
22with builtins;
3−with stdenv.lib;
3+with lib;
44writeShellScriptBin "update-index-state-hashes" ''
55 export PATH="${makeBinPath [ coreutils nix-tools nix curl ]}"
66
scripts/update-pins.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, writeScript, coreutils, glibc, git, openssh }@args:
1+{ stdenv, lib, writeScript, coreutils, glibc, git, openssh }@args:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 repo = "git@github.com:input-output-hk/haskell.nix.git";
scripts/update-stackage.nix+1−1
@@ -1,4 +1,4 @@
1−{ stdenv, writeScript, coreutils, glibc, git, openssh
1+{ stdenv, lib, writeScript, coreutils, glibc, git, openssh
22, nix-tools, cabal-install, nix-prefetch-git
33, gawk, bash, curl, findutils }@args:
44
test/buildable/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
1+{ stdenv, lib, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 project = cabalProject' {
test/builder-haddock/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ mkCabalProjectPkgSet, stdenv, testSrc }:
1+{ mkCabalProjectPkgSet, stdenv, lib, testSrc }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 pkgSet = mkCabalProjectPkgSet {
test/cabal-22/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, mkCabalProjectPkgSet, cabalProject', haskellLib, util, recurseIntoAttrs, testSrc, compiler-nix-name }:
1+{ stdenv, lib, mkCabalProjectPkgSet, cabalProject', haskellLib, util, recurseIntoAttrs, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 project = cabalProject' {
test/cabal-hpack/default.nix+2−2
@@ -1,7 +1,7 @@
11# Test a package set
2−{ stdenv, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
2+{ stdenv, lib, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
33
4−with stdenv.lib;
4+with lib;
55
66let
77 modules = [
test/cabal-simple-prof/default.nix+2−2
@@ -1,7 +1,7 @@
11# Test a package set
2−{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
2+{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
33
4−with stdenv.lib;
4+with lib;
55
66let
77 modules = [
test/cabal-simple/default.nix+2−2
@@ -1,7 +1,7 @@
11# Test a package set
2−{ stdenv, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
2+{ stdenv, lib, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
33
4−with stdenv.lib;
4+with lib;
55
66let
77 modules = [
test/cabal-source-repo-comments/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
1+{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 project = cabalProject' {
test/cabal-source-repo/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
1+{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 project = cabalProject' {
test/cabal-sublib/default.nix+2−2
@@ -1,7 +1,7 @@
11# Test a package set
2−{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
2+{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
33
4−with stdenv.lib;
4+with lib;
55
66let
77 modules = [
test/call-cabal-project-to-nix/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, mkCabalProjectPkgSet, callCabalProjectToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
1+{ stdenv, lib, mkCabalProjectPkgSet, callCabalProjectToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 # This test could use cabalProject', but it does so that it
test/call-stack-to-nix/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, mkStackPkgSet, callStackToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc }:
1+{ stdenv, lib, mkStackPkgSet, callStackToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 callProjectResults = callStackToNix {
test/compiler-nix-name/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, haskell-nix, recurseIntoAttrs, testSrc }:
1+{ stdenv, lib, haskell-nix, recurseIntoAttrs, testSrc }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 project = haskell-nix.cabalProject' {
test/coverage-golden/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, fetchFromGitHub, recurseIntoAttrs, runCommand, testSrc, compiler-nix-name, buildPackages, sources }:
1+{ stdenv, lib, fetchFromGitHub, recurseIntoAttrs, runCommand, testSrc, compiler-nix-name, buildPackages, sources }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 # Using buildPackages.buildPackages here because buildPackages.git
test/coverage-no-libs/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, cabal-install, cabalProject', stackProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
1+{ stdenv, lib, cabal-install, cabalProject', stackProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 projectArgs = {
test/coverage/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, cabal-install, cabalProject', stackProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
1+{ stdenv, lib, cabal-install, cabalProject', stackProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 projectArgs = {
test/exe-only/default.nix+2−2
@@ -1,7 +1,7 @@
11# Test a package set
2−{ stdenv, util, haskell-nix, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
2+{ stdenv, lib, util, haskell-nix, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
33
4−with stdenv.lib;
4+with lib;
55
66let
77 project = haskell-nix.cabalProject' {
test/extra-hackage/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
1+{ stdenv, lib, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66
test/fully-static/default.nix+2−2
@@ -1,11 +1,11 @@
11{ stackProject'
2−, stdenv, gmp6, openssl, zlib, libffi
2+, stdenv, lib, gmp6, openssl, zlib, libffi
33, buildPackages
44, recurseIntoAttrs
55, testSrc
66}:
77
8−with stdenv.lib;
8+with lib;
99
1010let
1111 # Grab the compiler name from stack-to-nix output.
test/ghc-options/cabal.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
1+{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 project = cabalProject' {
test/ghc-options/stack.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, stackProject', recurseIntoAttrs, haskellLib, testSrc }:
1+{ stdenv, lib, stackProject', recurseIntoAttrs, haskellLib, testSrc }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 project = stackProject' {
test/githash/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, haskell-nix, recurseIntoAttrs, testSrc, compiler-nix-name, runCommand, gitMinimal, buildPackages }:
1+{ stdenv, lib, haskell-nix, recurseIntoAttrs, testSrc, compiler-nix-name, runCommand, gitMinimal, buildPackages }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 src = testSrc "githash";
test/index-state/default.nix+2−2
@@ -1,7 +1,7 @@
11# Test a package set
2−{ stdenv, testSrc, tool, compiler-nix-name }:
2+{ stdenv, lib, testSrc, tool, compiler-nix-name }:
33
4−with stdenv.lib;
4+with lib;
55
66let
77 # The hackage-security 0.6.0.1 was uploaded at 2020-04-06T20:54:35Z
test/project-flags/cabal.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
1+{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 project = cabalProject' {
test/project-flags/stack.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, stackProject', recurseIntoAttrs, haskellLib, testSrc }:
1+{ stdenv, lib, stackProject', recurseIntoAttrs, haskellLib, testSrc }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 project = stackProject' {
test/setup-deps/default.nix+1−1
@@ -1,7 +1,7 @@
11{ pkgs, compiler-nix-name }:
22
33with pkgs;
4−with stdenv.lib;
4+with lib;
55
66let
77 project = haskell-nix.cabalProject' {
test/shell-for-setup-deps/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, cabal-install, cabalProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
1+{ stdenv, lib, cabal-install, cabalProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 project = cabalProject' {
test/shell-for/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, cabal-install, mkCabalProjectPkgSet, recurseIntoAttrs, runCommand, testSrc }:
1+{ stdenv, lib, cabal-install, mkCabalProjectPkgSet, recurseIntoAttrs, runCommand, testSrc }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 pkgSet = mkCabalProjectPkgSet {
test/snapshots/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, haskellPackages, snapshots, recurseIntoAttrs, runCommand, testSrc }:
1+{ stdenv, lib, haskellPackages, snapshots, recurseIntoAttrs, runCommand, testSrc }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 env = snapshots."lts-14.13".ghcWithHoogle
test/stack-simple/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, pkgs, mkStackPkgSet, haskellLib, testSrc }:
1+{ stdenv, lib, pkgs, mkStackPkgSet, haskellLib, testSrc }:
22
3−with stdenv.lib;
3+with lib;
44
55let
66 # ./pkgs.nix and ./stack-simple.nix are generated by running
test/sublib-docs/default.nix+2−2
@@ -1,7 +1,7 @@
11# Test a package set
2−{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
2+{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
33
4−with stdenv.lib;
4+with lib;
55
66let
77 project = cabalProject' {
test/with-packages/default.nix+2−2
@@ -1,6 +1,6 @@
1−{ stdenv, util, mkPkgSet, recurseIntoAttrs, testSrc }:
1+{ stdenv, lib, util, mkPkgSet, recurseIntoAttrs, testSrc }:
22
3−with stdenv.lib;
3+with lib;
44with util;
55
66let