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
This commit is contained in:
Hamish Mackenzie 2021-02-11 01:07:16 +13:00 committed by GitHub
parent 1498e70fcb
commit 89f50a96dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 270 additions and 233 deletions

View File

@ -33,7 +33,7 @@ in rec {
# are not pure).
maintainer-scripts = pkgs.dontRecurseIntoAttrs {
update-hackage = import ./scripts/update-hackage.nix {
inherit (pkgs) stdenv writeScript coreutils glibc git
inherit (pkgs) stdenv lib writeScript coreutils glibc git
openssh nix-prefetch-git gawk bash curl findutils;
# Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
nix-tools = haskell.internal-nix-tools;
@ -41,7 +41,7 @@ in rec {
inherit (haskell) update-index-state-hashes;
};
update-stackage = haskell.callPackage ./scripts/update-stackage.nix {
inherit (pkgs) stdenv writeScript coreutils glibc git
inherit (pkgs) stdenv lib writeScript coreutils glibc git
openssh nix-prefetch-git gawk bash curl findutils;
# Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
nix-tools = haskell.internal-nix-tools;

View File

@ -296,7 +296,7 @@ let
homepage = package.homepage or "";
description = package.synopsis or "";
license = haskellLib.cabalToNixpkgsLicense package.license;
platforms = if platforms == null then stdenv.lib.platforms.all else platforms;
platforms = if platforms == null then lib.platforms.all else platforms;
};
propagatedBuildInputs =

View File

@ -56,7 +56,7 @@ let
homepage = package.homepage or "";
description = package.synopsis or "";
license = haskellLib.cabalToNixpkgsLicense package.license;
platforms = if component.platforms == null then stdenv.lib.platforms.all else component.platforms;
platforms = if component.platforms == null then lib.platforms.all else component.platforms;
};
phases = ["unpackPhase" "patchPhase" "buildPhase" "installPhase"];

View File

@ -1,4 +1,4 @@
{ fetchurl, hackage, stdenv, ghc, zlib, src, version }:
{ fetchurl, hackage, stdenv, lib, ghc, zlib, src, version }:
let dependencies =
[ { name = "deepseq"; version = "1.4.3.0"; }
{ name = "binary"; version = "0.8.5.1"; }
@ -42,7 +42,7 @@ in stdenv.mkDerivation ({
};
meta = {
platforms = stdenv.lib.platforms.all;
platforms = lib.platforms.all;
};
nativeBuildInputs = [ ghc zlib ];

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl
{ stdenv, lib, fetchurl
, ghc-version, ghc-version-date, ghc-patches, src-spec
, targetPrefix
, targetPlatform, hostPlatform
@ -25,7 +25,7 @@ stdenv.mkDerivation (rec {
nativeBuildInputs = [
perl autoconf automake m4 python3 sphinx
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
] ++ stdenv.lib.optional (patches != []) autoreconfHook;
] ++ lib.optional (patches != []) autoreconfHook;
# For building runtime libs
depsBuildTarget = toolsForTarget;
@ -33,10 +33,10 @@ stdenv.mkDerivation (rec {
buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
propagatedBuildInputs = [ targetPackages.stdenv.cc ]
++ stdenv.lib.optional useLLVM llvmPackages.llvm;
++ lib.optional useLLVM llvmPackages.llvm;
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
depsTargetTarget = map lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
postPatch = "patchShebangs .";
@ -54,7 +54,7 @@ stdenv.mkDerivation (rec {
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}"
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString targetPlatform.isAarch32 ".gold"}"
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@ -64,13 +64,13 @@ stdenv.mkDerivation (rec {
echo -n "${buildMK}" > mk/build.mk
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
'' + lib.optionalString (!stdenv.isDarwin) ''
export NIX_LDFLAGS+=" -rpath $out/lib/${targetPrefix}ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
'' + lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
'' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
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
'' + stdenv.lib.optionalString targetPlatform.isMusl ''
'' + lib.optionalString targetPlatform.isMusl ''
echo "patching llvm-targets for musl targets..."
echo "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /'
@ -86,10 +86,10 @@ stdenv.mkDerivation (rec {
--replace '*-android*|*-gnueabi*)' \
'*-android*|*-gnueabi*|*-musleabi*)'
done
'' + stdenv.lib.optionalString (src-spec.version != ghc-version) ''
'' + lib.optionalString (src-spec.version != ghc-version) ''
substituteInPlace configure --replace 'RELEASE=YES' 'RELEASE=NO'
echo '${ghc-version}' > VERSION
'' + stdenv.lib.optionalString (ghc-version-date != null) ''
'' + lib.optionalString (ghc-version-date != null) ''
substituteInPlace configure --replace 'RELEASE=YES' 'RELEASE=NO'
echo '${ghc-version-date}' > VERSION_DATE
'';
@ -99,16 +99,16 @@ stdenv.mkDerivation (rec {
configureFlags = [
"--datadir=$doc/share/doc/ghc"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optionals (targetLibffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetLibffi.dev}/include" "--with-ffi-libraries=${targetLibffi.out}/lib"
] ++ stdenv.lib.optional (!enableIntegerSimple) [
] ++ lib.optionals (targetLibffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetLibffi.dev}/include" "--with-ffi-libraries=${targetLibffi.out}/lib"
] ++ lib.optional (!enableIntegerSimple) [
"--with-gmp-includes=${targetGmp.dev}/include" "--with-gmp-libraries=${targetGmp.out}/lib"
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
] ++ lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
] ++ lib.optionals (targetPlatform != hostPlatform) [
"--enable-bootstrap-with-devel-snapshot"
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
] ++ lib.optionals (disableLargeAddressSpace) [
"--disable-large-address-space"
] ++ stdenv.lib.optionals (targetPlatform.isAarch32) [
] ++ lib.optionals (targetPlatform.isAarch32) [
"CFLAGS=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
@ -116,7 +116,7 @@ stdenv.mkDerivation (rec {
outputs = [ "out" ];
phases = [ "unpackPhase" "patchPhase" ]
++ stdenv.lib.optional (ghc-patches != []) "autoreconfPhase"
++ lib.optional (ghc-patches != []) "autoreconfPhase"
++ [ "configurePhase" "installPhase" ];
installPhase = "cp -r . $out";
})

View File

@ -3,7 +3,7 @@
# haskell.nix ships its own version of the ghc expression as it needs more
# control over the expression to isolate it against varying <nixpkgs> and
# allow us to customize it to the way haskell.nix works.
{ stdenv, haskell-nix, targetPackages
{ stdenv, lib, haskell-nix, targetPackages
# build-tools
, bootPkgs
@ -26,7 +26,7 @@
, # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform && !stdenv.targetPlatform.isAarch32
@ -42,7 +42,7 @@
, # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString haskell-nix.haskellLib.isCrossTarget (
ghcFlavour ? lib.optionalString haskell-nix.haskellLib.isCrossTarget (
if useLLVM
then "perf-cross"
else "perf-cross-ncg"
@ -82,7 +82,7 @@ let
targetGmp = targetPackages.gmp or gmp;
# TODO(@Ericson2314) Make unconditional
targetPrefix = stdenv.lib.optionalString
targetPrefix = lib.optionalString
(targetPlatform != hostPlatform)
"${targetPlatform.config}-";
@ -93,52 +93,52 @@ let
endif
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
'' + lib.optionalString (targetPlatform != hostPlatform) ''
CrossCompilePrefix = ${targetPrefix}
'' + stdenv.lib.optionalString isCrossTarget ''
'' + lib.optionalString isCrossTarget ''
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
'' + lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
'' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99
'' + stdenv.lib.optionalString (!enableTerminfo) ''
'' + lib.optionalString (!enableTerminfo) ''
WITH_TERMINFO=NO
''
# musl doesn't have a system-linker. Only on x86, and on x86 we need it, as
# our elf linker for x86_64 is broken.
+ stdenv.lib.optionalString (targetPlatform.isMusl && !targetPlatform.isx86) ''
+ lib.optionalString (targetPlatform.isMusl && !targetPlatform.isx86) ''
compiler_CONFIGURE_OPTS += --flags=-dynamic-system-linker
''
# While split sections are now enabled by default in ghc 8.8 for windows,
# the seem to lead to `too many sections` errors when building base for
# profiling.
+ stdenv.lib.optionalString targetPlatform.isWindows ''
+ lib.optionalString targetPlatform.isWindows ''
SplitSections = NO
'' + stdenv.lib.optionalString (!enableLibraryProfiling) ''
'' + lib.optionalString (!enableLibraryProfiling) ''
BUILD_PROF_LIBS = NO
'';
# Splicer will pull out correct variations
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
libDeps = platform: lib.optional enableTerminfo [ ncurses ]
++ [targetLibffi]
++ stdenv.lib.optional (!enableIntegerSimple) gmp
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv
++ stdenv.lib.optional (platform.isLinux && !platform.isAarch32) numactl;
++ lib.optional (!enableIntegerSimple) gmp
++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv
++ lib.optional (platform.isLinux && !platform.isAarch32) numactl;
toolsForTarget =
if hostPlatform == buildPlatform then
[ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm
[ targetPackages.stdenv.cc ] ++ lib.optional useLLVM llvmPackages.llvm
else assert targetPlatform == hostPlatform; # build != host == target
[ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
[ stdenv.cc ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
targetCC = builtins.head toolsForTarget;
configured-src = import ./configured-src.nix {
inherit stdenv fetchurl
inherit stdenv lib fetchurl
ghc-version ghc-version-date ghc-patches src-spec
targetPrefix
targetPlatform hostPlatform
@ -212,7 +212,7 @@ stdenv.mkDerivation (rec {
nativeBuildInputs = [
perl autoconf automake m4 python3 sphinx
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
] ++ stdenv.lib.optional (patches != []) autoreconfHook;
] ++ lib.optional (patches != []) autoreconfHook;
# For building runtime libs
depsBuildTarget = toolsForTarget;
@ -220,14 +220,14 @@ stdenv.mkDerivation (rec {
buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
propagatedBuildInputs = [ targetPackages.stdenv.cc ]
++ stdenv.lib.optional useLLVM llvmPackages.llvm;
++ lib.optional useLLVM llvmPackages.llvm;
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
depsTargetTarget = map lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
# required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
# See #63511 - the only unstripped file is the debug rts which isn't meant to
# be stripped.
@ -236,8 +236,8 @@ stdenv.mkDerivation (rec {
checkTarget = "test";
hardeningDisable = [ "format" ]
++ stdenv.lib.optional stdenv.targetPlatform.isAarch32 "pic"
++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
++ lib.optional stdenv.targetPlatform.isAarch32 "pic"
++ lib.optional stdenv.targetPlatform.isMusl "pie";
postInstall = ''
# Install the bash completion file.
@ -250,7 +250,7 @@ stdenv.mkDerivation (rec {
# The ghcprog fixup is for musl (where runhaskell script just needs to point to the correct
# ghc program to work).
sed -i \
-e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' \
-e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' \
-e 's/ghcprog="ghc-/ghcprog="${targetPrefix}ghc-/' \
$i
done
@ -324,7 +324,7 @@ stdenv.mkDerivation (rec {
inherit (ghc.meta) license platforms;
};
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
dontStrip = true;
dontPatchELF = true;
noAuditTmpdir = true;

View File

@ -1,10 +0,0 @@
{ pkgs ? import <nixpkgs> {} }:
let
fetch = jsonFile:
with builtins;
let spec = fromJSON (readFile jsonFile);
in pkgs.fetchgit {
name = "old-ghc-nix";
inherit (spec) sha256 url rev;
};
in import (fetch ./old-ghc-nix.json) { inherit pkgs; }

View File

@ -1,7 +0,0 @@
{
"url": "https://github.com/angerman/old-ghc-nix",
"rev": "2a41a09127f6dc7a6384823d1acd51ba257f95bd",
"date": "2020-06-03T12:50:09+08:00",
"sha256": "1cp6aksb6ldgjb5zyqikyjrjij79n9z7wd86migph0wp19vmszkf",
"fetchSubmodules": false
}

View File

@ -90,7 +90,7 @@ executables you must add package overrides to:
```nix
{
packages.bench.components.exes.bench.configureFlags =
stdenv.lib.optionals stdenv.hostPlatform.isMusl [
lib.optionals stdenv.hostPlatform.isMusl [
"--disable-executable-dynamic"
"--disable-shared"
"--ghc-option=-optl=-pthread"

View File

@ -119,6 +119,7 @@
},
"nixpkgs-unstable": {
"branch": "nixpkgs-unstable",
"builtin": false,
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
@ -128,5 +129,18 @@
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/410bbd828cdc6156aecd5bc91772ad3a6b1099c7.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"old-ghc-nix": {
"branch": "master",
"builtin": false,
"description": "Old and New GHC",
"homepage": null,
"owner": "angerman",
"repo": "old-ghc-nix",
"rev": "131ce9ae27d7b7afdd1d3ce8c3a74483e60b91bb",
"sha256": "0n62qr7hrqmy6h80736ji47ln759sk845g43f9cprpmcs9m4wl9i",
"type": "tarball",
"url": "https://github.com/angerman/old-ghc-nix/archive/131ce9ae27d7b7afdd1d3ce8c3a74483e60b91bb.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

View File

@ -6,52 +6,63 @@ let
# The fetchers. fetch_<type> fetches specs of type <type>.
#
fetch_file = pkgs: spec:
if spec.builtin or true then
builtins_fetchurl { inherit (spec) url sha256; }
else
pkgs.fetchurl { inherit (spec) url sha256; };
fetch_file = pkgs: name: spec:
let
name' = sanitizeName name + "-src";
in
if spec.builtin or true then
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
else
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
fetch_tarball = pkgs: spec:
if spec.builtin or true then
builtins_fetchTarball { inherit (spec) url sha256; }
else
pkgs.fetchzip { inherit (spec) url sha256; };
fetch_tarball = pkgs: name: spec:
let
name' = sanitizeName name + "-src";
in
if spec.builtin or true then
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
else
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
fetch_git = pkgs: spec:
pkgs.fetchgit { url = spec.repo; inherit (spec) rev deepClone sha256; };
fetch_git = name: spec:
let
ref =
if spec ? ref then spec.ref else
if spec ? branch then "refs/heads/${spec.branch}" else
if spec ? tag then "refs/tags/${spec.tag}" else
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
in
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
fetch_builtin-tarball = spec:
builtins.trace
''
WARNING:
The niv type "builtin-tarball" will soon be deprecated. You should
instead use `builtin = true`.
fetch_local = spec: spec.path;
$ niv modify <package> -a type=tarball -a builtin=true
''
builtins_fetchTarball { inherit (spec) url sha256; };
fetch_builtin-tarball = name: throw
''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
$ niv modify ${name} -a type=tarball -a builtin=true'';
fetch_builtin-url = spec:
builtins.trace
''
WARNING:
The niv type "builtin-url" will soon be deprecated. You should
instead use `builtin = true`.
$ niv modify <package> -a type=file -a builtin=true
''
(builtins_fetchurl { inherit (spec) url sha256; });
fetch_builtin-url = name: throw
''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
$ niv modify ${name} -a type=file -a builtin=true'';
#
# Various helpers
#
# https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
sanitizeName = name:
(
concatMapStrings (s: if builtins.isList s then "-" else s)
(
builtins.split "[^[:alnum:]+._?=-]+"
((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
)
);
# The set of packages used when specs are fetched using non-builtins.
mkPkgs = sources:
mkPkgs = sources: system:
let
sourcesNixpkgs =
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {};
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
in
@ -71,14 +82,27 @@ let
if ! builtins.hasAttr "type" spec then
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
else if spec.type == "file" then fetch_file pkgs spec
else if spec.type == "tarball" then fetch_tarball pkgs spec
else if spec.type == "git" then fetch_git pkgs spec
else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec
else if spec.type == "builtin-url" then fetch_builtin-url spec
else if spec.type == "file" then fetch_file pkgs name spec
else if spec.type == "tarball" then fetch_tarball pkgs name spec
else if spec.type == "git" then fetch_git name spec
else if spec.type == "local" then fetch_local spec
else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
else if spec.type == "builtin-url" then fetch_builtin-url name
else
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
# If the environment variable NIV_OVERRIDE_${name} is set, then use
# the path directly as opposed to the fetched source.
replace = name: drv:
let
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
in
if ersatz == "" then drv else
# this turns the string into an actual Nix path (for both absolute and
# relative paths)
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
# Ports of functions for older nix versions
# a Nix version of mapAttrs if the built-in doesn't exist
@ -87,23 +111,37 @@ let
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
concatMapStrings = f: list: concatStrings (map f list);
concatStrings = builtins.concatStringsSep "";
# https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
optionalAttrs = cond: as: if cond then as else {};
# fetchTarball version that is compatible between all the versions of Nix
builtins_fetchTarball = { url, sha256 }@attrs:
builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
let
inherit (builtins) lessThan nixVersion fetchTarball;
in
if lessThan nixVersion "1.12" then
fetchTarball { inherit url; }
fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
else
fetchTarball attrs;
# fetchurl version that is compatible between all the versions of Nix
builtins_fetchurl = { url, sha256 }@attrs:
builtins_fetchurl = { url, name ? null, sha256 }@attrs:
let
inherit (builtins) lessThan nixVersion fetchurl;
in
if lessThan nixVersion "1.12" then
fetchurl { inherit url; }
fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
else
fetchurl attrs;
@ -115,14 +153,15 @@ let
then abort
"The values in sources.json should not have an 'outPath' attribute"
else
spec // { outPath = fetch config.pkgs name spec; }
spec // { outPath = replace name (fetch config.pkgs name spec); }
) config.sources;
# The "config" used by the fetchers
mkConfig =
{ sourcesFile ? ./sources.json
, sources ? builtins.fromJSON (builtins.readFile sourcesFile)
, pkgs ? mkPkgs sources
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
, sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
, system ? builtins.currentSystem
, pkgs ? mkPkgs sources system
}: rec {
# The sources, i.e. the attribute set of spec name to spec
inherit sources;
@ -130,5 +169,6 @@ let
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
inherit pkgs;
};
in
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }

View File

@ -34,16 +34,16 @@ final: prev:
in {
packages = {
# clock 0.7.2 needs to be patched to support cross compilation.
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)) ];
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)) ];
# nix calls this package crypto
# 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) ];
# 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) ];
# 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) ];
# 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) ];
# 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) ];
# streaming-commons.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/streaming-commons-0.2.0.0.patch ];
# x509-system.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/x509-system-1.6.6.patch ];
# file-embed-lzma.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/file-embed-lzma-0.patch ];
# 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) ];
# streaming-commons.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/streaming-commons-0.2.0.0.patch ];
# x509-system.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/x509-system-1.6.6.patch ];
# file-embed-lzma.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/file-embed-lzma-0.patch ];
# Set all of these to [], as these form the
# dependency graph of the libiserv, iserv-proxy, and iserv-remote

View File

@ -735,7 +735,7 @@ in {
isHaskellNixBootCompiler = true;
}
)
(import ../compiler/old-ghc-nix { pkgs = final; });
(import sources.old-ghc-nix { pkgs = final; });
packages = {
# now that we have nix-tools and hpack, we can just

View File

@ -1,4 +1,4 @@
{ stdenv, cmake, python3, fetchFromGitHub, emscriptenRev ? null, substituteAll }:
{ stdenv, lib, cmake, python3, fetchFromGitHub, emscriptenRev ? null, substituteAll }:
let
defaultVersion = "93";
@ -29,14 +29,14 @@ stdenv.mkDerivation rec {
inherit rev;
};
patches = stdenv.lib.optional (emscriptenRev != null) (substituteAll {
patches = lib.optional (emscriptenRev != null) (substituteAll {
src = ./0001-Get-rid-of-git-dependency.patch;
emscriptenv = "1.39.1";
});
nativeBuildInputs = [ cmake python3 ];
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/WebAssembly/binaryen";
description = "Compiler infrastructure and toolchain library for WebAssembly, in C++";
platforms = platforms.all;

View File

@ -1,4 +1,4 @@
{ emscriptenVersion, stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler
{ emscriptenVersion, stdenv, lib, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler
, jre, binaryen, enableWasm ? true , cmake, emscriptenBackend ? emscriptenfastcomp
}:
@ -45,7 +45,7 @@ stdenv.mkDerivation {
echo "SPIDERMONKEY_ENGINE = []" >> $out/${appdir}/config
echo "EMCC_FAST_COMPILER = 0" >> $out/${appdir}/config
''
+ stdenv.lib.optionalString enableWasm ''
+ lib.optionalString enableWasm ''
echo "BINARYEN_ROOT = '${binaryenVersioned}'" >> $out/share/emscripten/config
''
+
@ -61,7 +61,7 @@ stdenv.mkDerivation {
echo "--------------- /running test -----------------"
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/emscripten-core/emscripten";
description = "An LLVM-to-JavaScript Compiler";
platforms = platforms.all;

View File

@ -1,4 +1,4 @@
{ newScope, stdenv, binutils, wrapCCWith, symlinkJoin }:
{ newScope, stdenv, lib, binutils, wrapCCWith, symlinkJoin }:
let
callPackage = newScope (self // {inherit stdenv;});
@ -15,7 +15,7 @@ let
'';
};
emscriptenfastcomp = symlinkJoin {
name = "emscriptenfastcomp-${stdenv.lib.getVersion self.emscriptenfastcomp-unwrapped}";
name = "emscriptenfastcomp-${lib.getVersion self.emscriptenfastcomp-unwrapped}";
paths = [ self.emscriptenfastcomp-wrapped self.emscriptenfastcomp-unwrapped ];
preferLocalBuild = false;
allowSubstitutes = true;

View File

@ -1,4 +1,4 @@
{ emscriptenVersion, stdenv, fetchFromGitHub, cmake, python, gtest, ... }:
{ emscriptenVersion, stdenv, lib, fetchFromGitHub, cmake, python, gtest, ... }:
let
rev = emscriptenVersion;
@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
#"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
"-DLLVM_BUILD_TESTS=ON"
"-DCLANG_INCLUDE_TESTS=ON"
] ++ (stdenv.lib.optional stdenv.isLinux
] ++ (lib.optional stdenv.isLinux
# necessary for clang to find crtend.o
"-DGCC_INSTALL_PREFIX=${gcc}"
);
@ -45,11 +45,11 @@ stdenv.mkDerivation rec {
inherit gcc;
};
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/emscripten-core/emscripten-fastcomp";
description = "Emscripten LLVM";
platforms = platforms.all;
maintainers = with maintainers; [ qknight matthewbauer ];
license = stdenv.lib.licenses.ncsa;
license = lib.licenses.ncsa;
};
}

View File

@ -1,4 +1,4 @@
{ newScope, stdenv, binutils, wrapCCWith, symlinkJoin }:
{ newScope, stdenv, lib, binutils, wrapCCWith, symlinkJoin }:
let
callPackage = newScope (self // {inherit stdenv;});
@ -15,7 +15,7 @@ let
'';
};
emscriptenupstream = symlinkJoin {
name = "emscriptenupstream-${stdenv.lib.getVersion self.emscriptenupstream-unwrapped}";
name = "emscriptenupstream-${lib.getVersion self.emscriptenupstream-unwrapped}";
paths = [ self.emscriptenupstream-wrapped self.emscriptenupstream-unwrapped ];
preferLocalBuild = false;
allowSubstitutes = true;

View File

@ -1,4 +1,4 @@
{ emscriptenVersion, stdenv, fetchFromGitHub, cmake, python, gtest, ... }:
{ emscriptenVersion, stdenv, lib, fetchFromGitHub, cmake, python, gtest, ... }:
let
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
#"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
"-DLLVM_BUILD_TESTS=ON"
"-DCLANG_INCLUDE_TESTS=OFF"
] ++ (stdenv.lib.optional stdenv.isLinux
] ++ (lib.optional stdenv.isLinux
# necessary for clang to find crtend.o
"-DGCC_INSTALL_PREFIX=${gcc}"
);
@ -50,11 +50,11 @@ stdenv.mkDerivation rec {
inherit gcc;
};
meta = with stdenv.lib; {
meta = with lib; {
homepage = "http://github.com/llvm/llvm-project";
description = "LLVM";
platforms = platforms.all;
maintainers = with maintainers; [ ];
license = stdenv.lib.licenses.ncsa;
license = lib.licenses.ncsa;
};
}

View File

@ -266,7 +266,7 @@ final: prev: {
update-index-state-hashes = import ../scripts/update-index-state-hashes.nix {
inherit (final.haskell-nix) indexStateHashesPath;
inherit (final) coreutils nix writeShellScriptBin stdenv curl;
inherit (final) coreutils nix writeShellScriptBin stdenv lib curl;
# Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
nix-tools = final.haskell-nix.internal-nix-tools;
};

View File

@ -17,11 +17,11 @@ final: prev:
# });
mfpr = prev.mfpr.overrideAttrs (drv: {
configureFlags = (drv.configureFlags or []) ++ prev.stdenv.lib.optional prev.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
configureFlags = (drv.configureFlags or []) ++ prev.lib.optional prev.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
});
libmpc = prev.libmpc.overrideAttrs (drv: {
configureFlags = (drv.configureFlags or []) ++ prev.stdenv.lib.optional prev.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
configureFlags = (drv.configureFlags or []) ++ prev.lib.optional prev.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
});
binutils-unwrapped = prev.binutils-unwrapped.overrideAttrs (attrs: {
@ -72,7 +72,7 @@ final: prev:
# figuring out which libraries we need for the build (walking the
# dependencies) and then placing them somewhere where wine+remote-iserv
# will find them.
remote-iserv.postInstall = pkgs.stdenv.lib.optionalString pkgs.stdenv.hostPlatform.isWindows (
remote-iserv.postInstall = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isWindows (
let extra-libs = [ pkgs.openssl.bin pkgs.libffi pkgs.gmp pkgs.libsodium ]; in ''
for p in ${lib.concatStringsSep " "extra-libs}; do
find "$p" -iname '*.dll' -exec cp {} $out/bin/ \;
@ -91,20 +91,20 @@ final: prev:
# else null)) ];
# clock 0.7.2 needs to be patched to support cross compilation.
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)) ];
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)) ];
# nix calls this package crypto
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) ];
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) ];
# this patch seems to be rather flaky and highly dependent on
# the network library. I think we might need to respin that in
# a better way that doesn't just delete some code, but makes
# the bounds checks stricter.
# 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) ];
# 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) ];
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) ];
streaming-commons.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/streaming-commons-0.2.0.0.patch ];
x509-system.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/x509-system-1.6.6.patch ];
file-embed-lzma.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/file-embed-lzma-0.patch ];
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) ];
streaming-commons.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/streaming-commons-0.2.0.0.patch ];
x509-system.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/x509-system-1.6.6.patch ];
file-embed-lzma.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/file-embed-lzma-0.patch ];
# Set all of these to [], as these form the
# dependency graph of the libiserv, iserv-proxy, and iserv-remote

View File

@ -1,9 +1,9 @@
{ stdenv, writeScript, coreutils, gawk, nix
{ stdenv, lib, writeScript, coreutils, gawk, nix
, nix-tools
, limitMB ? 525
}:
with stdenv.lib;
with lib;
writeScript "check-closure-size.sh" ''
#!${stdenv.shell}

View File

@ -1,6 +1,6 @@
{ stdenv, writeScript, coreutils, time, gnutar, gzip, hydra-migration, jq }:
{ stdenv, lib, writeScript, coreutils, time, gnutar, gzip, hydra-migration, jq }:
with stdenv.lib;
with lib;
writeScript "check-hydra.sh" ''
#!${stdenv.shell}

View File

@ -1,6 +1,6 @@
{ stdenv, writeScript }:
{ stdenv, lib, writeScript }:
with stdenv.lib;
with lib;
writeScript "check-materialization-concurrency.sh" ''
#!${stdenv.shell}

View File

@ -1,6 +1,6 @@
{ stdenv, writeScript, coreutils, gnutar, gzip, nix }:
{ stdenv, lib, writeScript, coreutils, gnutar, gzip, nix }:
with stdenv.lib;
with lib;
writeScript "check-path-supprot.sh" ''
#!${stdenv.shell}

View File

@ -1,7 +1,7 @@
{ stdenv, writeScript, coreutils, glibc, git, openssh, gnused, mkdocs
{ stdenv, lib, writeScript, coreutils, glibc, git, openssh, gnused, mkdocs
, generatedOptions }:
with stdenv.lib;
with lib;
let
repo = "git@github.com:input-output-hk/haskell.nix.git";

View File

@ -1,10 +1,10 @@
{ stdenv, writeScript, glibc, coreutils, git, openssh
{ stdenv, lib, writeScript, glibc, coreutils, git, openssh
, nix-tools, cabal-install, nix-prefetch-git
, bash, curl, findutils, gawk }:
{ name, script }:
with stdenv.lib;
with lib;
let
repoHTTPS = "https://github.com/input-output-hk/${name}.nix";

View File

@ -1,4 +1,4 @@
{ stdenv, writeScript, coreutils, glibc, git, openssh
{ stdenv, lib, writeScript, coreutils, glibc, git, openssh
, nix-tools, cabal-install, nix-prefetch-git
, gawk, bash, curl, findutils
, update-index-state-hashes }@args:

View File

@ -1,6 +1,6 @@
{ indexStateHashesPath, nix-tools, coreutils, nix, writeShellScriptBin, stdenv, curl }:
{ indexStateHashesPath, nix-tools, coreutils, nix, writeShellScriptBin, stdenv, lib, curl }:
with builtins;
with stdenv.lib;
with lib;
writeShellScriptBin "update-index-state-hashes" ''
export PATH="${makeBinPath [ coreutils nix-tools nix curl ]}"

View File

@ -1,6 +1,6 @@
{ stdenv, writeScript, coreutils, glibc, git, openssh }@args:
{ stdenv, lib, writeScript, coreutils, glibc, git, openssh }@args:
with stdenv.lib;
with lib;
let
repo = "git@github.com:input-output-hk/haskell.nix.git";

View File

@ -1,4 +1,4 @@
{ stdenv, writeScript, coreutils, glibc, git, openssh
{ stdenv, lib, writeScript, coreutils, glibc, git, openssh
, nix-tools, cabal-install, nix-prefetch-git
, gawk, bash, curl, findutils }@args:

View File

@ -1,6 +1,6 @@
{ stdenv, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
{ stdenv, lib, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
project = cabalProject' {

View File

@ -1,6 +1,6 @@
{ mkCabalProjectPkgSet, stdenv, testSrc }:
{ mkCabalProjectPkgSet, stdenv, lib, testSrc }:
with stdenv.lib;
with lib;
let
pkgSet = mkCabalProjectPkgSet {

View File

@ -1,6 +1,6 @@
{ stdenv, mkCabalProjectPkgSet, cabalProject', haskellLib, util, recurseIntoAttrs, testSrc, compiler-nix-name }:
{ stdenv, lib, mkCabalProjectPkgSet, cabalProject', haskellLib, util, recurseIntoAttrs, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
project = cabalProject' {

View File

@ -1,7 +1,7 @@
# Test a package set
{ stdenv, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
{ stdenv, lib, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
modules = [

View File

@ -1,7 +1,7 @@
# Test a package set
{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
modules = [

View File

@ -1,7 +1,7 @@
# Test a package set
{ stdenv, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
{ stdenv, lib, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
modules = [

View File

@ -1,6 +1,6 @@
{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
project = cabalProject' {

View File

@ -1,6 +1,6 @@
{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
project = cabalProject' {

View File

@ -1,7 +1,7 @@
# Test a package set
{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
modules = [

View File

@ -1,6 +1,6 @@
{ stdenv, mkCabalProjectPkgSet, callCabalProjectToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
{ stdenv, lib, mkCabalProjectPkgSet, callCabalProjectToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
# This test could use cabalProject', but it does so that it

View File

@ -1,6 +1,6 @@
{ stdenv, mkStackPkgSet, callStackToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc }:
{ stdenv, lib, mkStackPkgSet, callStackToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc }:
with stdenv.lib;
with lib;
let
callProjectResults = callStackToNix {

View File

@ -1,6 +1,6 @@
{ stdenv, haskell-nix, recurseIntoAttrs, testSrc }:
{ stdenv, lib, haskell-nix, recurseIntoAttrs, testSrc }:
with stdenv.lib;
with lib;
let
project = haskell-nix.cabalProject' {

View File

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, recurseIntoAttrs, runCommand, testSrc, compiler-nix-name, buildPackages, sources }:
{ stdenv, lib, fetchFromGitHub, recurseIntoAttrs, runCommand, testSrc, compiler-nix-name, buildPackages, sources }:
with stdenv.lib;
with lib;
let
# Using buildPackages.buildPackages here because buildPackages.git

View File

@ -1,6 +1,6 @@
{ stdenv, cabal-install, cabalProject', stackProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
{ stdenv, lib, cabal-install, cabalProject', stackProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
projectArgs = {

View File

@ -1,6 +1,6 @@
{ stdenv, cabal-install, cabalProject', stackProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
{ stdenv, lib, cabal-install, cabalProject', stackProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
projectArgs = {

View File

@ -1,7 +1,7 @@
# Test a package set
{ stdenv, util, haskell-nix, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
{ stdenv, lib, util, haskell-nix, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
project = haskell-nix.cabalProject' {

View File

@ -1,6 +1,6 @@
{ stdenv, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
{ stdenv, lib, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let

View File

@ -1,11 +1,11 @@
{ stackProject'
, stdenv, gmp6, openssl, zlib, libffi
, stdenv, lib, gmp6, openssl, zlib, libffi
, buildPackages
, recurseIntoAttrs
, testSrc
}:
with stdenv.lib;
with lib;
let
# Grab the compiler name from stack-to-nix output.

View File

@ -1,6 +1,6 @@
{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
project = cabalProject' {

View File

@ -1,6 +1,6 @@
{ stdenv, stackProject', recurseIntoAttrs, haskellLib, testSrc }:
{ stdenv, lib, stackProject', recurseIntoAttrs, haskellLib, testSrc }:
with stdenv.lib;
with lib;
let
project = stackProject' {

View File

@ -1,6 +1,6 @@
{ stdenv, haskell-nix, recurseIntoAttrs, testSrc, compiler-nix-name, runCommand, gitMinimal, buildPackages }:
{ stdenv, lib, haskell-nix, recurseIntoAttrs, testSrc, compiler-nix-name, runCommand, gitMinimal, buildPackages }:
with stdenv.lib;
with lib;
let
src = testSrc "githash";

View File

@ -1,7 +1,7 @@
# Test a package set
{ stdenv, testSrc, tool, compiler-nix-name }:
{ stdenv, lib, testSrc, tool, compiler-nix-name }:
with stdenv.lib;
with lib;
let
# The hackage-security 0.6.0.1 was uploaded at 2020-04-06T20:54:35Z

View File

@ -1,6 +1,6 @@
{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
project = cabalProject' {

View File

@ -1,6 +1,6 @@
{ stdenv, stackProject', recurseIntoAttrs, haskellLib, testSrc }:
{ stdenv, lib, stackProject', recurseIntoAttrs, haskellLib, testSrc }:
with stdenv.lib;
with lib;
let
project = stackProject' {

View File

@ -1,7 +1,7 @@
{ pkgs, compiler-nix-name }:
with pkgs;
with stdenv.lib;
with lib;
let
project = haskell-nix.cabalProject' {

View File

@ -1,6 +1,6 @@
{ stdenv, cabal-install, cabalProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
{ stdenv, lib, cabal-install, cabalProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
project = cabalProject' {

View File

@ -1,6 +1,6 @@
{ stdenv, cabal-install, mkCabalProjectPkgSet, recurseIntoAttrs, runCommand, testSrc }:
{ stdenv, lib, cabal-install, mkCabalProjectPkgSet, recurseIntoAttrs, runCommand, testSrc }:
with stdenv.lib;
with lib;
let
pkgSet = mkCabalProjectPkgSet {

View File

@ -1,6 +1,6 @@
{ stdenv, haskellPackages, snapshots, recurseIntoAttrs, runCommand, testSrc }:
{ stdenv, lib, haskellPackages, snapshots, recurseIntoAttrs, runCommand, testSrc }:
with stdenv.lib;
with lib;
let
env = snapshots."lts-14.13".ghcWithHoogle

View File

@ -1,6 +1,6 @@
{ stdenv, pkgs, mkStackPkgSet, haskellLib, testSrc }:
{ stdenv, lib, pkgs, mkStackPkgSet, haskellLib, testSrc }:
with stdenv.lib;
with lib;
let
# ./pkgs.nix and ./stack-simple.nix are generated by running

View File

@ -1,7 +1,7 @@
# Test a package set
{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
with stdenv.lib;
with lib;
let
project = cabalProject' {

View File

@ -1,6 +1,6 @@
{ stdenv, util, mkPkgSet, recurseIntoAttrs, testSrc }:
{ stdenv, lib, util, mkPkgSet, recurseIntoAttrs, testSrc }:
with stdenv.lib;
with lib;
with util;
let