From 90f73381120f7ae9e0d5f0f6dc16cb141c658494 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sun, 24 Jan 2021 01:40:18 +0100 Subject: treewide: stdenv.lib -> lib --- pkgs/test/cc-wrapper/default.nix | 20 ++++++++++---------- pkgs/test/cc-wrapper/multilib.nix | 4 ++-- pkgs/test/install-shell-files/default.nix | 4 ++-- pkgs/test/ld-library-path/default.nix | 4 ++-- pkgs/test/patch-shebangs/default.nix | 4 ++-- pkgs/test/stdenv-inputs/default.nix | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) (limited to 'pkgs/test') diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix index fae3448c44c..d82ba296e2f 100644 --- a/pkgs/test/cc-wrapper/default.nix +++ b/pkgs/test/cc-wrapper/default.nix @@ -1,13 +1,13 @@ -{ stdenv, glibc }: -with stdenv.lib; +{ lib, stdenv, glibc }: + let # Sanitizers are not supported on Darwin. # Sanitizer headers aren't available in older libc++ stdenvs due to a bug 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) ); - staticLibc = optionalString (stdenv.hostPlatform.libc == "glibc") "-L ${glibc.static}/lib"; + staticLibc = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "-L ${glibc.static}/lib"; in stdenv.mkDerivation { name = "cc-wrapper-test"; @@ -23,7 +23,7 @@ in stdenv.mkDerivation { $CXX -o cxx-check ${./cxx-main.cc} ./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 mkdir -p foo/lib $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 $CC ${staticLibc} -static -o cc-static ${./cc-main.c} ./cc-static # 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 $CC ${staticLibc} -static-pie -o cc-static-pie ${./cc-main.c} ./cc-static-pie @@ -52,7 +52,7 @@ in stdenv.mkDerivation { printf "checking whether compiler uses NIX_LDFLAGS... " >&2 mkdir -p foo/lib $CC -shared \ - ${optionalString stdenv.isDarwin "-Wl,-install_name,@rpath/libfoo.dylib"} \ + ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,@rpath/libfoo.dylib"} \ -DVALUE=42 \ -o foo/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \ ${./foo.c} @@ -68,7 +68,7 @@ in stdenv.mkDerivation { $CXX -I std-include -nostdinc++ -o nostdinc-main++ ${./nostdinc-main.c} ./nostdinc-main++ - ${optionalString sanitizersWorking '' + ${lib.optionalString sanitizersWorking '' printf "checking whether sanitizers are fully functional... ">&2 $CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c} ./sanitizers @@ -77,5 +77,5 @@ in stdenv.mkDerivation { touch $out ''; - meta.platforms = platforms.all; + meta.platforms = lib.platforms.all; } diff --git a/pkgs/test/cc-wrapper/multilib.nix b/pkgs/test/cc-wrapper/multilib.nix index 5ea50b5eb26..828ad67f6c8 100644 --- a/pkgs/test/cc-wrapper/multilib.nix +++ b/pkgs/test/cc-wrapper/multilib.nix @@ -1,4 +1,4 @@ -{ stdenv }: +{ lib, stdenv }: stdenv.mkDerivation { name = "cc-multilib-test"; @@ -33,5 +33,5 @@ stdenv.mkDerivation { touch $out ''; - meta.platforms = stdenv.lib.platforms.x86_64; + meta.platforms = lib.platforms.x86_64; } diff --git a/pkgs/test/install-shell-files/default.nix b/pkgs/test/install-shell-files/default.nix index e3729c7d250..e9d32e4ccf6 100644 --- a/pkgs/test/install-shell-files/default.nix +++ b/pkgs/test/install-shell-files/default.nix @@ -1,10 +1,10 @@ -{ stdenv, runCommandLocal, recurseIntoAttrs, installShellFiles }: +{ lib, stdenv, runCommandLocal, recurseIntoAttrs, installShellFiles }: let runTest = name: env: buildCommand: runCommandLocal "install-shell-files--${name}" ({ nativeBuildInputs = [ installShellFiles ]; - meta.platforms = stdenv.lib.platforms.all; + meta.platforms = lib.platforms.all; } // env) buildCommand; in diff --git a/pkgs/test/ld-library-path/default.nix b/pkgs/test/ld-library-path/default.nix index bda3f0be84a..74c52cef253 100644 --- a/pkgs/test/ld-library-path/default.nix +++ b/pkgs/test/ld-library-path/default.nix @@ -1,4 +1,4 @@ -{ stdenv }: +{ lib, stdenv }: # 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 ''; - meta.platforms = stdenv.lib.platforms.linux; + meta.platforms = lib.platforms.linux; } diff --git a/pkgs/test/patch-shebangs/default.nix b/pkgs/test/patch-shebangs/default.nix index 3e68d96004f..5e1d859c138 100644 --- a/pkgs/test/patch-shebangs/default.nix +++ b/pkgs/test/patch-shebangs/default.nix @@ -1,4 +1,4 @@ -{ stdenv, runCommand }: +{ lib, stdenv, runCommand }: let bad-shebang = stdenv.mkDerivation { @@ -13,7 +13,7 @@ let }; in runCommand "patch-shebangs-test" { passthru = { inherit bad-shebang; }; - meta.platforms = stdenv.lib.platforms.all; + meta.platforms = lib.platforms.all; } '' printf "checking whether patchShebangs works properly... ">&2 if ! grep -q '^#!/bin/sh' ${bad-shebang}/bin/test; then diff --git a/pkgs/test/stdenv-inputs/default.nix b/pkgs/test/stdenv-inputs/default.nix index 4db10e75086..6a2e441d019 100644 --- a/pkgs/test/stdenv-inputs/default.nix +++ b/pkgs/test/stdenv-inputs/default.nix @@ -1,4 +1,4 @@ -{ stdenv }: +{ lib, stdenv }: let foo = stdenv.mkDerivation { @@ -12,7 +12,7 @@ let chmod +x $out/bin/foo cp ${./foo.c} $out/include/foo.h $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} \ ${./foo.c} ''; @@ -30,7 +30,7 @@ let chmod +x $out/bin/bar cp ${./bar.c} $dev/include/bar.h $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} \ ${./bar.c} ''; @@ -64,5 +64,5 @@ stdenv.mkDerivation { touch $out ''; - meta.platforms = stdenv.lib.platforms.all; + meta.platforms = lib.platforms.all; } -- cgit 1.4.1