diff options
author | Shawn8901 <shawn8901@googlemail.com> | 2023-01-26 18:31:02 +0100 |
---|---|---|
committer | Shawn8901 <shawn8901@googlemail.com> | 2023-01-26 18:31:02 +0100 |
commit | a59dda942cbe3d40c1ae424d4d8a6db715cac0d5 (patch) | |
tree | c4d7e17a260da0a29c9690de071787d3ca62b3d2 /pkgs/development/interpreters/perl | |
parent | aedc95590cdc13e99441684b7aca81cdbfa542ad (diff) |
treewide: remove global with lib; statements in pkgs/development
Diffstat (limited to 'pkgs/development/interpreters/perl')
-rw-r--r-- | pkgs/development/interpreters/perl/default.nix | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index ce7947a842ca6..e8db13a6474b0 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -12,8 +12,6 @@ assert (enableCrypt -> (libxcrypt != null)); # cgit) that are needed here should be included directly in Nixpkgs as # files. -with lib; - let libc = if stdenv.cc.libc or null != null then stdenv.cc.libc else "/usr"; @@ -33,7 +31,7 @@ let strictDeps = true; # TODO: Add a "dev" output containing the header files. outputs = [ "out" "man" "devdoc" ] ++ - optional crossCompiling "mini"; + lib.optional crossCompiling "mini"; setOutputFlags = false; # On FreeBSD, if Perl is built with threads support, having @@ -57,9 +55,9 @@ let # Enable TLS/SSL verification in HTTP::Tiny by default ./http-tiny-verify-ssl-by-default.patch ] - ++ optional stdenv.isSunOS ./ld-shared.patch - ++ optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ] - ++ optional crossCompiling ./MakeMaker-cross.patch; + ++ lib.optional stdenv.isSunOS ./ld-shared.patch + ++ lib.optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ] + ++ lib.optional crossCompiling ./MakeMaker-cross.patch; # This is not done for native builds because pwd may need to come from # bootstrap tools when building bootstrap perl. @@ -93,18 +91,18 @@ let "-Dlocincpth=${libcInc}/include" "-Dloclibpth=${libcLib}/lib" ] - ++ optionals ((builtins.match ''5\.[0-9]*[13579]\..+'' version) != null) [ "-Dusedevel" "-Uversiononly" ] - ++ optional stdenv.isSunOS "-Dcc=gcc" - ++ optional enableThreading "-Dusethreads" - ++ optional (!enableCrypt) "-A clear:d_crypt_r" - ++ optional stdenv.hostPlatform.isStatic "--all-static" - ++ optionals (!crossCompiling) [ + ++ lib.optionals ((builtins.match ''5\.[0-9]*[13579]\..+'' version) != null) [ "-Dusedevel" "-Uversiononly" ] + ++ lib.optional stdenv.isSunOS "-Dcc=gcc" + ++ lib.optional enableThreading "-Dusethreads" + ++ lib.optional (!enableCrypt) "-A clear:d_crypt_r" + ++ lib.optional stdenv.hostPlatform.isStatic "--all-static" + ++ lib.optionals (!crossCompiling) [ "-Dprefix=${placeholder "out"}" "-Dman1dir=${placeholder "out"}/share/man/man1" "-Dman3dir=${placeholder "out"}/share/man/man3" ]; - configureScript = optionalString (!crossCompiling) "${stdenv.shell} ./Configure"; + configureScript = lib.optionalString (!crossCompiling) "${stdenv.shell} ./Configure"; dontAddStaticConfigureFlags = true; @@ -138,9 +136,9 @@ let OLD_ZLIB = False GZIP_OS_CODE = AUTO_DETECT EOF - '' + optionalString stdenv.isDarwin '' + '' + lib.optionalString stdenv.isDarwin '' substituteInPlace hints/darwin.sh --replace "env MACOSX_DEPLOYMENT_TARGET=10.3" "" - '' + optionalString (!enableThreading) '' + '' + lib.optionalString (!enableThreading) '' # We need to do this because the bootstrap doesn't have a static libpthread sed -i 's,\(libswanted.*\)pthread,\1,g' Configure ''; @@ -183,7 +181,7 @@ let }" /no-such-path \ --replace "${stdenv.cc}" /no-such-path \ --replace "$man" /no-such-path - '' + optionalString crossCompiling + '' + lib.optionalString crossCompiling '' mkdir -p $mini/lib/perl5/cross_perl/${version} for dir in cnf/{stub,cpan}; do @@ -207,7 +205,7 @@ let "$mini/lib/perl5/cross_perl/${version}:$out/lib/perl5/${version}:$out/lib/perl5/${version}/$runtimeArch" ''; # */ - meta = { + meta = with lib; { homepage = "https://www.perl.org/"; description = "The standard implementation of the Perl 5 programmming language"; license = licenses.artistic1; @@ -215,7 +213,7 @@ let platforms = platforms.all; priority = 6; # in `buildEnv' (including the one inside `perl.withPackages') the library files will have priority over files in `perl` }; - } // optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) rec { + } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) rec { crossVersion = "c876045741f5159318085d2737b0090f35a842ca"; # June 5, 2022 perl-cross-src = fetchFromGitHub { |