···55# rewritten to /nix/store/<hash>/bin/python. Interpreters that are
66# already in the store are left untouched.
7788-fixupOutputHooks+=('if [ -z "$dontPatchShebangs" ]; then patchShebangs "$prefix"; fi')
88+fixupOutputHooks+=('if [ -z "$dontPatchShebangs" -a -e "$prefix" ]; then patchShebangs "$prefix"; fi')
991010patchShebangs() {
1111 local dir="$1"
···4747 '';
48484949 postInstall = ''
5050- # gross! convince apple to release this as part of CF
5151- cp /System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h "$out/System/Library/Frameworks/CoreFoundation.framework/Headers"
5050+ # gross! convince apple to release these as part of CF
5151+ cp /System/Library/Frameworks/CoreFoundation.framework/Headers/{CFAttributedString,CFNotificationCenter}.h \
5252+ "$out/System/Library/Frameworks/CoreFoundation.framework/Headers"
52535354 mv $out/System/* $out
5455 rmdir $out/System
···11-Fix Darwin builds.
22-33-From <http://git.savannah.gnu.org/cgit/cpio.git/commit/?id=3a7a1820d4cecbd77c7b74c785af5942510bf080>.
44-See also <http://lists.gnu.org/archive/html/bug-cpio/2010-07/msg00001.html>.
55-66-diff --git a/src/filetypes.h b/src/filetypes.h
77-index f80faab..81f0c32 100644
88---- a/src/filetypes.h
99-+++ b/src/filetypes.h
1010-@@ -81,5 +81,3 @@
1111- #ifndef S_ISLNK
1212- #define lstat stat
1313- #endif
1414--int lstat ();
1515--int stat ();
+15-19
pkgs/tools/archivers/cpio/default.nix
···11{ stdenv, fetchurl, fetchpatch }:
2233-stdenv.mkDerivation {
44- name = "cpio-2.11";
33+let
44+ version = "2.12";
55+ name = "cpio-${version}";
66+in stdenv.mkDerivation {
77+ inherit name;
5869 src = fetchurl {
77- url = mirror://gnu/cpio/cpio-2.11.tar.bz2;
88- sha256 = "bb820bfd96e74fc6ce43104f06fe733178517e7f5d1cdee553773e8eff7d5bbd";
1010+ url = "mirror://gnu/cpio/${name}.tar.bz2";
1111+ sha256 = "0vi9q475h1rki53100zml75vxsykzyhrn70hidy41s5c2rc8r6bh";
912 };
10131114 patches = [
1212- ./no-gets.patch
1315 (fetchpatch {
1414- name = "CVE-2014-9112.diff";
1515- url = "http://pkgs.fedoraproject.org/cgit/cpio.git/plain/cpio-2.11"
1616- + "-CVE-2014-9112.patch?h=f21&id=b475b4d6f31c95e073edc95c742a33a39ef4ec95";
1717- sha256 = "0c9yrysvpwbmiq7ph84dk6mv46hddiyvkgya1zsmj76n9ypb1b4i";
1616+ name = "CVE-2015-1197-cpio-2.12.patch";
1717+ url = "https://gist.github.com/nckx/70b0bfa80ddfb86c2967/"
1818+ + "raw/e9b40d4d4b701f584f826775b75beb10751dc884/"
1919+ + "CVE-2015-1197-cpio-2.12.patch";
2020+ sha256 = "0ph43m4lavwkc4gnl5h9p3da4kb1pnhwk5l2qsky70dqri8pcr8v";
1821 })
1919- ] ++ stdenv.lib.optional stdenv.isDarwin ./darwin-fix.patch;
2020-2121- postPatch = let pp =
2222- fetchpatch {
2323- name = "CVE-2015-1197.diff";
2424- url = "https://marc.info/?l=oss-security&m=142289947619786&w=2";
2525- sha256 = "0fr95bj416zfljv40fl1sh50059d18wdmfgaq8ad2fqi5cnbk859";
2626- };
2727- # one "<" and one "&" sign get mangled in the patch
2828- in "cat ${pp} | sed 's/</</;s/&/\\&/' | patch -p1";
2222+ ];
29233024 preConfigure = if stdenv.isCygwin then ''
3125 sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'
3226 '' else null;
2727+2828+ enableParallelBuilding = true;
33293430 meta = {
3531 homepage = http://www.gnu.org/software/cpio/;
-24
pkgs/tools/archivers/cpio/no-gets.patch
···11-https://bugs.gentoo.org/424974
22-33-hack until gzip pulls a newer gnulib version
44-55-From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
66-From: Eric Blake <eblake@redhat.com>
77-Date: Thu, 29 Mar 2012 13:30:41 -0600
88-Subject: [PATCH] stdio: don't assume gets any more
99-1010-Gnulib intentionally does not have a gets module, and now that C11
1111-and glibc have dropped it, we should be more proactive about warning
1212-any user on a platform that still has a declaration of this dangerous
1313-interface.
1414-1515---- a/gnu/stdio.in.h
1616-+++ b/gnu/stdio.in.h
1717-@@ -125,7 +125,6 @@
1818- so any use of gets warrants an unconditional warning. Assume it is
1919- always declared, since it is required by C89. */
2020- #undef gets
2121--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
2222-2323- #if @GNULIB_FOPEN@
2424- # if @REPLACE_FOPEN@