treewide: stdenv.lib -> lib
This commit is contained in:
@@ -132,7 +132,7 @@ Description: BLAS C implementation
|
||||
Cflags: -I$dev/include
|
||||
Libs: -L$out/lib -lcblas
|
||||
EOF
|
||||
'' + stdenv.lib.optionalString (blasImplementation == "mkl") ''
|
||||
'' + lib.optionalString (blasImplementation == "mkl") ''
|
||||
mkdir -p $out/nix-support
|
||||
echo 'export MKL_INTERFACE_LAYER=${lib.optionalString isILP64 "I"}LP64,GNU' > $out/nix-support/setup-hook
|
||||
ln -s $out/lib/libblas${canonicalExtension} $out/lib/libmkl_rt${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||
|
||||
@@ -98,7 +98,7 @@ Description: LAPACK C implementation
|
||||
Cflags: -I$dev/include
|
||||
Libs: -L$out/lib -llapacke
|
||||
EOF
|
||||
'' + stdenv.lib.optionalString (lapackImplementation == "mkl") ''
|
||||
'' + lib.optionalString (lapackImplementation == "mkl") ''
|
||||
mkdir -p $out/nix-support
|
||||
echo 'export MKL_INTERFACE_LAYER=${lib.optionalString isILP64 "I"}LP64,GNU' > $out/nix-support/setup-hook
|
||||
ln -s $out/lib/liblapack${canonicalExtension} $out/lib/libmkl_rt${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ stdenv
|
||||
{ lib
|
||||
, stdenv
|
||||
, bash
|
||||
, binutils-unwrapped
|
||||
, coreutils
|
||||
@@ -15,7 +16,7 @@ rec {
|
||||
src = ./appimage-exec.sh;
|
||||
isExecutable = true;
|
||||
dir = "bin";
|
||||
path = with pkgs; stdenv.lib.makeBinPath [
|
||||
path = lib.makeBinPath [
|
||||
bash
|
||||
binutils-unwrapped
|
||||
coreutils
|
||||
|
||||
@@ -94,7 +94,7 @@ rec {
|
||||
inherit imageDigest;
|
||||
imageName = finalImageName;
|
||||
imageTag = finalImageTag;
|
||||
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
|
||||
outputHashMode = "flat";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = sha256;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ stdenv, makeWrapper, nix, skopeo, jq }:
|
||||
|
||||
with stdenv.lib;
|
||||
{ lib, stdenv, makeWrapper, nix, skopeo, jq }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "nix-prefetch-docker";
|
||||
@@ -12,13 +10,13 @@ stdenv.mkDerivation {
|
||||
installPhase = ''
|
||||
install -vD ${./nix-prefetch-docker} $out/bin/$name;
|
||||
wrapProgram $out/bin/$name \
|
||||
--prefix PATH : ${makeBinPath [ nix skopeo jq ]} \
|
||||
--prefix PATH : ${lib.makeBinPath [ nix skopeo jq ]} \
|
||||
--set HOME /homeless-shelter
|
||||
'';
|
||||
|
||||
preferLocalBuild = true;
|
||||
|
||||
meta = {
|
||||
meta = with lib; {
|
||||
description = "Script used to obtain source hashes for dockerTools.pullImage";
|
||||
maintainers = with maintainers; [ offline ];
|
||||
platforms = platforms.unix;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{stdenv, dotnetfx}:
|
||||
{ lib, stdenv, dotnetfx }:
|
||||
{ name
|
||||
, src
|
||||
, baseDir ? "."
|
||||
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
${stdenv.lib.optionalString modifyPublicMain ''
|
||||
${lib.optionalString modifyPublicMain ''
|
||||
sed -i -e "s|static void Main|public static void Main|" ${mainClassFile}
|
||||
''}
|
||||
${preBuild}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{stdenv, dotnetfx}:
|
||||
{ lib, stdenv, dotnetfx }:
|
||||
|
||||
let dotnetenv =
|
||||
{
|
||||
buildSolution = import ./build-solution.nix {
|
||||
inherit stdenv;
|
||||
inherit lib stdenv;
|
||||
dotnetfx = dotnetfx.pkg;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Adaptation of the MIT-licensed work on `sbt2nix` done by Charles O'Farrell
|
||||
|
||||
{ fetchurl, stdenv }:
|
||||
{ lib, fetchurl, stdenv }:
|
||||
let
|
||||
defaultRepos = [
|
||||
"https://repo1.maven.org/maven2"
|
||||
@@ -36,21 +36,20 @@ assert (url == "") || (urls == []);
|
||||
# if repos is empty, then url or urls must be specified.
|
||||
assert (repos != []) || (url != "") || (urls != []);
|
||||
|
||||
|
||||
let
|
||||
name_ =
|
||||
with stdenv.lib; concatStrings [
|
||||
(replaceChars ["."] ["_"] groupId) "_"
|
||||
(replaceChars ["."] ["_"] artifactId) "-"
|
||||
lib.concatStrings [
|
||||
(lib.replaceChars ["."] ["_"] groupId) "_"
|
||||
(lib.replaceChars ["."] ["_"] artifactId) "-"
|
||||
version
|
||||
];
|
||||
mkJarUrl = repoUrl:
|
||||
with stdenv.lib; concatStringsSep "/" [
|
||||
(removeSuffix "/" repoUrl)
|
||||
(replaceChars ["."] ["/"] groupId)
|
||||
lib.concatStringsSep "/" [
|
||||
(lib.removeSuffix "/" repoUrl)
|
||||
(lib.replaceChars ["."] ["/"] groupId)
|
||||
artifactId
|
||||
version
|
||||
"${artifactId}-${version}${optionalString (!isNull classifier) "-${classifier}"}.jar"
|
||||
"${artifactId}-${version}${lib.optionalString (!isNull classifier) "-${classifier}"}.jar"
|
||||
];
|
||||
urls_ =
|
||||
if url != "" then [url]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, icoutils }:
|
||||
{ lib, stdenv, icoutils }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "icon-conv-tools-0.0.0";
|
||||
@@ -23,9 +23,9 @@ stdenv.mkDerivation {
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
meta = {
|
||||
meta = with lib; {
|
||||
description = "Tools for icon conversion specific to nix package manager";
|
||||
maintainers = with stdenv.lib.maintainers; [ jraygauthier ];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
maintainers = with maintainers; [ jraygauthier ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ stdenv.mkDerivation {
|
||||
)
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
meta = with lib; {
|
||||
platforms = platforms.unix;
|
||||
description = "An LD_PRELOAD library to intercept and rewrite the paths in glibc calls";
|
||||
longDescription = ''
|
||||
libredirect is an LD_PRELOAD library to intercept and rewrite the paths in
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, writeText, ocaml, findlib, ocamlbuild, camlp4 }:
|
||||
{ lib, stdenv, writeText, ocaml, findlib, ocamlbuild, camlp4 }:
|
||||
|
||||
{ name, version, buildInputs ? [],
|
||||
createFindlibDestdir ? true,
|
||||
@@ -14,7 +14,7 @@ let
|
||||
};
|
||||
in
|
||||
assert minimumSupportedOcamlVersion != null ->
|
||||
stdenv.lib.versionOlder minimumSupportedOcamlVersion ocaml.version;
|
||||
lib.versionOlder minimumSupportedOcamlVersion ocaml.version;
|
||||
|
||||
stdenv.mkDerivation (args // {
|
||||
name = "ocaml-${name}-${version}";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{ stdenv, ocaml, findlib, dune, dune_2 }:
|
||||
{ lib, stdenv, ocaml, findlib, dune, dune_2 }:
|
||||
|
||||
{ pname, version, buildInputs ? [], enableParallelBuilding ? true, ... }@args:
|
||||
|
||||
let Dune = if args.useDune2 or false then dune_2 else dune; in
|
||||
|
||||
if args ? minimumOCamlVersion &&
|
||||
! stdenv.lib.versionAtLeast ocaml.version args.minimumOCamlVersion
|
||||
! lib.versionAtLeast ocaml.version args.minimumOCamlVersion
|
||||
then throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, ocaml_oasis, ocaml, findlib, ocamlbuild }:
|
||||
{ lib, stdenv, ocaml_oasis, ocaml, findlib, ocamlbuild }:
|
||||
|
||||
{ pname, version, buildInputs ? [], meta ? { platforms = ocaml.meta.platforms or []; },
|
||||
minimumOCamlVersion ? null,
|
||||
@@ -8,7 +8,7 @@
|
||||
}@args:
|
||||
|
||||
if args ? minimumOCamlVersion &&
|
||||
! stdenv.lib.versionAtLeast ocaml.version args.minimumOCamlVersion
|
||||
! lib.versionAtLeast ocaml.version args.minimumOCamlVersion
|
||||
then throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# PKG_CONFIG_PATH_FOR_BUILD work properly.
|
||||
|
||||
{ stdenvNoCC
|
||||
, lib
|
||||
, buildPackages
|
||||
, pkg-config
|
||||
, baseBinName ? "pkg-config"
|
||||
@@ -19,7 +20,7 @@ let
|
||||
#
|
||||
# TODO(@Ericson2314) Make unconditional, or optional but always true by
|
||||
# default.
|
||||
targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform)
|
||||
targetPrefix = lib.optionalString (targetPlatform != hostPlatform)
|
||||
(targetPlatform.config + "-");
|
||||
|
||||
# See description in cc-wrapper.
|
||||
@@ -119,7 +120,7 @@ stdenv.mkDerivation {
|
||||
let pkg-config_ = if pkg-config != null then pkg-config else {}; in
|
||||
(if pkg-config_ ? meta then removeAttrs pkg-config.meta ["priority"] else {}) //
|
||||
{ description =
|
||||
stdenv.lib.attrByPath ["meta" "description"] "pkg-config" pkg-config_
|
||||
lib.attrByPath ["meta" "description"] "pkg-config" pkg-config_
|
||||
+ " (wrapper script)";
|
||||
priority = 10;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv }:
|
||||
{ lib, stdenv }:
|
||||
# helper functions for packaging programs with plugin systems
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
diffPlugins = expectedPlugins: foundPluginsFilePath: ''
|
||||
# sort both lists first
|
||||
plugins_expected=$(mktemp)
|
||||
(${stdenv.lib.concatMapStrings (s: "echo \"${s}\";") expectedPlugins}) \
|
||||
(${lib.concatMapStrings (s: "echo \"${s}\";") expectedPlugins}) \
|
||||
| sort -u > "$plugins_expected"
|
||||
plugins_found=$(mktemp)
|
||||
sort -u "${foundPluginsFilePath}" > "$plugins_found"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# that contains a Debian-like (i.e. dpkg-based) OS.
|
||||
|
||||
{ name ? "debian-build"
|
||||
, lib
|
||||
, diskImage
|
||||
, src, stdenv, vmTools, checkinstall
|
||||
, fsTranslation ? false
|
||||
@@ -11,8 +12,6 @@
|
||||
debRequires ? []
|
||||
, ... } @ args:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
vmTools.runInLinuxImage (stdenv.mkDerivation (
|
||||
|
||||
{
|
||||
@@ -59,8 +58,8 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
|
||||
export PAGER=cat
|
||||
${checkinstall}/sbin/checkinstall --nodoc -y -D \
|
||||
--fstrans=${if fsTranslation then "yes" else "no"} \
|
||||
--requires="${concatStringsSep "," debRequires}" \
|
||||
--provides="${concatStringsSep "," debProvides}" \
|
||||
--requires="${lib.concatStringsSep "," debRequires}" \
|
||||
--provides="${lib.concatStringsSep "," debProvides}" \
|
||||
${if (src ? version) then "--pkgversion=$(echo ${src.version} | tr _ -)"
|
||||
else "--pkgversion=0.0.0"} \
|
||||
''${debMaintainer:+--maintainer="'$debMaintainer'"} \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs }:
|
||||
{ lib, pkgs }:
|
||||
|
||||
with pkgs;
|
||||
|
||||
@@ -23,7 +23,7 @@ rec {
|
||||
} // args);
|
||||
|
||||
nixBuild = args: import ./nix-build.nix (
|
||||
{ inherit stdenv;
|
||||
{ inherit lib stdenv;
|
||||
} // args);
|
||||
|
||||
coverageAnalysis = args: nixBuild (
|
||||
@@ -46,7 +46,7 @@ rec {
|
||||
} // args);
|
||||
|
||||
debBuild = args: import ./debian-build.nix (
|
||||
{ inherit stdenv vmTools checkinstall;
|
||||
{ inherit lib stdenv vmTools checkinstall;
|
||||
} // args);
|
||||
|
||||
aggregate =
|
||||
@@ -94,7 +94,7 @@ rec {
|
||||
|
||||
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
|
||||
|
||||
patchPhase = stdenv.lib.optionalString isNixOS ''
|
||||
patchPhase = lib.optionalString isNixOS ''
|
||||
touch .update-on-nixos-rebuild
|
||||
'';
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
, doCoverityAnalysis ? false
|
||||
, lcovFilter ? []
|
||||
, lcovExtraTraceFiles ? []
|
||||
, src, stdenv
|
||||
, src, lib, stdenv
|
||||
, name ? if doCoverageAnalysis then "nix-coverage" else "nix-build"
|
||||
, failureHook ? null
|
||||
, prePhases ? []
|
||||
@@ -69,7 +69,7 @@ stdenv.mkDerivation (
|
||||
fi
|
||||
'';
|
||||
|
||||
failureHook = (stdenv.lib.optionalString (failureHook != null) failureHook) +
|
||||
failureHook = (lib.optionalString (failureHook != null) failureHook) +
|
||||
''
|
||||
if test -n "$succeedOnFailure"; then
|
||||
if test -n "$keepBuildDirectory"; then
|
||||
@@ -136,10 +136,10 @@ stdenv.mkDerivation (
|
||||
|
||||
buildInputs =
|
||||
buildInputs ++
|
||||
(stdenv.lib.optional doCoverageAnalysis args.makeGCOVReport) ++
|
||||
(stdenv.lib.optional doClangAnalysis args.clang-analyzer) ++
|
||||
(stdenv.lib.optional doCoverityAnalysis args.cov-build) ++
|
||||
(stdenv.lib.optional doCoverityAnalysis args.xz);
|
||||
(lib.optional doCoverageAnalysis args.makeGCOVReport) ++
|
||||
(lib.optional doClangAnalysis args.clang-analyzer) ++
|
||||
(lib.optional doCoverityAnalysis args.cov-build) ++
|
||||
(lib.optional doCoverityAnalysis args.xz);
|
||||
|
||||
lcovFilter = ["/nix/store/*"] ++ lcovFilter;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, pkg-config, curl, darwin, libiconv, libgit2, libssh2,
|
||||
{ lib, stdenv, pkg-config, curl, darwin, libiconv, libgit2, libssh2,
|
||||
openssl, sqlite, zlib, dbus, dbus-glib, gdk-pixbuf, cairo, python3,
|
||||
libsodium, postgresql, gmp, foundationdb, capnproto, nettle, clang,
|
||||
llvmPackages, ... }:
|
||||
@@ -17,7 +17,7 @@ in
|
||||
|
||||
cargo = attrs: {
|
||||
buildInputs = [ openssl zlib curl ]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ];
|
||||
++ lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ];
|
||||
};
|
||||
|
||||
libz-sys = attrs: {
|
||||
@@ -149,7 +149,7 @@ in
|
||||
};
|
||||
|
||||
serde_derive = attrs: {
|
||||
buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
|
||||
buildInputs = lib.optional stdenv.isDarwin Security;
|
||||
};
|
||||
|
||||
thrussh-libsodium = attrs: {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, buildPackages
|
||||
, cacert
|
||||
, cargo
|
||||
@@ -83,13 +84,13 @@ let
|
||||
cargoDepsCopy="$sourceRoot/${cargoVendorDir}"
|
||||
'';
|
||||
|
||||
targetIsJSON = stdenv.lib.hasSuffix ".json" target;
|
||||
targetIsJSON = lib.hasSuffix ".json" target;
|
||||
useSysroot = targetIsJSON && !__internal_dontAddSysroot;
|
||||
|
||||
# see https://github.com/rust-lang/cargo/blob/964a16a28e234a3d397b2a7031d4ab4a428b1391/src/cargo/core/compiler/compile_kind.rs#L151-L168
|
||||
# the "${}" is needed to transform the path into a /nix/store path before baseNameOf
|
||||
shortTarget = if targetIsJSON then
|
||||
(stdenv.lib.removeSuffix ".json" (builtins.baseNameOf "${target}"))
|
||||
(lib.removeSuffix ".json" (builtins.baseNameOf "${target}"))
|
||||
else target;
|
||||
|
||||
sysroot = (callPackage ./sysroot {}) {
|
||||
@@ -116,7 +117,7 @@ in
|
||||
# See https://os.phil-opp.com/testing/ for more information.
|
||||
assert useSysroot -> !(args.doCheck or true);
|
||||
|
||||
stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optionalAttrs useSysroot {
|
||||
stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // lib.optionalAttrs useSysroot {
|
||||
RUSTFLAGS = "--sysroot ${sysroot} " + (args.RUSTFLAGS or "");
|
||||
} // {
|
||||
inherit cargoDeps;
|
||||
@@ -124,7 +125,7 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional
|
||||
patchRegistryDeps = ./patch-registry-deps;
|
||||
|
||||
nativeBuildInputs = nativeBuildInputs ++ [ cacert git cargo rustc ];
|
||||
buildInputs = buildInputs ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW windows.pthreads;
|
||||
buildInputs = buildInputs ++ lib.optional stdenv.hostPlatform.isMinGW windows.pthreads;
|
||||
|
||||
patches = cargoPatches ++ patches;
|
||||
|
||||
@@ -147,11 +148,11 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional
|
||||
cat >> .cargo/config <<'EOF'
|
||||
[target."${rust.toRustTarget stdenv.buildPlatform}"]
|
||||
"linker" = "${ccForBuild}"
|
||||
${stdenv.lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) ''
|
||||
${lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) ''
|
||||
[target."${shortTarget}"]
|
||||
"linker" = "${ccForHost}"
|
||||
${# https://github.com/rust-lang/rust/issues/46651#issuecomment-433611633
|
||||
stdenv.lib.optionalString (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isAarch64) ''
|
||||
lib.optionalString (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isAarch64) ''
|
||||
"rustflags" = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ]
|
||||
''}
|
||||
''}
|
||||
@@ -163,7 +164,7 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional
|
||||
# After unpacking and applying patches, check that the Cargo.lock matches our
|
||||
# src package. Note that we do this after the patchPhase, because the
|
||||
# patchPhase may create the Cargo.lock if upstream has not shipped one.
|
||||
postPatch = (args.postPatch or "") + stdenv.lib.optionalString validateCargoDeps ''
|
||||
postPatch = (args.postPatch or "") + lib.optionalString validateCargoDeps ''
|
||||
cargoDepsLockfile=$NIX_BUILD_TOP/$cargoDepsCopy/Cargo.lock
|
||||
srcLockfile=$NIX_BUILD_TOP/$sourceRoot/Cargo.lock
|
||||
|
||||
@@ -206,7 +207,7 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional
|
||||
'';
|
||||
|
||||
buildPhase = with builtins; args.buildPhase or ''
|
||||
${stdenv.lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"}
|
||||
${lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"}
|
||||
runHook preBuild
|
||||
|
||||
(
|
||||
@@ -217,14 +218,14 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional
|
||||
"CC_${rust.toRustTarget stdenv.hostPlatform}"="${ccForHost}" \
|
||||
"CXX_${rust.toRustTarget stdenv.hostPlatform}"="${cxxForHost}" \
|
||||
cargo build -j $NIX_BUILD_CORES \
|
||||
${stdenv.lib.optionalString (buildType == "release") "--release"} \
|
||||
${lib.optionalString (buildType == "release") "--release"} \
|
||||
--target ${target} \
|
||||
--frozen ${concatStringsSep " " cargoBuildFlags}
|
||||
)
|
||||
|
||||
runHook postBuild
|
||||
|
||||
${stdenv.lib.optionalString (buildAndTestSubdir != null) "popd"}
|
||||
${lib.optionalString (buildAndTestSubdir != null) "popd"}
|
||||
|
||||
# This needs to be done after postBuild: packages like `cargo` do a pushd/popd in
|
||||
# the pre/postBuild-hooks that need to be taken into account before gathering
|
||||
@@ -238,15 +239,15 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional
|
||||
'';
|
||||
|
||||
checkPhase = args.checkPhase or (let
|
||||
argstr = "${stdenv.lib.optionalString (checkType == "release") "--release"} --target ${target} --frozen";
|
||||
argstr = "${lib.optionalString (checkType == "release") "--release"} --target ${target} --frozen";
|
||||
threads = if cargoParallelTestThreads then "$NIX_BUILD_CORES" else "1";
|
||||
in ''
|
||||
${stdenv.lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"}
|
||||
${lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"}
|
||||
runHook preCheck
|
||||
echo "Running cargo test ${argstr} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}"
|
||||
cargo test -j $NIX_BUILD_CORES ${argstr} -- --test-threads=${threads} ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"}
|
||||
runHook postCheck
|
||||
${stdenv.lib.optionalString (buildAndTestSubdir != null) "popd"}
|
||||
${lib.optionalString (buildAndTestSubdir != null) "popd"}
|
||||
'');
|
||||
|
||||
doCheck = args.doCheck or true;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, cacert, git, cargo, python3 }:
|
||||
{ lib, stdenv, cacert, git, cargo, python3 }:
|
||||
let cargo-vendor-normalise = stdenv.mkDerivation {
|
||||
name = "cargo-vendor-normalise";
|
||||
src = ./cargo-vendor-normalise.py;
|
||||
@@ -80,7 +80,7 @@ in stdenv.mkDerivation ({
|
||||
|
||||
inherit (hash_) outputHashAlgo outputHash;
|
||||
|
||||
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
|
||||
} // (builtins.removeAttrs args [
|
||||
"name" "sha256" "cargoUpdateHook"
|
||||
]))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ runCommand
|
||||
, lib
|
||||
, stdenv
|
||||
, storeDir ? builtins.storeDir
|
||||
, writeScript
|
||||
@@ -64,7 +65,7 @@ rec {
|
||||
mkdir proc sys dev
|
||||
|
||||
# Run root script
|
||||
${stdenv.lib.optionalString (runAsRoot != null) ''
|
||||
${lib.optionalString (runAsRoot != null) ''
|
||||
mkdir -p ./${storeDir}
|
||||
mount --rbind ${storeDir} ./${storeDir}
|
||||
unshare -imnpuf --mount-proc chroot ./ ${runAsRootFile}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{ stdenv, cleanPackaging, fetchurl }:
|
||||
let lib = stdenv.lib;
|
||||
in {
|
||||
{ lib, stdenv, cleanPackaging, fetchurl }:
|
||||
{
|
||||
# : string
|
||||
pname
|
||||
# : string
|
||||
@@ -98,7 +97,7 @@ in stdenv.mkDerivation {
|
||||
meta = {
|
||||
homepage = "https://skarnet.org/software/${pname}/";
|
||||
inherit description platforms;
|
||||
license = stdenv.lib.licenses.isc;
|
||||
license = lib.licenses.isc;
|
||||
maintainers = with lib.maintainers;
|
||||
[ pmahoney Profpatsch ] ++ maintainers;
|
||||
};
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
# files were either discarded or moved to outputs.
|
||||
# This ensures nothing is forgotten and new files
|
||||
# are correctly handled on update.
|
||||
{ stdenv, file, writeScript }:
|
||||
{ lib, stdenv, file, writeScript }:
|
||||
|
||||
let
|
||||
globWith = stdenv.lib.concatMapStringsSep "\n";
|
||||
globWith = lib.concatMapStringsSep "\n";
|
||||
rmNoise = noiseGlobs: globWith (f:
|
||||
''rm -rf ${f}'') noiseGlobs;
|
||||
mvDoc = docGlobs: globWith
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{ stdenv }:
|
||||
{ lib, stdenv }:
|
||||
|
||||
args:
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = if args ? name then args.name else baseNameOf (toString args.src);
|
||||
builder = with stdenv.lib; builtins.toFile "builder.sh" ''
|
||||
builder = builtins.toFile "builder.sh" ''
|
||||
source $stdenv/setup
|
||||
set -o pipefail
|
||||
|
||||
@@ -13,7 +13,7 @@ stdenv.mkDerivation ({
|
||||
args=
|
||||
|
||||
pushd "$src"
|
||||
echo -ne "${concatStringsSep "\\0" args.files}" | xargs -0 -n1 -I {} -- find {} -type f -print0 | while read -d "" line; do
|
||||
echo -ne "${lib.concatStringsSep "\\0" args.files}" | xargs -0 -n1 -I {} -- find {} -type f -print0 | while read -d "" line; do
|
||||
mkdir -p "$out/$(dirname "$line")"
|
||||
substituteAll "$line" "$out/$line"
|
||||
done
|
||||
|
||||
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
|
||||
meta = with lib; {
|
||||
description = "Create templates of nix expressions from RPM .spec files";
|
||||
maintainers = with maintainers; [ tstrobel ];
|
||||
platforms = with stdenv.lib.platforms; unix;
|
||||
platforms = platforms.unix;
|
||||
hydraPlatforms = [];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ pkgs
|
||||
{ lib
|
||||
, pkgs
|
||||
, kernel ? pkgs.linux
|
||||
, img ? pkgs.stdenv.hostPlatform.linux-kernel.target
|
||||
, storeDir ? builtins.storeDir
|
||||
@@ -572,7 +573,7 @@ rec {
|
||||
buildCommand = ''
|
||||
${createRootFS}
|
||||
|
||||
PATH=$PATH:${stdenv.lib.makeBinPath [ dpkg dpkg glibc lzma ]}
|
||||
PATH=$PATH:${lib.makeBinPath [ dpkg dpkg glibc lzma ]}
|
||||
|
||||
# Unpack the .debs. We do this to prevent pre-install scripts
|
||||
# (which have lots of circular dependencies) from barfing.
|
||||
|
||||
@@ -196,7 +196,7 @@ let
|
||||
|
||||
in runCommand "test-writers" {
|
||||
passthru = { inherit writeTest bin simple; };
|
||||
meta.platforms = stdenv.lib.platforms.all;
|
||||
meta.platforms = lib.platforms.all;
|
||||
} ''
|
||||
${lib.concatMapStringsSep "\n" (test: writeTest "success" "${test}/bin/test_writers") (lib.attrValues bin)}
|
||||
${lib.concatMapStringsSep "\n" (test: writeTest "success" test) (lib.attrValues simple)}
|
||||
|
||||
Reference in New Issue
Block a user