treewide: stdenv.lib -> lib

This commit is contained in:
Pavol Rusnak 2021-01-24 01:40:18 +01:00
parent 2f34b4b883
commit 90f7338112
No known key found for this signature in database
GPG key ID: 91F3B339B9A02A3D
49 changed files with 134 additions and 133 deletions

View file

@ -37,7 +37,7 @@ under the terms of [COPYING](../COPYING), which is an MIT-like license.
* Not start with the package name. * Not start with the package name.
* Not have a period at the end. * Not have a period at the end.
* `meta.license` must be set and fit the upstream license. * `meta.license` must be set and fit the upstream license.
* If there is no upstream license, `meta.license` should default to `stdenv.lib.licenses.unfree`. * If there is no upstream license, `meta.license` should default to `lib.licenses.unfree`.
* `meta.maintainers` must be set. * `meta.maintainers` must be set.
See the nixpkgs manual for more details on [standard meta-attributes](https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes) and on how to [submit changes to nixpkgs](https://nixos.org/nixpkgs/manual/#chap-submitting-changes). See the nixpkgs manual for more details on [standard meta-attributes](https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes) and on how to [submit changes to nixpkgs](https://nixos.org/nixpkgs/manual/#chap-submitting-changes).

View file

@ -1,6 +1,6 @@
import ./make-test-python.nix ({ pkgs, ... }: { import ./make-test-python.nix ({ pkgs, ... }: {
name = "usbguard"; name = "usbguard";
meta = with pkgs.stdenv.lib.maintainers; { meta = with pkgs.lib.maintainers; {
maintainers = [ tnias ]; maintainers = [ tnias ];
}; };

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, fetchpatch { lib, stdenv, fetchFromGitHub, fetchpatch
, cmake, halide , cmake, halide
, libpng, libjpeg, libtiff, libraw , libpng, libjpeg, libtiff, libraw
}: }:
@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
done done
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Burst photography pipeline based on Google's HDR+"; description = "Burst photography pipeline based on Google's HDR+";
homepage = "https://www.timothybrooks.com/tech/hdr-plus/"; homepage = "https://www.timothybrooks.com/tech/hdr-plus/";
license = licenses.mit; license = licenses.mit;

View file

@ -38,10 +38,10 @@ in mkDerivation rec {
passthru.updateScript = writeScript "${pname}-updater" '' passthru.updateScript = writeScript "${pname}-updater" ''
#!${stdenv.shell} #!${stdenv.shell}
set -eu -o pipefail set -eu -o pipefail
PATH=${stdenv.lib.makeBinPath [curl pup common-updater-scripts]}:$PATH PATH=${lib.makeBinPath [curl pup common-updater-scripts]}:$PATH
latestVersion="$(curl -sS https://www.rescuetime.com/release-notes/linux | pup '.release:first-of-type h2 strong text{}' | tr -d '\n')" latestVersion="$(curl -sS https://www.rescuetime.com/release-notes/linux | pup '.release:first-of-type h2 strong text{}' | tr -d '\n')"
for platform in ${stdenv.lib.concatStringsSep " " meta.platforms}; do for platform in ${lib.concatStringsSep " " meta.platforms}; do
# The script will not perform an update when the version attribute is up to date from previous platform run # The script will not perform an update when the version attribute is up to date from previous platform run
# We need to clear it before each run # We need to clear it before each run
update-source-version ${pname} 0 $(yes 0 | head -64 | tr -d "\n") --system=$platform update-source-version ${pname} 0 $(yes 0 | head -64 | tr -d "\n") --system=$platform

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, hamlib, pkg-config, qt5, qtbase, qttools, qtserialport, qtcharts, qmake, wrapQtAppsHook }: { lib, stdenv, fetchurl, hamlib, pkg-config, qt5, qtbase, qttools, qtserialport, qtcharts, qmake, wrapQtAppsHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "klog"; pname = "klog";
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
qmakeFlags = [ "KLog.pro" ]; qmakeFlags = [ "KLog.pro" ];
meta = with stdenv.lib; { meta = with lib; {
description = "A multiplatform free hamradio logger"; description = "A multiplatform free hamradio logger";
longDescription = '' longDescription = ''
KLog provides QSO management, useful QSL management DX-Cluster client, DXCC management, KLog provides QSO management, useful QSL management DX-Cluster client, DXCC management,

View file

@ -1,4 +1,4 @@
{ gccStdenv, fetchurl, zlib, mpi }: { lib, gccStdenv, fetchurl, zlib, mpi }:
gccStdenv.mkDerivation rec { gccStdenv.mkDerivation rec {
version = "3.7.2"; version = "3.7.2";
@ -14,7 +14,7 @@ gccStdenv.mkDerivation rec {
buildFlags = [ "thread" "mpis" ]; buildFlags = [ "thread" "mpis" ];
preInstall = "mkdir -p $out/man/man1"; preInstall = "mkdir -p $out/man/man1";
meta = with gccStdenv.lib; { meta = with lib; {
description = "Estimates population size, migration, population splitting parameters using genetic/genomic data"; description = "Estimates population size, migration, population splitting parameters using genetic/genomic data";
homepage = "https://peterbeerli.com/migrate-html5/index.html"; homepage = "https://peterbeerli.com/migrate-html5/index.html";
license = licenses.mit; license = licenses.mit;

View file

@ -132,7 +132,7 @@ Description: BLAS C implementation
Cflags: -I$dev/include Cflags: -I$dev/include
Libs: -L$out/lib -lcblas Libs: -L$out/lib -lcblas
EOF EOF
'' + stdenv.lib.optionalString (blasImplementation == "mkl") '' '' + lib.optionalString (blasImplementation == "mkl") ''
mkdir -p $out/nix-support mkdir -p $out/nix-support
echo 'export MKL_INTERFACE_LAYER=${lib.optionalString isILP64 "I"}LP64,GNU' > $out/nix-support/setup-hook 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} ln -s $out/lib/libblas${canonicalExtension} $out/lib/libmkl_rt${stdenv.hostPlatform.extensions.sharedLibrary}

View file

@ -98,7 +98,7 @@ Description: LAPACK C implementation
Cflags: -I$dev/include Cflags: -I$dev/include
Libs: -L$out/lib -llapacke Libs: -L$out/lib -llapacke
EOF EOF
'' + stdenv.lib.optionalString (lapackImplementation == "mkl") '' '' + lib.optionalString (lapackImplementation == "mkl") ''
mkdir -p $out/nix-support mkdir -p $out/nix-support
echo 'export MKL_INTERFACE_LAYER=${lib.optionalString isILP64 "I"}LP64,GNU' > $out/nix-support/setup-hook 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} ln -s $out/lib/liblapack${canonicalExtension} $out/lib/libmkl_rt${stdenv.hostPlatform.extensions.sharedLibrary}

View file

@ -1,4 +1,5 @@
{ stdenv { lib
, stdenv
, bash , bash
, binutils-unwrapped , binutils-unwrapped
, coreutils , coreutils
@ -15,7 +16,7 @@ rec {
src = ./appimage-exec.sh; src = ./appimage-exec.sh;
isExecutable = true; isExecutable = true;
dir = "bin"; dir = "bin";
path = with pkgs; stdenv.lib.makeBinPath [ path = lib.makeBinPath [
bash bash
binutils-unwrapped binutils-unwrapped
coreutils coreutils

View file

@ -94,7 +94,7 @@ rec {
inherit imageDigest; inherit imageDigest;
imageName = finalImageName; imageName = finalImageName;
imageTag = finalImageTag; imageTag = finalImageTag;
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars; impureEnvVars = lib.fetchers.proxyImpureEnvVars;
outputHashMode = "flat"; outputHashMode = "flat";
outputHashAlgo = "sha256"; outputHashAlgo = "sha256";
outputHash = sha256; outputHash = sha256;

View file

@ -1,6 +1,4 @@
{ stdenv, makeWrapper, nix, skopeo, jq }: { lib, stdenv, makeWrapper, nix, skopeo, jq }:
with stdenv.lib;
stdenv.mkDerivation { stdenv.mkDerivation {
name = "nix-prefetch-docker"; name = "nix-prefetch-docker";
@ -12,13 +10,13 @@ stdenv.mkDerivation {
installPhase = '' installPhase = ''
install -vD ${./nix-prefetch-docker} $out/bin/$name; install -vD ${./nix-prefetch-docker} $out/bin/$name;
wrapProgram $out/bin/$name \ wrapProgram $out/bin/$name \
--prefix PATH : ${makeBinPath [ nix skopeo jq ]} \ --prefix PATH : ${lib.makeBinPath [ nix skopeo jq ]} \
--set HOME /homeless-shelter --set HOME /homeless-shelter
''; '';
preferLocalBuild = true; preferLocalBuild = true;
meta = { meta = with lib; {
description = "Script used to obtain source hashes for dockerTools.pullImage"; description = "Script used to obtain source hashes for dockerTools.pullImage";
maintainers = with maintainers; [ offline ]; maintainers = with maintainers; [ offline ];
platforms = platforms.unix; platforms = platforms.unix;

View file

@ -1,4 +1,4 @@
{stdenv, dotnetfx}: { lib, stdenv, dotnetfx }:
{ name { name
, src , src
, baseDir ? "." , baseDir ? "."
@ -24,7 +24,7 @@ stdenv.mkDerivation {
''; '';
preBuild = '' preBuild = ''
${stdenv.lib.optionalString modifyPublicMain '' ${lib.optionalString modifyPublicMain ''
sed -i -e "s|static void Main|public static void Main|" ${mainClassFile} sed -i -e "s|static void Main|public static void Main|" ${mainClassFile}
''} ''}
${preBuild} ${preBuild}

View file

@ -1,9 +1,9 @@
{stdenv, dotnetfx}: { lib, stdenv, dotnetfx }:
let dotnetenv = let dotnetenv =
{ {
buildSolution = import ./build-solution.nix { buildSolution = import ./build-solution.nix {
inherit stdenv; inherit lib stdenv;
dotnetfx = dotnetfx.pkg; dotnetfx = dotnetfx.pkg;
}; };

View file

@ -1,6 +1,6 @@
# Adaptation of the MIT-licensed work on `sbt2nix` done by Charles O'Farrell # Adaptation of the MIT-licensed work on `sbt2nix` done by Charles O'Farrell
{ fetchurl, stdenv }: { lib, fetchurl, stdenv }:
let let
defaultRepos = [ defaultRepos = [
"https://repo1.maven.org/maven2" "https://repo1.maven.org/maven2"
@ -36,21 +36,20 @@ assert (url == "") || (urls == []);
# if repos is empty, then url or urls must be specified. # if repos is empty, then url or urls must be specified.
assert (repos != []) || (url != "") || (urls != []); assert (repos != []) || (url != "") || (urls != []);
let let
name_ = name_ =
with stdenv.lib; concatStrings [ lib.concatStrings [
(replaceChars ["."] ["_"] groupId) "_" (lib.replaceChars ["."] ["_"] groupId) "_"
(replaceChars ["."] ["_"] artifactId) "-" (lib.replaceChars ["."] ["_"] artifactId) "-"
version version
]; ];
mkJarUrl = repoUrl: mkJarUrl = repoUrl:
with stdenv.lib; concatStringsSep "/" [ lib.concatStringsSep "/" [
(removeSuffix "/" repoUrl) (lib.removeSuffix "/" repoUrl)
(replaceChars ["."] ["/"] groupId) (lib.replaceChars ["."] ["/"] groupId)
artifactId artifactId
version version
"${artifactId}-${version}${optionalString (!isNull classifier) "-${classifier}"}.jar" "${artifactId}-${version}${lib.optionalString (!isNull classifier) "-${classifier}"}.jar"
]; ];
urls_ = urls_ =
if url != "" then [url] if url != "" then [url]

View file

@ -1,4 +1,4 @@
{ stdenv, icoutils }: { lib, stdenv, icoutils }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "icon-conv-tools-0.0.0"; name = "icon-conv-tools-0.0.0";
@ -23,9 +23,9 @@ stdenv.mkDerivation {
dontPatchELF = true; dontPatchELF = true;
dontStrip = true; dontStrip = true;
meta = { meta = with lib; {
description = "Tools for icon conversion specific to nix package manager"; description = "Tools for icon conversion specific to nix package manager";
maintainers = with stdenv.lib.maintainers; [ jraygauthier ]; maintainers = with maintainers; [ jraygauthier ];
platforms = with stdenv.lib.platforms; linux; platforms = platforms.linux;
}; };
} }

View file

@ -46,8 +46,8 @@ stdenv.mkDerivation {
) )
''; '';
meta = { meta = with lib; {
platforms = stdenv.lib.platforms.unix; platforms = platforms.unix;
description = "An LD_PRELOAD library to intercept and rewrite the paths in glibc calls"; description = "An LD_PRELOAD library to intercept and rewrite the paths in glibc calls";
longDescription = '' longDescription = ''
libredirect is an LD_PRELOAD library to intercept and rewrite the paths in libredirect is an LD_PRELOAD library to intercept and rewrite the paths in

View file

@ -1,4 +1,4 @@
{ stdenv, writeText, ocaml, findlib, ocamlbuild, camlp4 }: { lib, stdenv, writeText, ocaml, findlib, ocamlbuild, camlp4 }:
{ name, version, buildInputs ? [], { name, version, buildInputs ? [],
createFindlibDestdir ? true, createFindlibDestdir ? true,
@ -14,7 +14,7 @@ let
}; };
in in
assert minimumSupportedOcamlVersion != null -> assert minimumSupportedOcamlVersion != null ->
stdenv.lib.versionOlder minimumSupportedOcamlVersion ocaml.version; lib.versionOlder minimumSupportedOcamlVersion ocaml.version;
stdenv.mkDerivation (args // { stdenv.mkDerivation (args // {
name = "ocaml-${name}-${version}"; name = "ocaml-${name}-${version}";

View file

@ -1,11 +1,11 @@
{ stdenv, ocaml, findlib, dune, dune_2 }: { lib, stdenv, ocaml, findlib, dune, dune_2 }:
{ pname, version, buildInputs ? [], enableParallelBuilding ? true, ... }@args: { pname, version, buildInputs ? [], enableParallelBuilding ? true, ... }@args:
let Dune = if args.useDune2 or false then dune_2 else dune; in let Dune = if args.useDune2 or false then dune_2 else dune; in
if args ? minimumOCamlVersion && 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}" then throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
else else

View file

@ -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 []; }, { pname, version, buildInputs ? [], meta ? { platforms = ocaml.meta.platforms or []; },
minimumOCamlVersion ? null, minimumOCamlVersion ? null,
@ -8,7 +8,7 @@
}@args: }@args:
if args ? minimumOCamlVersion && 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}" then throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
else else

View file

@ -2,6 +2,7 @@
# PKG_CONFIG_PATH_FOR_BUILD work properly. # PKG_CONFIG_PATH_FOR_BUILD work properly.
{ stdenvNoCC { stdenvNoCC
, lib
, buildPackages , buildPackages
, pkg-config , pkg-config
, baseBinName ? "pkg-config" , baseBinName ? "pkg-config"
@ -19,7 +20,7 @@ let
# #
# TODO(@Ericson2314) Make unconditional, or optional but always true by # TODO(@Ericson2314) Make unconditional, or optional but always true by
# default. # default.
targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform) targetPrefix = lib.optionalString (targetPlatform != hostPlatform)
(targetPlatform.config + "-"); (targetPlatform.config + "-");
# See description in cc-wrapper. # See description in cc-wrapper.
@ -119,7 +120,7 @@ stdenv.mkDerivation {
let pkg-config_ = if pkg-config != null then pkg-config else {}; in let pkg-config_ = if pkg-config != null then pkg-config else {}; in
(if pkg-config_ ? meta then removeAttrs pkg-config.meta ["priority"] else {}) // (if pkg-config_ ? meta then removeAttrs pkg-config.meta ["priority"] else {}) //
{ description = { description =
stdenv.lib.attrByPath ["meta" "description"] "pkg-config" pkg-config_ lib.attrByPath ["meta" "description"] "pkg-config" pkg-config_
+ " (wrapper script)"; + " (wrapper script)";
priority = 10; priority = 10;
}; };

View file

@ -1,4 +1,4 @@
{ stdenv }: { lib, stdenv }:
# helper functions for packaging programs with plugin systems # helper functions for packaging programs with plugin systems
{ {
@ -13,7 +13,7 @@
diffPlugins = expectedPlugins: foundPluginsFilePath: '' diffPlugins = expectedPlugins: foundPluginsFilePath: ''
# sort both lists first # sort both lists first
plugins_expected=$(mktemp) plugins_expected=$(mktemp)
(${stdenv.lib.concatMapStrings (s: "echo \"${s}\";") expectedPlugins}) \ (${lib.concatMapStrings (s: "echo \"${s}\";") expectedPlugins}) \
| sort -u > "$plugins_expected" | sort -u > "$plugins_expected"
plugins_found=$(mktemp) plugins_found=$(mktemp)
sort -u "${foundPluginsFilePath}" > "$plugins_found" sort -u "${foundPluginsFilePath}" > "$plugins_found"

View file

@ -2,6 +2,7 @@
# that contains a Debian-like (i.e. dpkg-based) OS. # that contains a Debian-like (i.e. dpkg-based) OS.
{ name ? "debian-build" { name ? "debian-build"
, lib
, diskImage , diskImage
, src, stdenv, vmTools, checkinstall , src, stdenv, vmTools, checkinstall
, fsTranslation ? false , fsTranslation ? false
@ -11,8 +12,6 @@
debRequires ? [] debRequires ? []
, ... } @ args: , ... } @ args:
with stdenv.lib;
vmTools.runInLinuxImage (stdenv.mkDerivation ( vmTools.runInLinuxImage (stdenv.mkDerivation (
{ {
@ -59,8 +58,8 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
export PAGER=cat export PAGER=cat
${checkinstall}/sbin/checkinstall --nodoc -y -D \ ${checkinstall}/sbin/checkinstall --nodoc -y -D \
--fstrans=${if fsTranslation then "yes" else "no"} \ --fstrans=${if fsTranslation then "yes" else "no"} \
--requires="${concatStringsSep "," debRequires}" \ --requires="${lib.concatStringsSep "," debRequires}" \
--provides="${concatStringsSep "," debProvides}" \ --provides="${lib.concatStringsSep "," debProvides}" \
${if (src ? version) then "--pkgversion=$(echo ${src.version} | tr _ -)" ${if (src ? version) then "--pkgversion=$(echo ${src.version} | tr _ -)"
else "--pkgversion=0.0.0"} \ else "--pkgversion=0.0.0"} \
''${debMaintainer:+--maintainer="'$debMaintainer'"} \ ''${debMaintainer:+--maintainer="'$debMaintainer'"} \

View file

@ -1,4 +1,4 @@
{ pkgs }: { lib, pkgs }:
with pkgs; with pkgs;
@ -23,7 +23,7 @@ rec {
} // args); } // args);
nixBuild = args: import ./nix-build.nix ( nixBuild = args: import ./nix-build.nix (
{ inherit stdenv; { inherit lib stdenv;
} // args); } // args);
coverageAnalysis = args: nixBuild ( coverageAnalysis = args: nixBuild (
@ -46,7 +46,7 @@ rec {
} // args); } // args);
debBuild = args: import ./debian-build.nix ( debBuild = args: import ./debian-build.nix (
{ inherit stdenv vmTools checkinstall; { inherit lib stdenv vmTools checkinstall;
} // args); } // args);
aggregate = aggregate =
@ -94,7 +94,7 @@ rec {
phases = [ "unpackPhase" "patchPhase" "installPhase" ]; phases = [ "unpackPhase" "patchPhase" "installPhase" ];
patchPhase = stdenv.lib.optionalString isNixOS '' patchPhase = lib.optionalString isNixOS ''
touch .update-on-nixos-rebuild touch .update-on-nixos-rebuild
''; '';

View file

@ -12,7 +12,7 @@
, doCoverityAnalysis ? false , doCoverityAnalysis ? false
, lcovFilter ? [] , lcovFilter ? []
, lcovExtraTraceFiles ? [] , lcovExtraTraceFiles ? []
, src, stdenv , src, lib, stdenv
, name ? if doCoverageAnalysis then "nix-coverage" else "nix-build" , name ? if doCoverageAnalysis then "nix-coverage" else "nix-build"
, failureHook ? null , failureHook ? null
, prePhases ? [] , prePhases ? []
@ -69,7 +69,7 @@ stdenv.mkDerivation (
fi fi
''; '';
failureHook = (stdenv.lib.optionalString (failureHook != null) failureHook) + failureHook = (lib.optionalString (failureHook != null) failureHook) +
'' ''
if test -n "$succeedOnFailure"; then if test -n "$succeedOnFailure"; then
if test -n "$keepBuildDirectory"; then if test -n "$keepBuildDirectory"; then
@ -136,10 +136,10 @@ stdenv.mkDerivation (
buildInputs = buildInputs =
buildInputs ++ buildInputs ++
(stdenv.lib.optional doCoverageAnalysis args.makeGCOVReport) ++ (lib.optional doCoverageAnalysis args.makeGCOVReport) ++
(stdenv.lib.optional doClangAnalysis args.clang-analyzer) ++ (lib.optional doClangAnalysis args.clang-analyzer) ++
(stdenv.lib.optional doCoverityAnalysis args.cov-build) ++ (lib.optional doCoverityAnalysis args.cov-build) ++
(stdenv.lib.optional doCoverityAnalysis args.xz); (lib.optional doCoverityAnalysis args.xz);
lcovFilter = ["/nix/store/*"] ++ lcovFilter; lcovFilter = ["/nix/store/*"] ++ lcovFilter;

View file

@ -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, openssl, sqlite, zlib, dbus, dbus-glib, gdk-pixbuf, cairo, python3,
libsodium, postgresql, gmp, foundationdb, capnproto, nettle, clang, libsodium, postgresql, gmp, foundationdb, capnproto, nettle, clang,
llvmPackages, ... }: llvmPackages, ... }:
@ -17,7 +17,7 @@ in
cargo = attrs: { cargo = attrs: {
buildInputs = [ openssl zlib curl ] buildInputs = [ openssl zlib curl ]
++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ]; ++ lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ];
}; };
libz-sys = attrs: { libz-sys = attrs: {
@ -149,7 +149,7 @@ in
}; };
serde_derive = attrs: { serde_derive = attrs: {
buildInputs = stdenv.lib.optional stdenv.isDarwin Security; buildInputs = lib.optional stdenv.isDarwin Security;
}; };
thrussh-libsodium = attrs: { thrussh-libsodium = attrs: {

View file

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, buildPackages , buildPackages
, cacert , cacert
, cargo , cargo
@ -83,13 +84,13 @@ let
cargoDepsCopy="$sourceRoot/${cargoVendorDir}" cargoDepsCopy="$sourceRoot/${cargoVendorDir}"
''; '';
targetIsJSON = stdenv.lib.hasSuffix ".json" target; targetIsJSON = lib.hasSuffix ".json" target;
useSysroot = targetIsJSON && !__internal_dontAddSysroot; useSysroot = targetIsJSON && !__internal_dontAddSysroot;
# see https://github.com/rust-lang/cargo/blob/964a16a28e234a3d397b2a7031d4ab4a428b1391/src/cargo/core/compiler/compile_kind.rs#L151-L168 # 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 # the "${}" is needed to transform the path into a /nix/store path before baseNameOf
shortTarget = if targetIsJSON then shortTarget = if targetIsJSON then
(stdenv.lib.removeSuffix ".json" (builtins.baseNameOf "${target}")) (lib.removeSuffix ".json" (builtins.baseNameOf "${target}"))
else target; else target;
sysroot = (callPackage ./sysroot {}) { sysroot = (callPackage ./sysroot {}) {
@ -116,7 +117,7 @@ in
# See https://os.phil-opp.com/testing/ for more information. # See https://os.phil-opp.com/testing/ for more information.
assert useSysroot -> !(args.doCheck or true); 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 ""); RUSTFLAGS = "--sysroot ${sysroot} " + (args.RUSTFLAGS or "");
} // { } // {
inherit cargoDeps; inherit cargoDeps;
@ -124,7 +125,7 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional
patchRegistryDeps = ./patch-registry-deps; patchRegistryDeps = ./patch-registry-deps;
nativeBuildInputs = nativeBuildInputs ++ [ cacert git cargo rustc ]; 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; patches = cargoPatches ++ patches;
@ -147,11 +148,11 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional
cat >> .cargo/config <<'EOF' cat >> .cargo/config <<'EOF'
[target."${rust.toRustTarget stdenv.buildPlatform}"] [target."${rust.toRustTarget stdenv.buildPlatform}"]
"linker" = "${ccForBuild}" "linker" = "${ccForBuild}"
${stdenv.lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) '' ${lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) ''
[target."${shortTarget}"] [target."${shortTarget}"]
"linker" = "${ccForHost}" "linker" = "${ccForHost}"
${# https://github.com/rust-lang/rust/issues/46651#issuecomment-433611633 ${# 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" ] "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 # After unpacking and applying patches, check that the Cargo.lock matches our
# src package. Note that we do this after the patchPhase, because the # src package. Note that we do this after the patchPhase, because the
# patchPhase may create the Cargo.lock if upstream has not shipped one. # 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 cargoDepsLockfile=$NIX_BUILD_TOP/$cargoDepsCopy/Cargo.lock
srcLockfile=$NIX_BUILD_TOP/$sourceRoot/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 '' buildPhase = with builtins; args.buildPhase or ''
${stdenv.lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"} ${lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"}
runHook preBuild runHook preBuild
( (
@ -217,14 +218,14 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional
"CC_${rust.toRustTarget stdenv.hostPlatform}"="${ccForHost}" \ "CC_${rust.toRustTarget stdenv.hostPlatform}"="${ccForHost}" \
"CXX_${rust.toRustTarget stdenv.hostPlatform}"="${cxxForHost}" \ "CXX_${rust.toRustTarget stdenv.hostPlatform}"="${cxxForHost}" \
cargo build -j $NIX_BUILD_CORES \ cargo build -j $NIX_BUILD_CORES \
${stdenv.lib.optionalString (buildType == "release") "--release"} \ ${lib.optionalString (buildType == "release") "--release"} \
--target ${target} \ --target ${target} \
--frozen ${concatStringsSep " " cargoBuildFlags} --frozen ${concatStringsSep " " cargoBuildFlags}
) )
runHook postBuild 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 # 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 # 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 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"; threads = if cargoParallelTestThreads then "$NIX_BUILD_CORES" else "1";
in '' in ''
${stdenv.lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"} ${lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"}
runHook preCheck runHook preCheck
echo "Running cargo test ${argstr} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}" echo "Running cargo test ${argstr} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}"
cargo test -j $NIX_BUILD_CORES ${argstr} -- --test-threads=${threads} ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"} cargo test -j $NIX_BUILD_CORES ${argstr} -- --test-threads=${threads} ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"}
runHook postCheck runHook postCheck
${stdenv.lib.optionalString (buildAndTestSubdir != null) "popd"} ${lib.optionalString (buildAndTestSubdir != null) "popd"}
''); '');
doCheck = args.doCheck or true; doCheck = args.doCheck or true;

View file

@ -1,4 +1,4 @@
{ stdenv, cacert, git, cargo, python3 }: { lib, stdenv, cacert, git, cargo, python3 }:
let cargo-vendor-normalise = stdenv.mkDerivation { let cargo-vendor-normalise = stdenv.mkDerivation {
name = "cargo-vendor-normalise"; name = "cargo-vendor-normalise";
src = ./cargo-vendor-normalise.py; src = ./cargo-vendor-normalise.py;
@ -80,7 +80,7 @@ in stdenv.mkDerivation ({
inherit (hash_) outputHashAlgo outputHash; inherit (hash_) outputHashAlgo outputHash;
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars; impureEnvVars = lib.fetchers.proxyImpureEnvVars;
} // (builtins.removeAttrs args [ } // (builtins.removeAttrs args [
"name" "sha256" "cargoUpdateHook" "name" "sha256" "cargoUpdateHook"
])) ]))

View file

@ -1,4 +1,5 @@
{ runCommand { runCommand
, lib
, stdenv , stdenv
, storeDir ? builtins.storeDir , storeDir ? builtins.storeDir
, writeScript , writeScript
@ -64,7 +65,7 @@ rec {
mkdir proc sys dev mkdir proc sys dev
# Run root script # Run root script
${stdenv.lib.optionalString (runAsRoot != null) '' ${lib.optionalString (runAsRoot != null) ''
mkdir -p ./${storeDir} mkdir -p ./${storeDir}
mount --rbind ${storeDir} ./${storeDir} mount --rbind ${storeDir} ./${storeDir}
unshare -imnpuf --mount-proc chroot ./ ${runAsRootFile} unshare -imnpuf --mount-proc chroot ./ ${runAsRootFile}

View file

@ -1,6 +1,5 @@
{ stdenv, cleanPackaging, fetchurl }: { lib, stdenv, cleanPackaging, fetchurl }:
let lib = stdenv.lib; {
in {
# : string # : string
pname pname
# : string # : string
@ -98,7 +97,7 @@ in stdenv.mkDerivation {
meta = { meta = {
homepage = "https://skarnet.org/software/${pname}/"; homepage = "https://skarnet.org/software/${pname}/";
inherit description platforms; inherit description platforms;
license = stdenv.lib.licenses.isc; license = lib.licenses.isc;
maintainers = with lib.maintainers; maintainers = with lib.maintainers;
[ pmahoney Profpatsch ] ++ maintainers; [ pmahoney Profpatsch ] ++ maintainers;
}; };

View file

@ -3,10 +3,10 @@
# files were either discarded or moved to outputs. # files were either discarded or moved to outputs.
# This ensures nothing is forgotten and new files # This ensures nothing is forgotten and new files
# are correctly handled on update. # are correctly handled on update.
{ stdenv, file, writeScript }: { lib, stdenv, file, writeScript }:
let let
globWith = stdenv.lib.concatMapStringsSep "\n"; globWith = lib.concatMapStringsSep "\n";
rmNoise = noiseGlobs: globWith (f: rmNoise = noiseGlobs: globWith (f:
''rm -rf ${f}'') noiseGlobs; ''rm -rf ${f}'') noiseGlobs;
mvDoc = docGlobs: globWith mvDoc = docGlobs: globWith

View file

@ -1,10 +1,10 @@
{ stdenv }: { lib, stdenv }:
args: args:
stdenv.mkDerivation ({ stdenv.mkDerivation ({
name = if args ? name then args.name else baseNameOf (toString args.src); 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 source $stdenv/setup
set -o pipefail set -o pipefail
@ -13,7 +13,7 @@ stdenv.mkDerivation ({
args= args=
pushd "$src" 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")" mkdir -p "$out/$(dirname "$line")"
substituteAll "$line" "$out/$line" substituteAll "$line" "$out/$line"
done done

View file

@ -18,7 +18,7 @@ stdenv.mkDerivation {
meta = with lib; { meta = with lib; {
description = "Create templates of nix expressions from RPM .spec files"; description = "Create templates of nix expressions from RPM .spec files";
maintainers = with maintainers; [ tstrobel ]; maintainers = with maintainers; [ tstrobel ];
platforms = with stdenv.lib.platforms; unix; platforms = platforms.unix;
hydraPlatforms = []; hydraPlatforms = [];
}; };
} }

View file

@ -1,4 +1,5 @@
{ pkgs { lib
, pkgs
, kernel ? pkgs.linux , kernel ? pkgs.linux
, img ? pkgs.stdenv.hostPlatform.linux-kernel.target , img ? pkgs.stdenv.hostPlatform.linux-kernel.target
, storeDir ? builtins.storeDir , storeDir ? builtins.storeDir
@ -572,7 +573,7 @@ rec {
buildCommand = '' buildCommand = ''
${createRootFS} ${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 # Unpack the .debs. We do this to prevent pre-install scripts
# (which have lots of circular dependencies) from barfing. # (which have lots of circular dependencies) from barfing.

View file

@ -196,7 +196,7 @@ let
in runCommand "test-writers" { in runCommand "test-writers" {
passthru = { inherit writeTest bin simple; }; 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}/bin/test_writers") (lib.attrValues bin)}
${lib.concatMapStringsSep "\n" (test: writeTest "success" test) (lib.attrValues simple)} ${lib.concatMapStringsSep "\n" (test: writeTest "success" test) (lib.attrValues simple)}

View file

@ -1,4 +1,4 @@
{ stdenv, makeWrapper, coreutils, gnused, gnugrep, diffutils, nix, git, jq }: { lib, stdenv, makeWrapper, coreutils, gnused, gnugrep, diffutils, nix, git, jq }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "common-updater-scripts"; name = "common-updater-scripts";
@ -12,7 +12,7 @@ stdenv.mkDerivation {
cp ${./scripts}/* $out/bin cp ${./scripts}/* $out/bin
for f in $out/bin/*; do for f in $out/bin/*; do
wrapProgram $f --prefix PATH : ${stdenv.lib.makeBinPath [ coreutils gnused gnugrep nix diffutils git jq ]} wrapProgram $f --prefix PATH : ${lib.makeBinPath [ coreutils gnused gnugrep nix diffutils git jq ]}
done done
''; '';
} }

View file

@ -35,7 +35,7 @@ let
buildPhase = '' buildPhase = ''
export GRADLE_USER_HOME=$(mktemp -d) export GRADLE_USER_HOME=$(mktemp -d)
# https://github.com/gradle/gradle/issues/4426 # https://github.com/gradle/gradle/issues/4426
${stdenv.lib.optionalString stdenv.isDarwin "export TERM=dumb"} ${lib.optionalString stdenv.isDarwin "export TERM=dumb"}
gradle --no-daemon desktop:release gradle --no-daemon desktop:release
''; '';
# perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar) # perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar)
@ -57,7 +57,7 @@ in stdenv.mkDerivation rec {
buildPhase = '' buildPhase = ''
export GRADLE_USER_HOME=$(mktemp -d) export GRADLE_USER_HOME=$(mktemp -d)
# https://github.com/gradle/gradle/issues/4426 # https://github.com/gradle/gradle/issues/4426
${stdenv.lib.optionalString stdenv.isDarwin "export TERM=dumb"} ${lib.optionalString stdenv.isDarwin "export TERM=dumb"}
# point to offline repo # point to offline repo
sed -ie "s#repositories {#repositories { maven { url '${deps}' };#g" build.gradle sed -ie "s#repositories {#repositories { maven { url '${deps}' };#g" build.gradle
gradle --offline --no-daemon desktop:release gradle --offline --no-daemon desktop:release

View file

@ -1,4 +1,4 @@
{ multiStdenv, fetchurl }: { lib, multiStdenv, fetchurl }:
let version = "1.7.4"; in let version = "1.7.4"; in
multiStdenv.mkDerivation { multiStdenv.mkDerivation {
@ -16,7 +16,7 @@ multiStdenv.mkDerivation {
sed -e s@/bin/bash@"${multiStdenv.shell}"@g -i src/*.sh sed -e s@/bin/bash@"${multiStdenv.shell}"@g -i src/*.sh
''; '';
meta = with multiStdenv.lib; { meta = with lib; {
description = "Tool for creating static Linux binaries"; description = "Tool for creating static Linux binaries";
platforms = platforms.linux; platforms = platforms.linux;
license = licenses.gpl2; license = licenses.gpl2;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }: { lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "fiche"; pname = "fiche";
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
doCheck = true; doCheck = true;
meta = with stdenv.lib; { meta = with lib; {
description = "Command line pastebin for sharing terminal output"; description = "Command line pastebin for sharing terminal output";
longDescription = '' longDescription = ''
Fiche is a command line pastebin server for sharing terminal output. Fiche is a command line pastebin server for sharing terminal output.

View file

@ -139,7 +139,7 @@ let
outputs = [ "out" "lib" "dev" "pythonsrc" ]; outputs = [ "out" "lib" "dev" "pythonsrc" ];
meta = with gcc6Stdenv.lib; { meta = with lib; {
description = "Open source, distributed, transactional key-value store"; description = "Open source, distributed, transactional key-value store";
homepage = "https://www.foundationdb.org"; homepage = "https://www.foundationdb.org";
license = licenses.asl20; license = licenses.asl20;

View file

@ -1,4 +1,5 @@
{ buildBazelPackage { lib
, buildBazelPackage
, fetchFromGitHub , fetchFromGitHub
, stdenv , stdenv
, cmake , cmake
@ -109,7 +110,7 @@ buildBazelPackage rec {
"--cxxopt=-Wno-uninitialized" "--cxxopt=-Wno-uninitialized"
]; ];
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://envoyproxy.io"; homepage = "https://envoyproxy.io";
description = "Cloud-native edge and service proxy"; description = "Cloud-native edge and service proxy";
license = licenses.asl20; license = licenses.asl20;

View file

@ -1,13 +1,13 @@
{ stdenv, glibc }: { lib, stdenv, glibc }:
with stdenv.lib;
let let
# Sanitizers are not supported on Darwin. # Sanitizers are not supported on Darwin.
# Sanitizer headers aren't available in older libc++ stdenvs due to a bug # Sanitizer headers aren't available in older libc++ stdenvs due to a bug
sanitizersWorking = !stdenv.hostPlatform.isMusl && ( sanitizersWorking = !stdenv.hostPlatform.isMusl && (
(stdenv.cc.isClang && versionAtLeast (getVersion stdenv.cc.name) "5.0.0") (stdenv.cc.isClang && lib.versionAtLeast (lib.getVersion stdenv.cc.name) "5.0.0")
|| (stdenv.cc.isGNU && stdenv.isLinux) || (stdenv.cc.isGNU && stdenv.isLinux)
); );
staticLibc = optionalString (stdenv.hostPlatform.libc == "glibc") "-L ${glibc.static}/lib"; staticLibc = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "-L ${glibc.static}/lib";
in stdenv.mkDerivation { in stdenv.mkDerivation {
name = "cc-wrapper-test"; name = "cc-wrapper-test";
@ -23,7 +23,7 @@ in stdenv.mkDerivation {
$CXX -o cxx-check ${./cxx-main.cc} $CXX -o cxx-check ${./cxx-main.cc}
./cxx-check ./cxx-check
${optionalString (stdenv.isDarwin && stdenv.cc.isClang) '' ${lib.optionalString (stdenv.isDarwin && stdenv.cc.isClang) ''
printf "checking whether compiler can build with CoreFoundation.framework... " >&2 printf "checking whether compiler can build with CoreFoundation.framework... " >&2
mkdir -p foo/lib mkdir -p foo/lib
$CC -framework CoreFoundation -o core-foundation-check ${./core-foundation-main.c} $CC -framework CoreFoundation -o core-foundation-check ${./core-foundation-main.c}
@ -31,12 +31,12 @@ in stdenv.mkDerivation {
''} ''}
${optionalString (!stdenv.isDarwin) '' ${lib.optionalString (!stdenv.isDarwin) ''
printf "checking whether compiler builds valid static C binaries... " >&2 printf "checking whether compiler builds valid static C binaries... " >&2
$CC ${staticLibc} -static -o cc-static ${./cc-main.c} $CC ${staticLibc} -static -o cc-static ${./cc-main.c}
./cc-static ./cc-static
# our glibc does not have pie enabled yet. # our glibc does not have pie enabled yet.
${optionalString (stdenv.hostPlatform.isMusl && stdenv.cc.isGNU) '' ${lib.optionalString (stdenv.hostPlatform.isMusl && stdenv.cc.isGNU) ''
printf "checking whether compiler builds valid static pie C binaries... " >&2 printf "checking whether compiler builds valid static pie C binaries... " >&2
$CC ${staticLibc} -static-pie -o cc-static-pie ${./cc-main.c} $CC ${staticLibc} -static-pie -o cc-static-pie ${./cc-main.c}
./cc-static-pie ./cc-static-pie
@ -52,7 +52,7 @@ in stdenv.mkDerivation {
printf "checking whether compiler uses NIX_LDFLAGS... " >&2 printf "checking whether compiler uses NIX_LDFLAGS... " >&2
mkdir -p foo/lib mkdir -p foo/lib
$CC -shared \ $CC -shared \
${optionalString stdenv.isDarwin "-Wl,-install_name,@rpath/libfoo.dylib"} \ ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,@rpath/libfoo.dylib"} \
-DVALUE=42 \ -DVALUE=42 \
-o foo/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \ -o foo/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \
${./foo.c} ${./foo.c}
@ -68,7 +68,7 @@ in stdenv.mkDerivation {
$CXX -I std-include -nostdinc++ -o nostdinc-main++ ${./nostdinc-main.c} $CXX -I std-include -nostdinc++ -o nostdinc-main++ ${./nostdinc-main.c}
./nostdinc-main++ ./nostdinc-main++
${optionalString sanitizersWorking '' ${lib.optionalString sanitizersWorking ''
printf "checking whether sanitizers are fully functional... ">&2 printf "checking whether sanitizers are fully functional... ">&2
$CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c} $CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c}
./sanitizers ./sanitizers
@ -77,5 +77,5 @@ in stdenv.mkDerivation {
touch $out touch $out
''; '';
meta.platforms = platforms.all; meta.platforms = lib.platforms.all;
} }

View file

@ -1,4 +1,4 @@
{ stdenv }: { lib, stdenv }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "cc-multilib-test"; name = "cc-multilib-test";
@ -33,5 +33,5 @@ stdenv.mkDerivation {
touch $out touch $out
''; '';
meta.platforms = stdenv.lib.platforms.x86_64; meta.platforms = lib.platforms.x86_64;
} }

View file

@ -1,10 +1,10 @@
{ stdenv, runCommandLocal, recurseIntoAttrs, installShellFiles }: { lib, stdenv, runCommandLocal, recurseIntoAttrs, installShellFiles }:
let let
runTest = name: env: buildCommand: runTest = name: env: buildCommand:
runCommandLocal "install-shell-files--${name}" ({ runCommandLocal "install-shell-files--${name}" ({
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
meta.platforms = stdenv.lib.platforms.all; meta.platforms = lib.platforms.all;
} // env) buildCommand; } // env) buildCommand;
in in

View file

@ -1,4 +1,4 @@
{ stdenv }: { lib, stdenv }:
# This tests that libraries listed in LD_LIBRARY_PATH take precedence over those listed in RPATH. # This tests that libraries listed in LD_LIBRARY_PATH take precedence over those listed in RPATH.
@ -84,5 +84,5 @@ in stdenv.mkDerivation {
touch $out touch $out
''; '';
meta.platforms = stdenv.lib.platforms.linux; meta.platforms = lib.platforms.linux;
} }

View file

@ -1,4 +1,4 @@
{ stdenv, runCommand }: { lib, stdenv, runCommand }:
let let
bad-shebang = stdenv.mkDerivation { bad-shebang = stdenv.mkDerivation {
@ -13,7 +13,7 @@ let
}; };
in runCommand "patch-shebangs-test" { in runCommand "patch-shebangs-test" {
passthru = { inherit bad-shebang; }; passthru = { inherit bad-shebang; };
meta.platforms = stdenv.lib.platforms.all; meta.platforms = lib.platforms.all;
} '' } ''
printf "checking whether patchShebangs works properly... ">&2 printf "checking whether patchShebangs works properly... ">&2
if ! grep -q '^#!/bin/sh' ${bad-shebang}/bin/test; then if ! grep -q '^#!/bin/sh' ${bad-shebang}/bin/test; then

View file

@ -1,4 +1,4 @@
{ stdenv }: { lib, stdenv }:
let let
foo = stdenv.mkDerivation { foo = stdenv.mkDerivation {
@ -12,7 +12,7 @@ let
chmod +x $out/bin/foo chmod +x $out/bin/foo
cp ${./foo.c} $out/include/foo.h cp ${./foo.c} $out/include/foo.h
$CC -shared \ $CC -shared \
${stdenv.lib.optionalString stdenv.isDarwin "-Wl,-install_name,$out/lib/libfoo.dylib"} \ ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,$out/lib/libfoo.dylib"} \
-o $out/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \ -o $out/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \
${./foo.c} ${./foo.c}
''; '';
@ -30,7 +30,7 @@ let
chmod +x $out/bin/bar chmod +x $out/bin/bar
cp ${./bar.c} $dev/include/bar.h cp ${./bar.c} $dev/include/bar.h
$CC -shared \ $CC -shared \
${stdenv.lib.optionalString stdenv.isDarwin "-Wl,-install_name,$dev/lib/libbar.dylib"} \ ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,$dev/lib/libbar.dylib"} \
-o $dev/lib/libbar${stdenv.hostPlatform.extensions.sharedLibrary} \ -o $dev/lib/libbar${stdenv.hostPlatform.extensions.sharedLibrary} \
${./bar.c} ${./bar.c}
''; '';
@ -64,5 +64,5 @@ stdenv.mkDerivation {
touch $out touch $out
''; '';
meta.platforms = stdenv.lib.platforms.all; meta.platforms = lib.platforms.all;
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, libpng, libjpeg, giflib, perl, pkg-config }: { lib, stdenv, fetchFromGitHub, libpng, libjpeg, giflib, perl, pkg-config }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "metapixel"; pname = "metapixel";
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
cp metapixel-sizesort $out/bin/metapixel-sizesort cp metapixel-sizesort $out/bin/metapixel-sizesort
''; '';
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://github.com/schani/metapixel"; homepage = "https://github.com/schani/metapixel";
description = "Tool for generating photomosaics"; description = "Tool for generating photomosaics";
license = licenses.gpl2Only; license = licenses.gpl2Only;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub { lib, stdenv, fetchFromGitHub
, autoreconfHook, pkg-config , autoreconfHook, pkg-config
, liblxi, readline, lua , liblxi, readline, lua
}: }:
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
buildInputs = [ liblxi readline lua ]; buildInputs = [ liblxi readline lua ];
meta = with stdenv.lib; { meta = with lib; {
description = "Tool for communicating with LXI compatible instruments"; description = "Tool for communicating with LXI compatible instruments";
longDescription = '' longDescription = ''
lxi-tools is a collection of open source software tools lxi-tools is a collection of open source software tools

View file

@ -15,7 +15,7 @@ stdenv.mkDerivation {
# source-highlight uses it's own binary to generate documentation. # source-highlight uses it's own binary to generate documentation.
# During cross-compilation, that binary was built for the target # During cross-compilation, that binary was built for the target
# platform architecture, so it can't run on the build host. # platform architecture, so it can't run on the build host.
patchPhase = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' patchPhase = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
substituteInPlace Makefile.in --replace "src doc tests" "src tests" substituteInPlace Makefile.in --replace "src doc tests" "src tests"
''; '';