Skip to content

Commit

Permalink
Merge #179844: staging-next 2022-07-01
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Jul 8, 2022
2 parents 0be91ce + add0201 commit b39924f
Show file tree
Hide file tree
Showing 77 changed files with 926 additions and 540 deletions.
26 changes: 15 additions & 11 deletions doc/languages-frameworks/perl.section.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Perl {#sec-language-perl}

## Running perl programs on the shell {#ssec-perl-running}
## Running Perl programs on the shell {#ssec-perl-running}

When executing a Perl script, it is possible you get an error such as `./myscript.pl: bad interpreter: /usr/bin/perl: no such file or directory`. This happens when the script expects Perl to be installed at `/usr/bin/perl`, which is not the case when using Perl from nixpkgs. You can fix the script by changing the first line to:

Expand Down Expand Up @@ -35,15 +35,16 @@ Perl packages from CPAN are defined in [pkgs/top-level/perl-packages.nix](https:

```nix
ClassC3 = buildPerlPackage rec {
name = "Class-C3-0.21";
pname = "Class-C3";
version = "0.21";
src = fetchurl {
url = "mirror://cpan/authors/id/F/FL/FLORA/${name}.tar.gz";
url = "mirror://cpan/authors/id/F/FL/FLORA/${pname}-${version}.tar.gz";
sha256 = "1bl8z095y4js66pwxnm7s853pi9czala4sqc743fdlnk27kq94gz";
};
};
```

Note the use of `mirror://cpan/`, and the `${name}` in the URL definition to ensure that the name attribute is consistent with the source that we’re actually downloading. Perl packages are made available in `all-packages.nix` through the variable `perlPackages`. For instance, if you have a package that needs `ClassC3`, you would typically write
Note the use of `mirror://cpan/`, and the `pname` and `version` in the URL definition to ensure that the `pname` attribute is consistent with the source that we’re actually downloading. Perl packages are made available in `all-packages.nix` through the variable `perlPackages`. For instance, if you have a package that needs `ClassC3`, you would typically write

```nix
foo = import ../path/to/foo.nix {
Expand Down Expand Up @@ -72,10 +73,11 @@ So what does `buildPerlPackage` do? It does the following:
{ buildPerlPackage, fetchurl, db }:
buildPerlPackage rec {
name = "BerkeleyDB-0.36";
pname = "BerkeleyDB";
version = "0.36";
src = fetchurl {
url = "mirror://cpan/authors/id/P/PM/PMQS/${name}.tar.gz";
url = "mirror://cpan/authors/id/P/PM/PMQS/${pname}-${version}.tar.gz";
sha256 = "07xf50riarb60l1h6m2dqmql8q5dij619712fsgw7ach04d8g3z1";
};
Expand All @@ -90,9 +92,10 @@ Dependencies on other Perl packages can be specified in the `buildInputs` and `p

```nix
ClassC3Componentised = buildPerlPackage rec {
name = "Class-C3-Componentised-1.0004";
pname = "Class-C3-Componentised";
version = "1.0004";
src = fetchurl {
url = "mirror://cpan/authors/id/A/AS/ASH/${name}.tar.gz";
url = "mirror://cpan/authors/id/A/AS/ASH/${pname}-${version}.tar.gz";
sha256 = "0xql73jkcdbq4q9m0b0rnca6nrlvf5hyzy8is0crdk65bynvs8q1";
};
propagatedBuildInputs = [
Expand All @@ -111,7 +114,7 @@ ImageExifTool = buildPerlPackage {
version = "11.50";
src = fetchurl {
url = "https://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-11.50.tar.gz";
url = "https://www.sno.phy.queensu.ca/~phil/exiftool/${pname}-${version}.tar.gz";
sha256 = "0d8v48y94z8maxkmw1rv7v9m0jg2dc8xbp581njb6yhr7abwqdv3";
};
Expand Down Expand Up @@ -139,9 +142,10 @@ This program takes a Perl module name, looks it up on CPAN, fetches and unpacks
```ShellSession
$ nix-generate-from-cpan XML::Simple
XMLSimple = buildPerlPackage rec {
name = "XML-Simple-2.22";
pname = "XML-Simple";
version = "2.22";
src = fetchurl {
url = "mirror://cpan/authors/id/G/GR/GRANTM/${name}.tar.gz";
url = "mirror://cpan/authors/id/G/GR/GRANTM/XML-Simple-2.22.tar.gz";
sha256 = "b9450ef22ea9644ae5d6ada086dc4300fa105be050a2030ebd4efd28c198eb49";
};
propagatedBuildInputs = [ XMLNamespaceSupport XMLSAX XMLSAXExpat ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/cluster/kompose/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kompose }:
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kompose, git }:

buildGoModule rec {
pname = "kompose";
Expand All @@ -13,7 +13,7 @@ buildGoModule rec {

vendorSha256 = "sha256-OR5U2PnebO0a+lwU09Dveh0Yxk91cmSRorTxQIO5lHc=";

nativeBuildInputs = [ installShellFiles ];
nativeBuildInputs = [ installShellFiles git ];

ldflags = [ "-s" "-w" ];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, git }:

buildGoModule rec {
pname = "gitbatch";
Expand All @@ -15,7 +15,15 @@ buildGoModule rec {

ldflags = [ "-s" "-w" ];

checkFlags = [ "-short" ];
nativeBuildInputs = [
git # required by unit tests
];

preCheck = ''
HOME=$(mktemp -d)
# Disable tests requiring network access to gitlab.com
buildFlagsArray+=("-run" "[^(Test(Run|Start|(Fetch|Pull)With(Go|)Git))]")
'';

meta = with lib; {
description = "Running git UI commands";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/data/misc/cacert/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let
blocklist = writeText "cacert-blocklist.txt" (lib.concatStringsSep "\n" blacklist);
extraCertificatesBundle = writeText "cacert-extra-certificates-bundle.crt" (lib.concatStringsSep "\n\n" extraCertificateStrings);

srcVersion = "3.77";
srcVersion = "3.80";
version = if nssOverride != null then nssOverride.version else srcVersion;
meta = with lib; {
homepage = "https://curl.haxx.se/docs/caextract.html";
Expand All @@ -35,7 +35,7 @@ let

src = if nssOverride != null then nssOverride.src else fetchurl {
url = "mirror://mozilla/security/nss/releases/NSS_${lib.replaceStrings ["."] ["_"] version}_RTM/src/nss-${version}.tar.gz";
sha256 = "1pfy33b51914sivqyaxdwfd930hzb77gm07z4f57hnyk5xddypl2";
sha256 = "sha256-wL8f0sfimmsCswliK6r8RD7skMiTS7FV2ku5iYh4S2o=";
};

dontBuild = true;
Expand Down
8 changes: 3 additions & 5 deletions pkgs/development/compilers/gcc/10/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ with lib;
with builtins;

let majorVersion = "10";
version = "${majorVersion}.3.0";
version = "${majorVersion}.4.0";

inherit (stdenv) buildPlatform hostPlatform targetPlatform;

patches = [ ./gcc10-asan-glibc-2.34.patch ]
patches = [ ]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
++ optional (noSysDirs && hostPlatform.isRiscV) ../no-sys-dirs-riscv.patch
Expand All @@ -73,8 +73,6 @@ let majorVersion = "10";
# Obtain latest patch with ../update-mcfgthread-patches.sh
++ optional (!crossStageStatic && targetPlatform.isMinGW) ./Added-mcf-thread-model-support-from-mcfgthread.patch

++ [ ../libsanitizer-no-cyclades.patch ]

++ optional (buildPlatform.system == "aarch64-darwin" && targetPlatform != buildPlatform) (fetchpatch {
url = "https://raw.githubusercontent.com/richard-vd/musl-cross-make/5e9e87f06fc3220e102c29d3413fbbffa456fcd6/patches/gcc-${version}/0008-darwin-aarch64-self-host-driver.patch";
sha256 = "sha256-XtykrPd5h/tsnjY1wGjzSOJ+AyyNLsfnjuOZ5Ryq9vA=";
Expand All @@ -95,7 +93,7 @@ stdenv.mkDerivation ({

src = fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
sha256 = "0i6378ig6h397zkhd7m4ccwjx5alvzrf2hm27p1pzwjhlv0h9x34";
sha256 = "1wg4xdizkksmwi66mvv2v4pk3ja8x64m7v9gzhykzd3wrmdpsaf9";
};

inherit patches;
Expand Down
70 changes: 0 additions & 70 deletions pkgs/development/compilers/gcc/10/gcc10-asan-glibc-2.34.patch

This file was deleted.

9 changes: 7 additions & 2 deletions pkgs/development/compilers/ghc/8.6.5-binary.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ assert stdenv.targetPlatform == stdenv.hostPlatform;
let
useLLVM = !stdenv.targetPlatform.isx86;

useNcurses6 = stdenv.hostPlatform.system == "x86_64-linux";
useNcurses6 = stdenv.hostPlatform.system == "x86_64-linux"
|| (with stdenv.hostPlatform; isPower64 && isLittleEndian);

ourNcurses = if useNcurses6 then ncurses6 else ncurses5;

Expand Down Expand Up @@ -73,6 +74,10 @@ stdenv.mkDerivation rec {
url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-apple-darwin.tar.xz";
sha256 = "0s9188vhhgf23q3rjarwhbr524z6h2qga5xaaa2pma03sfqvvhfz";
};
powerpc64le-linux = {
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-powerpc64le-fedora29-linux.tar.xz";
sha256 = "sha256-tWSsJdPVrCiqDyIKzpBt5DaXb3b6j951tCya584kWs4=";
};
}.${stdenv.hostPlatform.system}
or (throw "cannot bootstrap GHC on this platform"));

Expand Down Expand Up @@ -211,7 +216,7 @@ stdenv.mkDerivation rec {

meta = rec {
license = lib.licenses.bsd3;
platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "powerpc64le-linux" ];
# build segfaults, use ghc8102Binary which has proper musl support instead
broken = stdenv.hostPlatform.isMusl;
maintainers = with lib.maintainers; [
Expand Down
20 changes: 15 additions & 5 deletions pkgs/development/go-modules/generic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,22 @@ let
exclude+='\)'
buildGoDir() {
local d; local cmd;
cmd="$1"
d="$2"
local cmd="$1" dir="$2"
. $TMPDIR/buildFlagsArray
declare -a flags
flags+=($buildFlags "''${buildFlagsArray[@]}")
flags+=(''${tags:+-tags=${lib.concatStringsSep "," tags}})
flags+=(''${ldflags:+-ldflags="$ldflags"})
flags+=("-v" "-p" "$NIX_BUILD_CORES")
if [ "$cmd" = "test" ]; then
flags+=($checkFlags)
fi
local OUT
if ! OUT="$(go $cmd $buildFlags "''${buildFlagsArray[@]}" ''${tags:+-tags=${lib.concatStringsSep "," tags}} ''${ldflags:+-ldflags="$ldflags"} -v -p $NIX_BUILD_CORES $d 2>&1)"; then
if ! OUT="$(go $cmd "''${flags[@]}" $dir 2>&1)"; then
if ! echo "$OUT" | grep -qE '(no( buildable| non-test)?|build constraints exclude all) Go (source )?files'; then
echo "$OUT" >&2
return 1
Expand Down Expand Up @@ -241,7 +251,7 @@ let
runHook preCheck
for pkg in $(getGoDirs test); do
buildGoDir test $checkFlags "$pkg"
buildGoDir test "$pkg"
done
runHook postCheck
Expand Down
20 changes: 15 additions & 5 deletions pkgs/development/go-packages/generic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,22 @@ let
exclude+='\)'
buildGoDir() {
local d; local cmd;
cmd="$1"
d="$2"
local cmd="$1" dir="$2"
. $TMPDIR/buildFlagsArray
declare -a flags
flags+=($buildFlags "''${buildFlagsArray[@]}")
flags+=(''${tags:+-tags=${lib.concatStringsSep "," tags}})
flags+=(''${ldflags:+-ldflags="$ldflags"})
flags+=("-v" "-p" "$NIX_BUILD_CORES")
if [ "$cmd" = "test" ]; then
flags+=($checkFlags)
fi
local OUT
if ! OUT="$(go $cmd $buildFlags "''${buildFlagsArray[@]}" ''${tags:+-tags=${lib.concatStringsSep "," tags}} ''${ldflags:+-ldflags="$ldflags"} -v -p $NIX_BUILD_CORES $d 2>&1)"; then
if ! OUT="$(go $cmd "''${flags[@]}" $dir 2>&1)"; then
if ! echo "$OUT" | grep -qE '(no( buildable| non-test)?|build constraints exclude all) Go (source )?files'; then
echo "$OUT" >&2
return 1
Expand Down Expand Up @@ -225,7 +235,7 @@ let
runHook preCheck
for pkg in $(getGoDirs test); do
buildGoDir test $checkFlags "$pkg"
buildGoDir test "$pkg"
done
runHook postCheck
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/audio/libopenmpt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

stdenv.mkDerivation rec {
pname = "libopenmpt";
version = "0.6.3";
version = "0.6.4";

outputs = [ "out" "dev" "bin" ];

src = fetchurl {
url = "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${version}+release.autotools.tar.gz";
sha256 = "pBCv63zVlwsWuabOfazPSVsaXpEhqdZELeDAKP1Uols=";
sha256 = "4J+4RcMpJwCnrBPDsx1mns072+vL/hMo66I3bOvkAWI=";
};

enableParallelBuilding = true;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/glib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ in

stdenv.mkDerivation rec {
pname = "glib";
version = "2.72.2";
version = "2.72.3";

src = fetchurl {
url = "mirror://gnome/sources/glib/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "eNWZoTPbp/4gNt+o24+2Exq5ZCeD/JV4sHogmVJS0t4=";
sha256 = "Sjmi9iS4US1QDVhAFz7af6hfUcEJBS6ugGrOzoXTRfA=";
};

patches = optionals stdenv.isDarwin [
Expand Down
10 changes: 10 additions & 0 deletions pkgs/development/libraries/gnu-efi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ stdenv.mkDerivation rec {
sha256 = "tztkOg1Wl9HzltdDFEjoht2AVmh4lXjj4aKCd8lShDU=";
};

patches = [
# Pull fix pending upstream inclusion for parallel builds
# https://sourceforge.net/p/gnu-efi/patches/84/
(fetchurl {
name = "parallel-build.patch";
url = "https://sourceforge.net/p/gnu-efi/patches/84/attachment/0001-lib-Makefile-add-.o-file-dependency-on-libsubdirs-ta.patch";
sha256 = "sha256-+2UwV2lopdB/tazib1BLzO1E3GgB1L8dZsSQKWVoLwA=";
})
];

buildInputs = [ pciutils ];

hardeningDisable = [ "stackprotector" ];
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/libraries/gpgme/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ stdenv.mkDerivation rec {
./python-310-detection-without-distutils.patch
# Find correct version string for Python >= 3.10, https://dev.gnupg.org/D546
./python-find-version-string-above-310.patch
# Fix a test after disallowing compressed signatures in gpg (PR #180336)
./test_t-verify_double-plaintext.patch

# Disable python tests on Darwin as they use gpg (see configureFlags below)
] ++ lib.optional stdenv.isDarwin ./disable-python-tests.patch
# Fix _AC_UNDECLARED_WARNING for autoconf>=2.70
Expand Down
Loading

1 comment on commit b39924f

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vcunat, you pushed a commit directly to master/release branch
instead of going through a Pull Request.

That's highly discouraged beyond the few exceptions listed
on #118661

Please sign in to comment.