From f5a7ce13174f04b94f807f731915029c1d7739df Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Fri, 16 Jun 2017 05:12:37 +0200 Subject: [PATCH 001/108] ldns: also build examples --- pkgs/development/libraries/ldns/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/ldns/default.nix b/pkgs/development/libraries/ldns/default.nix index 91eb7aecea9..ff63b6af25e 100644 --- a/pkgs/development/libraries/ldns/default.nix +++ b/pkgs/development/libraries/ldns/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { patchShebangs doc/doxyparse.pl ''; - outputs = [ "out" "dev" "man" ]; + outputs = [ "out" "dev" "man" "examples" ]; nativeBuildInputs = [ perl ]; buildInputs = [ openssl ]; @@ -24,6 +24,13 @@ stdenv.mkDerivation rec { postInstall = '' moveToOutput "bin/ldns-config" "$dev" + + pushd examples + configureFlagsArray+=( "--bindir=$examples/bin" ) + configurePhase + make + make install + popd ''; meta = with stdenv.lib; { From 0419452113ebb135907257bb063cb690a4de0b52 Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Tue, 11 Jul 2017 21:54:13 -0400 Subject: [PATCH 002/108] Fix Darwin stdenv to work on 10.13 The main changes are in libSystem, which lost the coretls component in 10.13 and some hardening changes that quietly crash any program that uses %n in a non-constant format string, so we've needed to patch a lot of programs that use gnulib. --- pkgs/applications/editors/nano/default.nix | 4 +++- .../libraries/libunistring/default.nix | 2 +- pkgs/development/tools/misc/gnum4/default.nix | 4 ++-- pkgs/development/tools/parsing/bison/3.x.nix | 4 +++- .../Libsystem/reexported_libraries | 2 +- .../Libsystem/system_kernel_symbols | 2 -- pkgs/stdenv/darwin/darwin-secure-format.patch | 15 ++++++++++++ pkgs/stdenv/darwin/default.nix | 23 +++++++++++++------ pkgs/tools/compression/gzip/default.nix | 4 +++- pkgs/tools/misc/coreutils/default.nix | 3 ++- 10 files changed, 46 insertions(+), 17 deletions(-) create mode 100644 pkgs/stdenv/darwin/darwin-secure-format.patch diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix index f3527d85fd7..6a740bbf6f1 100644 --- a/pkgs/applications/editors/nano/default.nix +++ b/pkgs/applications/editors/nano/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, fetchFromGitHub +{ stdenv, hostPlatform, fetchurl, fetchFromGitHub , ncurses , texinfo , gettext ? null @@ -27,6 +27,8 @@ in stdenv.mkDerivation rec { sha256 = "1hl9gni3qmblr062a7w6vz16gvxbswgc5c19c923ja0bk48vyhyb"; }; + patches = stdenv.lib.optional hostPlatform.isDarwin stdenv.secure-format-patch; + nativeBuildInputs = [ texinfo ] ++ optional enableNls gettext; buildInputs = [ ncurses ]; diff --git a/pkgs/development/libraries/libunistring/default.nix b/pkgs/development/libraries/libunistring/default.nix index 662767b6678..20874f6f6a1 100644 --- a/pkgs/development/libraries/libunistring/default.nix +++ b/pkgs/development/libraries/libunistring/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "1ra1baz2187kbw9im47g6kqb5mx9plq703mkjxaval8rxv5q3q4w"; }; - patches = stdenv.lib.optional stdenv.isDarwin [ ./clang.patch ]; + patches = stdenv.lib.optionals stdenv.isDarwin [ ./clang.patch stdenv.secure-format-patch ]; outputs = [ "out" "dev" "info" "doc" ]; diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix index fbbd6cc4d6f..33ea7890746 100644 --- a/pkgs/development/tools/misc/gnum4/default.nix +++ b/pkgs/development/tools/misc/gnum4/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, hostPlatform, fetchurl }: stdenv.mkDerivation rec { name = "gnum4-1.4.18"; @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { configureFlags = "--with-syscmd-shell=${stdenv.shell}"; # Upstream is aware of it; it may be in the next release. - patches = [ ./s_isdir.patch ]; + patches = [ ./s_isdir.patch ] ++ stdenv.lib.optional hostPlatform.isDarwin stdenv.secure-format-patch; # FIXME needs gcc 4.9 in bootstrap tools hardeningDisable = [ "stackprotector" ]; diff --git a/pkgs/development/tools/parsing/bison/3.x.nix b/pkgs/development/tools/parsing/bison/3.x.nix index ebbee4e693d..0369d7dabde 100644 --- a/pkgs/development/tools/parsing/bison/3.x.nix +++ b/pkgs/development/tools/parsing/bison/3.x.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, m4, perl, help2man }: +{ stdenv, hostPlatform, fetchurl, m4, perl, help2man }: stdenv.mkDerivation rec { name = "bison-3.0.4"; @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "b67fd2daae7a64b5ba862c66c07c1addb9e6b1b05c5f2049392cfd8a2172952e"; }; + patches = stdenv.lib.optional hostPlatform.isDarwin stdenv.secure-format-patch; + nativeBuildInputs = [ m4 perl ] ++ stdenv.lib.optional stdenv.isSunOS help2man; propagatedBuildInputs = [ m4 ]; diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries index 00aaba1d498..494426eba6d 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries @@ -19,7 +19,7 @@ /usr/lib/system/libsystem_configuration.dylib /usr/lib/system/libsystem_coreservices.dylib -/usr/lib/system/libsystem_coretls.dylib +# /usr/lib/system/libsystem_coretls.dylib # Removed in 10.13 /usr/lib/system/libsystem_dnssd.dylib /usr/lib/system/libsystem_info.dylib diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_kernel_symbols b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_kernel_symbols index ff9073157a5..ed76787a900 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_kernel_symbols +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_kernel_symbols @@ -376,7 +376,6 @@ _fsync _fsync$NOCANCEL _ftruncate _futimes -_get_dp_control_port _getattrlist _getattrlistat _getattrlistbulk @@ -838,7 +837,6 @@ _sendmsg$NOCANCEL _sendmsg_x _sendto _sendto$NOCANCEL -_set_dp_control_port _setattrlist _setaudit _setaudit_addr diff --git a/pkgs/stdenv/darwin/darwin-secure-format.patch b/pkgs/stdenv/darwin/darwin-secure-format.patch new file mode 100644 index 00000000000..b14d8be6ef1 --- /dev/null +++ b/pkgs/stdenv/darwin/darwin-secure-format.patch @@ -0,0 +1,15 @@ +With format string strictness, High Sierra also enforces that %n isn't used +in dynamic format strings, but we should just disable its use on darwin in +general. + +--- a/lib/vasnprintf.c 2017-06-22 15:19:15.000000000 -0700 ++++ b/lib/vasnprintf.c 2017-06-22 15:20:20.000000000 -0700 +@@ -4869,7 +4869,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t * + #endif + *fbp = dp->conversion; + #if USE_SNPRINTF +-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) ++# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) + fbp[1] = '%'; + fbp[2] = 'n'; + fbp[3] = '\0'; diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index f6d9bcac510..e7ce04b0a14 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -4,15 +4,15 @@ # Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools , bootstrapFiles ? let fetch = { file, sha256, executable ? true }: import { - url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/c4effbe806be9a0a3727fdbbc9a5e28149347532/${file}"; + url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/10cbca5b30c6cb421ce15139f32ae3a4977292cf/${file}"; inherit (localSystem) system; inherit sha256 executable; }; in { - sh = fetch { file = "sh"; sha256 = "1b9r3dksj907bpxp589yhc4217cas73vni8sng4r57f04ydjcinr"; }; - bzip2 = fetch { file = "bzip2"; sha256 = "1wm28jgap4cbr8hf4ambg6h9flr2b4mcbh7fw20i0l51v6n8igky"; }; - mkdir = fetch { file = "mkdir"; sha256 = "0jc32mzx2whhx2xh70grvvgz4jj26118p9yxmhjqcysagc0k7y66"; }; - cpio = fetch { file = "cpio"; sha256 = "0x5dcczkzn0g8yb4pah449jmgy3nmpzrqy4s480grcx05b6v6hkp"; }; - tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "0ifdc8bwxdhmpbhx2vd3lwjg71gqm6pi5mfm0fkcsbqavl8hd8hz"; executable = false; }; + sh = fetch { file = "sh"; sha256 = "0s8a9vpzj6vadq4jmf4r8cargwnsf327hdjydxgqsfxb8y1q39w3"; }; + bzip2 = fetch { file = "bzip2"; sha256 = "1jqljpjr8mkiv7g5rl5impqx3all8vn1mxxdwa004pr3h48c1zgg"; }; + mkdir = fetch { file = "mkdir"; sha256 = "17zsjiwnq07i5r85q1hg7f6cnkcgllwy2amz9klaqwjy4vzz4vwh"; }; + cpio = fetch { file = "cpio"; sha256 = "04hrair58dgja6syh442pswiga5an9nl58ls57yknkn2pq51nx9m"; }; + tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "103833hrci0vwi1gi978hkp69rncicvpdszn87ffpf1cq0jzpa14"; executable = false; }; } }: @@ -109,7 +109,13 @@ in rec { stdenvSandboxProfile = binShClosure + libSystemProfile; extraSandboxProfile = binShClosure + libSystemProfile; - extraAttrs = { inherit platform; parent = last; }; + extraAttrs = { + inherit platform; + parent = last; + + # This is used all over the place so I figured I'd just leave it here for now + secure-format-patch = ./darwin-secure-format.patch; + }; overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; }; }; @@ -319,6 +325,9 @@ in rec { inherit platform bootstrapTools; libc = pkgs.darwin.Libsystem; shellPackage = pkgs.bash; + + # This is used all over the place so I figured I'd just leave it here for now + secure-format-patch = ./darwin-secure-format.patch; }; allowedRequisites = (with pkgs; [ diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix index cb7dc65c710..bb9555fa600 100644 --- a/pkgs/tools/compression/gzip/default.nix +++ b/pkgs/tools/compression/gzip/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, xz }: +{ stdenv, hostPlatform, fetchurl, xz }: stdenv.mkDerivation rec { name = "gzip-${version}"; @@ -9,6 +9,8 @@ stdenv.mkDerivation rec { sha256 = "1lxv3p4iyx7833mlihkn5wfwmz4cys5nybwpz3dfawag8kn6f5zz"; }; + patches = stdenv.lib.optional hostPlatform.isDarwin stdenv.secure-format-patch; + outputs = [ "out" "man" "info" ]; enableParallelBuilding = true; diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 9a988a2b431..099e9ee0849 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -24,7 +24,8 @@ stdenv.mkDerivation rec { # FIXME needs gcc 4.9 in bootstrap tools hardeningDisable = [ "stackprotector" ]; - patches = optional hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch; + patches = optional hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch + ++ optional hostPlatform.isDarwin stdenv.secure-format-patch; # The test tends to fail on btrfs and maybe other unusual filesystems. postPatch = optionalString (!hostPlatform.isDarwin) '' From 3bb9954a6bb977f3e33f766ae5df926495ef7bc4 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Fri, 16 Jun 2017 05:11:56 +0200 Subject: [PATCH 003/108] dns-root-data: init at 2017-06-16 --- pkgs/data/misc/dns-root-data/default.nix | 29 +++++++++++++++++++ pkgs/data/misc/dns-root-data/root.ds | 3 ++ pkgs/data/misc/dns-root-data/root.key | 2 ++ .../misc/dns-root-data/update-root-key.sh | 9 ++++++ pkgs/development/libraries/gnutls/generic.nix | 4 ++- pkgs/development/libraries/ldns/default.nix | 9 ++++-- pkgs/tools/networking/unbound/default.nix | 3 +- pkgs/top-level/all-packages.nix | 2 ++ 8 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 pkgs/data/misc/dns-root-data/default.nix create mode 100644 pkgs/data/misc/dns-root-data/root.ds create mode 100644 pkgs/data/misc/dns-root-data/root.key create mode 100755 pkgs/data/misc/dns-root-data/update-root-key.sh diff --git a/pkgs/data/misc/dns-root-data/default.nix b/pkgs/data/misc/dns-root-data/default.nix new file mode 100644 index 00000000000..ec0d9c83ad5 --- /dev/null +++ b/pkgs/data/misc/dns-root-data/default.nix @@ -0,0 +1,29 @@ +{ stdenv, lib, fetchurl }: + +let + + rootHints = fetchurl { + url = "http://www.internic.net/domain/named.root"; + sha256 = "1zf3ydn44z70gq1kd95lvk9cp68xlbl8vqpswqlhd30qafx6v6d1"; + }; + + rootKey = ./root.key; + rootDs = ./root.ds; + +in + +stdenv.mkDerivation { + name = "dns-root-data-2017-07-11"; + + buildCommand = '' + mkdir $out + cp ${rootHints} $out/root.hints + cp ${rootKey} $out/root.key + cp ${rootDs} $out/root.ds + ''; + + meta = with lib; { + description = "DNS root data including root zone and DNSSEC key"; + maintainers = with maintainers; [ fpletz ]; + }; +} diff --git a/pkgs/data/misc/dns-root-data/root.ds b/pkgs/data/misc/dns-root-data/root.ds new file mode 100644 index 00000000000..61c5b8fcd34 --- /dev/null +++ b/pkgs/data/misc/dns-root-data/root.ds @@ -0,0 +1,3 @@ +; created by unbound-anchor on Tue Jul 11 23:48:16 2017 +. IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5 +. IN DS 20326 8 2 E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D diff --git a/pkgs/data/misc/dns-root-data/root.key b/pkgs/data/misc/dns-root-data/root.key new file mode 100644 index 00000000000..9046cefcb71 --- /dev/null +++ b/pkgs/data/misc/dns-root-data/root.key @@ -0,0 +1,2 @@ +. 172800 IN DNSKEY 257 3 8 AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3+/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kvArMtNROxVQuCaSnIDdD5LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF0jLHwVN8efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7pr+eoZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLYA4/ilBmSVIzuDWfdRUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwNR1AkUTV74bU= ;{id = 20326 (ksk), size = 2048b} ;;state=1 [ ADDPEND ] +. 172800 IN DNSKEY 257 3 8 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaDX6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpzW5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0= ;{id = 19036 (ksk), size = 2048b} ;;state=2 [ VALID ] diff --git a/pkgs/data/misc/dns-root-data/update-root-key.sh b/pkgs/data/misc/dns-root-data/update-root-key.sh new file mode 100755 index 00000000000..5db179621a7 --- /dev/null +++ b/pkgs/data/misc/dns-root-data/update-root-key.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p busybox unbound + +TMP=`mktemp` +unbound-anchor -a $TMP +grep -Ev "^($$|;)" $TMP | sed -e 's/ ;;count=.*//' > root.key +rm $TMP + +unbound-anchor -F -a root.ds diff --git a/pkgs/development/libraries/gnutls/generic.nix b/pkgs/development/libraries/gnutls/generic.nix index 48aa3fb9673..2a73682a746 100644 --- a/pkgs/development/libraries/gnutls/generic.nix +++ b/pkgs/development/libraries/gnutls/generic.nix @@ -1,6 +1,7 @@ { lib, fetchurl, stdenv, zlib, lzo, libtasn1, nettle, pkgconfig, lzip , guileBindings, guile, perl, gmp, autogen, libidn, p11_kit, libiconv , tpmSupport ? false, trousers, which, nettools, libunistring +, unbound, dns-root-data # Version dependent args , version, src, patches ? [], postPatch ? "", nativeBuildInputs ? [] @@ -32,12 +33,13 @@ stdenv.mkDerivation { ++ [ "--disable-dependency-tracking" "--enable-fast-install" + "--with-unbound-root-key-file=${dns-root-data}/root.key" ] ++ lib.optional guileBindings [ "--enable-guile" "--with-guile-site-dir=\${out}/share/guile/site" ]; enableParallelBuilding = true; - buildInputs = [ lzo lzip libtasn1 libidn p11_kit zlib gmp autogen libunistring ] + buildInputs = [ lzo lzip libtasn1 libidn p11_kit zlib gmp autogen libunistring unbound ] ++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) libiconv ++ lib.optional (tpmSupport && stdenv.isLinux) trousers ++ lib.optional guileBindings guile diff --git a/pkgs/development/libraries/ldns/default.nix b/pkgs/development/libraries/ldns/default.nix index ff63b6af25e..816b850f100 100644 --- a/pkgs/development/libraries/ldns/default.nix +++ b/pkgs/development/libraries/ldns/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, openssl, perl}: +{stdenv, fetchurl, openssl, perl, dns-root-data}: stdenv.mkDerivation rec { pname = "ldns"; @@ -20,7 +20,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ perl ]; buildInputs = [ openssl ]; - configureFlags = [ "--with-ssl=${openssl.dev}" "--with-drill"]; + configureFlags = [ + "--with-ssl=${openssl.dev}" + "--with-trust-anchor=${dns-root-data}/root.key" + "--with-drill" + "--disable-gost" + ]; postInstall = '' moveToOutput "bin/ldns-config" "$dev" diff --git a/pkgs/tools/networking/unbound/default.nix b/pkgs/tools/networking/unbound/default.nix index 7fc5fb90173..b70fc2ced83 100644 --- a/pkgs/tools/networking/unbound/default.nix +++ b/pkgs/tools/networking/unbound/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, openssl, nettle, expat, libevent }: +{ stdenv, fetchurl, openssl, nettle, expat, libevent, dns-root-data }: stdenv.mkDerivation rec { name = "unbound-${version}"; @@ -20,6 +20,7 @@ stdenv.mkDerivation rec { "--localstatedir=/var" "--sysconfdir=/etc" "--sbindir=\${out}/bin" + "--with-rootkey-file=${dns-root-data}/root.key" "--enable-pie" "--enable-relro-now" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c783b3cb916..3ce85d114b7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12807,6 +12807,8 @@ with pkgs; dina-font-pcf = callPackage ../data/fonts/dina-pcf { }; + dns-root-data = callPackage ../data/misc/dns-root-data { }; + docbook5 = callPackage ../data/sgml+xml/schemas/docbook-5.0 { }; docbook_sgml_dtd_31 = callPackage ../data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix { }; From 8d76effc178747f0c8f456fe619c1b014736a6af Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 11 Jul 2017 16:04:14 -0400 Subject: [PATCH 004/108] stdenv-setup: Make the package accumulators associative arrays instead of strings This is generally cleaner: less eval, less worrying about separators, and probably also faster. I got the idea from that python wrapper script. --- .../haskell-modules/generic-builder.nix | 2 +- pkgs/development/interpreters/python/wrap.sh | 2 +- pkgs/servers/x11/xorg/builder.sh | 4 +-- pkgs/stdenv/generic/setup.sh | 27 +++++++++---------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index e097fd5af33..a8da63493a4 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -211,7 +211,7 @@ stdenv.mkDerivation ({ configureFlags="${concatStringsSep " " defaultConfigureFlags} $configureFlags" # nativePkgs defined in stdenv/setup.hs - for p in $nativePkgs; do + for p in "''${!nativePkgs[@]}"; do if [ -d "$p/lib/${ghc.name}/package.conf.d" ]; then cp -f "$p/lib/${ghc.name}/package.conf.d/"*.conf $packageConfDir/ continue diff --git a/pkgs/development/interpreters/python/wrap.sh b/pkgs/development/interpreters/python/wrap.sh index 1c74e612b55..4b9b2024981 100644 --- a/pkgs/development/interpreters/python/wrap.sh +++ b/pkgs/development/interpreters/python/wrap.sh @@ -86,7 +86,7 @@ wrapPythonProgramsIn() { _addToPythonPath() { local dir="$1" # Stop if we've already visited here. - if [ -n "${pythonPathsSeen[$dir]}" ]; then return; fi + [ -n "${pythonPathsSeen[$dir]}" ] || return 0 pythonPathsSeen[$dir]=1 # addToSearchPath is defined in stdenv/generic/setup.sh. It will have # the effect of calling `export program_X=$dir/...:$program_X`. diff --git a/pkgs/servers/x11/xorg/builder.sh b/pkgs/servers/x11/xorg/builder.sh index 055886374df..3a8cf6fa6c8 100644 --- a/pkgs/servers/x11/xorg/builder.sh +++ b/pkgs/servers/x11/xorg/builder.sh @@ -18,14 +18,14 @@ postInstall() { for r in $requires; do if test -n "$crossConfig"; then - for p in $crossPkgs; do + for p in "${!crossPkgs[@]}"; do if test -e $p/lib/pkgconfig/$r.pc; then echo " found requisite $r in $p" propagatedBuildInputs="$propagatedBuildInputs $p" fi done else - for p in $nativePkgs; do + for p in "${!nativePkgs[@]}"; do if test -e $p/lib/pkgconfig/$r.pc; then echo " found requisite $r in $p" propagatedNativeBuildInputs="$propagatedNativeBuildInputs $p" diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index de94565ed6d..e90c7e03473 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -275,17 +275,14 @@ runHook addInputsHook # Recursively find all build inputs. findInputs() { - local pkg="$1" + local pkg=$1 local var=$2 + local -n varDeref=$var local propagatedBuildInputsFile=$3 - case ${!var} in - *\ $pkg\ *) - return 0 - ;; - esac - - eval $var="'${!var} $pkg '" + # Stop if we've already added this one + [[ -z "${varDeref["$pkg"]}" ]] || return 0 + varDeref["$pkg"]=1 if ! [ -e "$pkg" ]; then echo "build input $pkg does not exist" >&2 @@ -296,8 +293,8 @@ findInputs() { source "$pkg" fi - if [ -d $1/bin ]; then - addToSearchPath _PATH $1/bin + if [ -d "$pkg/bin" ]; then + addToSearchPath _PATH "$pkg/bin" fi if [ -f "$pkg/nix-support/setup-hook" ]; then @@ -317,19 +314,19 @@ findInputs() { if [ -z "$crossConfig" ]; then # Not cross-compiling - both buildInputs (and variants like propagatedBuildInputs) # are handled identically to nativeBuildInputs - nativePkgs="" + declare -gA nativePkgs for i in $nativeBuildInputs $buildInputs \ $defaultNativeBuildInputs $defaultBuildInputs \ $propagatedNativeBuildInputs $propagatedBuildInputs; do findInputs $i nativePkgs propagated-native-build-inputs done else - crossPkgs="" + declare -gA crossPkgs for i in $buildInputs $defaultBuildInputs $propagatedBuildInputs; do findInputs $i crossPkgs propagated-build-inputs done - nativePkgs="" + declare -gA nativePkgs for i in $nativeBuildInputs $defaultNativeBuildInputs $propagatedNativeBuildInputs; do findInputs $i nativePkgs propagated-native-build-inputs done @@ -345,7 +342,7 @@ _addToNativeEnv() { runHook envHook "$pkg" } -for i in $nativePkgs; do +for i in "${!nativePkgs[@]}"; do _addToNativeEnv $i done @@ -356,7 +353,7 @@ _addToCrossEnv() { runHook crossEnvHook "$pkg" } -for i in $crossPkgs; do +for i in "${!crossPkgs[@]}"; do _addToCrossEnv $i done From 5d4efb2c816d2143f29cad8153faad1686557b2a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 11 Jul 2017 20:23:06 -0400 Subject: [PATCH 005/108] stdenv-setup: Misc improvements as directed by ShellCheck I took some liberties with the flags-echoing code to make it more concise and correct. Also, a few warnings in findInputs and friends I skipped because I am going to rewrite those anyways. Thanks @grahamc for telling me about this great linter! --- pkgs/stdenv/generic/setup.sh | 140 +++++++++++++++++++++++------------ 1 file changed, 93 insertions(+), 47 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index e90c7e03473..2e424c1f581 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -52,9 +52,9 @@ runOneHook() { _callImplicitHook() { local def="$1" local hookName="$2" - case "$(type -t $hookName)" in - (function|alias|builtin) $hookName;; - (file) source $hookName;; + case "$(type -t "$hookName")" in + (function|alias|builtin) "$hookName";; + (file) source "$hookName";; (keyword) :;; (*) if [ -z "${!hookName}" ]; then return "$def"; else eval "${!hookName}"; fi;; esac @@ -66,7 +66,7 @@ _callImplicitHook() { _eval() { local code="$1" shift - if [ "$(type -t $code)" = function ]; then + if [ "$(type -t "$code")" = function ]; then eval "$code \"\$@\"" else eval "$code" @@ -80,12 +80,14 @@ _eval() { nestingLevel=0 startNest() { - nestingLevel=$(($nestingLevel + 1)) + # Assert natural as sanity check. + let nestingLevel+=1 "nestingLevel>=0" echo -en "\033[$1p" } stopNest() { - nestingLevel=$(($nestingLevel - 1)) + # Assert natural as sanity check. + let nestingLevel-=1 "nestingLevel>=0" echo -en "\033[q" } @@ -120,7 +122,7 @@ exitHandler() { # - system time for the shell # - user time for all child processes # - system time for all child processes - echo "build time elapsed: " ${times[*]} + echo "build time elapsed: " "${times[@]}" fi if [ $exitCode != 0 ]; then @@ -197,7 +199,7 @@ isELF() { local fd local magic exec {fd}< "$fn" - read -n 4 -u $fd magic + read -r -n 4 -u $fd magic exec {fd}<&- if [[ "$magic" =~ ELF ]]; then return 0; else return 1; fi } @@ -210,7 +212,7 @@ isScript() { local magic if ! [ -x /bin/sh ]; then return 0; fi exec {fd}< "$fn" - read -n 2 -u $fd magic + read -r -n 2 -u $fd magic exec {fd}<&- if [[ "$magic" =~ \#! ]]; then return 0; else return 1; fi } @@ -439,14 +441,14 @@ substitute() { p="${params[$n]}" if [ "$p" = --replace ]; then - pattern="${params[$((n + 1))]}" - replacement="${params[$((n + 2))]}" - n=$((n + 2)) + pattern="${params[$n + 1]}" + replacement="${params[$n + 2]}" + let n+=2 fi if [ "$p" = --subst-var ]; then - varName="${params[$((n + 1))]}" - n=$((n + 1)) + varName="${params[$n + 1]}" + let n+=1 # check if the used nix attribute name is a valid bash name if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then echo "WARNING: substitution variables should be valid bash names," @@ -459,9 +461,9 @@ substitute() { fi if [ "$p" = --subst-var-by ]; then - pattern="@${params[$((n + 1))]}@" - replacement="${params[$((n + 2))]}" - n=$((n + 2)) + pattern="@${params[$n + 1]}@" + replacement="${params[$n + 2]}" + let n+=2 fi content="${content//"$pattern"/$replacement}" @@ -525,7 +527,9 @@ dumpVars() { # Utility function: echo the base name of the given path, with the # prefix `HASH-' removed, if present. stripHash() { - local strippedName="$(basename "$1")"; + local strippedName + # On separate line for `set -e` + strippedName="$(basename "$1")" if echo "$strippedName" | grep -q '^[a-z0-9]\{32\}-'; then echo "$strippedName" | cut -c34- else @@ -582,6 +586,7 @@ unpackPhase() { if [ -z "$srcs" ]; then if [ -z "$src" ]; then + # shellcheck disable=SC2016 echo 'variable $src or $srcs should point to the source' exit 1 fi @@ -601,7 +606,7 @@ unpackPhase() { # Unpack all source archives. for i in $srcs; do - unpackFile $i + unpackFile "$i" done # Find the source directory. @@ -665,6 +670,7 @@ patchPhase() { ;; esac # "2>&1" is a hack to make patch fail if the decompressor fails (nonexistent patch, etc.) + # shellcheck disable=SC2086 $uncompress < "$i" 2>&1 | patch ${patchFlags:--p1} stopNest done @@ -681,18 +687,19 @@ fixLibtool() { configurePhase() { runHook preConfigure - if [ -z "$configureScript" -a -x ./configure ]; then + if [[ -z "$configureScript" && -x ./configure ]]; then configureScript=./configure fi if [ -z "$dontFixLibtool" ]; then - find . -iname "ltmain.sh" | while read i; do + local i + find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do echo "fixing libtool script $i" - fixLibtool $i + fixLibtool "$i" done fi - if [ -z "$dontAddPrefix" -a -n "$prefix" ]; then + if [[ -z "$dontAddPrefix" && -n "$prefix" ]]; then configureFlags="${prefixKey:---prefix=}$prefix $configureFlags" fi @@ -711,8 +718,14 @@ configurePhase() { fi if [ -n "$configureScript" ]; then - echo "configure flags: $configureFlags ${configureFlagsArray[@]}" - $configureScript $configureFlags "${configureFlagsArray[@]}" + # shellcheck disable=SC2086 + local flagsArray=($configureFlags "${configureFlagsArray[@]}") + printf 'configure flags:' + printf ' %q' "${flagsArray[@]}" + echo + # shellcheck disable=SC2086 + $configureScript "${flagsArray[@]}" + unset flagsArray else echo "no configure script, doing nothing" fi @@ -724,17 +737,23 @@ configurePhase() { buildPhase() { runHook preBuild - if [ -z "$makeFlags" ] && ! [ -n "$makefile" -o -e "Makefile" -o -e "makefile" -o -e "GNUmakefile" ]; then + if [ -z "$makeFlags" ] && ! [[ -n "$makefile" || -e "Makefile" || -e "makefile" || -e "GNUmakefile" ]]; then echo "no Makefile, doing nothing" else # See https://github.com/NixOS/nixpkgs/pull/1354#issuecomment-31260409 makeFlags="SHELL=$SHELL $makeFlags" - echo "make flags: $makeFlags ${makeFlagsArray[@]} $buildFlags ${buildFlagsArray[@]}" - make ${makefile:+-f $makefile} \ + # shellcheck disable=SC2086 + local flagsArray=( \ ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \ $makeFlags "${makeFlagsArray[@]}" \ - $buildFlags "${buildFlagsArray[@]}" + $buildFlags "${buildFlagsArray[@]}") + + printf 'build flags:' + printf ' %q' "${flagsArray[@]}" + echo + make ${makefile:+-f $makefile} "${flagsArray[@]}" + unset flagsArray fi runHook postBuild @@ -744,11 +763,17 @@ buildPhase() { checkPhase() { runHook preCheck - echo "check flags: $makeFlags ${makeFlagsArray[@]} $checkFlags ${checkFlagsArray[@]}" - make ${makefile:+-f $makefile} \ + # shellcheck disable=SC2086 + local flagsArray=( \ ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \ $makeFlags "${makeFlagsArray[@]}" \ - ${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}" ${checkTarget:-check} + ${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}" ${checkTarget:-check}) + + printf 'check flags:' + printf ' %q' "${flagsArray[@]}" + echo + make ${makefile:+-f $makefile} "${flagsArray[@]}" + unset flagsArray runHook postCheck } @@ -762,10 +787,17 @@ installPhase() { fi installTargets=${installTargets:-install} - echo "install flags: $installTargets $makeFlags ${makeFlagsArray[@]} $installFlags ${installFlagsArray[@]}" - make ${makefile:+-f $makefile} $installTargets \ + + # shellcheck disable=SC2086 + local flagsArray=( $installTargets \ $makeFlags "${makeFlagsArray[@]}" \ - $installFlags "${installFlagsArray[@]}" + $installFlags "${installFlagsArray[@]}") + + printf 'install flags:' + printf ' %q' "${flagsArray[@]}" + echo + make ${makefile:+-f $makefile} "${flagsArray[@]}" + unset flagsArray runHook postInstall } @@ -799,16 +831,19 @@ fixupPhase() { fi if [ -n "$propagated" ]; then mkdir -p "${!outputDev}/nix-support" + # shellcheck disable=SC2086 printLines $propagated > "${!outputDev}/nix-support/propagated-native-build-inputs" fi else if [ -n "$propagatedBuildInputs" ]; then mkdir -p "${!outputDev}/nix-support" + # shellcheck disable=SC2086 printLines $propagatedBuildInputs > "${!outputDev}/nix-support/propagated-build-inputs" fi if [ -n "$propagatedNativeBuildInputs" ]; then mkdir -p "${!outputDev}/nix-support" + # shellcheck disable=SC2086 printLines $propagatedNativeBuildInputs > "${!outputDev}/nix-support/propagated-native-build-inputs" fi fi @@ -822,6 +857,7 @@ fixupPhase() { if [ -n "$propagatedUserEnvPkgs" ]; then mkdir -p "${!outputBin}/nix-support" + # shellcheck disable=SC2086 printLines $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages" fi @@ -832,11 +868,17 @@ fixupPhase() { installCheckPhase() { runHook preInstallCheck - echo "installcheck flags: $makeFlags ${makeFlagsArray[@]} $installCheckFlags ${installCheckFlagsArray[@]}" - make ${makefile:+-f $makefile} \ + # shellcheck disable=SC2086 + local flagsArray=( \ ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \ $makeFlags "${makeFlagsArray[@]}" \ - $installCheckFlags "${installCheckFlagsArray[@]}" ${installCheckTarget:-installcheck} + $installCheckFlags "${installCheckFlagsArray[@]}" ${installCheckTarget:-installcheck}) + + printf 'installcheck flags:' + printf ' %q' "${flagsArray[@]}" + echo + make ${makefile:+-f $makefile} "${flagsArray[@]}" + unset flagsArray runHook postInstallCheck } @@ -845,14 +887,18 @@ installCheckPhase() { distPhase() { runHook preDist - echo "dist flags: $distFlags ${distFlagsArray[@]}" - make ${makefile:+-f $makefile} $distFlags "${distFlagsArray[@]}" ${distTarget:-dist} + # shellcheck disable=SC2086 + local flagsArray=($distFlags "${distFlagsArray[@]}" ${distTarget:-dist}) + + echo 'dist flags: %q' "${flagsArray[@]}" + make ${makefile:+-f $makefile} "${flagsArray[@]}" if [ "$dontCopyDist" != 1 ]; then mkdir -p "$out/tarballs" # Note: don't quote $tarballs, since we explicitly permit # wildcards in there. + # shellcheck disable=SC2086 cp -pvd ${tarballs:-*.tar.gz} $out/tarballs fi @@ -894,14 +940,14 @@ genericBuild() { fi for curPhase in $phases; do - if [ "$curPhase" = buildPhase -a -n "$dontBuild" ]; then continue; fi - if [ "$curPhase" = checkPhase -a -z "$doCheck" ]; then continue; fi - if [ "$curPhase" = installPhase -a -n "$dontInstall" ]; then continue; fi - if [ "$curPhase" = fixupPhase -a -n "$dontFixup" ]; then continue; fi - if [ "$curPhase" = installCheckPhase -a -z "$doInstallCheck" ]; then continue; fi - if [ "$curPhase" = distPhase -a -z "$doDist" ]; then continue; fi + if [[ "$curPhase" = buildPhase && -n "$dontBuild" ]]; then continue; fi + if [[ "$curPhase" = checkPhase && -z "$doCheck" ]]; then continue; fi + if [[ "$curPhase" = installPhase && -n "$dontInstall" ]]; then continue; fi + if [[ "$curPhase" = fixupPhase && -n "$dontFixup" ]]; then continue; fi + if [[ "$curPhase" = installCheckPhase && -z "$doInstallCheck" ]]; then continue; fi + if [[ "$curPhase" = distPhase && -z "$doDist" ]]; then continue; fi - if [ -n "$tracePhases" ]; then + if [[ -n "$tracePhases" ]]; then echo echo "@ phase-started $out $curPhase" fi From 5d693c84d2e492080e982bf7429d6e923229d721 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 12 Jul 2017 11:56:43 -0400 Subject: [PATCH 006/108] stdenv-setup: Clean up 'substitute()' for style and error handling It now blows up on null byte in file (rather than silently truncating), and invalid arguments (rather than silently skipping). --- pkgs/stdenv/generic/setup.sh | 75 +++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 2e424c1f581..0d9a647a5c3 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -421,50 +421,55 @@ fi substitute() { - local input="$1" - local output="$2" + local input=$1 + local output=$2 + shift 2 if [ ! -f "$input" ]; then - echo "substitute(): file '$input' does not exist" + echo "${FUNCNAME[0]}(): ERROR: file '$input' does not exist" >&2 return 1 fi - local -a params=("$@") + local content + # read returns non-0 on EOF, so we want read to fail + if IFS='' read -r -N 0 content < "$input"; then + echo "${FUNCNAME[0]}(): ERROR: File \"$input\" has null bytes, won't process" >&2 + return 1 + fi - local n p pattern replacement varName content + while (( "$#" )); do + case "$1" in + --replace) + pattern=$2 + replacement=$3 + shift 3 + ;; - # a slightly hacky way to keep newline at the end - content="$(cat "$input"; printf "%s" X)" - content="${content%X}" + --subst-var) + local varName=$2 + shift 2 + # check if the used nix attribute name is a valid bash name + if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + echo "${FUNCNAME[0]}(): WARNING: substitution variables should be valid bash names," >&2 + echo " \"$varName\" isn't and therefore was skipped; it might be caused" >&2 + echo " by multi-line phases in variables - see #14907 for details." >&2 + continue + fi + pattern=@$varName@ + replacement=${!varName} + ;; - for ((n = 2; n < ${#params[*]}; n += 1)); do - p="${params[$n]}" + --subst-var-by) + pattern=@$2@ + replacement=$3 + shift 3 + ;; - if [ "$p" = --replace ]; then - pattern="${params[$n + 1]}" - replacement="${params[$n + 2]}" - let n+=2 - fi - - if [ "$p" = --subst-var ]; then - varName="${params[$n + 1]}" - let n+=1 - # check if the used nix attribute name is a valid bash name - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "WARNING: substitution variables should be valid bash names," - echo " \"$varName\" isn't and therefore was skipped; it might be caused" - echo " by multi-line phases in variables - see #14907 for details." - continue - fi - pattern="@$varName@" - replacement="${!varName}" - fi - - if [ "$p" = --subst-var-by ]; then - pattern="@${params[$n + 1]}@" - replacement="${params[$n + 2]}" - let n+=2 - fi + *) + echo "${FUNCNAME[0]}(): ERROR: Invalid command line argument: $1" >&2 + return 1 + ;; + esac content="${content//"$pattern"/$replacement}" done From 706f0c384946804fe56cb6f7d43e59b465503ce6 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 5 Jul 2017 10:47:03 +0200 Subject: [PATCH 007/108] gnugrep: 3.0 -> 3.1 See http://lists.gnu.org/archive/html/info-gnu/2017-07/msg00000.html for release announcement --- pkgs/tools/text/gnugrep/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index b33ea716978..0db140c7891 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -1,13 +1,13 @@ { stdenv, fetchurl, pcre, libiconv, perl }: -let version = "3.0"; in +let version = "3.1"; in stdenv.mkDerivation { name = "gnugrep-${version}"; src = fetchurl { url = "mirror://gnu/grep/grep-${version}.tar.xz"; - sha256 = "1dcasjp3a578nrvzrcn38mpizb8w1q6mvfzhjmcqqgkf0nsivj72"; + sha256 = "0zm0ywmyz9g8vn1plw14mn8kj74yipx5qsljndbyfgmvndx5qqnv"; }; # Perl is needed for testing From 273a4c1c78d9e0b3aa852f197ce9ecc0e63ce42b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 13 Jul 2017 14:56:40 -0400 Subject: [PATCH 008/108] stdenv-setup: Combine [[ .. ]] && [[ .. ]] into one [[ .. && .. ]] Also remove useless quotes on same line --- pkgs/stdenv/generic/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 0d9a647a5c3..de83e4fb18f 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -742,7 +742,7 @@ configurePhase() { buildPhase() { runHook preBuild - if [ -z "$makeFlags" ] && ! [[ -n "$makefile" || -e "Makefile" || -e "makefile" || -e "GNUmakefile" ]]; then + if [[ -z $makeFlags && ! ( -n $makefile || -e Makefile || -e makefile || -e GNUmakefile[[ ) ]]; then echo "no Makefile, doing nothing" else # See https://github.com/NixOS/nixpkgs/pull/1354#issuecomment-31260409 From 2743078f664ae07c4bed06a96182c6a86bd7fa32 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 13 Jul 2017 14:59:53 -0400 Subject: [PATCH 009/108] stdenv-setup: Remove useless quotes foo=$1 surprisingly doesn't need quotes in Bash. Word splits are only syntactic in string variable (not array var!) assignments. --- pkgs/stdenv/generic/setup.sh | 70 ++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index de83e4fb18f..f95b2e58837 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -13,10 +13,10 @@ set -o pipefail # code). The hooks for are the shell function or variable # , and the values of the shell array ‘Hooks’. runHook() { - local hookName="$1" + local hookName=$1 shift local var="$hookName" - if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi + if [[ $hookName =~ Hook$ ]]; then var+=s; else var+=Hooks; fi local -n var local hook for hook in "_callImplicitHook 0 $hookName" "${var[@]}"; do @@ -29,10 +29,10 @@ runHook() { # Run all hooks with the specified name, until one succeeds (returns a # zero exit code). If none succeed, return a non-zero exit code. runOneHook() { - local hookName="$1" + local hookName=$1 shift local var="$hookName" - if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi + if [[ $hookName =~ Hook$ ]]; then var+=s; else var+=Hooks; fi local -n var local hook for hook in "_callImplicitHook 1 $hookName" "${var[@]}"; do @@ -50,8 +50,8 @@ runOneHook() { # environment variables) and from shell scripts (as functions). If you # want to allow multiple hooks, use runHook instead. _callImplicitHook() { - local def="$1" - local hookName="$2" + local def=$1 + local hookName=$2 case "$(type -t "$hookName")" in (function|alias|builtin) "$hookName";; (file) source "$hookName";; @@ -64,7 +64,7 @@ _callImplicitHook() { # A function wrapper around ‘eval’ that ensures that ‘return’ inside # hooks exits the hook, not the caller. _eval() { - local code="$1" + local code=$1 shift if [ "$(type -t "$code")" = function ]; then eval "$code \"\$@\"" @@ -195,26 +195,26 @@ _addRpathPrefix() { # Return success if the specified file is an ELF object. isELF() { - local fn="$1" + local fn=$1 local fd local magic exec {fd}< "$fn" read -r -n 4 -u $fd magic exec {fd}<&- - if [[ "$magic" =~ ELF ]]; then return 0; else return 1; fi + if [[ $magic =~ ELF ]]; then return 0; else return 1; fi } # Return success if the specified file is a script (i.e. starts with # "#!"). isScript() { - local fn="$1" + local fn=$1 local fd local magic if ! [ -x /bin/sh ]; then return 0; fi exec {fd}< "$fn" read -r -n 2 -u $fd magic exec {fd}<&- - if [[ "$magic" =~ \#! ]]; then return 0; else return 1; fi + if [[ $magic =~ \#! ]]; then return 0; else return 1; fi } # printf unfortunately will print a trailing newline regardless @@ -255,8 +255,8 @@ fi # Check that the pre-hook initialised SHELL. if [ -z "$SHELL" ]; then echo "SHELL not set"; exit 1; fi -BASH="$SHELL" -export CONFIG_SHELL="$SHELL" +BASH=$SHELL +export CONFIG_SHELL=$SHELL # Dummy implementation of the paxmark function. On Linux, this is @@ -283,7 +283,7 @@ findInputs() { local propagatedBuildInputsFile=$3 # Stop if we've already added this one - [[ -z "${varDeref["$pkg"]}" ]] || return 0 + [[ -z ${varDeref[$pkg]} ]] || return 0 varDeref["$pkg"]=1 if ! [ -e "$pkg" ]; then @@ -373,7 +373,7 @@ export TZ=UTC # for instance if we just want to perform a test build/install to a # temporary location and write a build report to $out. if [ -z "$prefix" ]; then - prefix="$out"; + prefix=$out; fi if [ "$useTempPrefix" = 1 ]; then @@ -449,7 +449,7 @@ substitute() { local varName=$2 shift 2 # check if the used nix attribute name is a valid bash name - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + if ! [[ $varName =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then echo "${FUNCNAME[0]}(): WARNING: substitution variables should be valid bash names," >&2 echo " \"$varName\" isn't and therefore was skipped; it might be caused" >&2 echo " by multi-line phases in variables - see #14907 for details." >&2 @@ -480,7 +480,7 @@ substitute() { substituteInPlace() { - local fileName="$1" + local fileName=$1 shift substitute "$fileName" "$fileName" "$@" } @@ -490,8 +490,8 @@ substituteInPlace() { # character or underscore. Note: other names that aren't bash-valid # will cause an error during `substitute --subst-var`. substituteAll() { - local input="$1" - local output="$2" + local input=$1 + local output=$2 local -a args=() # Select all environment variables that start with a lowercase character. @@ -507,7 +507,7 @@ substituteAll() { substituteAllInPlace() { - local fileName="$1" + local fileName=$1 shift substituteAll "$fileName" "$fileName" "$@" } @@ -534,7 +534,7 @@ dumpVars() { stripHash() { local strippedName # On separate line for `set -e` - strippedName="$(basename "$1")" + strippedName=$(basename "$1") if echo "$strippedName" | grep -q '^[a-z0-9]\{32\}-'; then echo "$strippedName" | cut -c34- else @@ -545,7 +545,7 @@ stripHash() { unpackCmdHooks+=(_defaultUnpack) _defaultUnpack() { - local fn="$1" + local fn=$1 if [ -d "$fn" ]; then @@ -576,7 +576,7 @@ _defaultUnpack() { unpackFile() { - curSrc="$1" + curSrc=$1 header "unpacking source archive $curSrc" 3 if ! runOneHook unpackCmd "$curSrc"; then echo "do not know how to unpack source archive $curSrc" @@ -595,7 +595,7 @@ unpackPhase() { echo 'variable $src or $srcs should point to the source' exit 1 fi - srcs="$src" + srcs=$src fi # To determine the source directory created by unpacking the @@ -629,7 +629,7 @@ unpackPhase() { echo "unpacker produced multiple directories" exit 1 fi - sourceRoot="$i" + sourceRoot=$i ;; esac fi @@ -692,7 +692,7 @@ fixLibtool() { configurePhase() { runHook preConfigure - if [[ -z "$configureScript" && -x ./configure ]]; then + if [[ -z $configureScript && -x ./configure ]]; then configureScript=./configure fi @@ -704,7 +704,7 @@ configurePhase() { done fi - if [[ -z "$dontAddPrefix" && -n "$prefix" ]]; then + if [[ -z $dontAddPrefix && -n $prefix ]]; then configureFlags="${prefixKey:---prefix=}$prefix $configureFlags" fi @@ -912,7 +912,7 @@ distPhase() { showPhaseHeader() { - local phase="$1" + local phase=$1 case $phase in unpackPhase) header "unpacking sources";; patchPhase) header "patching sources";; @@ -945,14 +945,14 @@ genericBuild() { fi for curPhase in $phases; do - if [[ "$curPhase" = buildPhase && -n "$dontBuild" ]]; then continue; fi - if [[ "$curPhase" = checkPhase && -z "$doCheck" ]]; then continue; fi - if [[ "$curPhase" = installPhase && -n "$dontInstall" ]]; then continue; fi - if [[ "$curPhase" = fixupPhase && -n "$dontFixup" ]]; then continue; fi - if [[ "$curPhase" = installCheckPhase && -z "$doInstallCheck" ]]; then continue; fi - if [[ "$curPhase" = distPhase && -z "$doDist" ]]; then continue; fi + if [[ $curPhase = buildPhase && -n $dontBuild ]]; then continue; fi + if [[ $curPhase = checkPhase && -z $doCheck ]]; then continue; fi + if [[ $curPhase = installPhase && -n $dontInstall ]]; then continue; fi + if [[ $curPhase = fixupPhase && -n $dontFixup ]]; then continue; fi + if [[ $curPhase = installCheckPhase && -z $doInstallCheck ]]; then continue; fi + if [[ $curPhase = distPhase && -z $doDist ]]; then continue; fi - if [[ -n "$tracePhases" ]]; then + if [[ -n $tracePhases ]]; then echo echo "@ phase-started $out $curPhase" fi From 30a14204149c8fb43001c4f2188e8e655a9a389a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 13 Jul 2017 16:31:39 -0400 Subject: [PATCH 010/108] stdenv-setup: Pull out and explain 3-part printing of commands @Dezgeg made the good point that the reasons for doing this were not at all intuitive. --- pkgs/stdenv/generic/setup.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index f95b2e58837..35fe8fd6950 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -104,6 +104,17 @@ closeNest() { done } +# Prints a command such that all word splits are unambiguous. We need +# to split the command in three parts because the middle format string +# will be, and must be, repeated for each argument. The first argument +# goes before the ':' and is just for convenience. +echoCmd() { + printf "%s:" "$1" + shift + printf ' %q' "$@" + echo +} + ###################################################################### # Error handling. @@ -725,9 +736,7 @@ configurePhase() { if [ -n "$configureScript" ]; then # shellcheck disable=SC2086 local flagsArray=($configureFlags "${configureFlagsArray[@]}") - printf 'configure flags:' - printf ' %q' "${flagsArray[@]}" - echo + echoCmd 'configure flags' "${flagsArray[@]}" # shellcheck disable=SC2086 $configureScript "${flagsArray[@]}" unset flagsArray @@ -754,9 +763,7 @@ buildPhase() { $makeFlags "${makeFlagsArray[@]}" \ $buildFlags "${buildFlagsArray[@]}") - printf 'build flags:' - printf ' %q' "${flagsArray[@]}" - echo + echoCmd 'build flags' "${flagsArray[@]}" make ${makefile:+-f $makefile} "${flagsArray[@]}" unset flagsArray fi @@ -774,9 +781,7 @@ checkPhase() { $makeFlags "${makeFlagsArray[@]}" \ ${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}" ${checkTarget:-check}) - printf 'check flags:' - printf ' %q' "${flagsArray[@]}" - echo + echoCmd 'check flags' "${flagsArray[@]}" make ${makefile:+-f $makefile} "${flagsArray[@]}" unset flagsArray @@ -798,9 +803,7 @@ installPhase() { $makeFlags "${makeFlagsArray[@]}" \ $installFlags "${installFlagsArray[@]}") - printf 'install flags:' - printf ' %q' "${flagsArray[@]}" - echo + echoCmd 'install flags' "${flagsArray[@]}" make ${makefile:+-f $makefile} "${flagsArray[@]}" unset flagsArray @@ -879,9 +882,7 @@ installCheckPhase() { $makeFlags "${makeFlagsArray[@]}" \ $installCheckFlags "${installCheckFlagsArray[@]}" ${installCheckTarget:-installcheck}) - printf 'installcheck flags:' - printf ' %q' "${flagsArray[@]}" - echo + echoCmd 'installcheck flags' "${flagsArray[@]}" make ${makefile:+-f $makefile} "${flagsArray[@]}" unset flagsArray From e826a6a24774045b7d7d4e9814d8356278b84568 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 12 Jul 2017 19:00:19 -0400 Subject: [PATCH 011/108] stdenv: Move some logic from cross adapter to stdenv proper Eventually the adapter will be removed. Moved is - Name suffix from hostPlatform - configurePlatforms To not cause more breakage, the default is currently [], but eventually it will be [ "build" "host" ], as the cross adapter makes it today. --- pkgs/stdenv/adapters.nix | 19 +------------------ pkgs/stdenv/generic/make-derivation.nix | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 5848ee87b1b..ac382927b1b 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -73,15 +73,8 @@ rec { }; in stdenv // { mkDerivation = - { name ? "", buildInputs ? [], nativeBuildInputs ? [] + { buildInputs ? [], nativeBuildInputs ? [] , propagatedBuildInputs ? [], propagatedNativeBuildInputs ? [] - , # Disabling the tests by default when cross compiling, as usually the - # tests rely on being able to run produced binaries. - doCheck ? false - , configureFlags ? [] - , # Target is not included by default because most programs don't care. - # Including it then would cause needless massive rebuilds. - configurePlatforms ? args.crossAttrs.configurePlatforms or [ "build" "host" ] , selfNativeBuildInput ? args.crossAttrs.selfNativeBuildInput or false , ... } @ args: @@ -106,7 +99,6 @@ rec { nativeInputsFromBuildInputs = stdenv.lib.filter hostAsNativeDrv buildInputsNotNull; in stdenv.mkDerivation (args // { - name = name + "-" + hostPlatform.config; nativeBuildInputs = nativeBuildInputs ++ nativeInputsFromBuildInputs ++ stdenv.lib.optional selfNativeBuildInput nativeDrv @@ -116,15 +108,6 @@ rec { ++ stdenv.lib.optional (hostPlatform.config == "aarch64-linux-gnu") pkgs.updateAutotoolsGnuConfigScriptsHook ; - inherit doCheck; - - # This parameter is sometimes a string and sometimes a list, yuck - configureFlags = let inherit (stdenv.lib) optional elem; in - (if stdenv.lib.isString configureFlags then [configureFlags] else configureFlags) - ++ optional (elem "build" configurePlatforms) "--build=${buildPlatform.config}" - ++ optional (elem "host" configurePlatforms) "--host=${hostPlatform.config}" - ++ optional (elem "target" configurePlatforms) "--target=${targetPlatform.config}"; - # Cross-linking dynamic libraries, every buildInput should # be propagated because ld needs the -rpath-link to find # any library needed to link the program dynamically at diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 05221e2f3c1..1486b11f701 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -12,12 +12,22 @@ rec { # * https://nixos.org/nix/manual/#ssec-derivation # Explanation about derivations in general mkDerivation = - { nativeBuildInputs ? [] + { name ? "" + + , nativeBuildInputs ? [] , buildInputs ? [] , propagatedNativeBuildInputs ? [] , propagatedBuildInputs ? [] + , configureFlags ? [] + , # Target is not included by default because most programs don't care. + # Including it then would cause needless mass rebuilds. + # + # TODO(@Ericson2314): Make [ "build" "host" ] always the default. + configurePlatforms ? lib.optionals + (stdenv.hostPlatform != stdenv.buildPlatform) + [ "build" "host" ] , crossConfig ? null , meta ? {} , passthru ? {} @@ -72,6 +82,9 @@ rec { lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists propagatedDependencies')); in { + name = name + lib.optionalString + (stdenv.hostPlatform != stdenv.buildPlatform) + stdenv.hostPlatform.config; builder = attrs.realBuilder or stdenv.shell; args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; inherit stdenv; @@ -84,6 +97,14 @@ rec { propagatedNativeBuildInputs = lib.elemAt propagatedDependencies' 0; propagatedBuildInputs = lib.elemAt propagatedDependencies' 1; + + # This parameter is sometimes a string and sometimes a list, yuck + configureFlags = let inherit (lib) optional elem; in + (if lib.isString configureFlags then [configureFlags] else configureFlags) + ++ optional (elem "build" configurePlatforms) "--build=${stdenv.buildPlatform.config}" + ++ optional (elem "host" configurePlatforms) "--host=${stdenv.hostPlatform.config}" + ++ optional (elem "target" configurePlatforms) "--target=${stdenv.targetPlatform.config}"; + } // lib.optionalAttrs (stdenv.buildPlatform.isDarwin) { # TODO: remove lib.unique once nix has a list canonicalization primitive __sandboxProfile = From aca5ba405e95d22a3934e03e947968866d23bdb6 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 26 Jun 2017 02:01:03 -0400 Subject: [PATCH 012/108] cc-wrapper: Unify and improve dynamic linker flag logic Besides deduplicating overlapping logic, clear warning messages were added for: - No glob/path for dynamic linker provided (use default glob) - Glob did not expand to anything (don't append flag) - glob expanded to multiple things (take first, like before) --- pkgs/build-support/cc-wrapper/default.nix | 66 +++++++++++------------ 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 37d62891ecf..4dc3d1845a4 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -105,22 +105,20 @@ let done ''); - # The dynamic linker has different names on different platforms. + # The dynamic linker has different names on different platforms. This is a + # shell glob that ought to match it. dynamicLinker = - if !nativeLibc then - (if targetPlatform.system == "i686-linux" then "ld-linux.so.2" else - if targetPlatform.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else - # ARM with a wildcard, which can be "" or "-armhf". - if targetPlatform.isArm32 then "ld-linux*.so.3" else - if targetPlatform.system == "aarch64-linux" then "ld-linux-aarch64.so.1" else - if targetPlatform.system == "powerpc-linux" then "ld.so.1" else - if targetPlatform.system == "mips64el-linux" then "ld.so.1" else - if targetPlatform.system == "x86_64-darwin" then "/usr/lib/dyld" else - if stdenv.lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1" else - builtins.trace - "Don't know the name of the dynamic linker for platform ${targetPlatform.config}, so guessing instead." - null) - else ""; + /**/ if libc == null then null + else if targetPlatform.system == "i686-linux" then "${libc_lib}/lib/ld-linux.so.2" + else if targetPlatform.system == "x86_64-linux" then "${libc_lib}/lib/ld-linux-x86-64.so.2" + # ARM with a wildcard, which can be "" or "-armhf". + else if targetPlatform.isArm32 then "${libc_lib}/lib/ld-linux*.so.3" + else if targetPlatform.system == "aarch64-linux" then "${libc_lib}/lib/ld-linux-aarch64.so.1" + else if targetPlatform.system == "powerpc-linux" then "${libc_lib}/lib/ld.so.1" + else if targetPlatform.system == "mips64el-linux" then "${libc_lib}/lib/ld.so.1" + else if targetPlatform.system == "x86_64-darwin" then "/usr/lib/dyld" + else if stdenv.lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1" + else null; expand-response-params = if buildPackages.stdenv.cc or null != null && buildPackages.stdenv.cc != "/dev/null" then buildPackages.stdenv.mkDerivation { @@ -175,39 +173,39 @@ stdenv.mkDerivation { } '' - # TODO(@Ericson2314): Unify logic next hash break - + optionalString (libc != null) (if (targetPlatform.isDarwin) then '' - echo $dynamicLinker > $out/nix-support/dynamic-linker - - echo "export LD_DYLD_PATH=\"$dynamicLinker\"" >> $out/nix-support/setup-hook - '' else if dynamicLinker != null then '' - dynamicLinker="${libc_lib}/lib/$dynamicLinker" - echo $dynamicLinker > $out/nix-support/dynamic-linker - - if [ -e ${libc_lib}/lib/32/ld-linux.so.2 ]; then - echo ${libc_lib}/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32 + + optionalString (libc != null) ('' + if [[ -z ''${dynamicLinker+x} ]]; then + echo "Don't know the name of the dynamic linker for platform '${targetPlatform.config}', so guessing instead." >&2 + dynamicLinker="${libc_lib}/lib/ld*.so.?" fi - # The dynamic linker is passed in `ldflagsBefore' to allow - # explicit overrides of the dynamic linker by callers to gcc/ld - # (the *last* value counts, so ours should come first). - echo "-dynamic-linker" $dynamicLinker > $out/nix-support/libc-ldflags-before - '' else '' - dynamicLinker=`eval 'echo $libc/lib/ld*.so.?'` + # Expand globs to fill array of options + dynamicLinker=($dynamicLinker) + + case ''${#dynamicLinker[@]} in + 0) echo "No dynamic linker found for platform '${targetPlatform.config}'." >&2;; + 1) echo "Using dynamic linker: '$dynamicLinker'" >&2;; + *) echo "Multiple dynamic linkers found for platform '${targetPlatform.config}'." >&2;; + esac + if [ -n "$dynamicLinker" ]; then echo $dynamicLinker > $out/nix-support/dynamic-linker + '' + (if targetPlatform.isDarwin then '' + printf "export LD_DYLD_PATH+=%q\n" "$dynamicLinker" >> $out/nix-support/setup-hook + '' else '' if [ -e ${libc_lib}/lib/32/ld-linux.so.2 ]; then echo ${libc_lib}/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32 fi - ldflagsBefore="-dynamic-linker $dlinker" + ldflagsBefore=(-dynamic-linker "$dynamicLinker") + '') + '' fi # The dynamic linker is passed in `ldflagsBefore' to allow # explicit overrides of the dynamic linker by callers to gcc/ld # (the *last* value counts, so ours should come first). - echo "$ldflagsBefore" > $out/nix-support/libc-ldflags-before + printLines "''${ldflagsBefore[@]}" > $out/nix-support/libc-ldflags-before '') + optionalString (libc != null) '' From 5ff18c44846de017438eead7e1b674d24d599859 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Fri, 14 Jul 2017 22:52:36 +0300 Subject: [PATCH 013/108] libuv: Disable yet another test This consistently times out for me on ARM, and apparently for others as well: https://github.com/libuv/libuv/issues/687 --- pkgs/development/libraries/libuv/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix index fdf5191bf72..97672436641 100644 --- a/pkgs/development/libraries/libuv/default.nix +++ b/pkgs/development/libraries/libuv/default.nix @@ -17,6 +17,7 @@ stdenv.mkDerivation rec { "getnameinfo_basic" "udp_send_hang_loop" # probably network-dependent "spawn_setuid_fails" "spawn_setgid_fails" "fs_chown" # user namespaces "getaddrinfo_fail" "getaddrinfo_fail_sync" + "threadpool_multiple_event_loops" # times out on slow machines ] # sometimes: timeout (no output), failed uv_listen ++ stdenv.lib.optionals stdenv.isDarwin [ "process_title" "emfile" ]; From 338a19520493f941a3f478bf852074e74a67b03d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 15 Jul 2017 10:38:01 +0200 Subject: [PATCH 014/108] dns-root-data: improve determinism, clear key status Nitpicks: - The timestamps there were useless. - The generator now switched the two keys; I don't know why. I intentionally remove the comments like "state=1 [ ADDPEND ]". The problem is that keys e.g. in ADDPEND state are *not* immediately usable for validation - see RFC5011 for details. I verified that Unbound does disregard this on the format we and Debian use ATM, presumably due to removing parts of the comments, but it would be confusing nevertheless. --- pkgs/data/misc/dns-root-data/root.ds | 1 - pkgs/data/misc/dns-root-data/root.key | 4 ++-- pkgs/data/misc/dns-root-data/update-root-key.sh | 9 +++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/data/misc/dns-root-data/root.ds b/pkgs/data/misc/dns-root-data/root.ds index 61c5b8fcd34..7578e0405d9 100644 --- a/pkgs/data/misc/dns-root-data/root.ds +++ b/pkgs/data/misc/dns-root-data/root.ds @@ -1,3 +1,2 @@ -; created by unbound-anchor on Tue Jul 11 23:48:16 2017 . IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5 . IN DS 20326 8 2 E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D diff --git a/pkgs/data/misc/dns-root-data/root.key b/pkgs/data/misc/dns-root-data/root.key index 9046cefcb71..c0da7b3f60f 100644 --- a/pkgs/data/misc/dns-root-data/root.key +++ b/pkgs/data/misc/dns-root-data/root.key @@ -1,2 +1,2 @@ -. 172800 IN DNSKEY 257 3 8 AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3+/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kvArMtNROxVQuCaSnIDdD5LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF0jLHwVN8efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7pr+eoZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLYA4/ilBmSVIzuDWfdRUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwNR1AkUTV74bU= ;{id = 20326 (ksk), size = 2048b} ;;state=1 [ ADDPEND ] -. 172800 IN DNSKEY 257 3 8 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaDX6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpzW5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0= ;{id = 19036 (ksk), size = 2048b} ;;state=2 [ VALID ] +. 172800 IN DNSKEY 257 3 8 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaDX6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpzW5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0= ;{id = 19036 (ksk), size = 2048b} +. 172800 IN DNSKEY 257 3 8 AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3+/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kvArMtNROxVQuCaSnIDdD5LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF0jLHwVN8efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7pr+eoZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLYA4/ilBmSVIzuDWfdRUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwNR1AkUTV74bU= ;{id = 20326 (ksk), size = 2048b} diff --git a/pkgs/data/misc/dns-root-data/update-root-key.sh b/pkgs/data/misc/dns-root-data/update-root-key.sh index 5db179621a7..9a3141aef19 100755 --- a/pkgs/data/misc/dns-root-data/update-root-key.sh +++ b/pkgs/data/misc/dns-root-data/update-root-key.sh @@ -2,8 +2,9 @@ #!nix-shell -i bash -p busybox unbound TMP=`mktemp` -unbound-anchor -a $TMP -grep -Ev "^($$|;)" $TMP | sed -e 's/ ;;count=.*//' > root.key -rm $TMP +unbound-anchor -a "$TMP" +grep -Ev "^($$|;)" "$TMP" | sed -e 's/ ;;.*//' > root.key -unbound-anchor -F -a root.ds +unbound-anchor -F -a "$TMP" +sed '/^;/d' < "$TMP" > root.ds +rm $TMP From 2ab67778d6935f6c59ba9c4667cdad0554b7dbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 15 Jul 2017 11:28:56 +0200 Subject: [PATCH 015/108] pciutils: 3.5.4 -> 3.5.5 --- pkgs/tools/system/pciutils/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/system/pciutils/default.nix b/pkgs/tools/system/pciutils/default.nix index 998a3bdf6d1..8a4fe6cb3cf 100644 --- a/pkgs/tools/system/pciutils/default.nix +++ b/pkgs/tools/system/pciutils/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, pkgconfig, zlib, kmod, which }: stdenv.mkDerivation rec { - name = "pciutils-3.5.4"; # with database from 2017-02 + name = "pciutils-3.5.5"; # with database from 2017-07 src = fetchurl { url = "mirror://kernel/software/utils/pciutils/${name}.tar.xz"; - sha256 = "0rpy7kkb2y89wmbcbfjjjxsk2x89v5xxhxib4vpl131ip5m3qab4"; + sha256 = "1d62f8fa192f90e61c35a6fc15ff3cb9a7a792f782407acc42ef67817c5939f5"; }; buildInputs = [ pkgconfig zlib kmod which ]; From 240313e251fc2f07cade7578fe6d01a625c967c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 15 Jul 2017 11:34:52 +0200 Subject: [PATCH 016/108] libjpeg(-turbo): 1.5.1 -> 1.5.2 --- pkgs/development/libraries/libjpeg-turbo/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libjpeg-turbo/default.nix b/pkgs/development/libraries/libjpeg-turbo/default.nix index cd8484170bd..d1181966815 100644 --- a/pkgs/development/libraries/libjpeg-turbo/default.nix +++ b/pkgs/development/libraries/libjpeg-turbo/default.nix @@ -4,11 +4,11 @@ stdenv.mkDerivation rec { name = "libjpeg-turbo-${version}"; - version = "1.5.1"; + version = "1.5.2"; src = fetchurl { url = "mirror://sourceforge/libjpeg-turbo/${name}.tar.gz"; - sha256 = "0v365hm6z6lddcqagjj15wflk66rqyw75m73cqzl65rh4lyrshj1"; + sha256 = "0a5m0psfp5952y5vrcs0nbdz1y9wqzg2ms0xwrx752034wxr964h"; }; # github releases still need autotools, surprisingly patches = From 0f09b057944dd3fdee3422ba46d66d5f28298f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 15 Jul 2017 11:39:46 +0200 Subject: [PATCH 017/108] libpng: 1.6.29 -> 1.6.30 --- pkgs/development/libraries/libpng/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix index c2f50af84ca..0ae40a76386 100644 --- a/pkgs/development/libraries/libpng/default.nix +++ b/pkgs/development/libraries/libpng/default.nix @@ -5,13 +5,13 @@ assert zlib != null; let - version = "1.6.29"; - patchVersion = "1.6.26"; + version = "1.6.30"; + patchVersion = "1.6.30"; # patchVersion = version; - sha256 = "0fgjqp7x6jynacmqh6dj72cn6nnf6yxjfqqqfsxrx0pyx22bcia2"; + sha256 = "0rin6la7q03vb7wsafhlvzqri1v9ky30g4ljsfcwa37pzwpk6z16"; patch_src = fetchurl { url = "mirror://sourceforge/libpng-apng/libpng-${patchVersion}-apng.patch.gz"; - sha256 = "0b6p2k4afvhk1svargpllcvhxb4g3p857wkqk85cks0yv42ckph1"; + sha256 = "06nrcp2n77f563hch8g9gv62jg894mvya6zizj5fsmbqzaqmjqqs"; }; whenPatched = stdenv.lib.optionalString apngSupport; From 5a03a05520068abd1a5964310abfac22a90c26e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 15 Jul 2017 11:43:47 +0200 Subject: [PATCH 018/108] gtk3: maintenance 3.22.15 -> 3.22.16 --- pkgs/development/libraries/gtk+/3.x.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix index 917371678e9..cf888641b94 100644 --- a/pkgs/development/libraries/gtk+/3.x.nix +++ b/pkgs/development/libraries/gtk+/3.x.nix @@ -13,7 +13,7 @@ with stdenv.lib; let ver_maj = "3.22"; - ver_min = "15"; + ver_min = "16"; version = "${ver_maj}.${ver_min}"; in stdenv.mkDerivation rec { @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "mirror://gnome/sources/gtk+/${ver_maj}/gtk+-${version}.tar.xz"; - sha256 = "c8a012c2a99132629ab043f764a2b7cb6388483a015cd15c7a4288bec3590fdb"; + sha256 = "3e0c3ad01f3c8c5c9b1cc1ae00852bd55164c8e5a9c1f90ba5e07f14f175fe2c"; }; outputs = [ "out" "dev" ]; From 7d80f94f754f848410b6a3be831bee7c9e82174a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 15 Jul 2017 11:46:54 +0200 Subject: [PATCH 019/108] dbus: maintenance 1.10.18 -> 1.10.20 --- pkgs/development/libraries/dbus/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix index f569f53861d..5fe13d86f2d 100644 --- a/pkgs/development/libraries/dbus/default.nix +++ b/pkgs/development/libraries/dbus/default.nix @@ -6,8 +6,8 @@ assert x11Support -> libX11 != null && libSM != null; let - version = "1.10.18"; - sha256 = "0jjirhw6xwz2ffmbg5kr79108l8i1bdaw7szc67n3qpkygaxsjb0"; + version = "1.10.20"; + sha256 = "0j0b8rn9fvh1m4nndp9fzq09xw50grp5kfvkv7jgs9al1dwbjx75"; self = stdenv.mkDerivation { name = "dbus-${version}"; From 3d1266fcbdf6f9bd56a09f6cf661a2bec2f410a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 15 Jul 2017 12:28:25 +0200 Subject: [PATCH 020/108] mesa: maintenance 17.1.4 -> 17.1.5 --- pkgs/development/libraries/mesa/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index e1bd4255636..45819a8f3a6 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -67,7 +67,7 @@ let in let - version = "17.1.4"; + version = "17.1.5"; branch = head (splitString "." version); driverLink = "/run/opengl-driver" + optionalString stdenv.isi686 "-32"; in @@ -82,7 +82,7 @@ stdenv.mkDerivation { "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz" "https://launchpad.net/mesa/trunk/${version}/+download/mesa-${version}.tar.xz" ]; - sha256 = "06f3b0e6a28f0d20b7f3391cf67fe89ae98ecd0a686cd545da76557b6cec9cad"; + sha256 = "378516b171712687aace4c7ea8b37c85895231d7a6d61e1e27362cf6034fded9"; }; prePatch = "patchShebangs ."; From b3729eb3f228dbaa76477a84c0bbe861cb8aa3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 7 Jul 2017 11:50:42 +0200 Subject: [PATCH 021/108] libuv: 1.12.0 -> 1.13.1 --- pkgs/development/libraries/libuv/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix index 97672436641..1bc58260afe 100644 --- a/pkgs/development/libraries/libuv/default.nix +++ b/pkgs/development/libraries/libuv/default.nix @@ -2,14 +2,14 @@ , ApplicationServices, CoreServices }: stdenv.mkDerivation rec { - version = "1.12.0"; + version = "1.13.1"; name = "libuv-${version}"; src = fetchFromGitHub { owner = "libuv"; repo = "libuv"; rev = "v${version}"; - sha256 = "0m025i0sfm4iv3aiic88x4y4bbhhdb204pmd9r383fsl458fck2p"; + sha256 = "0k348kgdphha1w4cw78zngq3gqcrhcn0az7k0k4w2bgmdf4ip8z8"; }; postPatch = let From aaaa470ff821fc3dd32b4bb240047694ed26ac83 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 15 Jul 2017 13:47:21 -0400 Subject: [PATCH 022/108] mkDerivation: Fix errors from #27365 `nix-build pkgs/top-level/release.nix -A tarball` now succeeds. `configureFlags = null` lead to a type error, and one overrideDrv needed to be converted to to append a configureFlags list instead of string due to the normalization. Thanks @vcunat for alerting me to the issues---sorry I did not catch them before merging my own PR. --- pkgs/stdenv/generic/make-derivation.nix | 6 ++++-- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 1486b11f701..be271daf8c8 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -98,9 +98,11 @@ rec { propagatedNativeBuildInputs = lib.elemAt propagatedDependencies' 0; propagatedBuildInputs = lib.elemAt propagatedDependencies' 1; - # This parameter is sometimes a string and sometimes a list, yuck + # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck configureFlags = let inherit (lib) optional elem; in - (if lib.isString configureFlags then [configureFlags] else configureFlags) + (/**/ if lib.isString configureFlags then [configureFlags] + else if configureFlags == null then [] + else configureFlags) ++ optional (elem "build" configurePlatforms) "--build=${stdenv.buildPlatform.config}" ++ optional (elem "host" configurePlatforms) "--host=${stdenv.hostPlatform.config}" ++ optional (elem "target" configurePlatforms) "--target=${stdenv.targetPlatform.config}"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b62908e2798..57c8ecd6770 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3591,7 +3591,7 @@ with pkgs; (attrs: { nativeBuildInputs = attrs.nativeBuildInputs ++ [ gtk3 ]; # Fix this build error in ./tests/examples/waylandsink: # main.c:28:2: error: #error "Wayland is not supported in GTK+" - configureFlags = attrs.configureFlags or "" + "--enable-wayland=no"; + configureFlags = attrs.configureFlags or [] ++ [ "--enable-wayland=no" ]; }); }; }; From 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 26 Jun 2017 01:17:09 -0400 Subject: [PATCH 023/108] cc-wrapper: Always export environment variables for binutils Before, this only happened when cross compiling. --- pkgs/build-support/cc-wrapper/default.nix | 33 +++++++-------------- pkgs/build-support/cc-wrapper/setup-hook.sh | 27 +++++++++++++---- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 4dc3d1845a4..1b52a0b8b12 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -71,22 +71,6 @@ let -e 's^addCVars^addCVars${_infixSalt}^g' \ -e 's^\[ -z "\$crossConfig" \]^\[\[ "${builtins.toString (targetPlatform != hostPlatform)}" || -z "$crossConfig" \]\]^g' - '' + stdenv.lib.optionalString (textFile == ./setup-hook.sh) '' - cat << 'EOF' >> $out - for CMD in ar as nm objcopy ranlib strip strings size ld windres - do - # which is not part of stdenv, but compgen will do for now - if - PATH=$_PATH type -p ${prefix}$CMD > /dev/null - then - export ''$(echo "$CMD" | tr "[:lower:]" "[:upper:]")=${prefix}''${CMD}; - fi - done - EOF - - sed -i $out -e 's_envHooks_crossEnvHooks_g' - '' + '' - # NIX_ things which we don't both use and define, we revert them #asymmetric=$( # for pre in "" "\\$" @@ -143,6 +127,7 @@ stdenv.mkDerivation { inherit cc shell libc_bin libc_dev libc_lib binutils_bin coreutils_bin; gnugrep_bin = if nativeTools then "" else gnugrep; + binPrefix = prefix; passthru = { inherit libc nativeTools nativeLibc nativePrefix isGNU isClang default_cxx_stdlib_compile @@ -303,20 +288,24 @@ stdenv.mkDerivation { wrap ${prefix}ld.bfd ${preWrap ./ld-wrapper.sh} ${binutils_bin}/bin/${prefix}ld.bfd fi - export real_cc=${prefix}cc - export real_cxx=${prefix}c++ + # We export environment variables pointing to the wrapped nonstandard + # cmds, lest some lousy configure script use those to guess compiler + # version. + export named_cc=${prefix}cc + export named_cxx=${prefix}c++ + export default_cxx_stdlib_compile="${default_cxx_stdlib_compile}" if [ -e $ccPath/${prefix}gcc ]; then wrap ${prefix}gcc ${preWrap ./cc-wrapper.sh} $ccPath/${prefix}gcc ln -s ${prefix}gcc $out/bin/${prefix}cc - export real_cc=${prefix}gcc - export real_cxx=${prefix}g++ + export named_cc=${prefix}gcc + export named_cxx=${prefix}g++ elif [ -e $ccPath/clang ]; then wrap ${prefix}clang ${preWrap ./cc-wrapper.sh} $ccPath/clang ln -s ${prefix}clang $out/bin/${prefix}cc - export real_cc=clang - export real_cxx=clang++ + export named_cc=${prefix}clang + export named_cxx=${prefix}clang++ fi if [ -e $ccPath/${prefix}g++ ]; then diff --git a/pkgs/build-support/cc-wrapper/setup-hook.sh b/pkgs/build-support/cc-wrapper/setup-hook.sh index f4f7ab181d3..2900dc71a41 100644 --- a/pkgs/build-support/cc-wrapper/setup-hook.sh +++ b/pkgs/build-support/cc-wrapper/setup-hook.sh @@ -1,5 +1,3 @@ -export NIX_CC=@out@ - addCVars () { if [ -d $1/include ]; then export NIX_CFLAGS_COMPILE+=" ${ccIncludeFlag:--isystem} $1/include" @@ -39,9 +37,26 @@ if [ -n "@coreutils_bin@" ]; then fi if [ -z "$crossConfig" ]; then - export CC=@real_cc@ - export CXX=@real_cxx@ + ENV_PREFIX="" else - export BUILD_CC=@real_cc@ - export BUILD_CXX=@real_cxx@ + ENV_PREFIX="BUILD_" fi + +export NIX_${ENV_PREFIX}CC=@out@ + +export ${ENV_PREFIX}CC=@named_cc@ +export ${ENV_PREFIX}CXX=@named_cxx@ + +for CMD in \ + cpp \ + ar as nm objcopy ranlib strip strings size ld windres +do + if + PATH=$_PATH type -p @binPrefix@$CMD > /dev/null + then + export ${ENV_PREFIX}$(echo "$CMD" | tr "[:lower:]" "[:upper:]")=@binPrefix@${CMD}; + fi +done + +# No local scope available for sourced files +unset ENV_PREFIX From c3d9ec531b53aa42fce7c6df8527d8b591d56a68 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 16 Jul 2017 01:06:56 +0300 Subject: [PATCH 024/108] pythonPackages.unittest2: Fix missing argument to substituteInPlace --- pkgs/top-level/python-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 429c16d2cdb..971585d9bd4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -24840,7 +24840,7 @@ in { postPatch = '' # argparse is needed for python < 2.7, which we do not support anymore. - substituteInPlace setup.py --replace "argparse" + substituteInPlace setup.py --replace "argparse" "" # # fixes a transient error when collecting tests, see https://bugs.launchpad.net/python-neutronclient/+bug/1508547 sed -i '510i\ return None, False' unittest2/loader.py From 3739858571e24e5f5a97a0627369826b240fb8e0 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 15 Jul 2017 20:29:49 -0400 Subject: [PATCH 025/108] cc-wrapper: Use new bash uppercase subsitution syntax in setup hook While this requires newer bash, stdenv's setup.sh now does across the board anyways. This way is more concise. --- pkgs/build-support/cc-wrapper/setup-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/setup-hook.sh b/pkgs/build-support/cc-wrapper/setup-hook.sh index 2900dc71a41..3e8494cf9c1 100644 --- a/pkgs/build-support/cc-wrapper/setup-hook.sh +++ b/pkgs/build-support/cc-wrapper/setup-hook.sh @@ -52,9 +52,9 @@ for CMD in \ ar as nm objcopy ranlib strip strings size ld windres do if - PATH=$_PATH type -p @binPrefix@$CMD > /dev/null + PATH=$_PATH type -p "@binPrefix@$CMD" > /dev/null then - export ${ENV_PREFIX}$(echo "$CMD" | tr "[:lower:]" "[:upper:]")=@binPrefix@${CMD}; + export "${ENV_PREFIX}${CMD^^}=@binPrefix@${CMD}"; fi done From ae26f291bcb6da0910fd3de47ff970e696f2c155 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 16 Jul 2017 17:22:45 +0200 Subject: [PATCH 026/108] systemd: 233 -> 234 --- pkgs/os-specific/linux/systemd/default.nix | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 41f9c1e3e99..7ea17855b09 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -9,14 +9,14 @@ assert stdenv.isLinux; stdenv.mkDerivation rec { - version = "233"; + version = "234"; name = "systemd-${version}"; src = fetchFromGitHub { owner = "nixos"; repo = "systemd"; - rev = "72782e7ad96f9da9b0e5873f87a64007068cee06"; - sha256 = "1cj20zrfr8g0vkxiv3h9bbd89xbj3mrsij3rjr1lbh4nkl5mcwpa"; + rev = "ba777535a890c2a2b7677dfacc63e12c578b9b3f"; + sha256 = "1cj20zrfr8g0vkxiv3h9bbd89xbj3mrsij3rja1lbh4nkl5mcwpa"; }; outputs = [ "out" "lib" "man" "dev" ]; @@ -99,8 +99,6 @@ stdenv.mkDerivation rec { --replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/ configureFlagsArray+=("--with-ntp-servers=0.nixos.pool.ntp.org 1.nixos.pool.ntp.org 2.nixos.pool.ntp.org 3.nixos.pool.ntp.org") - - #export NIX_CFLAGS_LINK+=" -Wl,-rpath,$libudev/lib" ''; PYTHON_BINARY = "${coreutils}/bin/env python"; # don't want a build time dependency on Python @@ -166,16 +164,6 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - /* - # some libs fail to link to liblzma and/or libffi - postFixup = let extraLibs = stdenv.lib.makeLibraryPath [ xz.out libffi.out zlib.out ]; - in '' - for f in "$out"/lib/*.so.0.*; do - patchelf --set-rpath `patchelf --print-rpath "$f"`':${extraLibs}' "$f" - done - ''; - */ - # The interface version prevents NixOS from switching to an # incompatible systemd at runtime. (Switching across reboots is # fine, of course.) It should be increased whenever systemd changes From c2cf696430055498467dd9deec59939e8d52a43e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 16 Jul 2017 18:28:02 +0100 Subject: [PATCH 027/108] nixos/agetty: override upstream default Since systemd 234 we keep default value for ExecStart in the upstream service file. Therefor we need to override it in our module. --- nixos/modules/services/ttys/agetty.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/ttys/agetty.nix b/nixos/modules/services/ttys/agetty.nix index 051d54e932f..f8dd75ea2c4 100644 --- a/nixos/modules/services/ttys/agetty.nix +++ b/nixos/modules/services/ttys/agetty.nix @@ -68,14 +68,19 @@ in services.mingetty.greetingLine = mkDefault ''<<< Welcome to NixOS ${config.system.nixosLabel} (\m) - \l >>>''; systemd.services."getty@" = - { serviceConfig.ExecStart = gettyCmd "--noclear --keep-baud %I 115200,38400,9600 $TERM"; + { serviceConfig.ExecStart = [ + "" # override upstream default with an empty ExecStart + (gettyCmd "--noclear --keep-baud %I 115200,38400,9600 $TERM") + ]; restartIfChanged = false; }; systemd.services."serial-getty@" = - { serviceConfig.ExecStart = - let speeds = concatStringsSep "," (map toString config.services.mingetty.serialSpeed); - in gettyCmd "%I ${speeds} $TERM"; + let speeds = concatStringsSep "," (map toString config.services.mingetty.serialSpeed); in + { serviceConfig.ExecStart = [ + "" # override upstream default with an empty ExecStart + (gettyCmd "%I ${speeds} $TERM") + ]; restartIfChanged = false; }; From dce958ac396e88c09d5b19c284f41eef68f54ce7 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 16 Jul 2017 11:39:40 -0500 Subject: [PATCH 028/108] buildenv: read propagated-user-env-packages line-by-line Since 3cb745d5a69018829ac15f7d5a508135f6bda123, the format of propagated-user-env-packages has changed and propagated packages have not been included by buildenv, including in the system environment. The buildenv builder is modified to read propagated-user-env-packages line-by-line, instead of expecting all packages on one line. --- pkgs/build-support/buildenv/builder.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/buildenv/builder.pl b/pkgs/build-support/buildenv/builder.pl index 678f5a3fe9e..7cc37d15673 100755 --- a/pkgs/build-support/buildenv/builder.pl +++ b/pkgs/build-support/buildenv/builder.pl @@ -141,12 +141,11 @@ sub addPkg { my $propagatedFN = "$pkgDir/nix-support/propagated-user-env-packages"; if (-e $propagatedFN) { open PROP, "<$propagatedFN" or die; - my $propagated = ; - close PROP; - my @propagated = split ' ', $propagated; - foreach my $p (@propagated) { + while (my $p = ) { + chomp $p; $postponed{$p} = 1 unless defined $done{$p}; } + close PROP; } } From 8e98811f76fa29e8a3782e9b0b0acc6d16926cac Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Mon, 17 Jul 2017 10:06:14 +0200 Subject: [PATCH 029/108] python36: 3.6.1 -> 3.6.2 --- pkgs/development/interpreters/python/cpython/3.6/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/python/cpython/3.6/default.nix b/pkgs/development/interpreters/python/cpython/3.6/default.nix index d2d922ce495..bca717b919b 100644 --- a/pkgs/development/interpreters/python/cpython/3.6/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.6/default.nix @@ -27,7 +27,7 @@ with stdenv.lib; let majorVersion = "3.6"; - minorVersion = "1"; + minorVersion = "2"; minorVersionSuffix = ""; pythonVersion = majorVersion; version = "${majorVersion}.${minorVersion}${minorVersionSuffix}"; @@ -48,7 +48,7 @@ in stdenv.mkDerivation { src = fetchurl { url = "https://www.python.org/ftp/python/${majorVersion}.${minorVersion}/Python-${version}.tar.xz"; - sha256 = "0ha03sbakxblzyvlramx5fj0ranzmzx4pa2png6nn8gczkfi0650"; + sha256 = "1ab4vlpdax1ihpiyiwchlgsk36apl4kgdw271wvl9l8ywhxpfacj"; }; NIX_LDFLAGS = optionalString stdenv.isLinux "-lgcc_s"; From ca0f2d8ce7c1c9e816930b8a46243eddf288d939 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Mon, 17 Jul 2017 10:51:59 +0200 Subject: [PATCH 030/108] python.pkgs.numpy: 1.12.1 -> 1.13.1 --- pkgs/development/python-modules/numpy/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/numpy/default.nix b/pkgs/development/python-modules/numpy/default.nix index d427a33f80f..965dda8c43a 100644 --- a/pkgs/development/python-modules/numpy/default.nix +++ b/pkgs/development/python-modules/numpy/default.nix @@ -2,12 +2,12 @@ buildPythonPackage rec { pname = "numpy"; - version = "1.12.1"; + version = "1.13.1"; name = "${pname}-${version}"; src = fetchurl { url = "mirror://pypi/n/numpy/numpy-${version}.zip"; - sha256 = "a65266a4ad6ec8936a1bc85ce51f8600634a31a258b722c9274a80ff189d9542"; + sha256 = "c9b0283776085cb2804efff73e9955ca279ba4edafd58d3ead70b61d209c4fbb"; }; disabled = isPyPy; From c2df8a28eec869c0f6cf10811f8d3bbc65b6dfc0 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Mon, 17 Jul 2017 10:52:41 +0200 Subject: [PATCH 031/108] python.pkgs.scipy: 0.19.0 -> 0.19.1 --- pkgs/development/python-modules/scipy/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix index a7428f134a7..ed4e205a2ae 100644 --- a/pkgs/development/python-modules/scipy/default.nix +++ b/pkgs/development/python-modules/scipy/default.nix @@ -2,12 +2,12 @@ buildPythonPackage rec { pname = "scipy"; - version = "0.19.0"; + version = "0.19.1"; name = "${pname}-${version}"; src = fetchurl { - url = "mirror://pypi/s/scipy/scipy-${version}.zip"; - sha256 = "4190d34bf9a09626cd42100bbb12e3d96b2daf1a8a3244e991263eb693732122"; + url = "mirror://pypi/s/scipy/scipy-${version}.tar.gz"; + sha256 = "a19a2ca7a7336495ec180adeaa0dfdcf41e96dbbee90d51c3ed828ba570884e6"; }; buildInputs = [ gfortran nose numpy.blas ]; From ac3cae1191eaf34a1ef846dc20070ab0e28db796 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Mon, 17 Jul 2017 10:52:59 +0200 Subject: [PATCH 032/108] python.pkgs.pandas: 0.20.2 -> 0.20.3 --- pkgs/development/python-modules/pandas/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix index ee75d211ad8..e9297676eaf 100644 --- a/pkgs/development/python-modules/pandas/default.nix +++ b/pkgs/development/python-modules/pandas/default.nix @@ -27,12 +27,12 @@ let inherit (stdenv) isDarwin; in buildPythonPackage rec { pname = "pandas"; - version = "0.20.2"; + version = "0.20.3"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "92173c976fcca70cb19a958eccdacf98af62ef7301bf786d0321cb8857cdfae6"; + sha256 = "a777e07633d83d546c55706420179551c8e01075b53c497dcf8ae4036766bc66"; }; LC_ALL = "en_US.UTF-8"; From 0c9667efa0677aec8b6dd6896f542d7e4d4dea46 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Mon, 17 Jul 2017 10:53:24 +0200 Subject: [PATCH 033/108] python.pkgs.dask: 0.14.3 -> 0.15.1 --- pkgs/development/python-modules/dask/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/dask/default.nix b/pkgs/development/python-modules/dask/default.nix index 6d5388a443c..740b0644381 100644 --- a/pkgs/development/python-modules/dask/default.nix +++ b/pkgs/development/python-modules/dask/default.nix @@ -12,12 +12,12 @@ buildPythonPackage rec { pname = "dask"; - version = "0.14.3"; + version = "0.15.1"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "9bf007f9cedc08f73089f0621ff65ec0882fc0a834acef56830dfd2872908211"; + sha256 = "f62f19ab5958b13d0ee733db18218c28a9d452a3554446a3dfb5ac3d4a5f7e34"; }; checkInputs = [ pytest ]; From e0f988fc4648c308465ac60f39c364bfd3034f23 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 12 Jul 2017 12:27:15 +0200 Subject: [PATCH 034/108] pythonPackages.kombu: fix tests for python3.6 --- pkgs/top-level/python-packages.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0726bfc6f71..09cced82514 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12581,6 +12581,14 @@ in { sha256 = "18hiricdnbnlz6hx3hbaa4dni6npv8rbid4dhf7k02k16qm6zz6h"; }; + # Backport fix for python-3.6 from master (see issue https://github.com/celery/kombu/issues/675) + # TODO remove at next update + patches = [ (pkgs.fetchpatch { + url = "https://github.com/celery/kombu/commit/dc3fceff59d79ceac3f8f11a5d697beabb4b7a7f.patch"; + sha256 = "0s6gsihzjvmpffc7xrrcijw00r56yb74jg0sbjgng2v1324z1da9"; + name = "don-t-modify-dict-size-while-iterating-over-it"; + }) ]; + buildInputs = with self; [ pytest case pytz ]; propagatedBuildInputs = with self; [ amqp ]; From 1e06824b3bb2d16718bf2a4c388c89ccbda32cda Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 12 Jul 2017 12:28:18 +0200 Subject: [PATCH 035/108] pythonPackages.olefile: init at 0.44 --- .../python-modules/olefile/default.nix | 19 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 pkgs/development/python-modules/olefile/default.nix diff --git a/pkgs/development/python-modules/olefile/default.nix b/pkgs/development/python-modules/olefile/default.nix new file mode 100644 index 00000000000..5cf51b84132 --- /dev/null +++ b/pkgs/development/python-modules/olefile/default.nix @@ -0,0 +1,19 @@ +{ stdenv, buildPythonPackage, fetchPypi }: +buildPythonPackage rec { + pname = "olefile"; + version = "0.44"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + extension = "zip"; + sha256 = "1bbk1xplmrhymqpk6rkb15sg7v9qfih7zh23p6g2fxxas06cmwk1"; + }; + + meta = with stdenv.lib; { + description = "Python package to parse, read and write Microsoft OLE2 files"; + homepage = https://www.decalage.info/python/olefileio; + # BSD like + reference to Pillow + license = "http://olefile.readthedocs.io/en/latest/License.html"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 09cced82514..dd41361916d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16621,6 +16621,8 @@ in { }; }; + olefile = callPackage ../development/python-modules/olefile { }; + oslo-log = buildPythonPackage rec { name = "oslo.log-${version}"; version = "1.12.1"; From a8dd4d8e538fbb6fea9e2e0af14f057817d53d72 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 12 Jul 2017 12:28:55 +0200 Subject: [PATCH 036/108] pythonPackages.pillow: 3.4.2 -> 4.2.1 --- .../python-modules/pillow/default.nix | 62 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 58 +---------------- 2 files changed, 65 insertions(+), 55 deletions(-) create mode 100644 pkgs/development/python-modules/pillow/default.nix diff --git a/pkgs/development/python-modules/pillow/default.nix b/pkgs/development/python-modules/pillow/default.nix new file mode 100644 index 00000000000..0fbb36b3c19 --- /dev/null +++ b/pkgs/development/python-modules/pillow/default.nix @@ -0,0 +1,62 @@ +{ stdenv, buildPythonPackage, fetchPypi, isPyPy, + nose, olefile, + freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11}: +buildPythonPackage rec { + pname = "Pillow"; + version = "4.2.1"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "0wq0fiw964bj5rdmw66mhbfsjnmb13bcdr42krpk2ig5f1cgc967"; + }; + + doCheck = !stdenv.isDarwin && !isPyPy; + + # Disable imagefont tests, because they don't work well with infinality: + # https://github.com/python-pillow/Pillow/issues/1259 + postPatch = '' + rm Tests/test_imagefont.py + ''; + + propagatedBuildInputs = [ olefile ]; + + buildInputs = [ + freetype libjpeg zlib libtiff libwebp tcl nose lcms2 ] + ++ stdenv.lib.optionals (isPyPy) [ tk libX11 ]; + + # NOTE: we use LCMS_ROOT as WEBP root since there is not other setting for webp. + preConfigure = let + libinclude' = pkg: ''"${pkg.out}/lib", "${pkg.out}/include"''; + libinclude = pkg: ''"${pkg.out}/lib", "${pkg.dev}/include"''; + in '' + sed -i "setup.py" \ + -e 's|^FREETYPE_ROOT =.*$|FREETYPE_ROOT = ${libinclude freetype}|g ; + s|^JPEG_ROOT =.*$|JPEG_ROOT = ${libinclude libjpeg}|g ; + s|^ZLIB_ROOT =.*$|ZLIB_ROOT = ${libinclude zlib}|g ; + s|^LCMS_ROOT =.*$|LCMS_ROOT = ${libinclude lcms2}|g ; + s|^TIFF_ROOT =.*$|TIFF_ROOT = ${libinclude libtiff}|g ; + s|^TCL_ROOT=.*$|TCL_ROOT = ${libinclude' tcl}|g ;' + export LDFLAGS="-L${libwebp}/lib" + export CFLAGS="-I${libwebp}/include" + '' + # Remove impurities + + stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace setup.py \ + --replace '"/Library/Frameworks",' "" \ + --replace '"/System/Library/Frameworks"' "" + ''; + + meta = with stdenv.lib; { + homepage = "https://python-pillow.github.io/"; + description = "Fork of The Python Imaging Library (PIL)"; + longDescription = '' + The Python Imaging Library (PIL) adds image processing + capabilities to your Python interpreter. This library + supports many file formats, and provides powerful image + processing and graphics capabilities. + ''; + license = "http://www.pythonware.com/products/pil/license.htm"; + maintainers = with maintainers; [ goibhniu prikhi ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dd41361916d..14945f72299 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17612,61 +17612,9 @@ in { pystringtemplate = callPackage ../development/python-modules/stringtemplate { }; - pillow = buildPythonPackage rec { - name = "Pillow-${version}"; - version = "3.4.2"; - - src = pkgs.fetchurl { - url = "mirror://pypi/P/Pillow/${name}.tar.gz"; - sha256 = "0ee9975c05602e755ff5000232e0335ba30d507f6261922a658ee11b1cec36d1"; - }; - - doCheck = !stdenv.isDarwin && !isPyPy; - - # Disable imagefont tests, because they don't work well with infinality: - # https://github.com/python-pillow/Pillow/issues/1259 - postPatch = '' - rm Tests/test_imagefont.py - ''; - - buildInputs = with self; [ - pkgs.freetype pkgs.libjpeg pkgs.zlib pkgs.libtiff pkgs.libwebp pkgs.tcl nose pkgs.lcms2 ] - ++ optionals (isPyPy) [ pkgs.tk pkgs.xorg.libX11 ]; - - # NOTE: we use LCMS_ROOT as WEBP root since there is not other setting for webp. - preConfigure = let - libinclude' = pkg: ''"${pkg.out}/lib", "${pkg.out}/include"''; - libinclude = pkg: ''"${pkg.out}/lib", "${pkg.dev}/include"''; - in '' - sed -i "setup.py" \ - -e 's|^FREETYPE_ROOT =.*$|FREETYPE_ROOT = ${libinclude pkgs.freetype}|g ; - s|^JPEG_ROOT =.*$|JPEG_ROOT = ${libinclude pkgs.libjpeg}|g ; - s|^ZLIB_ROOT =.*$|ZLIB_ROOT = ${libinclude pkgs.zlib}|g ; - s|^LCMS_ROOT =.*$|LCMS_ROOT = ${libinclude pkgs.lcms2}|g ; - s|^TIFF_ROOT =.*$|TIFF_ROOT = ${libinclude pkgs.libtiff}|g ; - s|^TCL_ROOT=.*$|TCL_ROOT = ${libinclude' pkgs.tcl}|g ;' - export LDFLAGS="-L${pkgs.libwebp}/lib" - export CFLAGS="-I${pkgs.libwebp}/include" - '' - # Remove impurities - + stdenv.lib.optionalString stdenv.isDarwin '' - substituteInPlace setup.py \ - --replace '"/Library/Frameworks",' "" \ - --replace '"/System/Library/Frameworks"' "" - ''; - - meta = { - homepage = "https://python-pillow.github.io/"; - description = "Fork of The Python Imaging Library (PIL)"; - longDescription = '' - The Python Imaging Library (PIL) adds image processing - capabilities to your Python interpreter. This library - supports many file formats, and provides powerful image - processing and graphics capabilities. - ''; - license = "http://www.pythonware.com/products/pil/license.htm"; - maintainers = with maintainers; [ goibhniu prikhi ]; - }; + pillow = callPackage ../development/python-modules/pillow { + inherit (pkgs) freetype libjpeg zlib libtiff libwebp tcl lcms2 tk; + inherit (pkgs.xorg) libX11; }; pkgconfig = buildPythonPackage rec { From f7179c04747f4594416a63d499f3f3dae6c88aec Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 12 Jul 2017 12:29:59 +0200 Subject: [PATCH 037/108] pythonPackages.celery: fix tests for python3.6 --- ...fix_endless_python3.6_loop_logger_isa.patch | 18 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 6 ++++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/python-modules/celery/fix_endless_python3.6_loop_logger_isa.patch diff --git a/pkgs/development/python-modules/celery/fix_endless_python3.6_loop_logger_isa.patch b/pkgs/development/python-modules/celery/fix_endless_python3.6_loop_logger_isa.patch new file mode 100644 index 00000000000..27caa80dd4c --- /dev/null +++ b/pkgs/development/python-modules/celery/fix_endless_python3.6_loop_logger_isa.patch @@ -0,0 +1,18 @@ +Description: Fix endless loop in logger_isa (Python 3.6) +Author: George Psarakis +Origin: upstream, https://github.com/celery/celery/commit/9c950b47eca2b4e93fd2fe52cf80f158e6cf97ad +Forwarded: not-needed +Reviewed-By: Nishanth Aravamudan +Last-Update: 2017-06-12 + +--- celery-4.0.2.orig/celery/utils/log.py ++++ celery-4.0.2/celery/utils/log.py +@@ -82,7 +82,7 @@ def logger_isa(l, p, max=1000): + else: + if this in seen: + raise RuntimeError( +- 'Logger {0!r} parents recursive'.format(l), ++ 'Logger {0!r} parents recursive'.format(l.name), + ) + seen.add(this) + this = this.parent diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 14945f72299..39f4da0012c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3272,6 +3272,12 @@ in { sha256 = "0kgmbs3fl9879n48p4m79nxy9by2yhvxq1jdvlnqzzvkdb2sdmg3"; }; + # Fixes testsuite for python-3.6 + # From ubuntu packaging: https://launchpad.net/ubuntu/+archive/primary/+files/celery_4.0.2-0ubuntu1.debian.tar.xz + # (linked from https://launchpad.net/ubuntu/+source/celery) + # https://github.com/celery/celery/pull/3736#issuecomment-274155454 from upstream + patches = [ ../development/python-modules/celery/fix_endless_python3.6_loop_logger_isa.patch ]; + buildInputs = with self; [ pytest case ]; propagatedBuildInputs = with self; [ kombu billiard pytz anyjson amqp eventlet ]; From 9bb9d93ee77f9b9f6ab37ac0d24a60a6bc5719e5 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 12 Jul 2017 12:30:46 +0200 Subject: [PATCH 038/108] pythonPackages.pyparsing: 2.1.10 -> 2.2.0 --- .../python-modules/pyparsing/default.nix | 20 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 18 +---------------- 2 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 pkgs/development/python-modules/pyparsing/default.nix diff --git a/pkgs/development/python-modules/pyparsing/default.nix b/pkgs/development/python-modules/pyparsing/default.nix new file mode 100644 index 00000000000..f751a8bfbb2 --- /dev/null +++ b/pkgs/development/python-modules/pyparsing/default.nix @@ -0,0 +1,20 @@ +{ stdenv, buildPythonPackage, fetchPypi }: +buildPythonPackage rec { + pname = "pyparsing"; + name = "${pname}-${version}"; + version = "2.2.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "016b9gh606aa44sq92jslm89bg874ia0yyiyb643fa6dgbsbqch8"; + }; + + # Not everything necessary to run the tests is included in the distribution + doCheck = false; + + meta = with stdenv.lib; { + homepage = http://pyparsing.wikispaces.com/; + description = "An alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions"; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 39f4da0012c..64253c4db6e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19293,23 +19293,7 @@ in { }; }; - pyparsing = buildPythonPackage rec { - name = "pyparsing-${version}"; - version = "2.1.10"; - - src = pkgs.fetchurl { - url = "mirror://pypi/p/pyparsing/${name}.tar.gz"; - sha256 = "811c3e7b0031021137fc83e051795025fcb98674d07eb8fe922ba4de53d39188"; - }; - - # Not everything necessary to run the tests is included in the distribution - doCheck = false; - - meta = { - homepage = http://pyparsing.wikispaces.com/; - description = "An alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions"; - }; - }; + pyparsing = callPackage ../development/python-modules/pyparsing { }; pyparted = buildPythonPackage rec { name = "pyparted-${version}"; From 09d918d533697ab31500ee8610cee8b7eae1e8ab Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 12 Jul 2017 12:34:57 +0200 Subject: [PATCH 039/108] pythonPackages.django_raster: 0.4 -> 0.5 --- pkgs/development/python-modules/django-raster/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django-raster/default.nix b/pkgs/development/python-modules/django-raster/default.nix index 2332229100c..fbdc7282c1b 100644 --- a/pkgs/development/python-modules/django-raster/default.nix +++ b/pkgs/development/python-modules/django-raster/default.nix @@ -3,13 +3,13 @@ pyparsing, django, celery }: buildPythonPackage rec { - version = "0.4"; + version = "0.5"; pname = "django-raster"; name = "${pname}-${version}"; src = fetchurl { url = "mirror://pypi/d/django-raster/${name}.tar.gz"; - sha256 = "7fd6afa42b07ac51a3873e3d4840325dd3a8a631fdb5b853c76fbbfe59a2b17f"; + sha256 = "0v1jldb13s4dqq1vaq8ghfv3743jpi9a9n05bqgjm8szlkq8s7ah"; }; # Tests require a postgresql + postgis server From 0e24b762ea5cc105783c67052e5b18249d2f1857 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 19 Jul 2017 11:20:09 +0200 Subject: [PATCH 040/108] libgcrypt: 1.7.8 -> 1.8.0 See http://lists.gnu.org/archive/html/info-gnu/2017-07/msg00006.html for release information --- pkgs/development/libraries/libgcrypt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix index ac54858b1de..ed742bee874 100644 --- a/pkgs/development/libraries/libgcrypt/default.nix +++ b/pkgs/development/libraries/libgcrypt/default.nix @@ -4,11 +4,11 @@ assert enableCapabilities -> stdenv.isLinux; stdenv.mkDerivation rec { name = "libgcrypt-${version}"; - version = "1.7.8"; + version = "1.8.0"; src = fetchurl { url = "mirror://gnupg/libgcrypt/${name}.tar.bz2"; - sha256 = "16f1rsv4y4w2pk1il2jbcqggsb6mrlfva5vayd205fp68zm7d0ll"; + sha256 = "06w97l88y2c29zf8p8cg0m4k2kiiyj6pqxdl0cxigi3wp2brdr13"; }; outputs = [ "out" "dev" "info" ]; From 7d010ab5f4ae6f69339139165719bf071295536b Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Wed, 19 Jul 2017 07:59:40 -0500 Subject: [PATCH 041/108] mdadm: unset STRIP Commit 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98, sets the STRIP environment variable by default, but this confuses the mdadm Makefile, which uses STRIP as a flag to `install'. --- pkgs/os-specific/linux/mdadm/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix index 589099c911c..0929bae991d 100644 --- a/pkgs/os-specific/linux/mdadm/default.nix +++ b/pkgs/os-specific/linux/mdadm/default.nix @@ -22,6 +22,7 @@ stdenv.mkDerivation rec { makeFlags = [ "NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin" "MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm" + "STRIP=" ] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.prefix}" ]; From c1c314c36f849be027226a0c811370e9f076408a Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Wed, 19 Jul 2017 08:44:55 -0500 Subject: [PATCH 042/108] openssh: unset LD Commit 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98, sets the LD environment variable by default, but this confuses the openssh Makefile because `configure' does not respect it. --- pkgs/tools/networking/openssh/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/networking/openssh/default.nix b/pkgs/tools/networking/openssh/default.nix index aaef2723da0..c0440e78a38 100644 --- a/pkgs/tools/networking/openssh/default.nix +++ b/pkgs/tools/networking/openssh/default.nix @@ -60,6 +60,12 @@ stdenv.mkDerivation rec { ++ optional withKerberos kerberos ++ optional hpnSupport autoreconfHook; + preConfigure = '' + # Setting LD causes `configure' and `make' to disagree about which linker + # to use: `configure' wants `gcc', but `make' wants `ld'. + unset LD + ''; + # I set --disable-strip because later we strip anyway. And it fails to strip # properly when cross building. configureFlags = [ From baad4134161ea4f61d1f88ec6eb55a8d0b03a974 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Wed, 19 Jul 2017 08:55:28 -0500 Subject: [PATCH 043/108] ppp: fix invalid use of substituteInPlace substituteInPlace was invoked with multiple targets on the command line, which is not supported. --- pkgs/tools/networking/ppp/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/ppp/default.nix b/pkgs/tools/networking/ppp/default.nix index 90a4b988c3f..d07770260ff 100644 --- a/pkgs/tools/networking/ppp/default.nix +++ b/pkgs/tools/networking/ppp/default.nix @@ -34,7 +34,9 @@ stdenv.mkDerivation rec { ''; postFixup = '' - substituteInPlace $out/bin/{pon,poff,plog} --replace "/usr/sbin" "$out/bin" + for tgt in pon poff plog; do + substituteInPlace "$out/bin/$tgt" --replace "/usr/sbin" "$out/bin" + done ''; meta = { From c25199f6973dff040a3d248a759636f8b981b02d Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 20 Jul 2017 09:34:56 -0500 Subject: [PATCH 044/108] fetchurl: remove unpaired call to `stopNest' Fixes #27406. Commit 5d4efb2c816d2143f29cad8153faad1686557b2a added an assertion to `stopNest' which requires it be correctly paired with `startNest'. `fetchurl' calls `stopNest', but never calls `startNest'; the former calls are removed. --- pkgs/build-support/fetchurl/builder.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/build-support/fetchurl/builder.sh b/pkgs/build-support/fetchurl/builder.sh index c4fd18e46ca..7c2bdf260b4 100644 --- a/pkgs/build-support/fetchurl/builder.sh +++ b/pkgs/build-support/fetchurl/builder.sh @@ -39,7 +39,6 @@ tryDownload() { curlexit=$?; fi done - stopNest } @@ -51,7 +50,6 @@ finish() { fi runHook postFetch - stopNest exit 0 } From 4a0a066f67b204315f8b3fa59e87f2634f26b7e9 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 20 Jul 2017 10:42:58 -0500 Subject: [PATCH 045/108] newt: unset CPP Commit 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98 sets the CPP environment variable by default, confusing the newt Makefile, which expects CPP=gcc for computing dependencies. --- pkgs/development/libraries/newt/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/newt/default.nix b/pkgs/development/libraries/newt/default.nix index 9002d06693e..e00decca2ff 100644 --- a/pkgs/development/libraries/newt/default.nix +++ b/pkgs/development/libraries/newt/default.nix @@ -16,6 +16,12 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = "-lncurses"; + preConfigure = '' + # If CPP is set explicitly, configure and make will not agree about which + # programs to use at different stages. + unset CPP + ''; + crossAttrs = { makeFlags = "CROSS_COMPILE=${stdenv.cc.prefix}"; }; From aa11af8bbe5dc8dd9c580a5f392c6a6472cec371 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 20 Jul 2017 11:29:22 -0500 Subject: [PATCH 046/108] systemd: fix broken source hash --- pkgs/os-specific/linux/systemd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 7ea17855b09..89a08f14f9e 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { owner = "nixos"; repo = "systemd"; rev = "ba777535a890c2a2b7677dfacc63e12c578b9b3f"; - sha256 = "1cj20zrfr8g0vkxiv3h9bbd89xbj3mrsij3rja1lbh4nkl5mcwpa"; + sha256 = "1vb45fbqkrgczfwkb0y07ldnwhjqk2sh446hzfkdn8hrwl1lifg5"; }; outputs = [ "out" "lib" "man" "dev" ]; From 15776462b22aa95c5c6ee029f9e6d030e99134ea Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 21 Jul 2017 06:33:56 -0500 Subject: [PATCH 047/108] libunistring: disable parallel building Parallel building causes a test deadlock and has been disabled. --- pkgs/development/libraries/libunistring/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/libunistring/default.nix b/pkgs/development/libraries/libunistring/default.nix index 20874f6f6a1..c4acc0627af 100644 --- a/pkgs/development/libraries/libunistring/default.nix +++ b/pkgs/development/libraries/libunistring/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { propagatedBuildInputs = stdenv.lib.optional (!stdenv.isLinux) libiconv; + enableParallelBuilding = false; + configureFlags = [ "--with-libiconv-prefix=${libiconv}" ]; From 631f6b3e11c7d36bcdab2b11b5bb6ca7361a2e00 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 21 Jul 2017 06:34:26 -0500 Subject: [PATCH 048/108] systemd: unset RANLIB Commit 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98 sets the RANLIB environment variable by default, causing `make' to invoke the wrong program. --- pkgs/os-specific/linux/systemd/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 89a08f14f9e..8e303bee821 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -32,7 +32,6 @@ stdenv.mkDerivation rec { autoreconfHook gettext docbook_xsl docbook_xml_dtd_42 docbook_xml_dtd_45 ]; - configureFlags = [ "--localstatedir=/var" "--sysconfdir=/etc" @@ -76,6 +75,8 @@ stdenv.mkDerivation rec { preConfigure = '' + unset RANLIB + ./autogen.sh # FIXME: patch this in systemd properly (and send upstream). From 20321f66d7f8b434b84d4f3f4cb6353367256bc7 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 21 Jul 2017 07:40:23 -0500 Subject: [PATCH 049/108] x264: unset AS Commit 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98 sets the environment variable `AS' to the binutils assembler, but x264 needs yasm. --- pkgs/development/libraries/x264/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/x264/default.nix b/pkgs/development/libraries/x264/default.nix index 6e4dc00b038..bf32969836c 100644 --- a/pkgs/development/libraries/x264/default.nix +++ b/pkgs/development/libraries/x264/default.nix @@ -15,6 +15,11 @@ stdenv.mkDerivation rec { outputs = [ "out" "lib" ]; # leaving 52 kB of headers + preConfigure = '' + # `AS' is set to the binutils assembler, but we need yasm + unset AS + ''; + configureFlags = [ "--enable-shared" ] ++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic" ++ stdenv.lib.optional (enable10bit) "--bit-depth=10"; From b21defaf51daf002f94bb57bf0f5073b153247db Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 21 Jul 2017 08:09:02 -0500 Subject: [PATCH 050/108] zfs: fix invalid use of substituteInPlace substituteInPlace was invoked with multiple targets on the command line, which is not supported. --- pkgs/os-specific/linux/zfs/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix index 414f2ba444a..9e8856fdcdc 100644 --- a/pkgs/os-specific/linux/zfs/default.nix +++ b/pkgs/os-specific/linux/zfs/default.nix @@ -44,7 +44,6 @@ let substituteInPlace ./module/zfs/zfs_ctldir.c --replace "mount -t zfs" "${utillinux}/bin/mount -t zfs" substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount" "${utillinux}/bin/umount" substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/mount" "${utillinux}/bin/mount" - substituteInPlace ./udev/rules.d/* --replace "/lib/udev/vdev_id" "$out/lib/udev/vdev_id" substituteInPlace ./cmd/ztest/ztest.c --replace "/usr/sbin/ztest" "$out/sbin/ztest" substituteInPlace ./cmd/ztest/ztest.c --replace "/usr/sbin/zdb" "$out/sbin/zdb" substituteInPlace ./config/user-systemd.m4 --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d" @@ -54,6 +53,12 @@ let substituteInPlace ./module/Makefile.in --replace "/bin/cp" "cp" substituteInPlace ./etc/systemd/system/zfs-share.service.in \ --replace "@bindir@/rm " "${coreutils}/bin/rm " + + for f in ./udev/rules.d/* + do + substituteInPlace "$f" --replace "/lib/udev/vdev_id" "$out/lib/udev/vdev_id" + done + ./autogen.sh ''; From 5265d551a96e701387dc767ed62e3cbc9074fe90 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 21 Jul 2017 09:01:23 -0500 Subject: [PATCH 051/108] grub2: unset CPP Commit 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98 sets the environment variable `CPP' by default, but this intereferes with dependency calculation. --- pkgs/tools/misc/grub/2.0x.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index 2bbeea8133e..634022e88e0 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -85,6 +85,8 @@ stdenv.mkDerivation rec { # See . sed -i "tests/util/grub-shell.in" \ -e's/qemu-system-i386/qemu-system-x86_64 -nodefaults/g' + + unset CPP # setting CPP intereferes with dependency calculation ''; prePatch = From fe800447c27f66ef73bd82823dde3dca8448bd9a Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 21 Jul 2017 11:39:50 -0500 Subject: [PATCH 052/108] qemu: unset CPP Commit 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98 sets the environment variable `CPP' by default, but this interferes with dependency calculation. --- pkgs/applications/virtualization/qemu/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index d09926da7cd..8277261a150 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -59,6 +59,10 @@ stdenv.mkDerivation rec { hardeningDisable = [ "stackprotector" ]; + preConfigure = '' + unset CPP # intereferes with dependency calculation + ''; + configureFlags = [ "--smbd=smbd" # use `smbd' from $PATH "--audio-drv-list=${audio}" From 9aa4f09008ccada57264954ed773ad6a4537ecd2 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 21 Jul 2017 12:15:09 -0500 Subject: [PATCH 053/108] qt4: unset LD Commit 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98 sets the `LD' environment variable by default, interfering with the Makefile which uses gcc for linking. --- pkgs/development/libraries/qt-4.x/4.8/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index d3eaeed2f1e..1b87b1b0a27 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -114,6 +114,7 @@ stdenv.mkDerivation rec { -datadir $out/share/${name} -translationdir $out/share/${name}/translations " + unset LD # Makefile uses gcc for linking; setting LD interferes '' + optionalString stdenv.cc.isClang '' sed -i 's/QMAKE_CC = gcc/QMAKE_CC = clang/' mkspecs/common/g++-base.conf sed -i 's/QMAKE_CXX = g++/QMAKE_CXX = clang++/' mkspecs/common/g++-base.conf From bec5797290754fa783b77a49149254417cde1344 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 21 Jul 2017 16:51:53 -0500 Subject: [PATCH 054/108] syslinux: fix invalid use of substituteInPlace substituteInPlace was invoked with multiple targets on the command line, which is not supported. --- pkgs/os-specific/linux/syslinux/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/syslinux/default.nix b/pkgs/os-specific/linux/syslinux/default.nix index ce63d383c8e..37a237f57ac 100644 --- a/pkgs/os-specific/linux/syslinux/default.nix +++ b/pkgs/os-specific/linux/syslinux/default.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation rec { preBuild = '' substituteInPlace Makefile --replace /bin/pwd $(type -P pwd) substituteInPlace gpxe/src/Makefile.housekeeping --replace /bin/echo $(type -P echo) - substituteInPlace utils/ppmtolss16 gpxe/src/Makefile --replace /usr/bin/perl $(type -P perl) + substituteInPlace utils/ppmtolss16 --replace /usr/bin/perl $(type -P perl) + substituteInPlace gpxe/src/Makefile --replace /usr/bin/perl $(type -P perl) ''; stripDebugList = "bin sbin share/syslinux/com32"; From 4b14212914faac8a4d0dd3a6e0ff66cf4a1e1484 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 22 Jul 2017 17:43:28 -0500 Subject: [PATCH 055/108] nixos/tests/keymap: use SLIM theme from nixos/tests/slim --- nixos/tests/keymap.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/nixos/tests/keymap.nix b/nixos/tests/keymap.nix index 55a0e760388..c431c1a3417 100644 --- a/nixos/tests/keymap.nix +++ b/nixos/tests/keymap.nix @@ -49,6 +49,38 @@ let machine.i18n.consoleKeyMap = mkOverride 900 layout; machine.services.xserver.layout = mkOverride 900 layout; machine.imports = [ ./common/x11.nix extraConfig ]; + machine.services.xserver.displayManager.slim = { + enable = true; + + # Use a custom theme in order to get best OCR results + theme = pkgs.runCommand "slim-theme-ocr" { + nativeBuildInputs = [ pkgs.imagemagick ]; + } '' + mkdir "$out" + convert -size 1x1 xc:white "$out/background.jpg" + convert -size 200x100 xc:white "$out/panel.jpg" + cat > "$out/slim.theme" < Date: Sat, 22 Jul 2017 19:36:55 -0500 Subject: [PATCH 056/108] jam: unset AR Commit 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98 sets the AR environment variable by default, but this causes the jam Makefile to use the wrong command. --- pkgs/development/tools/build-managers/jam/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/tools/build-managers/jam/default.nix b/pkgs/development/tools/build-managers/jam/default.nix index c0d152ee7a2..7314643530e 100644 --- a/pkgs/development/tools/build-managers/jam/default.nix +++ b/pkgs/development/tools/build-managers/jam/default.nix @@ -10,6 +10,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ yacc ]; + preConfigure = '' + unset AR + ''; + buildPhase = '' make jam0 ./jam0 -j$NIX_BUILD_CORES -sBINDIR=$out/bin install From 101e0998e14ee01f5fd1ff86fa705f6cfe31cf27 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 22 Jul 2017 19:54:57 -0500 Subject: [PATCH 057/108] argyllcms: unset AR Commit 093cc00cdd9d8cf31ecce5bc1dd3645c460a1b98 sets the AR environment variable by default, but this causes the argyllcms Makefile to use the wrong command. --- pkgs/tools/graphics/argyllcms/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/graphics/argyllcms/default.nix b/pkgs/tools/graphics/argyllcms/default.nix index 3c7af45f81d..3cdb4497baf 100644 --- a/pkgs/tools/graphics/argyllcms/default.nix +++ b/pkgs/tools/graphics/argyllcms/default.nix @@ -84,6 +84,8 @@ stdenv.mkDerivation rec { substituteInPlace Makefile --replace "-j 3" "-j $NIX_BUILD_CORES" # Remove tiff, jpg and png to be sure the nixpkgs-provided ones are used rm -rf tiff jpg png + + unset AR ''; buildInputs = [ From 969d7b0451c0ac68a99dbb09f3e50a4710466f43 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Jul 2017 14:15:15 +0200 Subject: [PATCH 058/108] gnumake380: Remove This hasn't been used in a long time. --- .../build-managers/gnumake/3.80/default.nix | 18 --- .../build-managers/gnumake/3.80/log.patch | 125 ------------------ pkgs/top-level/all-packages.nix | 1 - 3 files changed, 144 deletions(-) delete mode 100644 pkgs/development/tools/build-managers/gnumake/3.80/default.nix delete mode 100644 pkgs/development/tools/build-managers/gnumake/3.80/log.patch diff --git a/pkgs/development/tools/build-managers/gnumake/3.80/default.nix b/pkgs/development/tools/build-managers/gnumake/3.80/default.nix deleted file mode 100644 index ad855df7353..00000000000 --- a/pkgs/development/tools/build-managers/gnumake/3.80/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{stdenv, fetchurl}: - -stdenv.mkDerivation { - name = "gnumake-3.80"; - - src = fetchurl { - url = http://tarballs.nixos.org/make-3.80.tar.bz2; - sha256 = "06rgz6npynr8whmf7rxgkyvcz0clf3ggwf4cyhj3fcscn3kkk6x9"; - }; - - patches = [./log.patch]; - - hardeningDisable = [ "format" ]; - - meta = { - platforms = stdenv.lib.platforms.unix; - }; -} diff --git a/pkgs/development/tools/build-managers/gnumake/3.80/log.patch b/pkgs/development/tools/build-managers/gnumake/3.80/log.patch deleted file mode 100644 index fa90acfe8de..00000000000 --- a/pkgs/development/tools/build-managers/gnumake/3.80/log.patch +++ /dev/null @@ -1,125 +0,0 @@ -diff -rc make-3.80-orig/job.c make-3.80/job.c -*** make-3.80-orig/job.c 2002-08-10 03:27:17.000000000 +0200 ---- make-3.80/job.c 2004-04-02 17:38:04.000000000 +0200 -*************** -*** 987,993 **** - appear. */ - - message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag)) -! ? "%s" : (char *) 0, p); - - /* Tell update_goal_chain that a command has been started on behalf of - this target. It is important that this happens here and not in ---- 987,993 ---- - appear. */ - - message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag)) -! ? "\e[3s\e[a%s\e[b" : (char *) 0, p); - - /* Tell update_goal_chain that a command has been started on behalf of - this target. It is important that this happens here and not in -diff -rc make-3.80-orig/main.c make-3.80/main.c -*** make-3.80-orig/main.c 2002-08-10 03:27:17.000000000 +0200 ---- make-3.80/main.c 2004-04-02 17:42:50.000000000 +0200 -*************** -*** 254,259 **** ---- 254,263 ---- - they appear out of date or not. */ - - int always_make_flag = 0; -+ -+ int logNestingStdout = 0; -+ int logNestingStderr = 0; -+ - - /* The usage output. We write it this way to make life easier for the - translators, especially those trying to translate to right-to-left -*************** -*** 827,832 **** ---- 831,845 ---- - } - - -+ static void closeNesting() -+ { -+ while (logNestingStdout--) -+ printf("\e[q"); -+ while (logNestingStderr--) -+ fprintf(stderr, "\e[q"); -+ } -+ -+ - #ifndef _AMIGA - int - main (argc, argv, envp) -*************** -*** 854,859 **** ---- 867,874 ---- - no_default_sh_exe = 1; - #endif - -+ atexit(closeNesting); -+ - default_goal_file = 0; - reading_file = 0; - -*************** -*** 2782,2787 **** ---- 2797,2808 ---- - - /* Use entire sentences to give the translators a fighting chance. */ - -+ if (entering) -+ { -+ printf("\e[p"); -+ logNestingStdout++; -+ } -+ - if (makelevel == 0) - if (starting_directory == 0) - if (entering) -*************** -*** 2810,2813 **** ---- 2831,2840 ---- - else - printf (_("%s[%u]: Leaving directory `%s'\n"), - program, makelevel, starting_directory); -+ -+ if (!entering) -+ { -+ printf("\e[q"); -+ logNestingStdout--; -+ } - } -diff -rc make-3.80-orig/make.h make-3.80/make.h -*** make-3.80-orig/make.h 2002-09-11 18:55:44.000000000 +0200 ---- make-3.80/make.h 2004-04-02 17:42:15.000000000 +0200 -*************** -*** 559,562 **** ---- 559,567 ---- - extern int atomic_stat PARAMS ((const char *file, struct stat *buf)); - extern struct dirent *atomic_readdir PARAMS ((DIR *dir)); - -+ - #endif -+ -+ -+ extern int logNestingStdout; -+ extern int logNestingStderr; -diff -rc make-3.80-orig/remake.c make-3.80/remake.c -*** make-3.80-orig/remake.c 2002-08-08 02:11:19.000000000 +0200 ---- make-3.80/remake.c 2004-04-04 23:10:19.000000000 +0200 -*************** -*** 1049,1055 **** ---- 1049,1059 ---- - /* The normal case: start some commands. */ - if (!touch_flag || file->cmds->any_recurse) - { -+ fprintf(stderr, "\e[pbuilding %s\n", file->name); -+ logNestingStderr++; - execute_file_commands (file); -+ fprintf(stderr, "\e[q"); -+ logNestingStderr--; - return; - } - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 08024b888ea..ece41e7cb81 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6891,7 +6891,6 @@ with pkgs; gnum4 = callPackage ../development/tools/misc/gnum4 { }; - gnumake380 = callPackage ../development/tools/build-managers/gnumake/3.80 { }; gnumake382 = callPackage ../development/tools/build-managers/gnumake/3.82 { }; gnumake3 = gnumake382; gnumake40 = callPackage ../development/tools/build-managers/gnumake/4.0 { }; From 8cfe77444bb73331f6766367c8c43bd8abd4b3e7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Jul 2017 14:17:36 +0200 Subject: [PATCH 059/108] gnumake40: Remove unused version --- .../4.0/darwin-library_search-dylib.patch | 17 ------- .../build-managers/gnumake/4.0/default.nix | 49 ------------------- .../gnumake/4.0/impure-dirs.patch | 34 ------------- pkgs/top-level/all-packages.nix | 1 - 4 files changed, 101 deletions(-) delete mode 100644 pkgs/development/tools/build-managers/gnumake/4.0/darwin-library_search-dylib.patch delete mode 100644 pkgs/development/tools/build-managers/gnumake/4.0/default.nix delete mode 100644 pkgs/development/tools/build-managers/gnumake/4.0/impure-dirs.patch diff --git a/pkgs/development/tools/build-managers/gnumake/4.0/darwin-library_search-dylib.patch b/pkgs/development/tools/build-managers/gnumake/4.0/darwin-library_search-dylib.patch deleted file mode 100644 index de7e4f61521..00000000000 --- a/pkgs/development/tools/build-managers/gnumake/4.0/darwin-library_search-dylib.patch +++ /dev/null @@ -1,17 +0,0 @@ -Fixed default libpatttern on Darwin, imported from prefix overlay. -Got merged upstream: -https://savannah.gnu.org/bugs/?37197 ---- default.c.orig 2009-05-02 12:25:24 +0200 -+++ default.c 2009-05-02 12:25:58 +0200 -@@ -509,7 +509,11 @@ - #ifdef __MSDOS__ - ".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a", - #else -+#ifdef __APPLE__ -+ ".LIBPATTERNS", "lib%.dylib lib%.a", -+#else - ".LIBPATTERNS", "lib%.so lib%.a", -+#endif - #endif - #endif - diff --git a/pkgs/development/tools/build-managers/gnumake/4.0/default.nix b/pkgs/development/tools/build-managers/gnumake/4.0/default.nix deleted file mode 100644 index a4128ac854c..00000000000 --- a/pkgs/development/tools/build-managers/gnumake/4.0/default.nix +++ /dev/null @@ -1,49 +0,0 @@ -{stdenv, fetchurl}: - -let version = "4.0"; in -stdenv.mkDerivation { - name = "gnumake-${version}"; - - src = fetchurl { - url = "mirror://gnu/make/make-${version}.tar.bz2"; - sha256 = "1nyvn8mknw0mf7727lprva3lisl1y0n03lvar342rrpdmz3qc1p6"; - }; - - /* On Darwin, there are 3 test failures that haven't been investigated - yet. */ - doCheck = !stdenv.isDarwin && !stdenv.isFreeBSD; - - patches = - [ - # Purity: don't look for library dependencies (of the form - # `-lfoo') in /lib and /usr/lib. It's a stupid feature anyway. - # Likewise, when searching for included Makefiles, don't look in - # /usr/include and friends. - ./impure-dirs.patch - - # a bunch of patches from Gentoo, mostly should be from upstream (unreleased) - ./darwin-library_search-dylib.patch - ]; - patchFlags = "-p0"; - - meta = { - description = "GNU Make, a program controlling the generation of non-source files from sources"; - - longDescription = - '' Make is a tool which controls the generation of executables and - other non-source files of a program from the program's source files. - - Make gets its knowledge of how to build your program from a file - called the makefile, which lists each of the non-source files and - how to compute it from other files. When you write a program, you - should write a makefile for it, so that it is possible to use Make - to build and install the program. - ''; - - homepage = http://www.gnu.org/software/make/; - - license = stdenv.lib.licenses.gpl3Plus; - maintainers = [ ]; - platforms = stdenv.lib.platforms.all; - }; -} diff --git a/pkgs/development/tools/build-managers/gnumake/4.0/impure-dirs.patch b/pkgs/development/tools/build-managers/gnumake/4.0/impure-dirs.patch deleted file mode 100644 index f6646f1d012..00000000000 --- a/pkgs/development/tools/build-managers/gnumake/4.0/impure-dirs.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -rc read.c read.c -*** read.c 2006-03-17 15:24:20.000000000 +0100 ---- read.c 2007-05-24 17:16:31.000000000 +0200 -*************** -*** 99,107 **** ---- 99,109 ---- - #endif - INCLUDEDIR, - #ifndef _AMIGA -+ #if 0 - "/usr/gnu/include", - "/usr/local/include", - "/usr/include", -+ #endif - #endif - 0 - }; -diff -rc reremake.c -*** remake.c 2006-03-20 03:36:37.000000000 +0100 ---- remake.c 2007-05-24 17:06:54.000000000 +0200 -*************** -*** 1452,1460 **** ---- 1452,1462 ---- - static char *dirs[] = - { - #ifndef _AMIGA -+ #if 0 - "/lib", - "/usr/lib", - #endif -+ #endif - #if defined(WINDOWS32) && !defined(LIBDIR) - /* - * This is completely up to the user at product install time. Just define diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ece41e7cb81..6d645e5540c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6893,7 +6893,6 @@ with pkgs; gnumake382 = callPackage ../development/tools/build-managers/gnumake/3.82 { }; gnumake3 = gnumake382; - gnumake40 = callPackage ../development/tools/build-managers/gnumake/4.0 { }; gnumake41 = callPackage ../development/tools/build-managers/gnumake/4.1 { }; gnumake42 = callPackage ../development/tools/build-managers/gnumake/4.2 { }; gnumake = gnumake42; From 9f345ce2c7b2b9878ea2d520f04f82435c6e227d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Jul 2017 14:17:55 +0200 Subject: [PATCH 060/108] gnumake41: Remove unused version --- .../build-managers/gnumake/4.1/default.nix | 45 ---------------- .../gnumake/4.1/impure-dirs.patch | 34 ------------ .../gnumake/4.1/no-tty-name.patch | 53 ------------------- pkgs/top-level/all-packages.nix | 1 - 4 files changed, 133 deletions(-) delete mode 100644 pkgs/development/tools/build-managers/gnumake/4.1/default.nix delete mode 100644 pkgs/development/tools/build-managers/gnumake/4.1/impure-dirs.patch delete mode 100644 pkgs/development/tools/build-managers/gnumake/4.1/no-tty-name.patch diff --git a/pkgs/development/tools/build-managers/gnumake/4.1/default.nix b/pkgs/development/tools/build-managers/gnumake/4.1/default.nix deleted file mode 100644 index 7c45a6c8e67..00000000000 --- a/pkgs/development/tools/build-managers/gnumake/4.1/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ stdenv, fetchurl }: - -let - version = "4.1"; -in -stdenv.mkDerivation { - name = "gnumake-${version}"; - - src = fetchurl { - url = "mirror://gnu/make/make-${version}.tar.bz2"; - sha256 = "19gwwhik3wdwn0r42b7xcihkbxvjl9r2bdal8nifc3k5i4rn3iqb"; - }; - - patchFlags = "-p0"; - patches = [ - # Purity: don't look for library dependencies (of the form `-lfoo') in /lib - # and /usr/lib. It's a stupid feature anyway. Likewise, when searching for - # included Makefiles, don't look in /usr/include and friends. - ./impure-dirs.patch - - # Don't segfault if we can't get a tty name. - ./no-tty-name.patch - ]; - - outputs = [ "out" "doc" ]; - - meta = { - homepage = http://www.gnu.org/software/make/; - description = "A tool to control the generation of non-source files from sources"; - license = stdenv.lib.licenses.gpl3Plus; - - longDescription = '' - Make is a tool which controls the generation of executables and - other non-source files of a program from the program's source files. - - Make gets its knowledge of how to build your program from a file - called the makefile, which lists each of the non-source files and - how to compute it from other files. When you write a program, you - should write a makefile for it, so that it is possible to use Make - to build and install the program. - ''; - - platforms = stdenv.lib.platforms.all; - }; -} diff --git a/pkgs/development/tools/build-managers/gnumake/4.1/impure-dirs.patch b/pkgs/development/tools/build-managers/gnumake/4.1/impure-dirs.patch deleted file mode 100644 index f6646f1d012..00000000000 --- a/pkgs/development/tools/build-managers/gnumake/4.1/impure-dirs.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -rc read.c read.c -*** read.c 2006-03-17 15:24:20.000000000 +0100 ---- read.c 2007-05-24 17:16:31.000000000 +0200 -*************** -*** 99,107 **** ---- 99,109 ---- - #endif - INCLUDEDIR, - #ifndef _AMIGA -+ #if 0 - "/usr/gnu/include", - "/usr/local/include", - "/usr/include", -+ #endif - #endif - 0 - }; -diff -rc reremake.c -*** remake.c 2006-03-20 03:36:37.000000000 +0100 ---- remake.c 2007-05-24 17:06:54.000000000 +0200 -*************** -*** 1452,1460 **** ---- 1452,1462 ---- - static char *dirs[] = - { - #ifndef _AMIGA -+ #if 0 - "/lib", - "/usr/lib", - #endif -+ #endif - #if defined(WINDOWS32) && !defined(LIBDIR) - /* - * This is completely up to the user at product install time. Just define diff --git a/pkgs/development/tools/build-managers/gnumake/4.1/no-tty-name.patch b/pkgs/development/tools/build-managers/gnumake/4.1/no-tty-name.patch deleted file mode 100644 index a84d7ab49d0..00000000000 --- a/pkgs/development/tools/build-managers/gnumake/4.1/no-tty-name.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 292da6f6867b75a5af7ddbb639a1feae022f438f Mon Sep 17 00:00:00 2001 -From: Paul Smith -Date: Mon, 20 Oct 2014 05:54:56 +0000 -Subject: * main.c (main): [SV 43434] Handle NULL returns from ttyname(). - ---- -diff --git main.c main.c -index b2d169c..0cdb8a8 100644 ---- main.c -+++ main.c -@@ -1429,13 +1429,18 @@ main (int argc, char **argv, char **envp) - #ifdef HAVE_ISATTY - if (isatty (fileno (stdout))) - if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMOUT"))) -- define_variable_cname ("MAKE_TERMOUT", TTYNAME (fileno (stdout)), -- o_default, 0)->export = v_export; -- -+ { -+ const char *tty = TTYNAME (fileno (stdout)); -+ define_variable_cname ("MAKE_TERMOUT", tty ? tty : DEFAULT_TTYNAME, -+ o_default, 0)->export = v_export; -+ } - if (isatty (fileno (stderr))) - if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMERR"))) -- define_variable_cname ("MAKE_TERMERR", TTYNAME (fileno (stderr)), -- o_default, 0)->export = v_export; -+ { -+ const char *tty = TTYNAME (fileno (stderr)); -+ define_variable_cname ("MAKE_TERMERR", tty ? tty : DEFAULT_TTYNAME, -+ o_default, 0)->export = v_export; -+ } - #endif - - /* Reset in case the switches changed our minds. */ -diff --git makeint.h makeint.h -index 6223936..2009f41 100644 ---- makeint.h -+++ makeint.h -@@ -436,10 +436,11 @@ extern struct rlimit stack_limit; - /* The number of bytes needed to represent the largest integer as a string. */ - #define INTSTR_LENGTH CSTRLEN ("18446744073709551616") - -+#define DEFAULT_TTYNAME "true" - #ifdef HAVE_TTYNAME - # define TTYNAME(_f) ttyname (_f) - #else --# define TTYNAME(_f) "true" -+# define TTYNAME(_f) DEFAULT_TTYNAME - #endif - - --- -cgit v0.9.0.2 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6d645e5540c..b50193f27c5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6893,7 +6893,6 @@ with pkgs; gnumake382 = callPackage ../development/tools/build-managers/gnumake/3.82 { }; gnumake3 = gnumake382; - gnumake41 = callPackage ../development/tools/build-managers/gnumake/4.1 { }; gnumake42 = callPackage ../development/tools/build-managers/gnumake/4.2 { }; gnumake = gnumake42; From 6669a3b47711dc967df0ea8ff93fa9857aad015d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Jul 2017 14:25:57 +0200 Subject: [PATCH 061/108] stdenv: Remove log nesting Nix/Hydra no longer support pretty printing of logs, so this is no longer useful. --- .../build-managers/gnumake/3.82/default.nix | 4 - .../build-managers/gnumake/3.82/log.patch | 125 ------------------ pkgs/stdenv/generic/setup.sh | 36 +---- 3 files changed, 4 insertions(+), 161 deletions(-) delete mode 100644 pkgs/development/tools/build-managers/gnumake/3.82/log.patch diff --git a/pkgs/development/tools/build-managers/gnumake/3.82/default.nix b/pkgs/development/tools/build-managers/gnumake/3.82/default.nix index ce5eff878ea..87897017f86 100644 --- a/pkgs/development/tools/build-managers/gnumake/3.82/default.nix +++ b/pkgs/development/tools/build-managers/gnumake/3.82/default.nix @@ -15,10 +15,6 @@ stdenv.mkDerivation { patches = [ - # Provide nested log output for subsequent pretty-printing by - # nix-log2xml. - ./log.patch - # Purity: don't look for library dependencies (of the form # `-lfoo') in /lib and /usr/lib. It's a stupid feature anyway. # Likewise, when searching for included Makefiles, don't look in diff --git a/pkgs/development/tools/build-managers/gnumake/3.82/log.patch b/pkgs/development/tools/build-managers/gnumake/3.82/log.patch deleted file mode 100644 index e6197fd8e78..00000000000 --- a/pkgs/development/tools/build-managers/gnumake/3.82/log.patch +++ /dev/null @@ -1,125 +0,0 @@ -diff -rc job.c job.c -*** job.c 2006-03-20 04:03:04.000000000 +0100 ---- job.c 2009-01-19 19:37:28.000000000 +0100 -*************** -*** 1083,1089 **** - appear. */ - - message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag)) -! ? "%s" : (char *) 0, p); - - /* Tell update_goal_chain that a command has been started on behalf of - this target. It is important that this happens here and not in ---- 1083,1089 ---- - appear. */ - - message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag)) -! ? (enable_nested_output ? "\e[3s\e[a%s\e[b" : "%s") : (char *) 0, p); - - /* Tell update_goal_chain that a command has been started on behalf of - this target. It is important that this happens here and not in -diff -rc main.c main.c -*** main.c 2006-03-20 03:36:37.000000000 +0100 ---- main.c 2009-01-19 19:41:41.000000000 +0100 -*************** -*** 886,891 **** ---- 886,900 ---- - } - - -+ static void close_nesting() -+ { -+ while (stdout_nesting_level--) -+ printf("\e[q"); -+ while (stderr_nesting_level--) -+ fprintf(stderr, "\e[q"); -+ } -+ -+ - #ifdef _AMIGA - int - main (int argc, char **argv) -*************** -*** 931,936 **** ---- 940,950 ---- - atexit (close_stdout); - #endif - -+ atexit(close_nesting); -+ -+ if (getenv("NIX_INDENT_MAKE")) -+ enable_nested_output = 1; -+ - /* Needed for OS/2 */ - initialize_main(&argc, &argv); - -*************** -*** 3095,3100 **** ---- 3109,3120 ---- - - /* Use entire sentences to give the translators a fighting chance. */ - -+ if (entering && enable_nested_output) -+ { -+ printf("\e[p"); -+ stdout_nesting_level++; -+ } -+ - if (makelevel == 0) - if (starting_directory == 0) - if (entering) -*************** -*** 3124,3129 **** ---- 3144,3159 ---- - printf (_("%s[%u]: Leaving directory `%s'\n"), - program, makelevel, starting_directory); - -+ if (!entering && enable_nested_output) -+ { -+ printf("\e[q"); -+ stdout_nesting_level--; -+ } -+ - /* Flush stdout to be sure this comes before any stderr output. */ - fflush (stdout); - } -+ -+ int enable_nested_output = 0; -+ int stdout_nesting_level = 0; -+ int stderr_nesting_level = 0; -diff -rc make.h -*** make.h 2006-02-16 00:54:43.000000000 +0100 ---- make.h 2009-01-19 19:32:03.000000000 +0100 -*************** -*** 609,611 **** ---- 609,614 ---- - - #define ENULLLOOP(_v,_c) do { errno = 0; (_v) = _c; } \ - while((_v)==0 && errno==EINTR) -+ extern int enable_nested_output; -+ extern int stdout_nesting_level; -+ extern int stderr_nesting_level; -diff -rc reremake.c -*** remake.c 2006-03-20 03:36:37.000000000 +0100 ---- remake.c 2009-01-19 19:39:40.000000000 +0100 -*************** -*** 1120,1126 **** ---- 1120,1137 ---- - /* The normal case: start some commands. */ - if (!touch_flag || file->cmds->any_recurse) - { -+ if (enable_nested_output) -+ { -+ log_working_directory (1); -+ fprintf(stderr, "\e[pbuilding %s\n", file->name); -+ stderr_nesting_level++; -+ } - execute_file_commands (file); -+ if (enable_nested_output) -+ { -+ fprintf(stderr, "\e[q"); -+ stderr_nesting_level--; -+ } - return; - } - diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 35fe8fd6950..8ee72c96256 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -77,32 +77,10 @@ _eval() { ###################################################################### # Logging. -nestingLevel=0 - -startNest() { - # Assert natural as sanity check. - let nestingLevel+=1 "nestingLevel>=0" - echo -en "\033[$1p" -} - -stopNest() { - # Assert natural as sanity check. - let nestingLevel-=1 "nestingLevel>=0" - echo -en "\033[q" -} - -header() { - startNest "$2" - echo "$1" -} - -# Make sure that even when we exit abnormally, the original nesting -# level is properly restored. -closeNest() { - while [ $nestingLevel -gt 0 ]; do - stopNest - done -} +# Obsolete. +stopNest() { true; } +header() { echo "$1"; } +closeNest() { true; } # Prints a command such that all word splits are unambiguous. We need # to split the command in three parts because the middle format string @@ -123,8 +101,6 @@ exitHandler() { exitCode=$? set +e - closeNest - if [ -n "$showBuildStats" ]; then times > "$NIX_BUILD_TOP/.times" local -a times=($(cat "$NIX_BUILD_TOP/.times")) @@ -593,7 +569,6 @@ unpackFile() { echo "do not know how to unpack source archive $curSrc" exit 1 fi - stopNest } @@ -688,7 +663,6 @@ patchPhase() { # "2>&1" is a hack to make patch fail if the decompressor fails (nonexistent patch, etc.) # shellcheck disable=SC2086 $uncompress < "$i" 2>&1 | patch ${patchFlags:--p1} - stopNest done runHook postPatch @@ -973,8 +947,6 @@ genericBuild() { echo echo "@ phase-succeeded $out $curPhase" fi - - stopNest done } From aa4a92d2df0eebde3e0d832d2c60071f50fe4e9f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Jul 2017 14:45:15 +0200 Subject: [PATCH 062/108] cc-wrapper/ld-wrapper: Minor speedup in string concatenation There is still a O(n) pattern match in ld-wrapper, so we should probably rewrite that code to use associative arrays. --- pkgs/build-support/cc-wrapper/cc-wrapper.sh | 6 +++--- pkgs/build-support/cc-wrapper/ld-wrapper.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh index 3ccdc34db5b..99eb63f40ed 100644 --- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -55,7 +55,7 @@ while [ $n -lt ${#params[*]} ]; do nonFlagArgs=1 elif [ "$p" = -m32 ]; then if [ -e @out@/nix-support/dynamic-linker-m32 ]; then - NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" + NIX_LDFLAGS+=" -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" fi fi n=$((n + 1)) @@ -111,9 +111,9 @@ fi if [[ "$isCpp" = 1 ]]; then if [[ "$cppInclude" = 1 ]]; then - NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}" + NIX_CFLAGS_COMPILE+=" ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}" fi - NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK $NIX_CXXSTDLIB_LINK" + NIX_CFLAGS_LINK+=" $NIX_CXXSTDLIB_LINK" fi LD=@ldPath@/ld diff --git a/pkgs/build-support/cc-wrapper/ld-wrapper.sh b/pkgs/build-support/cc-wrapper/ld-wrapper.sh index 056cfa92053..4b3906a2e10 100644 --- a/pkgs/build-support/cc-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/ld-wrapper.sh @@ -79,7 +79,7 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then case $libPath in *\ $path\ *) return 0 ;; esac - libPath="$libPath $path " + libPath+=" $path " } addToRPath() { @@ -90,12 +90,12 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then case $rpath in *\ $1\ *) return 0 ;; esac - rpath="$rpath $1 " + rpath+=" $1 " } libs="" addToLibs() { - libs="$libs $1" + libs+=" $1" } rpath="" From 47821f1cf0cd853d3d3dfea9259e02fea2766327 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 25 Jul 2017 18:46:49 +0200 Subject: [PATCH 063/108] cc-wrapper: More quadratic performance fixes This eliminates the slow lookup of whether we've already seen an rpath / library path entry. Issue #27609. --- pkgs/build-support/cc-wrapper/ld-wrapper.sh | 44 ++++++++++----------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/ld-wrapper.sh b/pkgs/build-support/cc-wrapper/ld-wrapper.sh index 4b3906a2e10..240082b5dfd 100644 --- a/pkgs/build-support/cc-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/ld-wrapper.sh @@ -64,7 +64,9 @@ extra+=($NIX_LDFLAGS_AFTER $NIX_LDFLAGS_HARDEN) # Add all used dynamic libraries to the rpath. if [ "$NIX_DONT_SET_RPATH" != 1 ]; then - libPath="" + declare -A libDirsSeen + declare -a libDirs + addToLibPath() { local path="$1" if [ "${path:0:1}" != / ]; then return 0; fi @@ -76,29 +78,27 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then fi ;; esac - case $libPath in - *\ $path\ *) return 0 ;; - esac - libPath+=" $path " + if [[ -z ${libDirsSeen[$path]} ]]; then + libDirs+=("$path") + libDirsSeen[$path]=1 + fi } + declare -A rpathsSeen + declare -a rpaths + addToRPath() { # If the path is not in the store, don't add it to the rpath. # This typically happens for libraries in /tmp that are later # copied to $out/lib. If not, we're screwed. if [ "${1:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then return 0; fi - case $rpath in - *\ $1\ *) return 0 ;; - esac - rpath+=" $1 " + if [[ -z ${rpathsSeen[$1]} ]]; then + rpaths+=("$1") + rpathsSeen[$1]=1 + fi } - libs="" - addToLibs() { - libs+=" $1" - } - - rpath="" + declare -a libs # First, find all -L... switches. allParams=("${params[@]}" ${extra[@]}) @@ -112,10 +112,10 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then addToLibPath ${p2} n=$((n + 1)) elif [ "$p" = -l ]; then - addToLibs ${p2} + libs+=(${p2}) n=$((n + 1)) elif [ "${p:0:2}" = -l ]; then - addToLibs ${p:2} + libs+=(${p:2}) elif [ "$p" = -dynamic-linker ]; then # Ignore the dynamic linker argument, or it # will get into the next 'elif'. We don't want @@ -135,9 +135,8 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then # so, add the directory to the rpath. # It's important to add the rpath in the order of -L..., so # the link time chosen objects will be those of runtime linking. - - for i in $libPath; do - for j in $libs; do + for i in ${libDirs[@]}; do + for j in ${libs[@]}; do if [ -f "$i/lib$j.so" ]; then addToRPath $i break @@ -145,10 +144,9 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then done done - # Finally, add `-rpath' switches. - for i in $rpath; do - extra+=(-rpath $i) + for i in ${rpaths[@]}; do + extra+=(-rpath "$i") done fi From 98cff3f44679665ce0d1da474865db10a1de1439 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 25 Jul 2017 14:25:37 -0400 Subject: [PATCH 064/108] darwin stdenv: Ensure libSystem reexports the right libraries The logic was made pure for the normal libSystem, but this change never made it to the bootstrap tools. Deduplication the logic as the comment suggests would have prevented this, but here's a stop-gap until we do so. --- pkgs/stdenv/darwin/default.nix | 2 ++ pkgs/stdenv/darwin/unpack-bootstrap-tools.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index e7ce04b0a14..cac33a1bebb 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -50,6 +50,8 @@ in rec { args = [ ./unpack-bootstrap-tools.sh ]; inherit (bootstrapFiles) mkdir bzip2 cpio tarball; + reexportedLibrariesFile = + ../../os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries; __sandboxProfile = binShClosure + libSystemProfile; }; diff --git a/pkgs/stdenv/darwin/unpack-bootstrap-tools.sh b/pkgs/stdenv/darwin/unpack-bootstrap-tools.sh index 66c4e9ebeda..0da80ec5ce5 100644 --- a/pkgs/stdenv/darwin/unpack-bootstrap-tools.sh +++ b/pkgs/stdenv/darwin/unpack-bootstrap-tools.sh @@ -26,7 +26,7 @@ install_name_tool \ $out/lib/system/libsystem_kernel.dylib # TODO: this logic basically duplicates similar logic in the Libsystem expression. Deduplicate them! -libs=$(otool -arch x86_64 -L /usr/lib/libSystem.dylib | tail -n +3 | awk '{ print $1 }') +libs=$(cat $reexportedLibrariesFile | grep -v '^#') for i in $libs; do if [ "$i" != "/usr/lib/system/libsystem_kernel.dylib" ] && [ "$i" != "/usr/lib/system/libsystem_c.dylib" ]; then From 34c0ba498c47808695229c6299c8ef66a0de9649 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 16 Jul 2017 12:10:52 -0400 Subject: [PATCH 065/108] stdenv-setup: Add quotes that don't do anything for consistency. @vcunat and others rightly point out that it's easier to quote always, than learn Bash's idiosyncrasies enough to know when it doesn't make a difference. This reverts commit 2743078f664ae07c4bed06a96182c6a86bd7fa32, which removes quotes that don't do anything, and then goes further adding even more quotes. --- pkgs/stdenv/generic/setup.sh | 148 +++++++++++++++++------------------ 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 8ee72c96256..e0a33ca1c38 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -13,10 +13,10 @@ set -o pipefail # code). The hooks for are the shell function or variable # , and the values of the shell array ‘Hooks’. runHook() { - local hookName=$1 + local hookName="$1" shift local var="$hookName" - if [[ $hookName =~ Hook$ ]]; then var+=s; else var+=Hooks; fi + if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi local -n var local hook for hook in "_callImplicitHook 0 $hookName" "${var[@]}"; do @@ -29,10 +29,10 @@ runHook() { # Run all hooks with the specified name, until one succeeds (returns a # zero exit code). If none succeed, return a non-zero exit code. runOneHook() { - local hookName=$1 + local hookName="$1" shift local var="$hookName" - if [[ $hookName =~ Hook$ ]]; then var+=s; else var+=Hooks; fi + if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi local -n var local hook for hook in "_callImplicitHook 1 $hookName" "${var[@]}"; do @@ -50,8 +50,8 @@ runOneHook() { # environment variables) and from shell scripts (as functions). If you # want to allow multiple hooks, use runHook instead. _callImplicitHook() { - local def=$1 - local hookName=$2 + local def="$1" + local hookName="$2" case "$(type -t "$hookName")" in (function|alias|builtin) "$hookName";; (file) source "$hookName";; @@ -64,7 +64,7 @@ _callImplicitHook() { # A function wrapper around ‘eval’ that ensures that ‘return’ inside # hooks exits the hook, not the caller. _eval() { - local code=$1 + local code="$1" shift if [ "$(type -t "$code")" = function ]; then eval "$code \"\$@\"" @@ -98,7 +98,7 @@ echoCmd() { # Error handling. exitHandler() { - exitCode=$? + exitCode="$?" set +e if [ -n "$showBuildStats" ]; then @@ -112,7 +112,7 @@ exitHandler() { echo "build time elapsed: " "${times[@]}" fi - if [ $exitCode != 0 ]; then + if [ "$exitCode" != 0 ]; then runHook failureHook # If the builder had a non-zero exit code and @@ -122,7 +122,7 @@ exitHandler() { if [ -n "$succeedOnFailure" ]; then echo "build failed with exit code $exitCode (ignored)" mkdir -p "$out/nix-support" - printf "%s" $exitCode > "$out/nix-support/failed" + printf "%s" "$exitCode" > "$out/nix-support/failed" exit 0 fi @@ -130,7 +130,7 @@ exitHandler() { runHook exitHook fi - exit $exitCode + exit "$exitCode" } trap "exitHandler" EXIT @@ -141,11 +141,11 @@ trap "exitHandler" EXIT addToSearchPathWithCustomDelimiter() { - local delimiter=$1 - local varName=$2 - local dir=$3 + local delimiter="$1" + local varName="$2" + local dir="$3" if [ -d "$dir" ]; then - eval export ${varName}=${!varName}${!varName:+$delimiter}${dir} + export "${varName}=${!varName}${!varName:+$delimiter}${dir}" fi } @@ -182,31 +182,31 @@ _addRpathPrefix() { # Return success if the specified file is an ELF object. isELF() { - local fn=$1 + local fn="$1" local fd local magic exec {fd}< "$fn" - read -r -n 4 -u $fd magic + read -r -n 4 -u "$fd" magic exec {fd}<&- - if [[ $magic =~ ELF ]]; then return 0; else return 1; fi + if [[ "$magic" =~ ELF ]]; then return 0; else return 1; fi } # Return success if the specified file is a script (i.e. starts with # "#!"). isScript() { - local fn=$1 + local fn="$1" local fd local magic if ! [ -x /bin/sh ]; then return 0; fi exec {fd}< "$fn" - read -r -n 2 -u $fd magic + read -r -n 2 -u "$fd" magic exec {fd}<&- - if [[ $magic =~ \#! ]]; then return 0; else return 1; fi + if [[ "$magic" =~ \#! ]]; then return 0; else return 1; fi } # printf unfortunately will print a trailing newline regardless printLines() { - [[ $# -gt 0 ]] || return 0 + [[ "$#" -gt 0 ]] || return 0 printf '%s\n' "$@" } @@ -232,7 +232,7 @@ shopt -s nullglob PATH= for i in $initialPath; do if [ "$i" = / ]; then i=; fi - addToSearchPath PATH $i/bin + addToSearchPath PATH "$i/bin" done if [ "$NIX_DEBUG" = 1 ]; then @@ -242,8 +242,8 @@ fi # Check that the pre-hook initialised SHELL. if [ -z "$SHELL" ]; then echo "SHELL not set"; exit 1; fi -BASH=$SHELL -export CONFIG_SHELL=$SHELL +BASH="$SHELL" +export CONFIG_SHELL="$SHELL" # Dummy implementation of the paxmark function. On Linux, this is @@ -252,7 +252,7 @@ paxmark() { true; } # Execute the pre-hook. -if [ -z "$shell" ]; then export shell=$SHELL; fi +if [ -z "$shell" ]; then export shell="$SHELL"; fi runHook preHook @@ -264,13 +264,13 @@ runHook addInputsHook # Recursively find all build inputs. findInputs() { - local pkg=$1 - local var=$2 - local -n varDeref=$var - local propagatedBuildInputsFile=$3 + local pkg="$1" + local var="$2" + local -n varDeref="$var" + local propagatedBuildInputsFile="$3" # Stop if we've already added this one - [[ -z ${varDeref[$pkg]} ]] || return 0 + [[ -z "${varDeref["$pkg"]}" ]] || return 0 varDeref["$pkg"]=1 if ! [ -e "$pkg" ]; then @@ -294,7 +294,7 @@ findInputs() { local fd pkgNext exec {fd}<"$pkg/nix-support/$propagatedBuildInputsFile" while IFS= read -r -u $fd pkgNext; do - findInputs "$pkgNext" $var $propagatedBuildInputsFile + findInputs "$pkgNext" "$var" "$propagatedBuildInputsFile" done exec {fd}<&- fi @@ -307,17 +307,17 @@ if [ -z "$crossConfig" ]; then for i in $nativeBuildInputs $buildInputs \ $defaultNativeBuildInputs $defaultBuildInputs \ $propagatedNativeBuildInputs $propagatedBuildInputs; do - findInputs $i nativePkgs propagated-native-build-inputs + findInputs "$i" nativePkgs propagated-native-build-inputs done else declare -gA crossPkgs for i in $buildInputs $defaultBuildInputs $propagatedBuildInputs; do - findInputs $i crossPkgs propagated-build-inputs + findInputs "$i" crossPkgs propagated-build-inputs done declare -gA nativePkgs for i in $nativeBuildInputs $defaultNativeBuildInputs $propagatedNativeBuildInputs; do - findInputs $i nativePkgs propagated-native-build-inputs + findInputs "$i" nativePkgs propagated-native-build-inputs done fi @@ -325,25 +325,25 @@ fi # Set the relevant environment variables to point to the build inputs # found above. _addToNativeEnv() { - local pkg=$1 + local pkg="$1" # Run the package-specific hooks set by the setup-hook scripts. runHook envHook "$pkg" } for i in "${!nativePkgs[@]}"; do - _addToNativeEnv $i + _addToNativeEnv "$i" done _addToCrossEnv() { - local pkg=$1 + local pkg="$1" # Run the package-specific hooks set by the setup-hook scripts. runHook crossEnvHook "$pkg" } for i in "${!crossPkgs[@]}"; do - _addToCrossEnv $i + _addToCrossEnv "$i" done @@ -360,7 +360,7 @@ export TZ=UTC # for instance if we just want to perform a test build/install to a # temporary location and write a build report to $out. if [ -z "$prefix" ]; then - prefix=$out; + prefix="$out"; fi if [ "$useTempPrefix" = 1 ]; then @@ -408,8 +408,8 @@ fi substitute() { - local input=$1 - local output=$2 + local input="$1" + local output="$2" shift 2 if [ ! -f "$input" ]; then @@ -427,28 +427,28 @@ substitute() { while (( "$#" )); do case "$1" in --replace) - pattern=$2 - replacement=$3 + pattern="$2" + replacement="$3" shift 3 ;; --subst-var) - local varName=$2 + local varName="$2" shift 2 # check if the used nix attribute name is a valid bash name - if ! [[ $varName =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then echo "${FUNCNAME[0]}(): WARNING: substitution variables should be valid bash names," >&2 echo " \"$varName\" isn't and therefore was skipped; it might be caused" >&2 echo " by multi-line phases in variables - see #14907 for details." >&2 continue fi - pattern=@$varName@ - replacement=${!varName} + pattern="@$varName@" + replacement="${!varName}" ;; --subst-var-by) - pattern=@$2@ - replacement=$3 + pattern="@$2@" + replacement="$3" shift 3 ;; @@ -467,7 +467,7 @@ substitute() { substituteInPlace() { - local fileName=$1 + local fileName="$1" shift substitute "$fileName" "$fileName" "$@" } @@ -477,8 +477,8 @@ substituteInPlace() { # character or underscore. Note: other names that aren't bash-valid # will cause an error during `substitute --subst-var`. substituteAll() { - local input=$1 - local output=$2 + local input="$1" + local output="$2" local -a args=() # Select all environment variables that start with a lowercase character. @@ -494,7 +494,7 @@ substituteAll() { substituteAllInPlace() { - local fileName=$1 + local fileName="$1" shift substituteAll "$fileName" "$fileName" "$@" } @@ -521,7 +521,7 @@ dumpVars() { stripHash() { local strippedName # On separate line for `set -e` - strippedName=$(basename "$1") + strippedName="$(basename "$1")" if echo "$strippedName" | grep -q '^[a-z0-9]\{32\}-'; then echo "$strippedName" | cut -c34- else @@ -532,7 +532,7 @@ stripHash() { unpackCmdHooks+=(_defaultUnpack) _defaultUnpack() { - local fn=$1 + local fn="$1" if [ -d "$fn" ]; then @@ -563,7 +563,7 @@ _defaultUnpack() { unpackFile() { - curSrc=$1 + curSrc="$1" header "unpacking source archive $curSrc" 3 if ! runOneHook unpackCmd "$curSrc"; then echo "do not know how to unpack source archive $curSrc" @@ -581,7 +581,7 @@ unpackPhase() { echo 'variable $src or $srcs should point to the source' exit 1 fi - srcs=$src + srcs="$src" fi # To determine the source directory created by unpacking the @@ -615,7 +615,7 @@ unpackPhase() { echo "unpacker produced multiple directories" exit 1 fi - sourceRoot=$i + sourceRoot="$i" ;; esac fi @@ -677,7 +677,7 @@ fixLibtool() { configurePhase() { runHook preConfigure - if [[ -z $configureScript && -x ./configure ]]; then + if [[ -z "$configureScript" && -x ./configure ]]; then configureScript=./configure fi @@ -689,7 +689,7 @@ configurePhase() { done fi - if [[ -z $dontAddPrefix && -n $prefix ]]; then + if [[ -z "$dontAddPrefix" && -n "$prefix" ]]; then configureFlags="${prefixKey:---prefix=}$prefix $configureFlags" fi @@ -725,7 +725,7 @@ configurePhase() { buildPhase() { runHook preBuild - if [[ -z $makeFlags && ! ( -n $makefile || -e Makefile || -e makefile || -e GNUmakefile[[ ) ]]; then + if [[ -z "$makeFlags" && ! ( -n "$makefile" || -e Makefile || -e makefile || -e GNUmakefile[[ ) ]]; then echo "no Makefile, doing nothing" else # See https://github.com/NixOS/nixpkgs/pull/1354#issuecomment-31260409 @@ -770,7 +770,7 @@ installPhase() { mkdir -p "$prefix" fi - installTargets=${installTargets:-install} + installTargets="${installTargets:-install}" # shellcheck disable=SC2086 local flagsArray=( $installTargets \ @@ -799,7 +799,7 @@ fixupPhase() { # Apply fixup to each output. local output for output in $outputs; do - prefix=${!output} runHook fixupOutput + prefix="${!output}" runHook fixupOutput done @@ -879,7 +879,7 @@ distPhase() { # Note: don't quote $tarballs, since we explicitly permit # wildcards in there. # shellcheck disable=SC2086 - cp -pvd ${tarballs:-*.tar.gz} $out/tarballs + cp -pvd ${tarballs:-*.tar.gz} "$out/tarballs" fi runHook postDist @@ -887,8 +887,8 @@ distPhase() { showPhaseHeader() { - local phase=$1 - case $phase in + local phase="$1" + case "$phase" in unpackPhase) header "unpacking sources";; patchPhase) header "patching sources";; configurePhase) header "configuring";; @@ -920,14 +920,14 @@ genericBuild() { fi for curPhase in $phases; do - if [[ $curPhase = buildPhase && -n $dontBuild ]]; then continue; fi - if [[ $curPhase = checkPhase && -z $doCheck ]]; then continue; fi - if [[ $curPhase = installPhase && -n $dontInstall ]]; then continue; fi - if [[ $curPhase = fixupPhase && -n $dontFixup ]]; then continue; fi - if [[ $curPhase = installCheckPhase && -z $doInstallCheck ]]; then continue; fi - if [[ $curPhase = distPhase && -z $doDist ]]; then continue; fi + if [[ "$curPhase" = buildPhase && -n "$dontBuild" ]]; then continue; fi + if [[ "$curPhase" = checkPhase && -z "$doCheck" ]]; then continue; fi + if [[ "$curPhase" = installPhase && -n "$dontInstall" ]]; then continue; fi + if [[ "$curPhase" = fixupPhase && -n "$dontFixup" ]]; then continue; fi + if [[ "$curPhase" = installCheckPhase && -z "$doInstallCheck" ]]; then continue; fi + if [[ "$curPhase" = distPhase && -z "$doDist" ]]; then continue; fi - if [[ -n $tracePhases ]]; then + if [[ -n "$tracePhases" ]]; then echo echo "@ phase-started $out $curPhase" fi From 61764cbba4619307d0abf987bc67369112dfb7c1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 26 Jul 2017 11:31:35 +0200 Subject: [PATCH 066/108] Revert "docbook-xsl: Install dbtoepub" This reverts commit 4e32f5bda32cd580a7ec731beb381b14bbf2b528. IMHO, it's not desirable to make docbook-xsl (and by extension a gazillion packages that depend on it) pull in Ruby. (For example, I just noticed that wget depends on ruby now...) --- .../data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix index a527765688d..a955f5cf8a4 100644 --- a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix +++ b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, ruby }: +{ lib, stdenv, fetchurl }: let @@ -10,8 +10,6 @@ let inherit sha256; }; - buildInputs = [ ruby ]; - dontBuild = true; installPhase = '' @@ -23,9 +21,6 @@ let # Backwards compatibility. Will remove eventually. mkdir -p $out/xml/xsl ln -s $dst $out/xml/xsl/docbook - - ln -sv $dst/epub/bin $out - chmod +x $out/bin/dbtoepub ''; meta = { From f6f40e3fe5fbb9721624a218faea1b520f9ec200 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 25 Jul 2017 18:48:47 -0400 Subject: [PATCH 067/108] stdenv-setup and misc pkgs: Revert to space-deliminated propagated-* files We cannot switch to line-delimited yet, because certain Nix commands do not read in the entire file, but just the first line. --- pkgs/build-support/cc-wrapper/default.nix | 6 +++--- pkgs/build-support/gcc-wrapper-old/builder.sh | 2 +- pkgs/build-support/trivial-builders.nix | 2 +- .../desktops/kde-4.14/kde-package/default.nix | 2 +- .../compilers/openjdk-darwin/8.nix | 2 +- .../compilers/openjdk-darwin/default.nix | 2 +- pkgs/development/compilers/openjdk/7.nix | 2 +- pkgs/development/compilers/openjdk/8.nix | 2 +- .../compilers/oraclejdk/jdk-linux-base.nix | 2 +- pkgs/development/compilers/zulu/default.nix | 2 +- .../haskell-modules/generic-builder.nix | 2 +- pkgs/misc/misc.nix | 2 +- pkgs/stdenv/generic/builder.sh | 2 +- pkgs/stdenv/generic/setup.sh | 19 +++++++++++-------- 14 files changed, 26 insertions(+), 23 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 1b52a0b8b12..09d1d4cd681 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -190,7 +190,7 @@ stdenv.mkDerivation { # The dynamic linker is passed in `ldflagsBefore' to allow # explicit overrides of the dynamic linker by callers to gcc/ld # (the *last* value counts, so ours should come first). - printLines "''${ldflagsBefore[@]}" > $out/nix-support/libc-ldflags-before + printWords "''${ldflagsBefore[@]}" > $out/nix-support/libc-ldflags-before '') + optionalString (libc != null) '' @@ -258,9 +258,9 @@ stdenv.mkDerivation { # Propagate the wrapped cc so that if you install the wrapper, # you get tools like gcov, the manpages, etc. as well (including # for binutils and Glibc). - printLines ${cc} ${cc.man or ""} ${binutils_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages + printWords ${cc} ${cc.man or ""} ${binutils_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages - printLines ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs + printWords ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs '' + optionalString (targetPlatform.isSunOS && nativePrefix != "") '' diff --git a/pkgs/build-support/gcc-wrapper-old/builder.sh b/pkgs/build-support/gcc-wrapper-old/builder.sh index 4f141f6b8f2..22e32814927 100644 --- a/pkgs/build-support/gcc-wrapper-old/builder.sh +++ b/pkgs/build-support/gcc-wrapper-old/builder.sh @@ -211,5 +211,5 @@ cp -p $utils $out/nix-support/utils.sh # tools like gcov, the manpages, etc. as well (including for binutils # and Glibc). if test -z "$nativeTools"; then - printLines $gcc $binutils $libc $libc_bin > $out/nix-support/propagated-user-env-packages + printWords $gcc $binutils $libc $libc_bin > $out/nix-support/propagated-user-env-packages fi diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 1ee1fe8298f..16bd4e8e405 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -84,7 +84,7 @@ rec { mkdir -p $out/nix-support cp ${script} $out/nix-support/setup-hook '' + lib.optionalString (deps != []) '' - printLines ${toString deps} > $out/nix-support/propagated-native-build-inputs + printWords ${toString deps} > $out/nix-support/propagated-native-build-inputs '' + lib.optionalString (substitutions != {}) '' substituteAll ${script} $out/nix-support/setup-hook ''); diff --git a/pkgs/desktops/kde-4.14/kde-package/default.nix b/pkgs/desktops/kde-4.14/kde-package/default.nix index 3637d9f89cb..94f878097de 100644 --- a/pkgs/desktops/kde-4.14/kde-package/default.nix +++ b/pkgs/desktops/kde-4.14/kde-package/default.nix @@ -86,7 +86,7 @@ rec { };}) '' mkdir -pv $out/nix-support - printLines ${toString list} | tee $out/nix-support/propagated-user-env-packages + printWords ${toString list} | tee $out/nix-support/propagated-user-env-packages ''; # Given manifest module data, return the module diff --git a/pkgs/development/compilers/openjdk-darwin/8.nix b/pkgs/development/compilers/openjdk-darwin/8.nix index 691829c7788..6234b63208c 100644 --- a/pkgs/development/compilers/openjdk-darwin/8.nix +++ b/pkgs/development/compilers/openjdk-darwin/8.nix @@ -33,7 +33,7 @@ let # any package that depends on the JRE has $CLASSPATH set up # properly. mkdir -p $out/nix-support - printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs + printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/jre/lib/libfontmanager.dylib diff --git a/pkgs/development/compilers/openjdk-darwin/default.nix b/pkgs/development/compilers/openjdk-darwin/default.nix index 8ce0835fcb6..1e8f88beea6 100644 --- a/pkgs/development/compilers/openjdk-darwin/default.nix +++ b/pkgs/development/compilers/openjdk-darwin/default.nix @@ -23,7 +23,7 @@ let # any package that depends on the JRE has $CLASSPATH set up # properly. mkdir -p $out/nix-support - printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs + printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/jre/lib/libfontmanager.dylib diff --git a/pkgs/development/compilers/openjdk/7.nix b/pkgs/development/compilers/openjdk/7.nix index 9ef7d26b2ef..72f0ba293ba 100644 --- a/pkgs/development/compilers/openjdk/7.nix +++ b/pkgs/development/compilers/openjdk/7.nix @@ -190,7 +190,7 @@ let # any package that depends on the JRE has $CLASSPATH set up # properly. mkdir -p $jre/nix-support - printLines ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs + printWords ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs # Set JAVA_HOME automatically. mkdir -p $out/nix-support diff --git a/pkgs/development/compilers/openjdk/8.nix b/pkgs/development/compilers/openjdk/8.nix index 7c50872ebe5..0f0b42640c5 100644 --- a/pkgs/development/compilers/openjdk/8.nix +++ b/pkgs/development/compilers/openjdk/8.nix @@ -202,7 +202,7 @@ let # any package that depends on the JRE has $CLASSPATH set up # properly. mkdir -p $jre/nix-support - printLines ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs + printWords ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs # Set JAVA_HOME automatically. mkdir -p $out/nix-support diff --git a/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix b/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix index 08fd724f773..fec038199ad 100644 --- a/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix +++ b/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix @@ -165,7 +165,7 @@ let result = stdenv.mkDerivation rec { ln -s $jrePath/lib/${architecture}/libnpjp2.so $jrePath/lib/${architecture}/plugins mkdir -p $out/nix-support - printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs + printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs # Set JAVA_HOME automatically. cat <> $out/nix-support/setup-hook diff --git a/pkgs/development/compilers/zulu/default.nix b/pkgs/development/compilers/zulu/default.nix index 03be4ee8a0b..f7638757ff7 100644 --- a/pkgs/development/compilers/zulu/default.nix +++ b/pkgs/development/compilers/zulu/default.nix @@ -54,7 +54,7 @@ in stdenv.mkDerivation rec { find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \; mkdir -p $out/nix-support - printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs + printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs # Set JAVA_HOME automatically. cat <> $out/nix-support/setup-hook diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index a8da63493a4..c7c54c959b5 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -311,7 +311,7 @@ stdenv.mkDerivation ({ ${optionalString isGhcjs '' for exeDir in "$out/bin/"*.jsexe; do exe="''${exeDir%.jsexe}" - printLines '#!${nodejs}/bin/node' > "$exe" + printWords '#!${nodejs}/bin/node' > "$exe" cat "$exeDir/all.js" >> "$exe" chmod +x "$exe" done diff --git a/pkgs/misc/misc.nix b/pkgs/misc/misc.nix index 6e8c6f4486f..a3c293beab3 100644 --- a/pkgs/misc/misc.nix +++ b/pkgs/misc/misc.nix @@ -23,7 +23,7 @@ in */ collection = {list, name} : runCommand "collection-${name}" {} '' mkdir -p $out/nix-support - printLines ${builtins.toString list} > $out/nix-support/propagated-user-env-packages + printWords ${builtins.toString list} > $out/nix-support/propagated-user-env-packages ''; /* creates a derivation symlinking references C/C++ libs into one include and lib directory called $out/cdt-envs/${name} diff --git a/pkgs/stdenv/generic/builder.sh b/pkgs/stdenv/generic/builder.sh index f8c0fd44ac7..686cb778ca7 100644 --- a/pkgs/stdenv/generic/builder.sh +++ b/pkgs/stdenv/generic/builder.sh @@ -15,5 +15,5 @@ cat "$setup" >> $out/setup # in stdenv. mkdir $out/nix-support if [ "$propagatedUserEnvPkgs" ]; then - printf '%s\n' $propagatedUserEnvPkgs > $out/nix-support/propagated-user-env-packages + printf '%s ' $propagatedUserEnvPkgs > $out/nix-support/propagated-user-env-packages fi diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index e0a33ca1c38..56ab8223296 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -210,6 +210,11 @@ printLines() { printf '%s\n' "$@" } +printWords() { + [[ "$#" -gt 0 ]] || return 0 + printf '%s ' "$@" +} + ###################################################################### # Initialisation. @@ -291,12 +296,10 @@ findInputs() { fi if [ -f "$pkg/nix-support/$propagatedBuildInputsFile" ]; then - local fd pkgNext - exec {fd}<"$pkg/nix-support/$propagatedBuildInputsFile" - while IFS= read -r -u $fd pkgNext; do + local pkgNext + for pkgNext in $(< "$pkg/nix-support/$propagatedBuildInputsFile"); do findInputs "$pkgNext" "$var" "$propagatedBuildInputsFile" done - exec {fd}<&- fi } @@ -814,19 +817,19 @@ fixupPhase() { if [ -n "$propagated" ]; then mkdir -p "${!outputDev}/nix-support" # shellcheck disable=SC2086 - printLines $propagated > "${!outputDev}/nix-support/propagated-native-build-inputs" + printWords $propagated > "${!outputDev}/nix-support/propagated-native-build-inputs" fi else if [ -n "$propagatedBuildInputs" ]; then mkdir -p "${!outputDev}/nix-support" # shellcheck disable=SC2086 - printLines $propagatedBuildInputs > "${!outputDev}/nix-support/propagated-build-inputs" + printWords $propagatedBuildInputs > "${!outputDev}/nix-support/propagated-build-inputs" fi if [ -n "$propagatedNativeBuildInputs" ]; then mkdir -p "${!outputDev}/nix-support" # shellcheck disable=SC2086 - printLines $propagatedNativeBuildInputs > "${!outputDev}/nix-support/propagated-native-build-inputs" + printWords $propagatedNativeBuildInputs > "${!outputDev}/nix-support/propagated-native-build-inputs" fi fi @@ -840,7 +843,7 @@ fixupPhase() { if [ -n "$propagatedUserEnvPkgs" ]; then mkdir -p "${!outputBin}/nix-support" # shellcheck disable=SC2086 - printLines $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages" + printWords $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages" fi runHook postFixup From ea7d13cf1acc60999a442b46b279460928165140 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 25 Jul 2017 17:48:50 -0400 Subject: [PATCH 068/108] stdenv-setup and misc hooks: Work with bash-3.4 for MacOS nix-shell This is a temporary measure until this impurity is removed from Nix. --- pkgs/build-support/cc-wrapper/setup-hook.sh | 2 +- .../haskell-modules/generic-builder.nix | 2 +- pkgs/servers/x11/xorg/builder.sh | 4 +- pkgs/stdenv/generic/setup.sh | 38 ++++++++++++------- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/setup-hook.sh b/pkgs/build-support/cc-wrapper/setup-hook.sh index 3e8494cf9c1..104b82425f2 100644 --- a/pkgs/build-support/cc-wrapper/setup-hook.sh +++ b/pkgs/build-support/cc-wrapper/setup-hook.sh @@ -54,7 +54,7 @@ do if PATH=$_PATH type -p "@binPrefix@$CMD" > /dev/null then - export "${ENV_PREFIX}${CMD^^}=@binPrefix@${CMD}"; + export "${ENV_PREFIX}$(echo "$CMD" | tr "[:lower:]" "[:upper:]")=@binPrefix@${CMD}"; fi done diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index c7c54c959b5..2ec77b0563a 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -211,7 +211,7 @@ stdenv.mkDerivation ({ configureFlags="${concatStringsSep " " defaultConfigureFlags} $configureFlags" # nativePkgs defined in stdenv/setup.hs - for p in "''${!nativePkgs[@]}"; do + for p in "''${nativePkgs[@]}"; do if [ -d "$p/lib/${ghc.name}/package.conf.d" ]; then cp -f "$p/lib/${ghc.name}/package.conf.d/"*.conf $packageConfDir/ continue diff --git a/pkgs/servers/x11/xorg/builder.sh b/pkgs/servers/x11/xorg/builder.sh index 3a8cf6fa6c8..fae8bf5a8ce 100644 --- a/pkgs/servers/x11/xorg/builder.sh +++ b/pkgs/servers/x11/xorg/builder.sh @@ -18,14 +18,14 @@ postInstall() { for r in $requires; do if test -n "$crossConfig"; then - for p in "${!crossPkgs[@]}"; do + for p in "${crossPkgs[@]}"; do if test -e $p/lib/pkgconfig/$r.pc; then echo " found requisite $r in $p" propagatedBuildInputs="$propagatedBuildInputs $p" fi done else - for p in "${!nativePkgs[@]}"; do + for p in "${nativePkgs[@]}"; do if test -e $p/lib/pkgconfig/$r.pc; then echo " found requisite $r in $p" propagatedNativeBuildInputs="$propagatedNativeBuildInputs $p" diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 56ab8223296..1e8b5f57585 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -17,9 +17,10 @@ runHook() { shift local var="$hookName" if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi - local -n var + + local varRef="$var[@]" local hook - for hook in "_callImplicitHook 0 $hookName" "${var[@]}"; do + for hook in "_callImplicitHook 0 $hookName" "${!varRef}"; do _eval "$hook" "$@" done return 0 @@ -33,9 +34,10 @@ runOneHook() { shift local var="$hookName" if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi - local -n var + + local varRef="$var[@]" local hook - for hook in "_callImplicitHook 1 $hookName" "${var[@]}"; do + for hook in "_callImplicitHook 1 $hookName" "${!varRef}"; do if _eval "$hook" "$@"; then return 0 fi @@ -271,12 +273,22 @@ runHook addInputsHook findInputs() { local pkg="$1" local var="$2" - local -n varDeref="$var" local propagatedBuildInputsFile="$3" - # Stop if we've already added this one - [[ -z "${varDeref["$pkg"]}" ]] || return 0 - varDeref["$pkg"]=1 + # TODO(@Ericson2314): Restore using associative array once Darwin + # nix-shell doesn't use impure bash. This should replace the O(n) + # case with an O(1) hash map lookup, assuming bash is implemented + # well :D. + local varRef="$var[*]" + + case "${!varRef}" in + *" $pkg "*) return 0 ;; + esac + + # For some reason, bash gives us some (hopefully limited) eval + # "for free"! Everything is single-quoted except for `"$var"` + # so `var` is expanded first. + declare -g "$var"'=("${'"$var"'[@]}" "$pkg")' if ! [ -e "$pkg" ]; then echo "build input $pkg does not exist" >&2 @@ -306,19 +318,19 @@ findInputs() { if [ -z "$crossConfig" ]; then # Not cross-compiling - both buildInputs (and variants like propagatedBuildInputs) # are handled identically to nativeBuildInputs - declare -gA nativePkgs + declare -ga nativePkgs for i in $nativeBuildInputs $buildInputs \ $defaultNativeBuildInputs $defaultBuildInputs \ $propagatedNativeBuildInputs $propagatedBuildInputs; do findInputs "$i" nativePkgs propagated-native-build-inputs done else - declare -gA crossPkgs + declare -ga crossPkgs for i in $buildInputs $defaultBuildInputs $propagatedBuildInputs; do findInputs "$i" crossPkgs propagated-build-inputs done - declare -gA nativePkgs + declare -ga nativePkgs for i in $nativeBuildInputs $defaultNativeBuildInputs $propagatedNativeBuildInputs; do findInputs "$i" nativePkgs propagated-native-build-inputs done @@ -334,7 +346,7 @@ _addToNativeEnv() { runHook envHook "$pkg" } -for i in "${!nativePkgs[@]}"; do +for i in "${nativePkgs[@]}"; do _addToNativeEnv "$i" done @@ -345,7 +357,7 @@ _addToCrossEnv() { runHook crossEnvHook "$pkg" } -for i in "${!crossPkgs[@]}"; do +for i in "${crossPkgs[@]}"; do _addToCrossEnv "$i" done From 820e4021d3474d6d11d8847be8b2ae9b24da72d8 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 25 Jul 2017 20:58:47 -0400 Subject: [PATCH 069/108] stdenv-setup: Remove any `declare -g` This is invalid before bash-4.2, affecting bash used impurely in nix-shell on MacOS. --- pkgs/stdenv/generic/setup.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 1e8b5f57585..dc3369f6611 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -285,10 +285,7 @@ findInputs() { *" $pkg "*) return 0 ;; esac - # For some reason, bash gives us some (hopefully limited) eval - # "for free"! Everything is single-quoted except for `"$var"` - # so `var` is expanded first. - declare -g "$var"'=("${'"$var"'[@]}" "$pkg")' + eval "$var"'+=("$pkg")' if ! [ -e "$pkg" ]; then echo "build input $pkg does not exist" >&2 @@ -318,19 +315,19 @@ findInputs() { if [ -z "$crossConfig" ]; then # Not cross-compiling - both buildInputs (and variants like propagatedBuildInputs) # are handled identically to nativeBuildInputs - declare -ga nativePkgs + declare -a nativePkgs for i in $nativeBuildInputs $buildInputs \ $defaultNativeBuildInputs $defaultBuildInputs \ $propagatedNativeBuildInputs $propagatedBuildInputs; do findInputs "$i" nativePkgs propagated-native-build-inputs done else - declare -ga crossPkgs + declare -a crossPkgs for i in $buildInputs $defaultBuildInputs $propagatedBuildInputs; do findInputs "$i" crossPkgs propagated-build-inputs done - declare -ga nativePkgs + declare -a nativePkgs for i in $nativeBuildInputs $defaultNativeBuildInputs $propagatedNativeBuildInputs; do findInputs "$i" nativePkgs propagated-native-build-inputs done From fd43b508775dd9490cc1314c4239ab48265d4529 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 14 Feb 2017 15:43:03 +0100 Subject: [PATCH 070/108] kbd: 2.0.3 -> 2.0.4 --- pkgs/os-specific/linux/kbd/console-fix.patch | 18 ----- pkgs/os-specific/linux/kbd/default.nix | 17 +++- pkgs/os-specific/linux/kbd/search-paths.patch | 78 +++++++++---------- 3 files changed, 49 insertions(+), 64 deletions(-) delete mode 100644 pkgs/os-specific/linux/kbd/console-fix.patch diff --git a/pkgs/os-specific/linux/kbd/console-fix.patch b/pkgs/os-specific/linux/kbd/console-fix.patch deleted file mode 100644 index aefc20ff914..00000000000 --- a/pkgs/os-specific/linux/kbd/console-fix.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/loadkeys.c b/src/loadkeys.c -index 6b23f68..adf65a0 100644 ---- a/src/loadkeys.c -+++ b/src/loadkeys.c -@@ -166,10 +166,10 @@ main(int argc, char *argv[]) - exit(EXIT_FAILURE); - } - -- /* get console */ -- fd = getfd(console); -- - if (!(options & OPT_M) && !(options & OPT_B)) { -+ /* get console */ -+ fd = getfd(console); -+ - /* check whether the keyboard is in Unicode mode */ - if (ioctl(fd, KDGKBMODE, &kbd_mode) || - ioctl(fd, KDGETMODE, &kd_mode)) { diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index 6e8893cc37d..31fcdae6c80 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -1,12 +1,15 @@ -{ stdenv, fetchurl, autoreconfHook, gzip, bzip2, pkgconfig, flex, check, pam }: +{ stdenv, fetchurl, autoreconfHook, + gzip, bzip2, pkgconfig, flex, check, + pam, coreutils +}: stdenv.mkDerivation rec { name = "kbd-${version}"; - version = "2.0.3"; + version = "2.0.4"; src = fetchurl { url = "mirror://kernel/linux/utils/kbd/${name}.tar.xz"; - sha256 = "0ppv953gn2zylcagr4z6zg5y2x93dxrml29plypg6xgbq3hrv2bs"; + sha256 = "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"; }; configureFlags = [ @@ -15,7 +18,7 @@ stdenv.mkDerivation rec { "--disable-nls" ]; - patches = [ ./console-fix.patch ./search-paths.patch ]; + patches = [ ./search-paths.patch ]; postPatch = '' @@ -34,6 +37,12 @@ stdenv.mkDerivation rec { ''} ''; + postInstall = '' + substituteInPlace $out/bin/unicode_{start,stop} \ + --replace /usr/bin/tty ${coreutils}/bin/tty + ''; + + buildInputs = [ check pam ]; nativeBuildInputs = [ autoreconfHook pkgconfig flex ]; diff --git a/pkgs/os-specific/linux/kbd/search-paths.patch b/pkgs/os-specific/linux/kbd/search-paths.patch index 66a56041481..c9405a56721 100644 --- a/pkgs/os-specific/linux/kbd/search-paths.patch +++ b/pkgs/os-specific/linux/kbd/search-paths.patch @@ -1,77 +1,71 @@ -diff -ru3 kbd-2.0.3-old/src/libkeymap/analyze.l kbd-2.0.3/src/libkeymap/analyze.l ---- kbd-2.0.3-old/src/libkeymap/analyze.l 2016-07-03 02:31:28.258958092 +0300 -+++ kbd-2.0.3/src/libkeymap/analyze.l 2016-07-03 02:44:53.042592223 +0300 -@@ -99,6 +99,9 @@ +--- a/src/libkeymap/analyze.l ++++ b/src/libkeymap/analyze.l +@@ -101,6 +101,9 @@ stack_pop(struct lk_ctx *ctx, void *scan static const char *const include_dirpath0[] = { "", 0 }; static const char *const include_dirpath1[] = { "", "../include/", "../../include/", 0 }; static const char *const include_dirpath3[] = { -+ "/etc/kbd/" KEYMAPDIR "/include/", -+ "/etc/kbd/" KEYMAPDIR "/i386/include/", -+ "/etc/kbd/" KEYMAPDIR "/mac/include/", ++ "/etc/kbd/" KEYMAPDIR "/include/", ++ "/etc/kbd/" KEYMAPDIR "/i386/include/", ++ "/etc/kbd/" KEYMAPDIR "/mac/include/", DATADIR "/" KEYMAPDIR "/include/", DATADIR "/" KEYMAPDIR "/i386/include/", DATADIR "/" KEYMAPDIR "/mac/include/", 0 -diff -ru3 kbd-2.0.3-old/src/loadkeys.c kbd-2.0.3/src/loadkeys.c ---- kbd-2.0.3-old/src/loadkeys.c 2016-07-03 02:31:28.260958091 +0300 -+++ kbd-2.0.3/src/loadkeys.c 2016-07-03 02:34:34.123871103 +0300 -@@ -26,7 +26,7 @@ +--- a/src/loadkeys.c ++++ b/src/loadkeys.c +@@ -27,7 +27,7 @@ #include "keymap.h" - static const char *progname = NULL; + static const char *progname = NULL; -static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", KERNDIR "/", 0 }; +static const char *const dirpath1[] = { "", "/etc/kbd/" KEYMAPDIR "/**", DATADIR "/" KEYMAPDIR "/**", 0 }; static const char *const suffixes[] = { "", ".kmap", ".map", 0 }; - static void __attribute__ ((noreturn)) -diff -ru3 kbd-2.0.3-old/src/loadunimap.c kbd-2.0.3/src/loadunimap.c ---- kbd-2.0.3-old/src/loadunimap.c 2016-07-03 02:31:28.259958091 +0300 -+++ kbd-2.0.3/src/loadunimap.c 2016-07-03 02:33:06.803911971 +0300 -@@ -28,7 +28,7 @@ + static void __attribute__((noreturn)) +--- a/src/loadunimap.c ++++ b/src/loadunimap.c +@@ -30,7 +30,7 @@ extern char *progname; extern int force; --static const char *const unidirpath[] = { "", DATADIR "/" UNIMAPDIR "/", 0 }; -+static const char *const unidirpath[] = { "", "/etc/kbd/" UNIMAPDIR "/", DATADIR "/" UNIMAPDIR "/", 0 }; +-static const char *const unidirpath[] = { "", DATADIR "/" UNIMAPDIR "/", 0 }; ++static const char *const unidirpath[] = { "", "/etc/kbd/" UNIMAPDIR "/", DATADIR "/" UNIMAPDIR "/", 0 }; static const char *const unisuffixes[] = { "", ".uni", ".sfm", 0 }; #ifdef MAIN -diff -ru3 kbd-2.0.3-old/src/mapscrn.c kbd-2.0.3/src/mapscrn.c ---- kbd-2.0.3-old/src/mapscrn.c 2016-07-03 02:31:28.260958091 +0300 -+++ kbd-2.0.3/src/mapscrn.c 2016-07-03 02:33:21.119905270 +0300 -@@ -25,7 +25,7 @@ - static int ctoi (char *); +--- a/src/mapscrn.c ++++ b/src/mapscrn.c +@@ -27,7 +27,7 @@ void loadnewmap(int fd, char *mfil); + static int ctoi(char *); /* search for the map file in these directories (with trailing /) */ --static const char *const mapdirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 }; -+static const char *const mapdirpath[] = { "", "/etc/kbd/" TRANSDIR "/", DATADIR "/" TRANSDIR "/", 0 }; +-static const char *const mapdirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 }; ++static const char *const mapdirpath[] = { "", "/etc/kbd/" TRANSDIR "/", DATADIR "/" TRANSDIR "/", 0 }; static const char *const mapsuffixes[] = { "", ".trans", "_to_uni.trans", ".acm", 0 }; #ifdef MAIN -diff -ru3 kbd-2.0.3-old/src/resizecons.c kbd-2.0.3/src/resizecons.c ---- kbd-2.0.3-old/src/resizecons.c 2016-07-03 02:31:28.260958091 +0300 -+++ kbd-2.0.3/src/resizecons.c 2016-07-03 02:33:32.253900060 +0300 -@@ -100,7 +100,7 @@ +--- a/src/resizecons.c ++++ b/src/resizecons.c +@@ -101,7 +101,7 @@ static int vga_get_fontheight(void); static void vga_set_cursor(int, int); static void vga_set_verticaldisplayend_lowbyte(int); --const char *const dirpath[] = { "", DATADIR "/" VIDEOMODEDIR "/", 0}; -+const char *const dirpath[] = { "", "/etc/kbd/" VIDEOMODEDIR "/", DATADIR "/" VIDEOMODEDIR "/", 0}; +-const char *const dirpath[] = { "", DATADIR "/" VIDEOMODEDIR "/", 0 }; ++const char *const dirpath[] = { "", "/etc/kbd/" VIDEOMODEDIR "/", DATADIR "/" VIDEOMODEDIR "/", 0}; const char *const suffixes[] = { "", 0 }; - int -diff -ru3 kbd-2.0.3-old/src/setfont.c kbd-2.0.3/src/setfont.c ---- kbd-2.0.3-old/src/setfont.c 2016-07-03 02:31:28.260958091 +0300 -+++ kbd-2.0.3/src/setfont.c 2016-07-03 02:33:54.315889734 +0300 -@@ -51,10 +51,10 @@ - int debug = 0; + int main(int argc, char **argv) +--- a/src/setfont.c ++++ b/src/setfont.c +@@ -53,10 +53,10 @@ int force = 0; + int debug = 0; /* search for the font in these directories (with trailing /) */ --const char *const fontdirpath[] = { "", DATADIR "/" FONTDIR "/", 0 }; -+const char *const fontdirpath[] = { "", "/etc/kbd/" FONTDIR "/", DATADIR "/" FONTDIR "/", 0 }; +-const char *const fontdirpath[] = { "", DATADIR "/" FONTDIR "/", 0 }; ++const char *const fontdirpath[] = { "", "/etc/kbd/" FONTDIR "/", DATADIR "/" FONTDIR "/", 0 }; const char *const fontsuffixes[] = { "", ".psfu", ".psf", ".cp", ".fnt", 0 }; /* hide partial fonts a bit - loading a single one is a bad idea */ --const char *const partfontdirpath[] = { "", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; -+const char *const partfontdirpath[] = { "", "/etc/kbd/" FONTDIR "/" PARTIALDIR "/", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; +-const char *const partfontdirpath[] = { "", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; ++const char *const partfontdirpath[] = { "", "/etc/kbd/" FONTDIR "/" PARTIALDIR "/", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; const char *const partfontsuffixes[] = { "", 0 }; static inline int From 00bf3a9dcaffedc4eaf244848a2a3f84e648bdba Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Fri, 28 Jul 2017 16:10:07 +0200 Subject: [PATCH 071/108] Revert "kbd: 2.0.3 -> 2.0.4" This reverts commit fd43b508775dd9490cc1314c4239ab48265d4529. ``` substitute(): ERROR: Invalid command line argument: /nix/store/8f42syfzv3cpw3jjq96sdzvnclivi783-kbd-2.0.4/bin/unicode_stop ``` @rnhmjoj please check --- pkgs/os-specific/linux/kbd/console-fix.patch | 18 +++++ pkgs/os-specific/linux/kbd/default.nix | 17 +--- pkgs/os-specific/linux/kbd/search-paths.patch | 78 ++++++++++--------- 3 files changed, 64 insertions(+), 49 deletions(-) create mode 100644 pkgs/os-specific/linux/kbd/console-fix.patch diff --git a/pkgs/os-specific/linux/kbd/console-fix.patch b/pkgs/os-specific/linux/kbd/console-fix.patch new file mode 100644 index 00000000000..aefc20ff914 --- /dev/null +++ b/pkgs/os-specific/linux/kbd/console-fix.patch @@ -0,0 +1,18 @@ +diff --git a/src/loadkeys.c b/src/loadkeys.c +index 6b23f68..adf65a0 100644 +--- a/src/loadkeys.c ++++ b/src/loadkeys.c +@@ -166,10 +166,10 @@ main(int argc, char *argv[]) + exit(EXIT_FAILURE); + } + +- /* get console */ +- fd = getfd(console); +- + if (!(options & OPT_M) && !(options & OPT_B)) { ++ /* get console */ ++ fd = getfd(console); ++ + /* check whether the keyboard is in Unicode mode */ + if (ioctl(fd, KDGKBMODE, &kbd_mode) || + ioctl(fd, KDGETMODE, &kd_mode)) { diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index 31fcdae6c80..6e8893cc37d 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -1,15 +1,12 @@ -{ stdenv, fetchurl, autoreconfHook, - gzip, bzip2, pkgconfig, flex, check, - pam, coreutils -}: +{ stdenv, fetchurl, autoreconfHook, gzip, bzip2, pkgconfig, flex, check, pam }: stdenv.mkDerivation rec { name = "kbd-${version}"; - version = "2.0.4"; + version = "2.0.3"; src = fetchurl { url = "mirror://kernel/linux/utils/kbd/${name}.tar.xz"; - sha256 = "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"; + sha256 = "0ppv953gn2zylcagr4z6zg5y2x93dxrml29plypg6xgbq3hrv2bs"; }; configureFlags = [ @@ -18,7 +15,7 @@ stdenv.mkDerivation rec { "--disable-nls" ]; - patches = [ ./search-paths.patch ]; + patches = [ ./console-fix.patch ./search-paths.patch ]; postPatch = '' @@ -37,12 +34,6 @@ stdenv.mkDerivation rec { ''} ''; - postInstall = '' - substituteInPlace $out/bin/unicode_{start,stop} \ - --replace /usr/bin/tty ${coreutils}/bin/tty - ''; - - buildInputs = [ check pam ]; nativeBuildInputs = [ autoreconfHook pkgconfig flex ]; diff --git a/pkgs/os-specific/linux/kbd/search-paths.patch b/pkgs/os-specific/linux/kbd/search-paths.patch index c9405a56721..66a56041481 100644 --- a/pkgs/os-specific/linux/kbd/search-paths.patch +++ b/pkgs/os-specific/linux/kbd/search-paths.patch @@ -1,71 +1,77 @@ ---- a/src/libkeymap/analyze.l -+++ b/src/libkeymap/analyze.l -@@ -101,6 +101,9 @@ stack_pop(struct lk_ctx *ctx, void *scan +diff -ru3 kbd-2.0.3-old/src/libkeymap/analyze.l kbd-2.0.3/src/libkeymap/analyze.l +--- kbd-2.0.3-old/src/libkeymap/analyze.l 2016-07-03 02:31:28.258958092 +0300 ++++ kbd-2.0.3/src/libkeymap/analyze.l 2016-07-03 02:44:53.042592223 +0300 +@@ -99,6 +99,9 @@ static const char *const include_dirpath0[] = { "", 0 }; static const char *const include_dirpath1[] = { "", "../include/", "../../include/", 0 }; static const char *const include_dirpath3[] = { -+ "/etc/kbd/" KEYMAPDIR "/include/", -+ "/etc/kbd/" KEYMAPDIR "/i386/include/", -+ "/etc/kbd/" KEYMAPDIR "/mac/include/", ++ "/etc/kbd/" KEYMAPDIR "/include/", ++ "/etc/kbd/" KEYMAPDIR "/i386/include/", ++ "/etc/kbd/" KEYMAPDIR "/mac/include/", DATADIR "/" KEYMAPDIR "/include/", DATADIR "/" KEYMAPDIR "/i386/include/", DATADIR "/" KEYMAPDIR "/mac/include/", 0 ---- a/src/loadkeys.c -+++ b/src/loadkeys.c -@@ -27,7 +27,7 @@ +diff -ru3 kbd-2.0.3-old/src/loadkeys.c kbd-2.0.3/src/loadkeys.c +--- kbd-2.0.3-old/src/loadkeys.c 2016-07-03 02:31:28.260958091 +0300 ++++ kbd-2.0.3/src/loadkeys.c 2016-07-03 02:34:34.123871103 +0300 +@@ -26,7 +26,7 @@ #include "keymap.h" - static const char *progname = NULL; + static const char *progname = NULL; -static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", KERNDIR "/", 0 }; +static const char *const dirpath1[] = { "", "/etc/kbd/" KEYMAPDIR "/**", DATADIR "/" KEYMAPDIR "/**", 0 }; static const char *const suffixes[] = { "", ".kmap", ".map", 0 }; - static void __attribute__((noreturn)) ---- a/src/loadunimap.c -+++ b/src/loadunimap.c -@@ -30,7 +30,7 @@ + static void __attribute__ ((noreturn)) +diff -ru3 kbd-2.0.3-old/src/loadunimap.c kbd-2.0.3/src/loadunimap.c +--- kbd-2.0.3-old/src/loadunimap.c 2016-07-03 02:31:28.259958091 +0300 ++++ kbd-2.0.3/src/loadunimap.c 2016-07-03 02:33:06.803911971 +0300 +@@ -28,7 +28,7 @@ extern char *progname; extern int force; --static const char *const unidirpath[] = { "", DATADIR "/" UNIMAPDIR "/", 0 }; -+static const char *const unidirpath[] = { "", "/etc/kbd/" UNIMAPDIR "/", DATADIR "/" UNIMAPDIR "/", 0 }; +-static const char *const unidirpath[] = { "", DATADIR "/" UNIMAPDIR "/", 0 }; ++static const char *const unidirpath[] = { "", "/etc/kbd/" UNIMAPDIR "/", DATADIR "/" UNIMAPDIR "/", 0 }; static const char *const unisuffixes[] = { "", ".uni", ".sfm", 0 }; #ifdef MAIN ---- a/src/mapscrn.c -+++ b/src/mapscrn.c -@@ -27,7 +27,7 @@ void loadnewmap(int fd, char *mfil); - static int ctoi(char *); +diff -ru3 kbd-2.0.3-old/src/mapscrn.c kbd-2.0.3/src/mapscrn.c +--- kbd-2.0.3-old/src/mapscrn.c 2016-07-03 02:31:28.260958091 +0300 ++++ kbd-2.0.3/src/mapscrn.c 2016-07-03 02:33:21.119905270 +0300 +@@ -25,7 +25,7 @@ + static int ctoi (char *); /* search for the map file in these directories (with trailing /) */ --static const char *const mapdirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 }; -+static const char *const mapdirpath[] = { "", "/etc/kbd/" TRANSDIR "/", DATADIR "/" TRANSDIR "/", 0 }; +-static const char *const mapdirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 }; ++static const char *const mapdirpath[] = { "", "/etc/kbd/" TRANSDIR "/", DATADIR "/" TRANSDIR "/", 0 }; static const char *const mapsuffixes[] = { "", ".trans", "_to_uni.trans", ".acm", 0 }; #ifdef MAIN ---- a/src/resizecons.c -+++ b/src/resizecons.c -@@ -101,7 +101,7 @@ static int vga_get_fontheight(void); +diff -ru3 kbd-2.0.3-old/src/resizecons.c kbd-2.0.3/src/resizecons.c +--- kbd-2.0.3-old/src/resizecons.c 2016-07-03 02:31:28.260958091 +0300 ++++ kbd-2.0.3/src/resizecons.c 2016-07-03 02:33:32.253900060 +0300 +@@ -100,7 +100,7 @@ static void vga_set_cursor(int, int); static void vga_set_verticaldisplayend_lowbyte(int); --const char *const dirpath[] = { "", DATADIR "/" VIDEOMODEDIR "/", 0 }; -+const char *const dirpath[] = { "", "/etc/kbd/" VIDEOMODEDIR "/", DATADIR "/" VIDEOMODEDIR "/", 0}; +-const char *const dirpath[] = { "", DATADIR "/" VIDEOMODEDIR "/", 0}; ++const char *const dirpath[] = { "", "/etc/kbd/" VIDEOMODEDIR "/", DATADIR "/" VIDEOMODEDIR "/", 0}; const char *const suffixes[] = { "", 0 }; - int main(int argc, char **argv) ---- a/src/setfont.c -+++ b/src/setfont.c -@@ -53,10 +53,10 @@ int force = 0; - int debug = 0; + int +diff -ru3 kbd-2.0.3-old/src/setfont.c kbd-2.0.3/src/setfont.c +--- kbd-2.0.3-old/src/setfont.c 2016-07-03 02:31:28.260958091 +0300 ++++ kbd-2.0.3/src/setfont.c 2016-07-03 02:33:54.315889734 +0300 +@@ -51,10 +51,10 @@ + int debug = 0; /* search for the font in these directories (with trailing /) */ --const char *const fontdirpath[] = { "", DATADIR "/" FONTDIR "/", 0 }; -+const char *const fontdirpath[] = { "", "/etc/kbd/" FONTDIR "/", DATADIR "/" FONTDIR "/", 0 }; +-const char *const fontdirpath[] = { "", DATADIR "/" FONTDIR "/", 0 }; ++const char *const fontdirpath[] = { "", "/etc/kbd/" FONTDIR "/", DATADIR "/" FONTDIR "/", 0 }; const char *const fontsuffixes[] = { "", ".psfu", ".psf", ".cp", ".fnt", 0 }; /* hide partial fonts a bit - loading a single one is a bad idea */ --const char *const partfontdirpath[] = { "", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; -+const char *const partfontdirpath[] = { "", "/etc/kbd/" FONTDIR "/" PARTIALDIR "/", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; +-const char *const partfontdirpath[] = { "", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; ++const char *const partfontdirpath[] = { "", "/etc/kbd/" FONTDIR "/" PARTIALDIR "/", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; const char *const partfontsuffixes[] = { "", 0 }; static inline int From b5f436cf0ec148bed1f901a2bccabb366fc49753 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sat, 22 Jul 2017 10:20:26 +0800 Subject: [PATCH 072/108] pythonPackages.zconfig: Add missing build-time only dependencies --- pkgs/development/python-modules/zconfig/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/zconfig/default.nix b/pkgs/development/python-modules/zconfig/default.nix index aa90bf0ce1a..5e7c762d03a 100644 --- a/pkgs/development/python-modules/zconfig/default.nix +++ b/pkgs/development/python-modules/zconfig/default.nix @@ -2,6 +2,8 @@ , fetchPypi , buildPythonPackage , zope_testrunner +, manuel +, docutils }: buildPythonPackage rec { @@ -16,6 +18,7 @@ buildPythonPackage rec { patches = [ ./skip-broken-test.patch ]; + buildInputs = [ manuel docutils ]; propagatedBuildInputs = [ zope_testrunner ]; meta = with stdenv.lib; { From 1d6aa6581ade284c567575db14a09e0283b52f99 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sat, 22 Jul 2017 10:20:45 +0800 Subject: [PATCH 073/108] pythonPackages.btrees: Add missing build-time only dependencies --- pkgs/development/python-modules/btrees/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/btrees/default.nix b/pkgs/development/python-modules/btrees/default.nix index 7cb10d96f90..7bfad0d4f5e 100644 --- a/pkgs/development/python-modules/btrees/default.nix +++ b/pkgs/development/python-modules/btrees/default.nix @@ -5,7 +5,8 @@ buildPythonPackage rec { version = "4.4.1"; name = "${pname}-${version}"; - propagatedBuildInputs = [ persistent zope_interface transaction ]; + buildInputs = [ transaction ]; + propagatedBuildInputs = [ persistent zope_interface ]; src = fetchPypi { inherit pname version; From 2e34c6d8a957df89d193025060f2f195e9452220 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sat, 22 Jul 2017 10:23:02 +0800 Subject: [PATCH 074/108] pythonPackages.zc_lockfile: 1.0.2 -> 1.2.1 --- .../python-modules/zc_lockfile/default.nix | 27 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 18 +------------ 2 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 pkgs/development/python-modules/zc_lockfile/default.nix diff --git a/pkgs/development/python-modules/zc_lockfile/default.nix b/pkgs/development/python-modules/zc_lockfile/default.nix new file mode 100644 index 00000000000..8a438fadcd7 --- /dev/null +++ b/pkgs/development/python-modules/zc_lockfile/default.nix @@ -0,0 +1,27 @@ +{ buildPythonPackage +, fetchPypi +, mock +, zope_testing +, stdenv +}: + +buildPythonPackage rec { + pname = "zc.lockfile"; + version = "1.2.1"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "11db91ada7f22fe8aae268d4bfdeae012c4fe655f66bbb315b00822ec00d043e"; + }; + + buildInputs = [ mock ]; + propagatedBuildInputs = [ zope_testing ]; + + meta = with stdenv.lib; { + description = "Inter-process locks"; + homepage = http://www.python.org/pypi/zc.lockfile; + license = licenses.zpt20; + maintainers = with maintainers; [ goibhniu ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1b97d88c045..86711d154bb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -24943,23 +24943,7 @@ EOF zconfig = callPackage ../development/python-modules/zconfig { }; - zc_lockfile = buildPythonPackage rec { - name = "zc.lockfile-${version}"; - version = "1.0.2"; - - src = pkgs.fetchurl { - url = "mirror://pypi/z/zc.lockfile/${name}.tar.gz"; - sha256 = "96bb2aa0438f3e29a31e4702316f832ec1482837daef729a92e28c202d8fba5c"; - }; - - meta = { - description = "Inter-process locks"; - homepage = http://www.python.org/pypi/zc.lockfile; - license = licenses.zpt20; - maintainers = with maintainers; [ goibhniu ]; - }; - }; - + zc_lockfile = callPackage ../development/python-modules/zc_lockfile { }; zdaemon = buildPythonPackage rec { name = "zdaemon-${version}"; From 61e73427e00e0eb5419ebbdb2e96ccacc513532b Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sat, 22 Jul 2017 10:24:43 +0800 Subject: [PATCH 075/108] pythonPackages.zodbpickle: 0.5.2 -> 0.6.0 --- .../python-modules/zodbpickle/default.nix | 23 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 17 +------------- 2 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 pkgs/development/python-modules/zodbpickle/default.nix diff --git a/pkgs/development/python-modules/zodbpickle/default.nix b/pkgs/development/python-modules/zodbpickle/default.nix new file mode 100644 index 00000000000..f51b30ab51e --- /dev/null +++ b/pkgs/development/python-modules/zodbpickle/default.nix @@ -0,0 +1,23 @@ +{ buildPythonPackage +, isPyPy +, fetchPypi +}: + +buildPythonPackage rec { + pname = "zodbpickle"; + version = "0.6.0"; + name = "${pname}-${version}"; + disabled = isPyPy; # https://github.com/zopefoundation/zodbpickle/issues/10 + + src = fetchPypi { + inherit pname version; + sha256 = "ea3248be966159e7791e3db0e35ea992b9235d52e7d39835438686741d196665"; + }; + + # fails.. + doCheck = false; + + meta = { + homepage = http://pypi.python.org/pypi/zodbpickle; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 86711d154bb..e4a7a349fa3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -25045,22 +25045,7 @@ EOF }; }; - zodbpickle = self.buildPythonPackage rec { - name = "zodbpickle-0.5.2"; - disabled = isPyPy; # https://github.com/zopefoundation/zodbpickle/issues/10 - - src = pkgs.fetchurl { - url = "mirror://pypi/z/zodbpickle/${name}.tar.gz"; - sha256 = "f65c00fbc13523fced63de6cc11747aa1a6343aeb2895c89838ed55a5ab12cca"; - }; - - # fails.. - doCheck = false; - - meta = { - homepage = http://pypi.python.org/pypi/zodbpickle; - }; - }; + zodbpickle = callPackage ../development/python-modules/zodbpickle {}; BTrees = callPackage ../development/python-modules/btrees {}; From 6bd2ac77075ec8b16094ef566b0b515faf8d0106 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sat, 22 Jul 2017 10:26:28 +0800 Subject: [PATCH 076/108] pythonPackages.persistent: 4.0.8 -> 4.2.4.2 --- .../python-modules/persistent/default.nix | 23 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 16 +------------ 2 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 pkgs/development/python-modules/persistent/default.nix diff --git a/pkgs/development/python-modules/persistent/default.nix b/pkgs/development/python-modules/persistent/default.nix new file mode 100644 index 00000000000..4940a8b2e04 --- /dev/null +++ b/pkgs/development/python-modules/persistent/default.nix @@ -0,0 +1,23 @@ +{ buildPythonPackage +, fetchPypi +, zope_interface +, pkgs +}: + +buildPythonPackage rec { + pname = "persistent"; + version = "4.2.4.2"; + name = "${pname}-${version}"; + + propagatedBuildInputs = [ zope_interface ]; + + src = fetchPypi { + inherit pname version; + sha256 = "cf264cd55866c7ffbcbe1328f8d8b28fd042a5dd0c03a03f68c0887df3aa1964"; + }; + + meta = { + description = "Automatic persistence for Python objects"; + homepage = http://www.zope.org/Products/ZODB; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e4a7a349fa3..276c2539926 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -25049,21 +25049,7 @@ EOF BTrees = callPackage ../development/python-modules/btrees {}; - persistent = self.buildPythonPackage rec { - name = "persistent-4.0.8"; - - propagatedBuildInputs = with self; [ zope_interface ]; - - src = pkgs.fetchurl { - url = "mirror://pypi/p/persistent/${name}.tar.gz"; - sha256 = "678902217c5370d33694c6dc95b89e1e6284b4dc41f04c056326194a3f6f3e22"; - }; - - meta = { - description = "Automatic persistence for Python objects"; - homepage = http://www.zope.org/Products/ZODB; - }; - }; + persistent = callPackage ../development/python-modules/persistent {}; xdot = buildPythonPackage rec { name = "xdot-0.7"; From fcb6e72ddf7d3fe43df23998147164abba8b6e63 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sat, 22 Jul 2017 10:28:43 +0800 Subject: [PATCH 077/108] vulnix: use zc_lockfile, zodbpickle and persistent from pythonPackages --- pkgs/tools/security/vulnix/requirements.nix | 96 ++++----------------- 1 file changed, 16 insertions(+), 80 deletions(-) diff --git a/pkgs/tools/security/vulnix/requirements.nix b/pkgs/tools/security/vulnix/requirements.nix index 11faca44ef9..d44d49f12a9 100644 --- a/pkgs/tools/security/vulnix/requirements.nix +++ b/pkgs/tools/security/vulnix/requirements.nix @@ -1,38 +1,6 @@ { pythonPackages, fetchurl, stdenv }: rec { - BTrees = pythonPackages.buildPythonPackage { - name = "BTrees-4.3.1"; - src = fetchurl { - url = "https://pypi.python.org/packages/24/76/cd6f225f2180c22af5cdb6656f51aec5fca45e45bdc4fa75c0a32f161a61/BTrees-4.3.1.tar.gz"; - sha256 = "2565b7d35260dfc6b1e2934470fd0a2f9326c58c535a2b4cb396289d1c195a95"; - }; - propagatedBuildInputs = [ - persistent - transaction - ] ++ (with pythonPackages; [ zope_interface coverage ]); - - meta = with stdenv.lib; { - homepage = ""; - license = licenses.zpt21; - description = "Scalable persistent object containers"; - }; - }; - - ZConfig = pythonPackages.buildPythonPackage { - name = "ZConfig-3.1.0"; - src = fetchurl { - url = "https://pypi.python.org/packages/52/b3/a96d62711a26d8cfbe546519975dc9ed54d2eb50b3238d2e6de045764796/ZConfig-3.1.0.tar.gz"; - sha256 = "c21fa3a073a56925a8098036d46717392994a92cffea1b3cda3176b70c0a842e"; - }; - propagatedBuildInputs = with pythonPackages; [ zope_testrunner ]; - meta = with stdenv.lib; { - homepage = ""; - license = licenses.zpt21; - description = "Structured Configuration Library"; - }; - }; - zodb = pythonPackages.buildPythonPackage { name = "ZODB-5.2.0"; src = fetchurl { @@ -41,13 +9,18 @@ rec { }; doCheck = false; propagatedBuildInputs = [ - BTrees - persistent transaction - ZConfig - zc.lockfile + ] ++ (with pythonPackages; [ + six + wheel + zope_interface zodbpickle - ] ++ (with pythonPackages; [ six wheel zope_interface ]); + zconfig + persistent + zc_lockfile + BTrees + ]); + meta = with stdenv.lib; { homepage = ""; license = licenses.zpt21; @@ -55,59 +28,22 @@ rec { }; }; - persistent = pythonPackages.buildPythonPackage { - name = "persistent-4.2.2"; - src = fetchurl { - url = "https://pypi.python.org/packages/3d/71/3302512282b606ec4d054e09be24c065915518903b29380b6573bff79c24/persistent-4.2.2.tar.gz"; - sha256 = "52ececc6dbba5ef572d3435189318b4dff07675bafa9620e32f785e147c6563c"; - }; - propagatedBuildInputs = with pythonPackages; [ zope_interface six wheel ]; - meta = with stdenv.lib; { - homepage = ""; - license = licenses.zpt21; - description = "Translucent persistent objects"; - }; - }; - transaction = pythonPackages.buildPythonPackage { name = "transaction-2.0.3"; src = fetchurl { url = "https://pypi.python.org/packages/8c/af/3ffafe85bcc93ecb09459f3f2bd8fbe142e9ab34048f9e2774543b470cbd/transaction-2.0.3.tar.gz"; sha256 = "67bfb81309ba9717edbb2ca2e5717c325b78beec0bf19f44e5b4b9410f82df7f"; }; - propagatedBuildInputs = with pythonPackages; [ zope_interface six wheel ]; + propagatedBuildInputs = with pythonPackages; [ + zope_interface + six + wheel + mock + ]; meta = with stdenv.lib; { homepage = ""; license = licenses.zpt21; description = "Transaction management for Python"; }; }; - - zc.lockfile = pythonPackages.buildPythonPackage { - name = "zc.lockfile-1.2.1"; - src = fetchurl { - url = "https://pypi.python.org/packages/bd/84/0299bbabbc9d3f84f718ba1039cc068030d3ad723c08f82a64337edf901e/zc.lockfile-1.2.1.tar.gz"; - sha256 = "11db91ada7f22fe8aae268d4bfdeae012c4fe655f66bbb315b00822ec00d043e"; - }; - meta = with stdenv.lib; { - homepage = ""; - license = licenses.zpt21; - description = "Basic inter-process locks"; - }; - }; - - zodbpickle = pythonPackages.buildPythonPackage { - name = "zodbpickle-0.6.0"; - src = fetchurl { - url = "https://pypi.python.org/packages/7a/fc/f6f437a5222b330735eaf8f1e67a6845bd1b600e9a9455e552d3c13c4902/zodbpickle-0.6.0.tar.gz"; - sha256 = "ea3248be966159e7791e3db0e35ea992b9235d52e7d39835438686741d196665"; - }; - doCheck = false; - - meta = with stdenv.lib; { - homepage = ""; - license = licenses.zpt21; - description = "Fork of Python 3 pickle module."; - }; - }; } From ee38a35f95d16b8cbf0d462aa3285448424098f5 Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Sat, 8 Jul 2017 23:32:01 +0000 Subject: [PATCH 078/108] pythonPackages.dkimpy: 0.6.1 -> 0.6.2 --- .../python-modules/dkimpy/default.nix | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/dkimpy/default.nix b/pkgs/development/python-modules/dkimpy/default.nix index df768f5d122..e32a9262f53 100644 --- a/pkgs/development/python-modules/dkimpy/default.nix +++ b/pkgs/development/python-modules/dkimpy/default.nix @@ -5,19 +5,24 @@ buildPythonApplication rec { name = "${pname}-${majorversion}.${minorversion}"; pname = "dkimpy"; majorversion = "0.6"; - minorversion = "1"; + minorversion = "2"; src = fetchurl { url = "https://launchpad.net/${pname}/${majorversion}/${majorversion}.${minorversion}/+download/${name}.tar.gz"; - sha256 = "0zmvyw18ww1jqrbqws636w3xki59fyqva553r6s74q5c4jvy36v2"; + sha256 = "1hagz8qk0v4ijfbcdq4z28bpgr2mkpr498z76i1vam2d50chmakl"; }; buildInputs = [ pytest ]; propagatedBuildInputs = [ openssl dns ]; - patchPhase = ''substituteInPlace dknewkey.py --replace \ - /usr/bin/openssl ${openssl}/bin/openssl - ''; + patchPhase = '' + substituteInPlace dknewkey.py --replace \ + /usr/bin/openssl ${openssl}/bin/openssl + ''; + + checkPhase = '' + python ./test.py + ''; postInstall = '' mkdir -p $out/bin $out/libexec @@ -27,15 +32,16 @@ buildPythonApplication rec { makeWrapper "$out/libexec/arcverify.py" $out/bin/arcverify makeWrapper "$out/libexec/arcsign.py" $out/bin/arcsign makeWrapper "$out/libexec/dknewkey.py" $out/bin/dknewkey - ''; + ''; meta = with stdenv.lib; { description = "DKIM + ARC email signing/verification tools + Python module"; - longDescription = ''Python module that implements DKIM (DomainKeys Identified Mail) - email signing and verification. It also provides a number of convєnient tools - for command line signing and verification, as well as generating new DKIM records. - This version also supports the experimental Authenticated Received Chain (ARC) - protocol. + longDescription = '' + Python module that implements DKIM (DomainKeys Identified Mail) email + signing and verification. It also provides a number of convєnient tools + for command line signing and verification, as well as generating new DKIM + records. This version also supports the experimental Authenticated + Received Chain (ARC) protocol. ''; homepage = "https://launchpad.net/dkimpy"; license = licenses.bsd3; From cecbb9fdf6a0b46a5714fd78c5a844d663fde3d7 Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Sat, 8 Jul 2017 23:13:57 +0000 Subject: [PATCH 079/108] dnspython: 1.14.0 -> 1.15.0 --- .../python-modules/dns/default.nix | 23 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 20 +--------------- 2 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 pkgs/development/python-modules/dns/default.nix diff --git a/pkgs/development/python-modules/dns/default.nix b/pkgs/development/python-modules/dns/default.nix new file mode 100644 index 00000000000..0548c5a1098 --- /dev/null +++ b/pkgs/development/python-modules/dns/default.nix @@ -0,0 +1,23 @@ +{ buildPythonPackage, fetchPypi, lib }: + +buildPythonPackage rec { + pname = "dnspython"; + version = "1.15.0"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + extension = "zip"; + sha256 = "0z5d9vwf211v54bybrhm3qpxclys4dfdfsp7lk2hvf57yzhn7xa0"; + }; + + # needs networking for some tests + doCheck = false; + + meta = { + description = "A DNS toolkit for Python 3.x"; + homepage = http://www.dnspython.org; + # BSD-like, check http://www.dnspython.org/LICENSE for details + license = lib.licenses.free; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 276c2539926..c5d685bbd30 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5321,25 +5321,7 @@ in { }; }; - dns = buildPythonPackage rec { - name = "dnspython-${version}"; - version = "1.14.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/d/dnspython/${name}.zip"; - sha256 = "1p1i46fyhxfic8mfh3gfckpn2pn7282xqabhihiqymrp4sa8ni91"; - }; - - # needs networking for some tests - doCheck = false; - - meta = { - description = "A DNS toolkit for Python 3.x"; - homepage = http://www.dnspython.org; - # BSD-like, check http://www.dnspython.org/LICENSE for details - license = licenses.free; - }; - }; + dns = callPackage ../development/python-modules/dns { }; docker = callPackage ../development/python-modules/docker.nix {}; From cb77b9c2e9ece07ee7e966548bafd7fac88bbc72 Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Sun, 9 Jul 2017 00:01:12 +0000 Subject: [PATCH 080/108] formencode: update for dnspython --- .../python-modules/FormEncode/default.nix | 32 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 25 +-------------- 2 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 pkgs/development/python-modules/FormEncode/default.nix diff --git a/pkgs/development/python-modules/FormEncode/default.nix b/pkgs/development/python-modules/FormEncode/default.nix new file mode 100644 index 00000000000..f0ccead6059 --- /dev/null +++ b/pkgs/development/python-modules/FormEncode/default.nix @@ -0,0 +1,32 @@ +{ stdenv, buildPythonPackage, fetchPypi, dns, pycountry, nose }: + +buildPythonPackage rec { + pname = "FormEncode"; + version = "1.3.0"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + extension = "zip"; + sha256 = "0y5gywq0l79l85ylr55p4xy0h921zgmfw6zmrvlh83aa4j074xg6"; + }; + + buildInputs = [ dns pycountry nose ]; + + patchPhase = '' + # dnspython3 has been superseded, see its PyPI page + substituteInPlace setup.py --replace dnspython3 dnspython + ''; + + preCheck = '' + # two tests require dns resolving + sed -i 's/test_cyrillic_email/noop/' formencode/tests/test_email.py + sed -i 's/test_unicode_ascii_subgroup/noop/' formencode/tests/test_email.py + ''; + + meta = with stdenv.lib; { + description = "FormEncode validates and converts nested structures"; + homepage = "http://formencode.org"; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c5d685bbd30..6a1b3365cc6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15957,30 +15957,7 @@ in { ''; }; - FormEncode = buildPythonPackage rec { - name = "FormEncode-${version}"; - version = "1.3.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/F/FormEncode/${name}.zip"; - sha256 = "0y5gywq0l79l85ylr55p4xy0h921zgmfw6zmrvlh83aa4j074xg6"; - }; - - buildInputs = with self; [ - dns pycountry nose - ]; - - preCheck = '' - # two tests require dns resolving - sed -i 's/test_cyrillic_email/noop/' formencode/tests/test_email.py - sed -i 's/test_unicode_ascii_subgroup/noop/' formencode/tests/test_email.py - ''; - - meta = with stdenv.lib; { - description = "FormEncode validates and converts nested structures"; - homepage = "http://formencode.org"; - }; - }; + FormEncode = callPackage ../development/python-modules/FormEncode { }; pycountry = buildPythonPackage rec { name = "pycountry-${version}"; From d2c0a46797cdb3d8fe337a8d77ae7870e3cc9fef Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Mon, 3 Jul 2017 23:30:58 +0000 Subject: [PATCH 081/108] email_validator: init at 1.0.2 --- .../email-validator/default.nix | 27 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/development/python-modules/email-validator/default.nix diff --git a/pkgs/development/python-modules/email-validator/default.nix b/pkgs/development/python-modules/email-validator/default.nix new file mode 100644 index 00000000000..4fc78d8bd1e --- /dev/null +++ b/pkgs/development/python-modules/email-validator/default.nix @@ -0,0 +1,27 @@ +{ stdenv, lib, buildPythonPackage, fetchPypi, isPy3k, dns, idna, ipaddress }: + +buildPythonPackage rec { + pname = "email_validator"; + version = "1.0.2"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "1ja9149l9ck5n45a72h3is7v476hjny5ybxbcamx1nw6iplsm7k6"; + }; + + doCheck = false; + + propagatedBuildInputs = [ + dns + idna + ] ++ (if isPy3k then [ ] else [ ipaddress ]); + + meta = with lib; { + description = "A robust email syntax and deliverability validation library for Python 2.x/3.x."; + homepage = https://github.com/JoshData/python-email-validator; + license = licenses.cc0; + maintainers = with maintainers; [ siddharthist ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6a1b3365cc6..475205d25d7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -136,6 +136,8 @@ in { emcee = callPackage ../development/python-modules/emcee { }; + email_validator = callPackage ../development/python-modules/email-validator { }; + dbus-python = callPackage ../development/python-modules/dbus { dbus = pkgs.dbus; }; From 822b09a5145c08e116451a9dfc248def12c5e90c Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Mon, 3 Jul 2017 23:31:49 +0000 Subject: [PATCH 082/108] ukpostcodeparser: init at 1.1.0 --- .../ukpostcodeparser/default.nix | 22 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/python-modules/ukpostcodeparser/default.nix diff --git a/pkgs/development/python-modules/ukpostcodeparser/default.nix b/pkgs/development/python-modules/ukpostcodeparser/default.nix new file mode 100644 index 00000000000..6eae1f52456 --- /dev/null +++ b/pkgs/development/python-modules/ukpostcodeparser/default.nix @@ -0,0 +1,22 @@ +{ stdenv, lib, buildPythonPackage, fetchPypi }: + +buildPythonPackage rec { + pname = "UkPostcodeParser"; + version = "1.1.0"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "1v8k91xhg5fr6sk91am93abjarw950ray7b9q3w5j25agjsxgcsf"; + }; + + doCheck = false; + + meta = with lib; { + description = "UK Postcode parser"; + homepage = https://github.com/hamstah/ukpostcodeparser; + license = licenses.publicDomain; + maintainers = with maintainers; [ siddharthist ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 475205d25d7..2bb2b161cce 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -24018,6 +24018,8 @@ in { u-msgpack-python = callPackage ../development/python-modules/u-msgpack-python { }; + ukpostcodeparser = callPackage ../development/python-modules/ukpostcodeparser { }; + umalqurra = buildPythonPackage rec { name = "umalqurra-${version}"; version = "0.2"; From 0dea2d20a74aa0a56f0d7044b43b66b423331177 Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Mon, 3 Jul 2017 23:33:04 +0000 Subject: [PATCH 083/108] faker: 0.0.4 -> 0.7.17 --- .../python-modules/faker/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 17 +-------- 2 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 pkgs/development/python-modules/faker/default.nix diff --git a/pkgs/development/python-modules/faker/default.nix b/pkgs/development/python-modules/faker/default.nix new file mode 100644 index 00000000000..d5934f38b88 --- /dev/null +++ b/pkgs/development/python-modules/faker/default.nix @@ -0,0 +1,36 @@ +{ stdenv, lib, buildPythonPackage, fetchPypi, + # Build inputs + dateutil, six, + # Test inputs + email_validator, nose, mock, ukpostcodeparser }: + +buildPythonPackage rec { + pname = "Faker"; + version = "0.7.17"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "0n4achwr6dcf67n983ls5cbp5ic3jrwsbl92rzjlzb1xvz1s1js9"; + }; + + checkInputs = [ + email_validator + nose + mock + ukpostcodeparser + ]; + + propagatedBuildInputs = [ + dateutil + six + ]; + + meta = with lib; { + description = "A Python library for generating fake user data"; + homepage = http://faker.rtfd.org; + license = licenses.mit; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2bb2b161cce..7cf16707d26 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5960,22 +5960,7 @@ in { }; }; - faker = buildPythonPackage rec { - name = "faker-0.0.4"; - disabled = isPy3k; - src = pkgs.fetchurl { - url = mirror://pypi/F/Faker/Faker-0.0.4.tar.gz; - sha256 = "09q5jna3j8di0gw5yjx0dvlndkrk2x9vvqzwyfsvg3nlp8h38js1"; - }; - buildInputs = with self; [ nose ]; - meta = { - description = "A Python library for generating fake user data"; - homepage = http://pypi.python.org/pypi/Faker; - license = licenses.mit; - maintainers = with maintainers; [ lovek323 ]; - platforms = platforms.unix; - }; - }; + faker = callPackage ../development/python-modules/faker { }; fake_factory = buildPythonPackage rec { name = "fake-factory-${version}"; From 8081ab6e5cb8a190dbe68803ee40157db5de8907 Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Tue, 25 Jul 2017 21:35:53 +0000 Subject: [PATCH 084/108] pythonPackages.pysideShiboken: patch for Python 3.6 --- pkgs/development/python-modules/pyside/shiboken.nix | 4 ++-- pkgs/development/python-modules/pyside/shiboken_py35.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pyside/shiboken.nix b/pkgs/development/python-modules/pyside/shiboken.nix index cef78c21550..0864b641cdb 100644 --- a/pkgs/development/python-modules/pyside/shiboken.nix +++ b/pkgs/development/python-modules/pyside/shiboken.nix @@ -1,4 +1,4 @@ -{ lib, fetchurl, cmake, buildPythonPackage, libxml2, libxslt, pysideApiextractor, pysideGeneratorrunner, python, sphinx, qt4, isPy3k, isPy35 }: +{ lib, fetchurl, cmake, buildPythonPackage, libxml2, libxslt, pysideApiextractor, pysideGeneratorrunner, python, sphinx, qt4, isPy3k, isPy35, isPy36 }: # This derivation provides a Python module and should therefore be called via `python-packages.nix`. # Python 3.5 is not supported: https://github.com/PySide/Shiboken/issues/77 @@ -23,7 +23,7 @@ buildPythonPackage rec { substituteInPlace generator/CMakeLists.txt --replace \ \"$\{GENERATORRUNNER_PLUGIN_DIR}\" lib/generatorrunner/ ''; - patches = if isPy35 then [ ./shiboken_py35.patch ] else null; + patches = if (isPy35 || isPy36) then [ ./shiboken_py35.patch ] else null; cmakeFlags = if isPy3k then "-DUSE_PYTHON3=TRUE" else null; diff --git a/pkgs/development/python-modules/pyside/shiboken_py35.patch b/pkgs/development/python-modules/pyside/shiboken_py35.patch index 5642ddc594d..32088144ed7 100644 --- a/pkgs/development/python-modules/pyside/shiboken_py35.patch +++ b/pkgs/development/python-modules/pyside/shiboken_py35.patch @@ -6,7 +6,7 @@ diff --git a/cmake/Modules/FindPython3Libs.cmake b/cmake/Modules/FindPython3Libs # CMAKE_FIND_FRAMEWORKS(Python) -FOREACH(_CURRENT_VERSION 3.4 3.3 3.2 3.1 3.0) -+FOREACH(_CURRENT_VERSION 3.5 3.4 3.3 3.2 3.1 3.0) ++FOREACH(_CURRENT_VERSION 3.6 3.5 3.4 3.3 3.2 3.1 3.0) IF(_CURRENT_VERSION GREATER 3.1) SET(_32FLAGS "m" "u" "mu" "dm" "du" "dmu" "") ELSE() From f05fcb40a1a4f4772b2fc345619206850366907a Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Tue, 25 Jul 2017 21:49:54 +0000 Subject: [PATCH 085/108] pythonPackages.FormEncode: 1.3.0 -> 1.3.1 --- pkgs/development/python-modules/FormEncode/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/FormEncode/default.nix b/pkgs/development/python-modules/FormEncode/default.nix index f0ccead6059..ff744fc1b8a 100644 --- a/pkgs/development/python-modules/FormEncode/default.nix +++ b/pkgs/development/python-modules/FormEncode/default.nix @@ -2,13 +2,12 @@ buildPythonPackage rec { pname = "FormEncode"; - version = "1.3.0"; + version = "1.3.1"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - extension = "zip"; - sha256 = "0y5gywq0l79l85ylr55p4xy0h921zgmfw6zmrvlh83aa4j074xg6"; + sha256 = "1xm77h2mds2prlaz0z4nzkx13g61rx5c2v3vpgjq9d5ij8bzb8md"; }; buildInputs = [ dns pycountry nose ]; From e985aa5501f6ab6bf363cf5ffd555e10a4fe63c5 Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Tue, 25 Jul 2017 21:50:16 +0000 Subject: [PATCH 086/108] pythonPackages.sqlobject: 3.0.0 -> 3.3.0 --- pkgs/top-level/python-packages.nix | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7cf16707d26..0f66e2b24cf 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -21662,14 +21662,23 @@ in { }; sqlobject = buildPythonPackage rec { - version = "3.0.0"; - name = "sqlobject-${version}"; - src = pkgs.fetchurl { - url = "mirror://pypi/S/SQLObject/SQLObject-${version}.tar.gz"; - sha256 = "15g3g7f4yiyplqf54px1dsnmrw3jb7xwx97z8qzgp9ijmm5vpr8r"; + pname = "SQLObject"; + version = "3.3.0"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "0p2dxrxh7xrv5yys09v5z95d0z40w22aq3xc01ghdidd7hr79xy9"; }; - propagatedBuildInputs = with self; [ pydispatcher FormEncode ]; + checkInputs = with self; [ pytest ]; + + propagatedBuildInputs = with self; [ + FormEncode + PasteDeploy + paste + pydispatcher + ]; meta = { description = "Object Relational Manager for providing an object interface to your database"; From 451ac7bc3fb789a8b16c572a4c89efcd6b5e8eed Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Fri, 28 Jul 2017 15:57:07 +0200 Subject: [PATCH 087/108] python.pkgs.pytest_xdist: 1.16.0 -> 1.18.2 --- pkgs/development/python-modules/pytest-xdist/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pytest-xdist/default.nix b/pkgs/development/python-modules/pytest-xdist/default.nix index b3577908cf9..600c98925af 100644 --- a/pkgs/development/python-modules/pytest-xdist/default.nix +++ b/pkgs/development/python-modules/pytest-xdist/default.nix @@ -3,11 +3,11 @@ buildPythonPackage rec { name = "${pname}-${version}"; pname = "pytest-xdist"; - version = "1.16.0"; + version = "1.18.2"; src = fetchPypi { inherit pname version; - sha256 = "42e5a1e5da9d7cff3e74b07f8692598382f95624f234ff7e00a3b1237e0feba2"; + sha256 = "10468377901b80255cf192c4603a94ffe8b1f071f5c912868da5f5cb91170dae"; }; buildInputs = [ pytest setuptools_scm ]; From 1e605e654f7a02b6d954b51401784992664e8582 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Fri, 28 Jul 2017 16:47:39 +0200 Subject: [PATCH 088/108] python.pkgs.tornado: 4.4.2 -> 4.5.1 --- .../python-modules/tornado/default.nix | 28 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 18 +----------- 2 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 pkgs/development/python-modules/tornado/default.nix diff --git a/pkgs/development/python-modules/tornado/default.nix b/pkgs/development/python-modules/tornado/default.nix new file mode 100644 index 00000000000..11078eb8562 --- /dev/null +++ b/pkgs/development/python-modules/tornado/default.nix @@ -0,0 +1,28 @@ +{ lib +, python +, buildPythonPackage +, fetchPypi +, backports_abc +, backports_ssl_match_hostname +, certifi +, singledispatch +}: + +buildPythonPackage rec { + pname = "tornado"; + version = "4.5.1"; + name = "${pname}-${version}"; + + propagatedBuildInputs = [ backports_abc backports_ssl_match_hostname certifi singledispatch ]; + + # We specify the name of the test files to prevent + # https://github.com/NixOS/nixpkgs/issues/14634 + checkPhase = '' + ${python.interpreter} -m unittest discover *_test.py + ''; + + src = fetchPypi { + inherit pname version; + sha256 = "db0904a28253cfe53e7dedc765c71596f3c53bb8a866ae50123320ec1a7b73fd"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0f66e2b24cf..48ced46476f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -25537,23 +25537,7 @@ EOF }; }; - tornado = buildPythonPackage rec { - name = "tornado-${version}"; - version = "4.4.2"; - - propagatedBuildInputs = with self; [ backports_abc backports_ssl_match_hostname certifi singledispatch ]; - - # We specify the name of the test files to prevent - # https://github.com/NixOS/nixpkgs/issues/14634 - checkPhase = '' - ${python.interpreter} -m unittest discover *_test.py - ''; - - src = pkgs.fetchurl { - url = "mirror://pypi/t/tornado/${name}.tar.gz"; - sha256 = "1k7d90afm5pivam90a37nqiz9wlmakvnsfymp3p43kcqz29gk618"; - }; - }; + tornado = callPackage ../development/python-modules/tornado { }; tokenlib = buildPythonPackage rec { name = "tokenlib-${version}"; From ac1ea28a5028e01782c04af9bdc9fdad5ccac446 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Fri, 28 Jul 2017 16:49:08 +0200 Subject: [PATCH 089/108] python.pkgs: maintenance updates --- pkgs/development/python-modules/actdiag/default.nix | 4 ++-- pkgs/development/python-modules/alabaster/default.nix | 4 ++-- pkgs/development/python-modules/alembic/default.nix | 4 ++-- pkgs/development/python-modules/aniso8601/default.nix | 4 ++-- pkgs/development/python-modules/discid/default.nix | 4 ++-- pkgs/development/python-modules/faker/default.nix | 4 ++-- pkgs/development/python-modules/keras/default.nix | 4 ++-- pkgs/development/python-modules/ldap.nix | 4 ++-- pkgs/development/python-modules/libagent/default.nix | 4 ++-- pkgs/development/python-modules/libnacl/default.nix | 4 ++-- pkgs/development/python-modules/m2r/default.nix | 4 ++-- pkgs/development/python-modules/plotly/default.nix | 4 ++-- pkgs/development/python-modules/pylint/default.nix | 4 ++-- pkgs/development/python-modules/pyroute2/default.nix | 4 ++-- pkgs/development/python-modules/sqlalchemy/default.nix | 4 ++-- pkgs/development/python-modules/trezor/default.nix | 4 ++-- pkgs/development/python-modules/ukpostcodeparser/default.nix | 4 ++-- pkgs/development/python-modules/vine/default.nix | 4 ++-- 18 files changed, 36 insertions(+), 36 deletions(-) diff --git a/pkgs/development/python-modules/actdiag/default.nix b/pkgs/development/python-modules/actdiag/default.nix index 064e5e6c11a..36d49ad29af 100644 --- a/pkgs/development/python-modules/actdiag/default.nix +++ b/pkgs/development/python-modules/actdiag/default.nix @@ -3,12 +3,12 @@ buildPythonPackage rec { pname = "actdiag"; - version = "0.5.3"; + version = "0.5.4"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "1vr4hnkr0gcvvpaycd8q3vcx029b2f5yv8swhdr8kwspaqb0dvfa"; + sha256 = "983071777d9941093aaef3be1f67c198a8ac8d2bba264cdd1f337ca415ab46af"; }; buildInputs = [ pep8 nose unittest2 docutils ]; diff --git a/pkgs/development/python-modules/alabaster/default.nix b/pkgs/development/python-modules/alabaster/default.nix index 69bcaa1fc06..fcd9a097800 100644 --- a/pkgs/development/python-modules/alabaster/default.nix +++ b/pkgs/development/python-modules/alabaster/default.nix @@ -3,12 +3,12 @@ buildPythonPackage rec { pname = "alabaster"; - version = "0.7.7"; + version = "0.7.10"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "f416a84e0d0ddbc288f6b8f2c276d10b40ca1238562cd9ed5a751292ec647b71"; + sha256 = "37cdcb9e9954ed60912ebc1ca12a9d12178c26637abdf124e3cde2341c257fe0"; }; propagatedBuildInputs = [ pygments ]; diff --git a/pkgs/development/python-modules/alembic/default.nix b/pkgs/development/python-modules/alembic/default.nix index 0538e7cf416..d1262d8fab4 100644 --- a/pkgs/development/python-modules/alembic/default.nix +++ b/pkgs/development/python-modules/alembic/default.nix @@ -6,11 +6,11 @@ buildPythonPackage rec { name = "${pname}-${version}"; pname = "alembic"; - version = "0.9.2"; + version = "0.9.3"; src = fetchPypi { inherit pname version; - sha256 = "0iw6wysm83hycvrycymf9b4mkji47536kl3x7grynfcbyjcvbdm2"; + sha256 = "57f2ede554c0b18f1cf811cfbb3b02c586a5422df94922e3821883ba0b8c616c"; }; buildInputs = [ pytest pytestcov mock coverage ]; diff --git a/pkgs/development/python-modules/aniso8601/default.nix b/pkgs/development/python-modules/aniso8601/default.nix index bc49e991b4f..95eda37d3f2 100644 --- a/pkgs/development/python-modules/aniso8601/default.nix +++ b/pkgs/development/python-modules/aniso8601/default.nix @@ -3,7 +3,7 @@ buildPythonPackage rec { pname = "aniso8601"; - version = "1.2.0"; + version = "1.2.1"; name = "${pname}-${version}"; meta = with stdenv.lib; { @@ -16,6 +16,6 @@ buildPythonPackage rec { src = fetchPypi { inherit pname version; - sha256 = "502400f82574afa804cc915d83f15c67533d364dcd594f8a6b9d2053f3404dd4"; + sha256 = "e7ba4f42d3aea75909c79b1f4c4614768b4f13fbb98fc658a7b6061ddb0be47c"; }; } diff --git a/pkgs/development/python-modules/discid/default.nix b/pkgs/development/python-modules/discid/default.nix index 167efe91425..d237f366fdf 100644 --- a/pkgs/development/python-modules/discid/default.nix +++ b/pkgs/development/python-modules/discid/default.nix @@ -2,12 +2,12 @@ buildPythonPackage rec { pname = "discid"; - version = "1.1.0"; + version = "1.1.1"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "b39d443051b26d0230be7a6c616243daae93337a8711dd5d4119bb6a0e516fa8"; + sha256 = "78a3bf6c8377fdbe3d85e914a209ff97aa43e35605779639847b510ced31f7b9"; }; patchPhase = '' diff --git a/pkgs/development/python-modules/faker/default.nix b/pkgs/development/python-modules/faker/default.nix index d5934f38b88..ce6887f3e06 100644 --- a/pkgs/development/python-modules/faker/default.nix +++ b/pkgs/development/python-modules/faker/default.nix @@ -6,12 +6,12 @@ buildPythonPackage rec { pname = "Faker"; - version = "0.7.17"; + version = "0.7.18"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "0n4achwr6dcf67n983ls5cbp5ic3jrwsbl92rzjlzb1xvz1s1js9"; + sha256 = "310b20f3c497a777622920dca314d90f774028d49c7ee7ccfa96ca4b9d9bf429"; }; checkInputs = [ diff --git a/pkgs/development/python-modules/keras/default.nix b/pkgs/development/python-modules/keras/default.nix index 43e576b1b31..011954ae827 100644 --- a/pkgs/development/python-modules/keras/default.nix +++ b/pkgs/development/python-modules/keras/default.nix @@ -12,12 +12,12 @@ buildPythonPackage rec { pname = "Keras"; - version = "2.0.5"; + version = "2.0.6"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "cbce24758530e070fe1b403d6d21391cbea78c037b70bf6afc1ca9f1f8269eff"; + sha256 = "0519480abe4ad18b2c2d1bc580eab75edd82c95083d341a1157952f4b00019bb"; }; checkInputs = [ diff --git a/pkgs/development/python-modules/ldap.nix b/pkgs/development/python-modules/ldap.nix index b583a2ae2d8..34a179f501b 100644 --- a/pkgs/development/python-modules/ldap.nix +++ b/pkgs/development/python-modules/ldap.nix @@ -3,13 +3,13 @@ buildPythonPackage rec { pname = "python-ldap"; - version = "2.4.39"; + version = "2.4.41"; name = "${pname}-${version}"; disabled = isPy3k; src = fetchPypi { inherit pname version; - sha256 = "3fb75108d27e8091de80dffa2ba3bf45c7a3bdc357e2959006aed52fa58bb2f3"; + sha256 = "6d430ecf040f2fc704ee316d3390cb1f5419c191371e1e131baef54a0e42cef0"; }; # Needed by tests to setup a mockup ldap server. diff --git a/pkgs/development/python-modules/libagent/default.nix b/pkgs/development/python-modules/libagent/default.nix index 5192abf8200..4a3839537e3 100644 --- a/pkgs/development/python-modules/libagent/default.nix +++ b/pkgs/development/python-modules/libagent/default.nix @@ -5,11 +5,11 @@ buildPythonPackage rec { name = "${pname}-${version}"; pname = "libagent"; - version = "0.9.1"; + version = "0.9.2"; src = fetchPypi{ inherit pname version; - sha256 = "1g19lsid7lqw567w31fif89w088lzbgh27xpb1pshjk1gvags3bc"; + sha256 = "d6c6dccc0a7693fc966f5962604a69a800e044ac5add3dd030c34cfd4d64311f"; }; buildInputs = [ diff --git a/pkgs/development/python-modules/libnacl/default.nix b/pkgs/development/python-modules/libnacl/default.nix index 7a96530912b..324740f17de 100644 --- a/pkgs/development/python-modules/libnacl/default.nix +++ b/pkgs/development/python-modules/libnacl/default.nix @@ -2,12 +2,12 @@ buildPythonPackage rec { pname = "libnacl"; - version = "1.5.1"; + version = "1.5.2"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "e44e9436e7245b0d8b7322bef67750cb7757834d7ccdb7eb7b723b4813df84fb"; + sha256 = "c58390b0d191db948fc9ab681f07fdfce2a573cd012356bada47d56795d00ee2"; }; buildInputs = [ pytest ]; diff --git a/pkgs/development/python-modules/m2r/default.nix b/pkgs/development/python-modules/m2r/default.nix index 74cc87d5d89..b79307a8084 100644 --- a/pkgs/development/python-modules/m2r/default.nix +++ b/pkgs/development/python-modules/m2r/default.nix @@ -3,11 +3,11 @@ buildPythonPackage rec { pname = "m2r"; name = "${pname}-${version}"; - version = "0.1.6"; + version = "0.1.7"; src = fetchPypi { inherit pname version; - sha256 = "a26bc2e25e0ad3f8650385aea25cf734ac4fcd30e54faec92fd39675da75e527"; + sha256 = "771631d051a52764fe5b660f97ad028df3aff90c9859d345ccfd17a4c7c2ab39"; }; propagatedBuildInputs = [ mistune docutils ]; diff --git a/pkgs/development/python-modules/plotly/default.nix b/pkgs/development/python-modules/plotly/default.nix index 383dbd1e08f..ed62a091281 100644 --- a/pkgs/development/python-modules/plotly/default.nix +++ b/pkgs/development/python-modules/plotly/default.nix @@ -10,12 +10,12 @@ buildPythonPackage rec { pname = "plotly"; - version = "2.0.10"; + version = "2.0.12"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "8c013a01bb11c4c269c38a7086ffb92d6a2827922c49706131842498a49b3b81"; + sha256 = "0050da900e4420c15766f8dfb8d252510896511361bf485b9308bc0287f7add0"; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/pylint/default.nix b/pkgs/development/python-modules/pylint/default.nix index 12871bd8f6c..8c82cb52910 100644 --- a/pkgs/development/python-modules/pylint/default.nix +++ b/pkgs/development/python-modules/pylint/default.nix @@ -4,11 +4,11 @@ buildPythonPackage rec { name = "${pname}-${version}"; pname = "pylint"; - version = "1.7.1"; + version = "1.7.2"; src = fetchurl { url = "mirror://pypi/p/${pname}/${name}.tar.gz"; - sha256 = "8b4a7ab6cf5062e40e2763c0b4a596020abada1d7304e369578b522e46a6264a"; + sha256 = "ea6afb93a9ed810cf52ff3838eb3a15e2bf6a81b80de0eaede1ce442caa5ca69"; }; buildInputs = [ pytest pytestrunner mccabe configparser backports_functools_lru_cache ]; diff --git a/pkgs/development/python-modules/pyroute2/default.nix b/pkgs/development/python-modules/pyroute2/default.nix index de1651ec2b0..2e60f6812e9 100644 --- a/pkgs/development/python-modules/pyroute2/default.nix +++ b/pkgs/development/python-modules/pyroute2/default.nix @@ -2,12 +2,12 @@ buildPythonPackage rec { pname = "pyroute2"; - version = "0.4.16"; + version = "0.4.18"; name = "${pname}-${version}"; src = fetchurl { url = "mirror://pypi/p/pyroute2/${name}.tar.gz"; - sha256 = "5c692efd83369cb44086572b3e1e95ab11f1bc516a89c8ca2429795a789f32a9"; + sha256 = "bdcff9f598ff4dda7420675ee387426cd9cc79d795ea73eb684a4314d4b00b9e"; }; # requires root priviledges diff --git a/pkgs/development/python-modules/sqlalchemy/default.nix b/pkgs/development/python-modules/sqlalchemy/default.nix index 4cd522fe195..36b04692a9e 100644 --- a/pkgs/development/python-modules/sqlalchemy/default.nix +++ b/pkgs/development/python-modules/sqlalchemy/default.nix @@ -11,11 +11,11 @@ buildPythonPackage rec { pname = "SQLAlchemy"; name = "${pname}-${version}"; - version = "1.1.11"; + version = "1.1.12"; src = fetchPypi { inherit pname version; - sha256 = "76f76965e9a968ba3aecd2a8bc0d991cea04fd9a182e6c95c81f1551487b0211"; + sha256 = "d501527319f51a3d9eb639b654222c6f67287228a98ba102b1d0b598eb3266c9"; }; checkInputs = [ pytest mock pytest_xdist ] diff --git a/pkgs/development/python-modules/trezor/default.nix b/pkgs/development/python-modules/trezor/default.nix index 6a3f9c63890..72d73022cab 100644 --- a/pkgs/development/python-modules/trezor/default.nix +++ b/pkgs/development/python-modules/trezor/default.nix @@ -5,11 +5,11 @@ buildPythonPackage rec { name = "${pname}-${version}"; pname = "trezor"; - version = "0.7.15"; + version = "0.7.16"; src = fetchPypi { inherit pname version; - sha256 = "f7e4f509263ca172532b4c0a440d164add7cdc021b4370a253d51eba5806b618"; + sha256 = "6bdb69fc125ba705854e21163be6c7da3aa17c2a3a84f40b6d8a3f6e4a8cb314"; }; propagatedBuildInputs = [ protobuf3_2 hidapi requests ]; diff --git a/pkgs/development/python-modules/ukpostcodeparser/default.nix b/pkgs/development/python-modules/ukpostcodeparser/default.nix index 6eae1f52456..d7d56bed881 100644 --- a/pkgs/development/python-modules/ukpostcodeparser/default.nix +++ b/pkgs/development/python-modules/ukpostcodeparser/default.nix @@ -2,12 +2,12 @@ buildPythonPackage rec { pname = "UkPostcodeParser"; - version = "1.1.0"; + version = "1.1.1"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "1v8k91xhg5fr6sk91am93abjarw950ray7b9q3w5j25agjsxgcsf"; + sha256 = "b7a7ac19d48897637c7aaa2f2970288f1c260e4a99140bf04c6086cf65576c6b"; }; doCheck = false; diff --git a/pkgs/development/python-modules/vine/default.nix b/pkgs/development/python-modules/vine/default.nix index 85b17f5119c..bf5a09a2418 100644 --- a/pkgs/development/python-modules/vine/default.nix +++ b/pkgs/development/python-modules/vine/default.nix @@ -3,14 +3,14 @@ buildPythonPackage rec { pname = "vine"; - version = "1.1.3"; + version = "1.1.4"; name = "${pname}-${version}"; disable = pythonOlder "2.7"; src = fetchPypi { inherit pname version; - sha256 = "0h94x9mc9bspg23lb1f73h7smdzc39ps7z7sm0q38ds9jahmvfc7"; + sha256 = "52116d59bc45392af9fdd3b75ed98ae48a93e822cee21e5fda249105c59a7a72"; }; buildInputs = [ case pytest ]; From ec59e3b3f52003a90a977f539366de59d4067c06 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Fri, 28 Jul 2017 18:08:06 +0200 Subject: [PATCH 090/108] openblas: 0.2.19 -> 0.2.20 --- pkgs/development/libraries/science/math/openblas/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix index 6f3f78e5501..4d51d1ed02d 100644 --- a/pkgs/development/libraries/science/math/openblas/default.nix +++ b/pkgs/development/libraries/science/math/openblas/default.nix @@ -61,13 +61,13 @@ let then blas64_ else hasPrefix "x86_64" stdenv.system; - version = "0.2.19"; + version = "0.2.20"; in stdenv.mkDerivation { name = "openblas-${version}"; src = fetchurl { url = "https://github.com/xianyi/OpenBLAS/archive/v${version}.tar.gz"; - sha256 = "0mw5ra1vjsqiba79zdhqfkqq6v3bla5a5c0wj7vca9qgjzjbah4w"; + sha256 = "157kpkbpwlr57dkmqiwr3qp9fglfidagv7l6fibrhln6v4aqpwsy"; name = "openblas-${version}.tar.gz"; }; From d50437ba3e366b96f32139615bd7742f980f0702 Mon Sep 17 00:00:00 2001 From: volth Date: Fri, 28 Jul 2017 20:17:18 +0000 Subject: [PATCH 091/108] flex_2_5_35: fix 404 --- pkgs/development/tools/parsing/flex/2.5.35.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/parsing/flex/2.5.35.nix b/pkgs/development/tools/parsing/flex/2.5.35.nix index 97ee871c87e..0a8da8b68f9 100644 --- a/pkgs/development/tools/parsing/flex/2.5.35.nix +++ b/pkgs/development/tools/parsing/flex/2.5.35.nix @@ -1,14 +1,14 @@ -{ stdenv, fetchurl, bison, m4 }: +{ stdenv, fetchurl, autoreconfHook, flex, bison, texinfo, help2man, m4 }: stdenv.mkDerivation { name = "flex-2.5.35"; src = fetchurl { - url = mirror://sourceforge/flex/flex-2.5.35.tar.bz2; - sha256 = "0ysff249mwhq0053bw3hxh58djc0gy7vjan2z1krrf9n5d5vvv0b"; + url = https://github.com/westes/flex/archive/flex-2-5-35.tar.gz; + sha256 = "0wh06nix8bd4w1aq4k2fbbkdq5i30a9lxz3xczf3ff28yy0kfwzm"; }; - buildInputs = [ bison ]; + nativeBuildInputs = [ flex bison texinfo help2man autoreconfHook ]; propagatedNativeBuildInputs = [ m4 ]; From 5e08c4a2cdbd8d77b26e339af3ddd1fd1fcad436 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 29 Jul 2017 19:14:47 +0200 Subject: [PATCH 092/108] flex: 2.6.3 -> 2.6.4 --- pkgs/development/tools/parsing/flex/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/parsing/flex/default.nix b/pkgs/development/tools/parsing/flex/default.nix index 3bb34f5bc90..addf3b6197a 100644 --- a/pkgs/development/tools/parsing/flex/default.nix +++ b/pkgs/development/tools/parsing/flex/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { name = "flex-${version}"; - version = "2.6.3"; + version = "2.6.4"; src = fetchurl { url = "https://github.com/westes/flex/releases/download/v${version}/flex-${version}.tar.gz"; - sha256 = "1an2cn2z85mkpgqcinh1fhhcd7993qm2lil1yxic8iz76ci79ck8"; + sha256 = "15g9bv236nzi665p9ggqjlfn4dwck5835vf0bbw2cz7h5c1swyp8"; }; buildInputs = [ bison ]; From 42beae061803b6c81925601f69ac704b4f700a60 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 29 Jul 2017 19:03:28 +0200 Subject: [PATCH 093/108] iptables: build with current flex --- pkgs/top-level/all-packages.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 21daf608d25..b9da5993556 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11936,9 +11936,7 @@ with pkgs; inherit (perlPackages) SGMLSpm; }; - iptables = callPackage ../os-specific/linux/iptables { - flex = flex_2_5_35; - }; + iptables = callPackage ../os-specific/linux/iptables { }; iptstate = callPackage ../os-specific/linux/iptstate { } ; From 7f69275f99359b140afe4e62d6095d2bf54113de Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 29 Jul 2017 19:26:14 +0200 Subject: [PATCH 094/108] dtc: build with current flex --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b9da5993556..086e8bee32c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1695,7 +1695,7 @@ with pkgs; dtach = callPackage ../tools/misc/dtach { }; - dtc = callPackage ../development/compilers/dtc { flex = flex_2_6_1; }; + dtc = callPackage ../development/compilers/dtc { }; dub = callPackage ../development/tools/build-managers/dub { }; From d3bfa0542c224f0c4001be964117acab5a2412d0 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 29 Jul 2017 19:26:42 +0200 Subject: [PATCH 095/108] intercal: build with current flex --- pkgs/top-level/all-packages.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 086e8bee32c..0c04cd24884 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5625,9 +5625,7 @@ with pkgs; inherit (haskellPackages) idris; }; - intercal = callPackage ../development/compilers/intercal { - flex = flex_2_6_1; # Works with 2.5.35 too, but not 2.6.3 - }; + intercal = callPackage ../development/compilers/intercal { }; irony-server = callPackage ../development/tools/irony-server/default.nix { # The repository of irony to use -- must match the version of the employed emacs From 5d2f5e374f405953998286be66a0caf88aa8ab1c Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 29 Jul 2017 19:26:59 +0200 Subject: [PATCH 096/108] verilator: build with current flex --- pkgs/applications/science/electronics/verilator/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/electronics/verilator/default.nix b/pkgs/applications/science/electronics/verilator/default.nix index ed4a430198a..31c2d4f6475 100644 --- a/pkgs/applications/science/electronics/verilator/default.nix +++ b/pkgs/applications/science/electronics/verilator/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, flex_2_6_1, bison }: +{ stdenv, fetchurl, perl, flex, bison }: stdenv.mkDerivation rec { name = "verilator-${version}"; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { }; enableParallelBuilding = true; - buildInputs = [ perl flex_2_6_1 bison ]; + buildInputs = [ perl flex bison ]; postInstall = '' sed -i -e '3a\#!/usr/bin/env perl' -e '1,3d' $out/bin/{verilator,verilator_coverage,verilator_profcfunc} From 6f0ef6bb3259031ddf2a3a69905a5ec7a86a1067 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 29 Jul 2017 19:42:44 +0200 Subject: [PATCH 097/108] ispc: build with current flex --- pkgs/development/compilers/ispc/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/ispc/default.nix b/pkgs/development/compilers/ispc/default.nix index f8413075ac8..6bc7f66ca29 100644 --- a/pkgs/development/compilers/ispc/default.nix +++ b/pkgs/development/compilers/ispc/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchFromGitHub, bash, which, m4, python, bison, flex_2_6_1, llvmPackages, clangWrapSelf, +{stdenv, fetchFromGitHub, bash, which, m4, python, bison, flex, llvmPackages, clangWrapSelf, testedTargets ? ["sse2" "host"] # the default test target is sse4, but that is not supported by all Hydra agents }: @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { m4 python bison - flex_2_6_1 + flex llvm llvmPackages.clang-unwrapped # we need to link against libclang, so we need the unwrapped ]; From 0a7e705f629c8dee29b06bb4c0be867e15c45059 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 29 Jul 2017 20:40:35 +0200 Subject: [PATCH 098/108] python36: Don't use ldconfig and speed up uuid load A Python 3.6 version of de1b4e71c1c8be30ad4ebc2ec6005928ba6cf280. --- .../python/cpython/3.6/default.nix | 4 + .../python/cpython/3.6/no-ldconfig.patch | 163 ++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 pkgs/development/interpreters/python/cpython/3.6/no-ldconfig.patch diff --git a/pkgs/development/interpreters/python/cpython/3.6/default.nix b/pkgs/development/interpreters/python/cpython/3.6/default.nix index bca717b919b..7e05a0ce61c 100644 --- a/pkgs/development/interpreters/python/cpython/3.6/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.6/default.nix @@ -64,6 +64,10 @@ in stdenv.mkDerivation { substituteInPlace configure --replace '-Wl,-stack_size,1000000' ' ' ''; + patches = [ + ./no-ldconfig.patch + ]; + postPatch = '' # Determinism substituteInPlace "Lib/py_compile.py" --replace "source_stats['mtime']" "(1 if 'DETERMINISTIC_BUILD' in os.environ else source_stats['mtime'])" diff --git a/pkgs/development/interpreters/python/cpython/3.6/no-ldconfig.patch b/pkgs/development/interpreters/python/cpython/3.6/no-ldconfig.patch new file mode 100644 index 00000000000..da6afe04d6e --- /dev/null +++ b/pkgs/development/interpreters/python/cpython/3.6/no-ldconfig.patch @@ -0,0 +1,163 @@ +From a831df344ec1c883a0ef04d8cc8f5c53a942f6de Mon Sep 17 00:00:00 2001 +From: Frederik Rietdijk +Date: Sat, 29 Jul 2017 20:17:40 +0200 +Subject: [PATCH] Don't use ldconfig and speed up uuid load + +--- + Lib/ctypes/util.py | 70 ++---------------------------------------------------- + Lib/uuid.py | 51 --------------------------------------- + 2 files changed, 2 insertions(+), 119 deletions(-) + +diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py +index 339ae8aa8a..2944985c30 100644 +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -85,46 +85,7 @@ elif os.name == "posix": + import re, tempfile + + def _findLib_gcc(name): +- # Run GCC's linker with the -t (aka --trace) option and examine the +- # library name it prints out. The GCC command will fail because we +- # haven't supplied a proper program with main(), but that does not +- # matter. +- expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)) +- +- c_compiler = shutil.which('gcc') +- if not c_compiler: +- c_compiler = shutil.which('cc') +- if not c_compiler: +- # No C compiler available, give up +- return None +- +- temp = tempfile.NamedTemporaryFile() +- try: +- args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name] +- +- env = dict(os.environ) +- env['LC_ALL'] = 'C' +- env['LANG'] = 'C' +- try: +- proc = subprocess.Popen(args, +- stdout=subprocess.PIPE, +- stderr=subprocess.STDOUT, +- env=env) +- except OSError: # E.g. bad executable +- return None +- with proc: +- trace = proc.stdout.read() +- finally: +- try: +- temp.close() +- except FileNotFoundError: +- # Raised if the file was already removed, which is the normal +- # behaviour of GCC if linking fails +- pass +- res = re.search(expr, trace) +- if not res: +- return None +- return os.fsdecode(res.group(0)) ++ return None + + + if sys.platform == "sunos5": +@@ -246,34 +207,7 @@ elif os.name == "posix": + else: + + def _findSoname_ldconfig(name): +- import struct +- if struct.calcsize('l') == 4: +- machine = os.uname().machine + '-32' +- else: +- machine = os.uname().machine + '-64' +- mach_map = { +- 'x86_64-64': 'libc6,x86-64', +- 'ppc64-64': 'libc6,64bit', +- 'sparc64-64': 'libc6,64bit', +- 's390x-64': 'libc6,64bit', +- 'ia64-64': 'libc6,IA-64', +- } +- abi_type = mach_map.get(machine, 'libc6') +- +- # XXX assuming GLIBC's ldconfig (with option -p) +- regex = r'\s+(lib%s\.[^\s]+)\s+\(%s' +- regex = os.fsencode(regex % (re.escape(name), abi_type)) +- try: +- with subprocess.Popen(['/sbin/ldconfig', '-p'], +- stdin=subprocess.DEVNULL, +- stderr=subprocess.DEVNULL, +- stdout=subprocess.PIPE, +- env={'LC_ALL': 'C', 'LANG': 'C'}) as p: +- res = re.search(regex, p.stdout.read()) +- if res: +- return os.fsdecode(res.group(1)) +- except OSError: +- pass ++ return None + + def _findLib_ld(name): + # See issue #9998 for why this is needed +diff --git a/Lib/uuid.py b/Lib/uuid.py +index 200c800b34..a099ab4b4a 100644 +--- a/Lib/uuid.py ++++ b/Lib/uuid.py +@@ -455,57 +455,6 @@ def _netbios_getnode(): + continue + return int.from_bytes(bytes, 'big') + +-# Thanks to Thomas Heller for ctypes and for his help with its use here. +- +-# If ctypes is available, use it to find system routines for UUID generation. +-# XXX This makes the module non-thread-safe! +-_uuid_generate_time = _UuidCreate = None +-try: +- import ctypes, ctypes.util +- import sys +- +- # The uuid_generate_* routines are provided by libuuid on at least +- # Linux and FreeBSD, and provided by libc on Mac OS X. +- _libnames = ['uuid'] +- if not sys.platform.startswith('win'): +- _libnames.append('c') +- for libname in _libnames: +- try: +- lib = ctypes.CDLL(ctypes.util.find_library(libname)) +- except Exception: +- continue +- if hasattr(lib, 'uuid_generate_time'): +- _uuid_generate_time = lib.uuid_generate_time +- break +- del _libnames +- +- # The uuid_generate_* functions are broken on MacOS X 10.5, as noted +- # in issue #8621 the function generates the same sequence of values +- # in the parent process and all children created using fork (unless +- # those children use exec as well). +- # +- # Assume that the uuid_generate functions are broken from 10.5 onward, +- # the test can be adjusted when a later version is fixed. +- if sys.platform == 'darwin': +- if int(os.uname().release.split('.')[0]) >= 9: +- _uuid_generate_time = None +- +- # On Windows prior to 2000, UuidCreate gives a UUID containing the +- # hardware address. On Windows 2000 and later, UuidCreate makes a +- # random UUID and UuidCreateSequential gives a UUID containing the +- # hardware address. These routines are provided by the RPC runtime. +- # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last +- # 6 bytes returned by UuidCreateSequential are fixed, they don't appear +- # to bear any relationship to the MAC address of any network device +- # on the box. +- try: +- lib = ctypes.windll.rpcrt4 +- except: +- lib = None +- _UuidCreate = getattr(lib, 'UuidCreateSequential', +- getattr(lib, 'UuidCreate', None)) +-except: +- pass + + def _unixdll_getnode(): + """Get the hardware address on Unix using ctypes.""" +-- +2.13.3 + From d64e798c822343ab1bfe902c905f6fa460e61db7 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 29 Jul 2017 20:41:02 +0200 Subject: [PATCH 099/108] python35: Don't use ldconfig and speed up uuid load A Python 3.5 version of de1b4e71c1c8be30ad4ebc2ec6005928ba6cf280. --- .../python/cpython/3.5/default.nix | 1 + .../python/cpython/3.5/no-ldconfig.patch | 164 ++++++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 pkgs/development/interpreters/python/cpython/3.5/no-ldconfig.patch diff --git a/pkgs/development/interpreters/python/cpython/3.5/default.nix b/pkgs/development/interpreters/python/cpython/3.5/default.nix index a4aec241a1a..a47b10d1cbb 100644 --- a/pkgs/development/interpreters/python/cpython/3.5/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.5/default.nix @@ -70,6 +70,7 @@ in stdenv.mkDerivation { url = https://github.com/python/cpython/commit/035ba5da3e53e.patch; sha256 = "1y74ir1w5cq542w27rgzgp70chhq2x047db9911mihpab8p2nj71"; }) + ./no-ldconfig.patch ]; postPatch = '' diff --git a/pkgs/development/interpreters/python/cpython/3.5/no-ldconfig.patch b/pkgs/development/interpreters/python/cpython/3.5/no-ldconfig.patch new file mode 100644 index 00000000000..c96de5d0e91 --- /dev/null +++ b/pkgs/development/interpreters/python/cpython/3.5/no-ldconfig.patch @@ -0,0 +1,164 @@ +From f0ed87f4066296b7aa3c095d04672c138506fa45 Mon Sep 17 00:00:00 2001 +From: Frederik Rietdijk +Date: Sat, 29 Jul 2017 20:33:56 +0200 +Subject: [PATCH] Don't use ldconfig and speed up uuid load + +--- + Lib/ctypes/util.py | 70 ++---------------------------------------------------- + Lib/uuid.py | 52 ---------------------------------------- + 2 files changed, 2 insertions(+), 120 deletions(-) + +diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py +index 7684eab81d..e9957d7951 100644 +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -95,46 +95,7 @@ elif os.name == "posix": + import re, tempfile + + def _findLib_gcc(name): +- # Run GCC's linker with the -t (aka --trace) option and examine the +- # library name it prints out. The GCC command will fail because we +- # haven't supplied a proper program with main(), but that does not +- # matter. +- expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)) +- +- c_compiler = shutil.which('gcc') +- if not c_compiler: +- c_compiler = shutil.which('cc') +- if not c_compiler: +- # No C compiler available, give up +- return None +- +- temp = tempfile.NamedTemporaryFile() +- try: +- args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name] +- +- env = dict(os.environ) +- env['LC_ALL'] = 'C' +- env['LANG'] = 'C' +- try: +- proc = subprocess.Popen(args, +- stdout=subprocess.PIPE, +- stderr=subprocess.STDOUT, +- env=env) +- except OSError: # E.g. bad executable +- return None +- with proc: +- trace = proc.stdout.read() +- finally: +- try: +- temp.close() +- except FileNotFoundError: +- # Raised if the file was already removed, which is the normal +- # behaviour of GCC if linking fails +- pass +- res = re.search(expr, trace) +- if not res: +- return None +- return os.fsdecode(res.group(0)) ++ return None + + + if sys.platform == "sunos5": +@@ -256,34 +217,7 @@ elif os.name == "posix": + else: + + def _findSoname_ldconfig(name): +- import struct +- if struct.calcsize('l') == 4: +- machine = os.uname().machine + '-32' +- else: +- machine = os.uname().machine + '-64' +- mach_map = { +- 'x86_64-64': 'libc6,x86-64', +- 'ppc64-64': 'libc6,64bit', +- 'sparc64-64': 'libc6,64bit', +- 's390x-64': 'libc6,64bit', +- 'ia64-64': 'libc6,IA-64', +- } +- abi_type = mach_map.get(machine, 'libc6') +- +- # XXX assuming GLIBC's ldconfig (with option -p) +- regex = os.fsencode( +- '\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)) +- try: +- with subprocess.Popen(['/sbin/ldconfig', '-p'], +- stdin=subprocess.DEVNULL, +- stderr=subprocess.DEVNULL, +- stdout=subprocess.PIPE, +- env={'LC_ALL': 'C', 'LANG': 'C'}) as p: +- res = re.search(regex, p.stdout.read()) +- if res: +- return os.fsdecode(res.group(1)) +- except OSError: +- pass ++ return None + + def find_library(name): + return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) +diff --git a/Lib/uuid.py b/Lib/uuid.py +index e96e7e034c..a099ab4b4a 100644 +--- a/Lib/uuid.py ++++ b/Lib/uuid.py +@@ -455,58 +455,6 @@ def _netbios_getnode(): + continue + return int.from_bytes(bytes, 'big') + +-# Thanks to Thomas Heller for ctypes and for his help with its use here. +- +-# If ctypes is available, use it to find system routines for UUID generation. +-# XXX This makes the module non-thread-safe! +-_uuid_generate_time = _UuidCreate = None +-try: +- import ctypes, ctypes.util +- import sys +- +- # The uuid_generate_* routines are provided by libuuid on at least +- # Linux and FreeBSD, and provided by libc on Mac OS X. +- _libnames = ['uuid'] +- if not sys.platform.startswith('win'): +- _libnames.append('c') +- for libname in _libnames: +- try: +- lib = ctypes.CDLL(ctypes.util.find_library(libname)) +- except Exception: +- continue +- if hasattr(lib, 'uuid_generate_time'): +- _uuid_generate_time = lib.uuid_generate_time +- break +- del _libnames +- +- # The uuid_generate_* functions are broken on MacOS X 10.5, as noted +- # in issue #8621 the function generates the same sequence of values +- # in the parent process and all children created using fork (unless +- # those children use exec as well). +- # +- # Assume that the uuid_generate functions are broken from 10.5 onward, +- # the test can be adjusted when a later version is fixed. +- if sys.platform == 'darwin': +- import os +- if int(os.uname().release.split('.')[0]) >= 9: +- _uuid_generate_time = None +- +- # On Windows prior to 2000, UuidCreate gives a UUID containing the +- # hardware address. On Windows 2000 and later, UuidCreate makes a +- # random UUID and UuidCreateSequential gives a UUID containing the +- # hardware address. These routines are provided by the RPC runtime. +- # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last +- # 6 bytes returned by UuidCreateSequential are fixed, they don't appear +- # to bear any relationship to the MAC address of any network device +- # on the box. +- try: +- lib = ctypes.windll.rpcrt4 +- except: +- lib = None +- _UuidCreate = getattr(lib, 'UuidCreateSequential', +- getattr(lib, 'UuidCreate', None)) +-except: +- pass + + def _unixdll_getnode(): + """Get the hardware address on Unix using ctypes.""" +-- +2.13.3 + From cdb18068cde28d53b0ce64e2a8f32b1a20b8717f Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 21 Jul 2017 08:09:02 -0500 Subject: [PATCH 100/108] zfs: fix invalid use of substituteInPlace substituteInPlace was invoked with multiple targets on the command line, which is not supported. (cherry picked from commit b21defaf51daf002f94bb57bf0f5073b153247db) Re-applied due to bad merge in b116fa5ff2a832b24ffbc3ed3fa703ca6bf904ed. --- pkgs/os-specific/linux/zfs/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix index 1e28cfe000f..a47b43a1f0f 100644 --- a/pkgs/os-specific/linux/zfs/default.nix +++ b/pkgs/os-specific/linux/zfs/default.nix @@ -45,7 +45,6 @@ in stdenv.mkDerivation rec { substituteInPlace ./module/zfs/zfs_ctldir.c --replace "mount -t zfs" "${utillinux}/bin/mount -t zfs" substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount" "${utillinux}/bin/umount" substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/mount" "${utillinux}/bin/mount" - substituteInPlace ./udev/rules.d/* --replace "/lib/udev/vdev_id" "$out/lib/udev/vdev_id" substituteInPlace ./cmd/ztest/ztest.c --replace "/usr/sbin/ztest" "$out/sbin/ztest" substituteInPlace ./cmd/ztest/ztest.c --replace "/usr/sbin/zdb" "$out/sbin/zdb" substituteInPlace ./config/user-systemd.m4 --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d" @@ -55,6 +54,12 @@ in stdenv.mkDerivation rec { substituteInPlace ./module/Makefile.in --replace "/bin/cp" "cp" substituteInPlace ./etc/systemd/system/zfs-share.service.in \ --replace "@bindir@/rm " "${coreutils}/bin/rm " + + for f in ./udev/rules.d/* + do + substituteInPlace "$f" --replace "/lib/udev/vdev_id" "$out/lib/udev/vdev_id" + done + ./autogen.sh ''; From 373a623daa80b3f1e18a084db4a6ebb206a0046d Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sun, 30 Jul 2017 01:21:44 +0300 Subject: [PATCH 101/108] Revert "Revert "kbd: 2.0.3 -> 2.0.4"" This reverts commit 00bf3a9dcaffedc4eaf244848a2a3f84e648bdba. --- pkgs/os-specific/linux/kbd/console-fix.patch | 18 ----- pkgs/os-specific/linux/kbd/default.nix | 17 +++- pkgs/os-specific/linux/kbd/search-paths.patch | 78 +++++++++---------- 3 files changed, 49 insertions(+), 64 deletions(-) delete mode 100644 pkgs/os-specific/linux/kbd/console-fix.patch diff --git a/pkgs/os-specific/linux/kbd/console-fix.patch b/pkgs/os-specific/linux/kbd/console-fix.patch deleted file mode 100644 index aefc20ff914..00000000000 --- a/pkgs/os-specific/linux/kbd/console-fix.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/loadkeys.c b/src/loadkeys.c -index 6b23f68..adf65a0 100644 ---- a/src/loadkeys.c -+++ b/src/loadkeys.c -@@ -166,10 +166,10 @@ main(int argc, char *argv[]) - exit(EXIT_FAILURE); - } - -- /* get console */ -- fd = getfd(console); -- - if (!(options & OPT_M) && !(options & OPT_B)) { -+ /* get console */ -+ fd = getfd(console); -+ - /* check whether the keyboard is in Unicode mode */ - if (ioctl(fd, KDGKBMODE, &kbd_mode) || - ioctl(fd, KDGETMODE, &kd_mode)) { diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index 6e8893cc37d..31fcdae6c80 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -1,12 +1,15 @@ -{ stdenv, fetchurl, autoreconfHook, gzip, bzip2, pkgconfig, flex, check, pam }: +{ stdenv, fetchurl, autoreconfHook, + gzip, bzip2, pkgconfig, flex, check, + pam, coreutils +}: stdenv.mkDerivation rec { name = "kbd-${version}"; - version = "2.0.3"; + version = "2.0.4"; src = fetchurl { url = "mirror://kernel/linux/utils/kbd/${name}.tar.xz"; - sha256 = "0ppv953gn2zylcagr4z6zg5y2x93dxrml29plypg6xgbq3hrv2bs"; + sha256 = "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"; }; configureFlags = [ @@ -15,7 +18,7 @@ stdenv.mkDerivation rec { "--disable-nls" ]; - patches = [ ./console-fix.patch ./search-paths.patch ]; + patches = [ ./search-paths.patch ]; postPatch = '' @@ -34,6 +37,12 @@ stdenv.mkDerivation rec { ''} ''; + postInstall = '' + substituteInPlace $out/bin/unicode_{start,stop} \ + --replace /usr/bin/tty ${coreutils}/bin/tty + ''; + + buildInputs = [ check pam ]; nativeBuildInputs = [ autoreconfHook pkgconfig flex ]; diff --git a/pkgs/os-specific/linux/kbd/search-paths.patch b/pkgs/os-specific/linux/kbd/search-paths.patch index 66a56041481..c9405a56721 100644 --- a/pkgs/os-specific/linux/kbd/search-paths.patch +++ b/pkgs/os-specific/linux/kbd/search-paths.patch @@ -1,77 +1,71 @@ -diff -ru3 kbd-2.0.3-old/src/libkeymap/analyze.l kbd-2.0.3/src/libkeymap/analyze.l ---- kbd-2.0.3-old/src/libkeymap/analyze.l 2016-07-03 02:31:28.258958092 +0300 -+++ kbd-2.0.3/src/libkeymap/analyze.l 2016-07-03 02:44:53.042592223 +0300 -@@ -99,6 +99,9 @@ +--- a/src/libkeymap/analyze.l ++++ b/src/libkeymap/analyze.l +@@ -101,6 +101,9 @@ stack_pop(struct lk_ctx *ctx, void *scan static const char *const include_dirpath0[] = { "", 0 }; static const char *const include_dirpath1[] = { "", "../include/", "../../include/", 0 }; static const char *const include_dirpath3[] = { -+ "/etc/kbd/" KEYMAPDIR "/include/", -+ "/etc/kbd/" KEYMAPDIR "/i386/include/", -+ "/etc/kbd/" KEYMAPDIR "/mac/include/", ++ "/etc/kbd/" KEYMAPDIR "/include/", ++ "/etc/kbd/" KEYMAPDIR "/i386/include/", ++ "/etc/kbd/" KEYMAPDIR "/mac/include/", DATADIR "/" KEYMAPDIR "/include/", DATADIR "/" KEYMAPDIR "/i386/include/", DATADIR "/" KEYMAPDIR "/mac/include/", 0 -diff -ru3 kbd-2.0.3-old/src/loadkeys.c kbd-2.0.3/src/loadkeys.c ---- kbd-2.0.3-old/src/loadkeys.c 2016-07-03 02:31:28.260958091 +0300 -+++ kbd-2.0.3/src/loadkeys.c 2016-07-03 02:34:34.123871103 +0300 -@@ -26,7 +26,7 @@ +--- a/src/loadkeys.c ++++ b/src/loadkeys.c +@@ -27,7 +27,7 @@ #include "keymap.h" - static const char *progname = NULL; + static const char *progname = NULL; -static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", KERNDIR "/", 0 }; +static const char *const dirpath1[] = { "", "/etc/kbd/" KEYMAPDIR "/**", DATADIR "/" KEYMAPDIR "/**", 0 }; static const char *const suffixes[] = { "", ".kmap", ".map", 0 }; - static void __attribute__ ((noreturn)) -diff -ru3 kbd-2.0.3-old/src/loadunimap.c kbd-2.0.3/src/loadunimap.c ---- kbd-2.0.3-old/src/loadunimap.c 2016-07-03 02:31:28.259958091 +0300 -+++ kbd-2.0.3/src/loadunimap.c 2016-07-03 02:33:06.803911971 +0300 -@@ -28,7 +28,7 @@ + static void __attribute__((noreturn)) +--- a/src/loadunimap.c ++++ b/src/loadunimap.c +@@ -30,7 +30,7 @@ extern char *progname; extern int force; --static const char *const unidirpath[] = { "", DATADIR "/" UNIMAPDIR "/", 0 }; -+static const char *const unidirpath[] = { "", "/etc/kbd/" UNIMAPDIR "/", DATADIR "/" UNIMAPDIR "/", 0 }; +-static const char *const unidirpath[] = { "", DATADIR "/" UNIMAPDIR "/", 0 }; ++static const char *const unidirpath[] = { "", "/etc/kbd/" UNIMAPDIR "/", DATADIR "/" UNIMAPDIR "/", 0 }; static const char *const unisuffixes[] = { "", ".uni", ".sfm", 0 }; #ifdef MAIN -diff -ru3 kbd-2.0.3-old/src/mapscrn.c kbd-2.0.3/src/mapscrn.c ---- kbd-2.0.3-old/src/mapscrn.c 2016-07-03 02:31:28.260958091 +0300 -+++ kbd-2.0.3/src/mapscrn.c 2016-07-03 02:33:21.119905270 +0300 -@@ -25,7 +25,7 @@ - static int ctoi (char *); +--- a/src/mapscrn.c ++++ b/src/mapscrn.c +@@ -27,7 +27,7 @@ void loadnewmap(int fd, char *mfil); + static int ctoi(char *); /* search for the map file in these directories (with trailing /) */ --static const char *const mapdirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 }; -+static const char *const mapdirpath[] = { "", "/etc/kbd/" TRANSDIR "/", DATADIR "/" TRANSDIR "/", 0 }; +-static const char *const mapdirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 }; ++static const char *const mapdirpath[] = { "", "/etc/kbd/" TRANSDIR "/", DATADIR "/" TRANSDIR "/", 0 }; static const char *const mapsuffixes[] = { "", ".trans", "_to_uni.trans", ".acm", 0 }; #ifdef MAIN -diff -ru3 kbd-2.0.3-old/src/resizecons.c kbd-2.0.3/src/resizecons.c ---- kbd-2.0.3-old/src/resizecons.c 2016-07-03 02:31:28.260958091 +0300 -+++ kbd-2.0.3/src/resizecons.c 2016-07-03 02:33:32.253900060 +0300 -@@ -100,7 +100,7 @@ +--- a/src/resizecons.c ++++ b/src/resizecons.c +@@ -101,7 +101,7 @@ static int vga_get_fontheight(void); static void vga_set_cursor(int, int); static void vga_set_verticaldisplayend_lowbyte(int); --const char *const dirpath[] = { "", DATADIR "/" VIDEOMODEDIR "/", 0}; -+const char *const dirpath[] = { "", "/etc/kbd/" VIDEOMODEDIR "/", DATADIR "/" VIDEOMODEDIR "/", 0}; +-const char *const dirpath[] = { "", DATADIR "/" VIDEOMODEDIR "/", 0 }; ++const char *const dirpath[] = { "", "/etc/kbd/" VIDEOMODEDIR "/", DATADIR "/" VIDEOMODEDIR "/", 0}; const char *const suffixes[] = { "", 0 }; - int -diff -ru3 kbd-2.0.3-old/src/setfont.c kbd-2.0.3/src/setfont.c ---- kbd-2.0.3-old/src/setfont.c 2016-07-03 02:31:28.260958091 +0300 -+++ kbd-2.0.3/src/setfont.c 2016-07-03 02:33:54.315889734 +0300 -@@ -51,10 +51,10 @@ - int debug = 0; + int main(int argc, char **argv) +--- a/src/setfont.c ++++ b/src/setfont.c +@@ -53,10 +53,10 @@ int force = 0; + int debug = 0; /* search for the font in these directories (with trailing /) */ --const char *const fontdirpath[] = { "", DATADIR "/" FONTDIR "/", 0 }; -+const char *const fontdirpath[] = { "", "/etc/kbd/" FONTDIR "/", DATADIR "/" FONTDIR "/", 0 }; +-const char *const fontdirpath[] = { "", DATADIR "/" FONTDIR "/", 0 }; ++const char *const fontdirpath[] = { "", "/etc/kbd/" FONTDIR "/", DATADIR "/" FONTDIR "/", 0 }; const char *const fontsuffixes[] = { "", ".psfu", ".psf", ".cp", ".fnt", 0 }; /* hide partial fonts a bit - loading a single one is a bad idea */ --const char *const partfontdirpath[] = { "", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; -+const char *const partfontdirpath[] = { "", "/etc/kbd/" FONTDIR "/" PARTIALDIR "/", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; +-const char *const partfontdirpath[] = { "", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; ++const char *const partfontdirpath[] = { "", "/etc/kbd/" FONTDIR "/" PARTIALDIR "/", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; const char *const partfontsuffixes[] = { "", 0 }; static inline int From 69e24c044aba1c0a3dc4e70d0f988ec1f3e6fb73 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sun, 30 Jul 2017 01:33:26 +0300 Subject: [PATCH 102/108] kbd: fix build --- pkgs/os-specific/linux/kbd/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index 31fcdae6c80..b97f48af414 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -38,8 +38,10 @@ stdenv.mkDerivation rec { ''; postInstall = '' - substituteInPlace $out/bin/unicode_{start,stop} \ - --replace /usr/bin/tty ${coreutils}/bin/tty + for i in $out/bin/unicode_{start,stop}; do + substituteInPlace "$i" \ + --replace /usr/bin/tty ${coreutils}/bin/tty + done ''; From 6128dd4d5085780e5c4b5dd0d8a74085592ac434 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 30 Jul 2017 08:42:33 +0200 Subject: [PATCH 103/108] Python wrapper: undo change 8d76effc178747f0c8f456fe619c1b014736a6af because we would otherwise end up with broken wrappers because PATH and PTYHONPATH weren't set. --- pkgs/development/interpreters/python/wrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/wrap.sh b/pkgs/development/interpreters/python/wrap.sh index 4b9b2024981..1c74e612b55 100644 --- a/pkgs/development/interpreters/python/wrap.sh +++ b/pkgs/development/interpreters/python/wrap.sh @@ -86,7 +86,7 @@ wrapPythonProgramsIn() { _addToPythonPath() { local dir="$1" # Stop if we've already visited here. - [ -n "${pythonPathsSeen[$dir]}" ] || return 0 + if [ -n "${pythonPathsSeen[$dir]}" ]; then return; fi pythonPathsSeen[$dir]=1 # addToSearchPath is defined in stdenv/generic/setup.sh. It will have # the effect of calling `export program_X=$dir/...:$program_X`. From 56fe3814905ee6b7740aeb0c8e97daa9badb8253 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 30 Jul 2017 10:18:47 +0200 Subject: [PATCH 104/108] gdal: enable parallel building --- pkgs/development/libraries/gdal/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix index 07f370b4210..eb8f17980c2 100644 --- a/pkgs/development/libraries/gdal/default.nix +++ b/pkgs/development/libraries/gdal/default.nix @@ -59,6 +59,8 @@ composableDerivation.composableDerivation {} (fixed: rec { wrapPythonPrograms ''; + enableParallelBuilding = true; + meta = { description = "Translator library for raster geospatial data formats"; homepage = http://www.gdal.org/; From 2c8960d85f6f5afc0a8204351380a495e6c1f064 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 30 Jul 2017 10:19:02 +0200 Subject: [PATCH 105/108] python.pkgs.numpy: enable parallel building --- pkgs/development/python-modules/numpy/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/numpy/default.nix b/pkgs/development/python-modules/numpy/default.nix index 965dda8c43a..75b946b4051 100644 --- a/pkgs/development/python-modules/numpy/default.nix +++ b/pkgs/development/python-modules/numpy/default.nix @@ -21,6 +21,7 @@ buildPythonPackage rec { preConfigure = '' sed -i 's/-faltivec//' numpy/distutils/system_info.py + export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES ''; preBuild = '' @@ -32,6 +33,8 @@ buildPythonPackage rec { EOF ''; + enableParallelBuilding = true; + checkPhase = '' runHook preCheck pushd dist From 70cd310712fce9aa2322ff3ba0fe437d4890fe8a Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 30 Jul 2017 10:19:15 +0200 Subject: [PATCH 106/108] python.pkgs.scipy: enable parallel building --- pkgs/development/python-modules/scipy/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix index ed4e205a2ae..f4e4518ef16 100644 --- a/pkgs/development/python-modules/scipy/default.nix +++ b/pkgs/development/python-modules/scipy/default.nix @@ -20,6 +20,7 @@ buildPythonPackage rec { preConfigure = '' sed -i '0,/from numpy.distutils.core/s//import setuptools;from numpy.distutils.core/' setup.py + export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES ''; preBuild = '' @@ -31,6 +32,8 @@ buildPythonPackage rec { EOF ''; + enableParallelBuilding = true; + checkPhase = '' runHook preCheck pushd dist From a974ee0188a923d3c238a3a58777ef0867111244 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 30 Jul 2017 14:03:31 +0200 Subject: [PATCH 107/108] tcp_wrappers: fix weird use of STRINGS in the Makefile --- pkgs/os-specific/linux/tcp-wrappers/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/tcp-wrappers/default.nix b/pkgs/os-specific/linux/tcp-wrappers/default.nix index 526b1a86db1..6a400f1de22 100644 --- a/pkgs/os-specific/linux/tcp-wrappers/default.nix +++ b/pkgs/os-specific/linux/tcp-wrappers/default.nix @@ -22,7 +22,7 @@ in stdenv.mkDerivation rec { patches="$(cat debian/patches/series | sed 's,^,debian/patches/,') $patches" ''; - makeFlags = [ "REAL_DAEMON_DIR=$(out)/bin" "linux" ]; + makeFlags = [ "STRINGS=" "REAL_DAEMON_DIR=$(out)/bin" "linux" ]; installPhase = '' mkdir -p "$out/bin" From ba68231273bea4cba01413fd2a0e56d68db9234c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 30 Jul 2017 14:42:30 +0200 Subject: [PATCH 108/108] libpng: 1.6.30 -> 1.6.31 1.6.30 won't build for ARM. Hydra has almost no binaries for current staging, so let's update for all platforms --- pkgs/development/libraries/libpng/default.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix index 0ae40a76386..94a9aa37ad9 100644 --- a/pkgs/development/libraries/libpng/default.nix +++ b/pkgs/development/libraries/libpng/default.nix @@ -5,13 +5,12 @@ assert zlib != null; let - version = "1.6.30"; - patchVersion = "1.6.30"; - # patchVersion = version; - sha256 = "0rin6la7q03vb7wsafhlvzqri1v9ky30g4ljsfcwa37pzwpk6z16"; + version = "1.6.31"; + patchVersion = "1.6.31"; + sha256 = "0hcbxv9qf4f9q7brrk0ndag526glr8lii43grssv45j9w0nn0ai3"; patch_src = fetchurl { url = "mirror://sourceforge/libpng-apng/libpng-${patchVersion}-apng.patch.gz"; - sha256 = "06nrcp2n77f563hch8g9gv62jg894mvya6zizj5fsmbqzaqmjqqs"; + sha256 = "0f10ih658j514vpvsli0pk378vcmjn78g52cssyg92r4k1r19rla"; }; whenPatched = stdenv.lib.optionalString apngSupport;