diff options
author | Ben Siraphob <bensiraphob@gmail.com> | 2021-01-24 00:15:07 +0700 |
---|---|---|
committer | Ben Siraphob <bensiraphob@gmail.com> | 2021-01-24 00:16:29 +0700 |
commit | 2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4 (patch) | |
tree | fd273f1e48a30237aa9b96342f6324757a4ca09f /pkgs/development/haskell-modules | |
parent | ec334a1b01c491faa3463c96717b71921dddef2c (diff) | |
download | nixlib-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar nixlib-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar.gz nixlib-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar.bz2 nixlib-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar.lz nixlib-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar.xz nixlib-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar.zst nixlib-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.zip |
pkgs/development: stdenv.lib -> lib
Diffstat (limited to 'pkgs/development/haskell-modules')
4 files changed, 28 insertions, 28 deletions
diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index a4674e356cc8..06578f565350 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -610,12 +610,12 @@ self: super: builtins.intersectAttrs super { git-annex = with pkgs; if (!stdenv.isLinux) then - let path = stdenv.lib.makeBinPath [ coreutils ]; + let path = lib.makeBinPath [ coreutils ]; in overrideCabal (addBuildTool super.git-annex makeWrapper) (_drv: { # This is an instance of https://github.com/NixOS/nix/pull/1085 # Fails with: # gpg: can't connect to the agent: File name too long - postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + postPatch = lib.optionalString stdenv.isDarwin '' substituteInPlace Test.hs \ --replace ', testCase "crypto" test_crypto' "" ''; diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index bf4f7bd3bbfc..582cf6df010c 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, buildHaskellPackages, ghc +{ lib, stdenv, buildPackages, buildHaskellPackages, ghc , jailbreak-cabal, hscolour, cpphs, nodejs , ghcWithHoogle, ghcWithPackages }: @@ -22,10 +22,10 @@ in , buildFlags ? [] , haddockFlags ? [] , description ? null -, doCheck ? !isCross && stdenv.lib.versionOlder "7.4" ghc.version +, doCheck ? !isCross && lib.versionOlder "7.4" ghc.version , doBenchmark ? false , doHoogle ? true -, doHaddockQuickjump ? doHoogle && stdenv.lib.versionAtLeast ghc.version "8.6" +, doHaddockQuickjump ? doHoogle && lib.versionAtLeast ghc.version "8.6" , editedCabalFile ? null # aarch64 outputs otherwise exceed 2GB limit , enableLibraryProfiling ? !(ghc.isGhcjs or stdenv.targetPlatform.isAarch64 or false) @@ -36,14 +36,14 @@ in , enableSharedLibraries ? !stdenv.hostPlatform.isStatic && (ghc.enableShared or false) , enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin , enableStaticLibraries ? !(stdenv.hostPlatform.isWindows or stdenv.hostPlatform.isWasm) -, enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4" +, enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows && lib.versionAtLeast ghc.version "8.4" , extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? [] # On macOS, statically linking against system frameworks is not supported; # see https://developer.apple.com/library/content/qa/qa1118/_index.html # They must be propagated to the environment of any executable linking with the library , libraryFrameworkDepends ? [], executableFrameworkDepends ? [] , homepage ? "https://hackage.haskell.org/package/${pname}" -, platforms ? with stdenv.lib.platforms; all # GHC can cross-compile +, platforms ? with lib.platforms; all # GHC can cross-compile , hydraPlatforms ? null , hyperlinkSource ? true , isExecutable ? false, isLibrary ? !isExecutable @@ -71,7 +71,7 @@ in , shellHook ? "" , coreSetup ? false # Use only core packages to build Setup.hs. , useCpphs ? false -, hardeningDisable ? stdenv.lib.optional (ghc.isHaLVM or false) "all" +, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all" , enableSeparateBinOutput ? false , enableSeparateDataOutput ? false , enableSeparateDocOutput ? doHaddock @@ -95,7 +95,7 @@ assert stdenv.hostPlatform.isWasm -> enableStaticLibraries == false; let - inherit (stdenv.lib) optional optionals optionalString versionOlder versionAtLeast + inherit (lib) optional optionals optionalString versionOlder versionAtLeast concatStringsSep enableFeature optionalAttrs; isGhcjs = ghc.isGhcjs or false; @@ -182,7 +182,7 @@ let parallelBuildingFlags = "-j$NIX_BUILD_CORES" + optionalString stdenv.isLinux " +RTS -A64M -RTS"; crossCabalFlagsString = - stdenv.lib.optionalString isCross (" " + stdenv.lib.concatStringsSep " " crossCabalFlags); + lib.optionalString isCross (" " + lib.concatStringsSep " " crossCabalFlags); buildFlagsString = optionalString (buildFlags != []) (" " + concatStringsSep " " buildFlags); @@ -213,7 +213,7 @@ let (enableFeature doBenchmark "benchmarks") "--enable-library-vanilla" # TODO: Should this be configurable? (enableFeature enableLibraryForGhci "library-for-ghci") - ] ++ optionals (enableDeadCodeElimination && (stdenv.lib.versionOlder "8.0.1" ghc.version)) [ + ] ++ optionals (enableDeadCodeElimination && (lib.versionOlder "8.0.1" ghc.version)) [ "--ghc-option=-split-sections" ] ++ optionals dontStrip [ "--disable-library-stripping" @@ -283,7 +283,7 @@ let continue fi ''; -in stdenv.lib.fix (drv: +in lib.fix (drv: assert allPkgconfigDepends != [] -> pkg-config != null; @@ -423,7 +423,7 @@ stdenv.mkDerivation ({ echo configureFlags: $configureFlags ${setupCommand} configure $configureFlags 2>&1 | ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log" - ${stdenv.lib.optionalString (!allowInconsistentDependencies) '' + ${lib.optionalString (!allowInconsistentDependencies) '' if ${gnugrep}/bin/egrep -q -z 'Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then echo >&2 "*** abort because of serious configure-time warning from Cabal" exit 1 @@ -455,7 +455,7 @@ stdenv.mkDerivation ({ ${optionalString doHoogle "--hoogle"} \ ${optionalString doHaddockQuickjump "--quickjump"} \ ${optionalString (isLibrary && hyperlinkSource) "--hyperlink-source"} \ - ${stdenv.lib.concatStringsSep " " haddockFlags} + ${lib.concatStringsSep " " haddockFlags} ''} runHook postHaddock ''; @@ -492,7 +492,7 @@ stdenv.mkDerivation ({ done ''} ${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"} - ${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && stdenv.lib.versionOlder ghc.version "7.10") '' + ${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && lib.versionOlder ghc.version "7.10") '' for exe in "${binDir}/"* ; do install_name_tool -add_rpath "$out/lib/ghc-${ghc.version}/${pname}-${version}" "$exe" done @@ -535,7 +535,7 @@ stdenv.mkDerivation ({ pkg-configDepends setupHaskellDepends ; - } // stdenv.lib.optionalAttrs doCheck { + } // lib.optionalAttrs doCheck { inherit testDepends testFrameworkDepends @@ -544,7 +544,7 @@ stdenv.mkDerivation ({ testSystemDepends testToolDepends ; - } // stdenv.lib.optionalAttrs doBenchmark { + } // lib.optionalAttrs doBenchmark { inherit benchmarkDepends benchmarkFrameworkDepends @@ -561,7 +561,7 @@ stdenv.mkDerivation ({ inherit propagatedBuildInputs otherBuildInputs allPkgconfigDepends; haskellBuildInputs = isHaskellPartition.right; systemBuildInputs = isHaskellPartition.wrong; - isHaskellPartition = stdenv.lib.partition + isHaskellPartition = lib.partition isHaskellPkg (propagatedBuildInputs ++ otherBuildInputs ++ depsBuildBuild ++ nativeBuildInputs); }; @@ -608,13 +608,13 @@ stdenv.mkDerivation ({ ghcEnv = withPackages (_: otherBuildInputsHaskell ++ propagatedBuildInputs ++ - stdenv.lib.optionals (!isCross) setupHaskellDepends); + lib.optionals (!isCross) setupHaskellDepends); - ghcCommandCaps = stdenv.lib.toUpper ghcCommand'; + ghcCommandCaps = lib.toUpper ghcCommand'; in stdenv.mkDerivation ({ inherit name shellHook; - depsBuildBuild = stdenv.lib.optional isCross ghcEnvForBuild; + depsBuildBuild = lib.optional isCross ghcEnvForBuild; nativeBuildInputs = [ ghcEnv ] ++ optional (allPkgconfigDepends != []) pkg-config ++ collectedToolDepends; @@ -623,7 +623,7 @@ stdenv.mkDerivation ({ phases = ["installPhase"]; installPhase = "echo $nativeBuildInputs $buildInputs > $out"; LANG = "en_US.UTF-8"; - LOCALE_ARCHIVE = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive"; + LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive"; "NIX_${ghcCommandCaps}" = "${ghcEnv}/bin/${ghcCommand}"; "NIX_${ghcCommandCaps}PKG" = "${ghcEnv}/bin/${ghcCommand}-pkg"; # TODO: is this still valid? diff --git a/pkgs/development/haskell-modules/hoogle.nix b/pkgs/development/haskell-modules/hoogle.nix index 0f620d46cccd..f47ac076f13a 100644 --- a/pkgs/development/haskell-modules/hoogle.nix +++ b/pkgs/development/haskell-modules/hoogle.nix @@ -120,7 +120,7 @@ buildPackages.stdenv.mkDerivation { meta = { description = "A local Hoogle database"; platforms = ghc.meta.platforms; - hydraPlatforms = with stdenv.lib.platforms; none; - maintainers = with stdenv.lib.maintainers; [ ttuegel ]; + hydraPlatforms = with lib.platforms; none; + maintainers = with lib.maintainers; [ ttuegel ]; }; } diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix index 91937b88eaff..28b48bfcbc4a 100644 --- a/pkgs/development/haskell-modules/make-package-set.nix +++ b/pkgs/development/haskell-modules/make-package-set.nix @@ -41,7 +41,7 @@ self: let inherit (stdenv) buildPlatform hostPlatform; - inherit (stdenv.lib) fix' extends makeOverridable; + inherit (lib) fix' extends makeOverridable; inherit (haskellLib) overrideCabal; mkDerivationImpl = pkgs.callPackage ./generic-builder.nix { @@ -84,8 +84,8 @@ let # lost on `.override`) but determine the auto-args based on `drv` (the problem here # is that nix has no way to "passthrough" args while preserving the reflection # info that callPackage uses to determine the arguments). - drv = if stdenv.lib.isFunction fn then fn else import fn; - auto = builtins.intersectAttrs (stdenv.lib.functionArgs drv) scope; + drv = if lib.isFunction fn then fn else import fn; + auto = builtins.intersectAttrs (lib.functionArgs drv) scope; # this wraps the `drv` function to add a `overrideScope` function to the result. drvScope = allArgs: drv allArgs // { @@ -98,7 +98,7 @@ let # nothing. in callPackageWithScope newScope drv manualArgs; }; - in stdenv.lib.makeOverridable drvScope (auto // manualArgs); + in lib.makeOverridable drvScope (auto // manualArgs); mkScope = scope: let ps = pkgs.__splicedPackages; |