git.iko.soy/typeable/nixpkgs
on master help sign in
Merge branch 'staging'

This includes a security update of expat.

commit3afa2460386b1472128e302d1db13dba54e68e12 authorVladimír Čunát <vcunat@gmail.com> dateWed 29 Jun 2016, 07:47 (10 years ago) parentd9036a0f4792cd
64 files changed+530−1076
nixos/lib/testing.nix+4−4 pkgs/applications/graphics/leocad/default.nix+1 pkgs/applications/graphics/photivo/default.nix+8−4 pkgs/applications/misc/cli-visualizer/default.nix+4 pkgs/applications/misc/termite/default.nix+2 pkgs/applications/science/robotics/qgroundcontrol/default.nix+5 pkgs/applications/video/simplescreenrecorder/default.nix+4 pkgs/applications/virtualization/virtualbox/default.nix+8−1 pkgs/build-support/cc-wrapper/default.nix+1 pkgs/build-support/gcc-cross-wrapper/builder.sh+1 pkgs/build-support/gcc-cross-wrapper/default.nix+3−1 pkgs/build-support/setup-hooks/make-wrapper.sh+1−1 pkgs/build-support/trivial-builders.nix+1 pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix+3−3 pkgs/desktops/kde-5/plasma-5.6/plasma-desktop/default.nix+3 pkgs/development/compilers/gcc/4.5/default.nix+26−12 pkgs/development/compilers/gcc/4.6/builder.sh+3−1 pkgs/development/compilers/gcc/4.6/default.nix+25−11 pkgs/development/compilers/gcc/4.8/default.nix+28−22 pkgs/development/compilers/gcc/4.9/default.nix+26−21 pkgs/development/compilers/gcc/5/default.nix+29−23 pkgs/development/compilers/gcc/6/default.nix+25−21 pkgs/development/compilers/gcc/builder.sh+22−23 pkgs/development/interpreters/pypy/default.nix+11 pkgs/development/libraries/botan/generic.nix+2 pkgs/development/libraries/botan/unstable.nix+1 pkgs/development/libraries/expat/CVE-2015-1283-refix.patch−37 pkgs/development/libraries/expat/CVE-2016-0718-v2-2-1.patch−755 pkgs/development/libraries/expat/default.nix+2−4 pkgs/development/libraries/gettext/default.nix+1−1 pkgs/development/libraries/glibc/builder.sh−58 pkgs/development/libraries/glibc/common.nix+1 pkgs/development/libraries/glibc/default.nix+63−2 pkgs/development/libraries/glibc/fix_warnings.patch+36 pkgs/development/libraries/gnutls/3.4.nix+2−2 pkgs/development/libraries/gnutls/3.5.nix+17 pkgs/development/libraries/gnutls/generic.nix+6−2 pkgs/development/libraries/kerberos/krb5.nix+2 pkgs/development/libraries/kerberos/path_char_fix.patch+38 pkgs/development/libraries/libelf/default.nix+3−3 pkgs/development/libraries/libmicrohttpd/default.nix+10−14 pkgs/development/libraries/libxkbcommon/default.nix+5−4 pkgs/development/libraries/xgboost/default.nix+2 pkgs/development/python-modules/generic/wrap.sh+6−7 pkgs/development/tools/analysis/rr/default.nix+2−1 pkgs/development/tools/misc/hydra/default.nix+7−1 pkgs/games/cataclysm-dda/default.nix+3 pkgs/games/dwarf-fortress/dfhack/default.nix+1 pkgs/games/dwarf-fortress/unfuck.nix+2 pkgs/games/openspades/default.nix+5−1 pkgs/games/openspades/git.nix+2 pkgs/games/the-butterfly-effect/default.nix+3 pkgs/misc/emulators/higan/default.nix+1 pkgs/misc/emulators/pcsx2/default.nix+4 pkgs/os-specific/linux/sysdig/default.nix+3 pkgs/servers/nosql/arangodb/default.nix+7−6 pkgs/stdenv/darwin/make-bootstrap-tools.nix+4−2 pkgs/stdenv/generic/setup.sh+4 pkgs/stdenv/linux/make-bootstrap-tools-cross.nix+22−20 pkgs/stdenv/linux/make-bootstrap-tools.nix+3−1 pkgs/tools/misc/coreutils/default.nix+5−1 pkgs/tools/misc/file/default.nix+2−2 pkgs/tools/typesetting/xmlto/default.nix+5−4 pkgs/top-level/all-packages.nix+4
nixos/lib/testing.nix+4−4
@@ -113,14 +113,14 @@ rec {
113113 --add-flags "$vms" \
114114 ${lib.optionalString enableOCR "--prefix PATH : '${ocrProg}/bin'"} \
115115 --run "testScript=\"\$(cat $out/test-script)\"" \
116− --set testScript '"$testScript"' \
117− --set VLANS '"${toString vlans}"'
116+ --set testScript '$testScript' \
117+ --set VLANS '${toString vlans}'
118118 ln -s ${testDriver}/bin/nixos-test-driver $out/bin/nixos-run-vms
119119 wrapProgram $out/bin/nixos-run-vms \
120120 --add-flags "$vms" \
121121 ${lib.optionalString enableOCR "--prefix PATH : '${ocrProg}/bin'"} \
122− --set tests '"startAll; joinAll;"' \
123− --set VLANS '"${toString vlans}"' \
122+ --set tests 'startAll; joinAll;' \
123+ --set VLANS '${toString vlans}' \
124124 ${lib.optionalString (builtins.length vms == 1) "--set USE_SERIAL 1"}
125125 ''; # "
126126
pkgs/applications/graphics/leocad/default.nix+1
@@ -17,6 +17,7 @@ stdenv.mkDerivation rec {
1717 buildInputs = [ qt4 qmake4Hook zlib ];
1818
1919 postPatch = ''
20+ sed '1i#include <cmath>' -i common/camera.cpp
2021 substituteInPlace common/camera.cpp --replace "isnan(" "std::isnan("
2122 export qmakeFlags="$qmakeFlags INSTALL_PREFIX=$out"
2223 '';
pkgs/applications/graphics/photivo/default.nix+8−4
@@ -10,15 +10,19 @@ stdenv.mkDerivation rec {
1010 sha256 = "0f6y18k7db2ci6xn664zcwm1g1k04sdv7gg1yd5jk41bndjb7z8h";
1111 };
1212
13− nativeBuildInputs = [ cmake pkgconfig ];
14−
15− buildInputs = [ qt4 fftw graphicsmagick_q16 lcms2 lensfun libjpeg exiv2 liblqr1 ];
16− patchPhase = '' # kinda icky
13+ postPatch = '' # kinda icky
1714 sed -e '/("@INSTALL@")/d' \
1815 -e s,@INSTALL@,$out/share/photivo, \
1916 -i Sources/ptSettings.cpp
17+ sed '1i#include <math.h>' -i Sources/filters/ptFilter_StdCurve.cpp
2018 '';
2119
20+ nativeBuildInputs = [ cmake pkgconfig ];
21+
22+ buildInputs = [ qt4 fftw graphicsmagick_q16 lcms2 lensfun libjpeg exiv2 liblqr1 ];
23+
24+ enableParallelBuilding = true;
25+
2226 meta = with stdenv.lib; {
2327 platforms = platforms.linux;
2428 maintainers = [ maintainers.mornfall ];
pkgs/applications/misc/cli-visualizer/default.nix+4
@@ -10,6 +10,10 @@ stdenv.mkDerivation rec {
1010 sha256 = "16768gyi85mkizfn874q2q9xf32knw08z27si3k5bk99492dxwzw";
1111 };
1212
13+ postPatch = ''
14+ sed '1i#include <cmath>' -i src/Transformer/SpectrumCircleTransformer.cpp
15+ '';
16+
1317 buildInputs = [ fftw ncurses libpulseaudio ];
1418
1519 buildFlags = [ "ENABLE_PULSE=1" ];
pkgs/applications/misc/termite/default.nix+2
@@ -13,6 +13,8 @@ let
1313 sha256 = "1cw4yw7n9m2si8b7zcfyz9pyihncabxm5g39v1mxslfajxgwzmd8";
1414 };
1515
16+ postPatch = "sed '1i#include <math.h>' -i termite.cc";
17+
1618 makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ];
1719
1820 buildInputs = [ pkgconfig vte gtk3 ncurses ];
pkgs/applications/science/robotics/qgroundcontrol/default.nix+5
@@ -27,6 +27,11 @@ stdenv.mkDerivation rec {
2727 ] ++ qtInputs;
2828
2929 patches = [ ./0001-fix-gcc-cmath-namespace-issues.patch ];
30+ postPatch = ''
31+ sed '1i#include <cmath>' -i src/Vehicle/Vehicle.cc \
32+ -i src/comm/{QGCFlightGearLink,QGCJSBSimLink}.cc \
33+ -i src/{uas/UAS,ui/QGCDataPlot2D}.cc
34+ '';
3035
3136 preConfigure = ''
3237 mkdir build
pkgs/applications/video/simplescreenrecorder/default.nix+4
@@ -11,11 +11,15 @@ stdenv.mkDerivation rec {
1111 sha256 = "1d89ncspjd8c4mckf0nb6y3hrxpv4rjpbj868pznhvfmdgr5nvql";
1212 };
1313
14+ postPatch = "sed '1i#include <random>' -i src/Benchmark.cpp";
15+
1416 buildInputs = [
1517 alsaLib ffmpeg libjack2 libX11 libXext libXfixes mesa pkgconfig
1618 libpulseaudio qt4
1719 ];
1820
21+ enableParallelBuilding = true;
22+
1923 meta = with stdenv.lib; {
2024 description = "A screen recorder for Linux";
2125 homepage = http://www.maartenbaert.be/simplescreenrecorder;
pkgs/applications/virtualization/virtualbox/default.nix+8−1
@@ -97,7 +97,14 @@ in stdenv.mkDerivation {
9797 set +x
9898 '';
9999
100− patches = optional enableHardening ./hardened.patch;
100+ patches = optional enableHardening ./hardened.patch
101+ ++ [
102+ (fetchurl rec {
103+ name = "fix-detect-gcc-5.4.patch";
104+ url = "https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=827193;filename=${name};msg=5";
105+ sha256 = "0y6v5dc6fqj9iv27cl8q2g87v1kxg19129mpas4vjg7g0529v4g9";
106+ })
107+ ];
101108
102109 postPatch = ''
103110 sed -i -e 's|/sbin/ifconfig|${nettools}/bin/ifconfig|' \
pkgs/build-support/cc-wrapper/default.nix+1
@@ -96,6 +96,7 @@ stdenv.mkDerivation {
9696 echo "-L${libc_lib}/lib" > $out/nix-support/libc-ldflags
9797
9898 echo "${libc_lib}" > $out/nix-support/orig-libc
99+ echo "${libc_dev}" > $out/nix-support/orig-libc-dev
99100 ''
100101
101102 + (if nativeTools then ''
pkgs/build-support/gcc-cross-wrapper/builder.sh+1
@@ -111,6 +111,7 @@ chmod +x "$out/bin/$crossConfig-ld"
111111# Glibc.
112112test -n "$gcc" && echo $gcc > $out/nix-support/orig-cc
113113test -n "$libc" && echo $libc > $out/nix-support/orig-libc
114+test -n "$libc_dev" && echo $libc_dev > $out/nix-support/orig-libc-dev
114115
115116doSubstitute "$addFlags" "$out/nix-support/add-flags"
116117
pkgs/build-support/gcc-cross-wrapper/default.nix+3−1
@@ -44,7 +44,9 @@ stdenv.mkDerivation {
4444 ldWrapper = ./ld-wrapper.sh;
4545 utils = ./utils.sh;
4646 addFlags = ./add-flags;
47− inherit nativeTools nativeLibc nativePrefix gcc libc binutils;
47+ inherit nativeTools nativeLibc nativePrefix gcc binutils;
48+ libc = if libc ? out then libc.out else libc;
49+ libc_dev = if libc ? dev then libc.dev else libc;
4850 crossConfig = if cross != null then cross.config else null;
4951 osxMinVersion = cross.osxMinVersion or null;
5052 gccLibs = if gcc != null then gccLibs else null;
pkgs/build-support/setup-hooks/make-wrapper.sh+1−1
@@ -16,7 +16,7 @@ makeWrapper() {
1616 varName=${params[$((n + 1))]}
1717 value=${params[$((n + 2))]}
1818 n=$((n + 2))
19− echo "export $varName=$value" >> $wrapper
19+ echo "export $varName=\"$value\"" >> $wrapper
2020 fi
2121
2222 if test "$p" = "--unset"; then
pkgs/build-support/trivial-builders.nix+1
@@ -8,6 +8,7 @@ rec {
88 runCommand = name: env: buildCommand:
99 stdenv.mkDerivation ({
1010 inherit name buildCommand;
11+ passAsFile = [ "buildCommand" ];
1112 } // env);
1213
1314
pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix+3−3
@@ -3,7 +3,7 @@
33let
44
55 common = { pname, sha256 }: stdenv.mkDerivation rec {
6− name = "${pname}-1.78.1";
6+ name = "${pname}-1.79.1";
77
88 src = fetchurl {
99 url = "mirror://sourceforge/docbook/${name}.tar.bz2";
@@ -35,12 +35,12 @@ in {
3535
3636 docbook_xsl = common {
3737 pname = "docbook-xsl";
38− sha256 = "0rxl013ncmz1n6ymk2idvx3hix9pdabk8xn01cpcv32wmfb753y9";
38+ sha256 = "0s59lihif2fr7rznckxr2kfyrvkirv76r1zvidp9b5mj28p4apvj";
3939 };
4040
4141 docbook_xsl_ns = common {
4242 pname = "docbook-xsl-ns";
43− sha256 = "1x3sc0axk9z3i6n0jhlsmzlmb723a4sjgslm9g12by6phirdx3ng";
43+ sha256 = "170ggf5dgjar65kkn5n33kvjr3pdinpj66nnxfx8b2avw0k91jin";
4444 };
4545
4646}
pkgs/desktops/kde-5/plasma-5.6/plasma-desktop/default.nix+3
@@ -34,6 +34,9 @@ plasmaPackage rec {
3434 })
3535 ./0003-tzdir.patch
3636 ];
37+ postPatch = ''
38+ sed '1i#include <cmath>' -i kcms/touchpad/src/backends/x11/synapticstouchpad.cpp
39+ '';
3740 NIX_CFLAGS_COMPILE = [ "-I${xorgserver.dev}/include/xorg" ];
3841 cmakeFlags = [
3942 "-DEvdev_INCLUDE_DIRS=${xf86inputevdev.dev}/include/xorg"
pkgs/development/compilers/gcc/4.5/default.nix+26−12
@@ -179,11 +179,11 @@ stdenv.mkDerivation ({
179179 sed -i "${gnu_h}" \
180180 -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
181181
182− echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
182+ echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
183183 sed -i "${gnu_h}" \
184− -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
184+ -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
185185 sed -i gcc/config/t-gnu \
186− -es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc}/include|g'
186+ -es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc.dev}/include|g'
187187 ''
188188 else if cross != null || stdenv.cc.libc != null then
189189 # On NixOS, use the right path to the dynamic linker instead of
@@ -197,7 +197,7 @@ stdenv.mkDerivation ({
197197 grep -q LIBC_DYNAMIC_LINKER "$header" || continue
198198 echo " fixing \`$header'..."
199199 sed -i "$header" \
200− -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
200+ -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
201201 done
202202 ''
203203 else null;
@@ -205,10 +205,10 @@ stdenv.mkDerivation ({
205205 inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
206206 libcCross crossMingw;
207207
208− nativeBuildInputs = [ texinfo which ]
208+ nativeBuildInputs = [ texinfo which gettext ]
209209 ++ optional (perl != null) perl;
210210
211− buildInputs = [ gmp mpfr libmpc libelf gettext ]
211+ buildInputs = [ gmp mpfr libmpc libelf ]
212212 ++ (optional (ppl != null) ppl)
213213 ++ (optional (cloogppl != null) cloogppl)
214214 ++ (optional (zlib != null) zlib)
@@ -284,6 +284,7 @@ stdenv.mkDerivation ({
284284 ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
285285 --with-gmp=${gmp.crossDrv}
286286 --with-mpfr=${mpfr.crossDrv}
287+ --with-mpc=${libmpc.crossDrv}
287288 --disable-libstdcxx-pch
288289 --without-included-gettext
289290 --with-system-zlib
@@ -346,15 +347,28 @@ stdenv.mkDerivation ({
346347 ++ optional (libpthread != null) libpthread)));
347348
348349 EXTRA_TARGET_CFLAGS =
349− if cross != null && libcCross != null
350− then "-idirafter ${libcCross}/include"
350+ if cross != null && libcCross != null then [
351+ "-idirafter ${libcCross.dev}/include"
352+ ]
353+ ++ optionals (! crossStageStatic) [
354+ "-B${libcCross.out}/lib"
355+ ]
351356 else null;
352357
353358 EXTRA_TARGET_LDFLAGS =
354− if cross != null && libcCross != null
355− then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
356− (optionalString (libpthreadCross != null)
357− " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
359+ if cross != null && libcCross != null then [
360+ "-Wl,-L${libcCross.out}/lib"
361+ ]
362+ ++ (if crossStageStatic then [
363+ "-B${libcCross.out}/lib"
364+ ] else [
365+ "-Wl,-rpath,${libcCross.out}/lib"
366+ "-Wl,-rpath-link,${libcCross.out}/lib"
367+ ])
368+ ++ optionals (libpthreadCross != null) [
369+ "-L${libpthreadCross}/lib"
370+ "-Wl,${libpthreadCross.TARGET_LDFLAGS}"
371+ ]
358372 else null;
359373
360374 passthru = { inherit langC langCC langAda langFortran langVhdl
pkgs/development/compilers/gcc/4.6/builder.sh+3−1
@@ -209,7 +209,9 @@ postInstall() {
209209 # Move runtime libraries to $lib.
210210 mkdir -p $lib/lib
211211 ln -s lib $lib/lib64
212− mv -v $out/lib/lib*.so $out/lib/lib*.so.*[0-9] $out/lib/*.la $lib/lib/
212+ moveToOutput "lib/lib*.so" "$lib"
213+ moveToOutput "lib/lib*.so.*[0-9]" "$lib"
214+ moveToOutput "lib/*.la" "$lib"
213215 for i in $lib/lib/*.la; do
214216 substituteInPlace $i --replace $out $lib
215217 done
pkgs/development/compilers/gcc/4.6/default.nix+25−11
@@ -170,7 +170,7 @@ let version = "4.6.4";
170170 "-stage-final";
171171 crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
172172
173− bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
173+ bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips && !stdenv.isDarwin;
174174
175175in
176176
@@ -229,11 +229,11 @@ stdenv.mkDerivation ({
229229 sed -i "${gnu_h}" \
230230 -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
231231
232− echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
232+ echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
233233 sed -i "${gnu_h}" \
234− -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
234+ -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
235235 sed -i gcc/config/t-gnu \
236− -es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc}/include|g'
236+ -es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc.dev}/include|g'
237237 ''
238238 else if cross != null || stdenv.cc.libc != null then
239239 # On NixOS, use the right path to the dynamic linker instead of
@@ -247,7 +247,7 @@ stdenv.mkDerivation ({
247247 grep -q LIBC_DYNAMIC_LINKER "$header" || continue
248248 echo " fixing \`$header'..."
249249 sed -i "$header" \
250− -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
250+ -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
251251 done
252252 ''
253253 else null;
@@ -357,6 +357,7 @@ stdenv.mkDerivation ({
357357 ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
358358 --with-gmp=${gmp.crossDrv}
359359 --with-mpfr=${mpfr.crossDrv}
360+ --with-mpc=${libmpc.crossDrv}
360361 --disable-libstdcxx-pch
361362 --without-included-gettext
362363 --with-system-zlib
@@ -421,15 +422,28 @@ stdenv.mkDerivation ({
421422 ++ optional (libpthread != null) libpthread)));
422423
423424 EXTRA_TARGET_CFLAGS =
424− if cross != null && libcCross != null
425− then "-idirafter ${libcCross}/include"
425+ if cross != null && libcCross != null then [
426+ "-idirafter ${libcCross.dev}/include"
427+ ]
428+ ++ optionals (! crossStageStatic) [
429+ "-B${libcCross.out}/lib"
430+ ]
426431 else null;
427432
428433 EXTRA_TARGET_LDFLAGS =
429− if cross != null && libcCross != null
430− then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
431− (optionalString (libpthreadCross != null)
432− " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
434+ if cross != null && libcCross != null then [
435+ "-Wl,-L${libcCross.out}/lib"
436+ ]
437+ ++ (if crossStageStatic then [
438+ "-B${libcCross.out}/lib"
439+ ] else [
440+ "-Wl,-rpath,${libcCross.out}/lib"
441+ "-Wl,-rpath-link,${libcCross.out}/lib"
442+ ])
443+ ++ optionals (libpthreadCross != null) [
444+ "-L${libpthreadCross}/lib"
445+ "-Wl,${libpthreadCross.TARGET_LDFLAGS}"
446+ ]
433447 else null;
434448
435449 passthru = { inherit langC langCC langAda langFortran langVhdl
pkgs/development/compilers/gcc/4.8/default.nix+28−22
@@ -70,7 +70,8 @@ let version = "4.8.5";
7070 # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
7171 # target libraries and tools.
7272 ++ optional langAda ../gnat-cflags.patch
73− ++ optional langFortran ../gfortran-driving.patch;
73+ ++ optional langFortran ../gfortran-driving.patch
74+ ++ optional stdenv.isDarwin ../gfortran-darwin-NXConstStr.patch;
7475
7576 javaEcj = fetchurl {
7677 # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
@@ -164,8 +165,8 @@ let version = "4.8.5";
164165 " --disable-libatomic " + # libatomic requires libc
165166 " --disable-decimal-float" # libdecnumber requires libc
166167 else
167− (if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
168− else " --with-headers=${libcCross}/include") +
168+ (if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot"
169+ else " --with-headers=${libcCross.dev}/include") +
169170 # Ensure that -print-prog-name is able to find the correct programs.
170171 (stdenv.lib.optionalString (crossMingw || crossDarwin) (
171172 " --with-as=${binutilsCross}/bin/${cross.config}-as" +
@@ -197,7 +198,7 @@ let version = "4.8.5";
197198 stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
198199 crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
199200
200− bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
201+ bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips && !stdenv.isDarwin;
201202
202203in
203204
@@ -255,9 +256,9 @@ stdenv.mkDerivation ({
255256 sed -i "${gnu_h}" \
256257 -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
257258
258− echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
259+ echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
259260 sed -i "${gnu_h}" \
260− -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
261+ -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
261262 ''
262263 else if cross != null || stdenv.cc.libc != null then
263264 # On NixOS, use the right path to the dynamic linker instead of
@@ -271,7 +272,7 @@ stdenv.mkDerivation ({
271272 grep -q LIBC_DYNAMIC_LINKER "$header" || continue
272273 echo " fixing \`$header'..."
273274 sed -i "$header" \
274− -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
275+ -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
275276 done
276277 ''
277278 else null;
@@ -304,15 +305,6 @@ stdenv.mkDerivation ({
304305 export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
305306 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
306307 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
307− '' + stdenv.lib.optionalString stdenv.isDarwin ''
308− if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
309− configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
310− makeFlagsArray+=( \
311− CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
312− CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
313− FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
314− )
315− fi
316308 '';
317309
318310 dontDisableStatic = true;
@@ -415,6 +407,7 @@ stdenv.mkDerivation ({
415407 ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
416408 --with-gmp=${gmp.crossDrv}
417409 --with-mpfr=${mpfr.crossDrv}
410+ --with-mpc=${libmpc.crossDrv}
418411 --disable-libstdcxx-pch
419412 --without-included-gettext
420413 --with-system-zlib
@@ -482,15 +475,28 @@ stdenv.mkDerivation ({
482475 ++ optional (libpthread != null) libpthread)));
483476
484477 EXTRA_TARGET_CFLAGS =
485− if cross != null && libcCross != null
486− then "-idirafter ${libcCross}/include"
478+ if cross != null && libcCross != null then [
479+ "-idirafter ${libcCross.dev}/include"
480+ ]
481+ ++ optionals (! crossStageStatic) [
482+ "-B${libcCross.out}/lib"
483+ ]
487484 else null;
488485
489486 EXTRA_TARGET_LDFLAGS =
490− if cross != null && libcCross != null
491− then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
492− (optionalString (libpthreadCross != null)
493− " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
487+ if cross != null && libcCross != null then [
488+ "-Wl,-L${libcCross.out}/lib"
489+ ]
490+ ++ (if crossStageStatic then [
491+ "-B${libcCross.out}/lib"
492+ ] else [
493+ "-Wl,-rpath,${libcCross.out}/lib"
494+ "-Wl,-rpath-link,${libcCross.out}/lib"
495+ ])
496+ ++ optionals (libpthreadCross != null) [
497+ "-L${libpthreadCross}/lib"
498+ "-Wl,${libpthreadCross.TARGET_LDFLAGS}"
499+ ]
494500 else null;
495501
496502 passthru =
pkgs/development/compilers/gcc/4.9/default.nix+26−21
@@ -166,8 +166,8 @@ let version = "4.9.3";
166166 " --disable-libatomic " + # libatomic requires libc
167167 " --disable-decimal-float" # libdecnumber requires libc
168168 else
169− (if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
170− else " --with-headers=${libcCross}/include") +
169+ (if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot"
170+ else " --with-headers=${libcCross.dev}/include") +
171171 # Ensure that -print-prog-name is able to find the correct programs.
172172 (stdenv.lib.optionalString (crossMingw || crossDarwin) (
173173 " --with-as=${binutilsCross}/bin/${cross.config}-as" +
@@ -199,7 +199,7 @@ let version = "4.9.3";
199199 stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
200200 crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
201201
202− bootstrap = cross == null;
202+ bootstrap = cross == null && !stdenv.isDarwin;
203203
204204in
205205
@@ -258,9 +258,9 @@ stdenv.mkDerivation ({
258258 sed -i "${gnu_h}" \
259259 -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
260260
261− echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
261+ echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
262262 sed -i "${gnu_h}" \
263− -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
263+ -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
264264 ''
265265 else if cross != null || stdenv.cc.libc != null then
266266 # On NixOS, use the right path to the dynamic linker instead of
@@ -274,7 +274,7 @@ stdenv.mkDerivation ({
274274 grep -q LIBC_DYNAMIC_LINKER "$header" || continue
275275 echo " fixing \`$header'..."
276276 sed -i "$header" \
277− -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
277+ -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
278278 done
279279 ''
280280 else null;
@@ -307,15 +307,6 @@ stdenv.mkDerivation ({
307307 export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
308308 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
309309 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
310− '' + stdenv.lib.optionalString stdenv.isDarwin ''
311− if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
312− configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
313− makeFlagsArray+=( \
314− CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
315− CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
316− FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
317− )
318− fi
319310 ''
320311 + stdenv.lib.optionalString (langJava || langGo) ''
321312 export lib=$out;
@@ -422,6 +413,7 @@ stdenv.mkDerivation ({
422413 ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
423414 --with-gmp=${gmp.crossDrv}
424415 --with-mpfr=${mpfr.crossDrv}
416+ --with-mpc=${libmpc.crossDrv}
425417 --disable-libstdcxx-pch
426418 --without-included-gettext
427419 --with-system-zlib
@@ -489,15 +481,28 @@ stdenv.mkDerivation ({
489481 ++ optional (libpthread != null) libpthread)));
490482
491483 EXTRA_TARGET_CFLAGS =
492− if cross != null && libcCross != null
493− then "-idirafter ${libcCross}/include"
484+ if cross != null && libcCross != null then [
485+ "-idirafter ${libcCross.dev}/include"
486+ ]
487+ ++ optionals (! crossStageStatic) [
488+ "-B${libcCross.out}/lib"
489+ ]
494490 else null;
495491
496492 EXTRA_TARGET_LDFLAGS =
497− if cross != null && libcCross != null
498− then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
499− (optionalString (libpthreadCross != null)
500− " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
493+ if cross != null && libcCross != null then [
494+ "-Wl,-L${libcCross.out}/lib"
495+ ]
496+ ++ (if crossStageStatic then [
497+ "-B${libcCross.out}/lib"
498+ ] else [
499+ "-Wl,-rpath,${libcCross.out}/lib"
500+ "-Wl,-rpath-link,${libcCross.out}/lib"
501+ ])
502+ ++ optionals (libpthreadCross != null) [
503+ "-L${libpthreadCross}/lib"
504+ "-Wl,${libpthreadCross.TARGET_LDFLAGS}"
505+ ]
501506 else null;
502507
503508 passthru =
pkgs/development/compilers/gcc/5/default.nix+29−23
@@ -58,7 +58,8 @@ assert langGo -> langCC;
5858with stdenv.lib;
5959with builtins;
6060
61−let version = "5.3.0";
61+let version = "5.4.0";
62+ sha256 = "0fihlcy5hnksdxk0sn6bvgnyq8gfrgs8m794b1jxwd1dxinzg3b0";
6263
6364 # Whether building a cross-compiler for GNU/Hurd.
6465 crossGNU = cross != null && cross.config == "i586-pc-gnu";
@@ -165,8 +166,8 @@ let version = "5.3.0";
165166 " --disable-libatomic " + # libatomic requires libc
166167 " --disable-decimal-float" # libdecnumber requires libc
167168 else
168− (if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
169− else " --with-headers=${libcCross}/include") +
169+ (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot"
170+ else " --with-headers=${getDev libcCross}/include") +
170171 # Ensure that -print-prog-name is able to find the correct programs.
171172 (stdenv.lib.optionalString (crossMingw || crossDarwin) (
172173 " --with-as=${binutilsCross}/bin/${cross.config}-as" +
@@ -198,7 +199,7 @@ let version = "5.3.0";
198199 stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
199200 crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
200201
201− bootstrap = cross == null;
202+ bootstrap = cross == null && !stdenv.isDarwin;
202203
203204in
204205
@@ -212,7 +213,7 @@ stdenv.mkDerivation ({
212213
213214 src = fetchurl {
214215 url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
215− sha256 = "1ny4smkp5bzs3cp8ss7pl6lk8yss0d9m4av1mvdp72r1x695akxq";
216+ inherit sha256;
216217 };
217218
218219 inherit patches;
@@ -256,9 +257,9 @@ stdenv.mkDerivation ({
256257 sed -i "${gnu_h}" \
257258 -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
258259
259− echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
260+ echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
260261 sed -i "${gnu_h}" \
261− -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
262+ -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
262263 ''
263264 else if cross != null || stdenv.cc.libc != null then
264265 # On NixOS, use the right path to the dynamic linker instead of
@@ -272,7 +273,7 @@ stdenv.mkDerivation ({
272273 grep -q LIBC_DYNAMIC_LINKER "$header" || continue
273274 echo " fixing \`$header'..."
274275 sed -i "$header" \
275− -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
276+ -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
276277 done
277278 ''
278279 else null;
@@ -306,15 +307,6 @@ stdenv.mkDerivation ({
306307 export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
307308 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
308309 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
309− '' + stdenv.lib.optionalString stdenv.isDarwin ''
310− if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
311− configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
312− makeFlagsArray+=( \
313− CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
314− CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
315− FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
316− )
317− fi
318310 '';
319311
320312 dontDisableStatic = true;
@@ -415,6 +407,7 @@ stdenv.mkDerivation ({
415407 ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
416408 --with-gmp=${gmp.crossDrv}
417409 --with-mpfr=${mpfr.crossDrv}
410+ --with-mpc=${libmpc.crossDrv}
418411 --disable-libstdcxx-pch
419412 --without-included-gettext
420413 --with-system-zlib
@@ -482,15 +475,28 @@ stdenv.mkDerivation ({
482475 ++ optional (libpthread != null) libpthread)));
483476
484477 EXTRA_TARGET_CFLAGS =
485− if cross != null && libcCross != null
486− then "-idirafter ${libcCross}/include"
478+ if cross != null && libcCross != null then [
479+ "-idirafter ${getDev libcCross}/include"
480+ ]
481+ ++ optionals (! crossStageStatic) [
482+ "-B${libcCross.out}/lib"
483+ ]
487484 else null;
488485
489486 EXTRA_TARGET_LDFLAGS =
490− if cross != null && libcCross != null
491− then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
492− (optionalString (libpthreadCross != null)
493− " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
487+ if cross != null && libcCross != null then [
488+ "-Wl,-L${libcCross.out}/lib"
489+ ]
490+ ++ (if crossStageStatic then [
491+ "-B${libcCross.out}/lib"
492+ ] else [
493+ "-Wl,-rpath,${libcCross.out}/lib"
494+ "-Wl,-rpath-link,${libcCross.out}/lib"
495+ ])
496+ ++ optionals (libpthreadCross != null) [
497+ "-L${libpthreadCross}/lib"
498+ "-Wl,${libpthreadCross.TARGET_LDFLAGS}"
499+ ]
494500 else null;
495501
496502 passthru =
pkgs/development/compilers/gcc/6/default.nix+25−21
@@ -165,8 +165,8 @@ let version = "6.1.0";
165165 " --disable-libatomic " + # libatomic requires libc
166166 " --disable-decimal-float" # libdecnumber requires libc
167167 else
168− (if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
169− else " --with-headers=${libcCross}/include") +
168+ (if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot"
169+ else " --with-headers=${libcCross.dev}/include") +
170170 # Ensure that -print-prog-name is able to find the correct programs.
171171 (stdenv.lib.optionalString (crossMingw || crossDarwin) (
172172 " --with-as=${binutilsCross}/bin/${cross.config}-as" +
@@ -198,7 +198,7 @@ let version = "6.1.0";
198198 stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
199199 crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
200200
201− bootstrap = cross == null;
201+ bootstrap = cross == null && !stdenv.isDarwin;
202202
203203in
204204
@@ -256,9 +256,9 @@ stdenv.mkDerivation ({
256256 sed -i "${gnu_h}" \
257257 -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
258258
259− echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
259+ echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
260260 sed -i "${gnu_h}" \
261− -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
261+ -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
262262 ''
263263 else if cross != null || stdenv.cc.libc != null then
264264 # On NixOS, use the right path to the dynamic linker instead of
@@ -272,7 +272,7 @@ stdenv.mkDerivation ({
272272 grep -q LIBC_DYNAMIC_LINKER "$header" || continue
273273 echo " fixing \`$header'..."
274274 sed -i "$header" \
275− -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
275+ -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
276276 done
277277 ''
278278 else null;
@@ -306,15 +306,6 @@ stdenv.mkDerivation ({
306306 export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
307307 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
308308 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
309− '' + stdenv.lib.optionalString stdenv.isDarwin ''
310− if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
311− configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
312− makeFlagsArray+=( \
313− CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
314− CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
315− FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
316− )
317− fi
318309 '';
319310
320311 dontDisableStatic = true;
@@ -482,15 +473,28 @@ stdenv.mkDerivation ({
482473 ++ optional (libpthread != null) libpthread)));
483474
484475 EXTRA_TARGET_CFLAGS =
485− if cross != null && libcCross != null
486− then "-idirafter ${libcCross}/include"
476+ if cross != null && libcCross != null then [
477+ "-idirafter ${libcCross.dev}/include"
478+ ]
479+ ++ optionals (! crossStageStatic) [
480+ "-B${libcCross.out}/lib"
481+ ]
487482 else null;
488483
489484 EXTRA_TARGET_LDFLAGS =
490− if cross != null && libcCross != null
491− then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
492− (optionalString (libpthreadCross != null)
493− " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
485+ if cross != null && libcCross != null then [
486+ "-Wl,-L${libcCross.out}/lib"
487+ ]
488+ ++ (if crossStageStatic then [
489+ "-B${libcCross.out}/lib"
490+ ] else [
491+ "-Wl,-rpath,${libcCross.out}/lib"
492+ "-Wl,-rpath-link,${libcCross.out}/lib"
493+ ])
494+ ++ optionals (libpthreadCross != null) [
495+ "-L${libpthreadCross}/lib"
496+ "-Wl,${libpthreadCross.TARGET_LDFLAGS}"
497+ ]
494498 else null;
495499
496500 passthru =
pkgs/development/compilers/gcc/builder.sh+22−23
@@ -70,10 +70,6 @@ if test "$noSysDirs" = "1"; then
7070 # gcj in.
7171 unset LIBRARY_PATH
7272 unset CPATH
73− if test -z "$crossStageStatic"; then
74− EXTRA_TARGET_CFLAGS="-B${libcCross}/lib -idirafter ${libcCross}/include"
75− EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib -Wl,-rpath,${libcCross}/lib -Wl,-rpath-link,${libcCross}/lib"
76− fi
7773 else
7874 if test -z "$NIX_CC_CROSS"; then
7975 EXTRA_TARGET_CFLAGS="$EXTRA_FLAGS"
@@ -90,15 +86,16 @@ if test "$noSysDirs" = "1"; then
9086 extraFlags="$(cat $NIX_CC_CROSS/nix-support/libc-cflags)"
9187 extraLDFlags="$(cat $NIX_CC_CROSS/nix-support/libc-ldflags) $(cat $NIX_CC_CROSS/nix-support/libc-ldflags-before)"
9288
93− # Use *real* header files, otherwise a limits.h is generated
94− # that does not include Glibc's limits.h (notably missing
95− # SSIZE_MAX, which breaks the build).
96− NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_CC_CROSS/nix-support/orig-libc)/include
97−
9889 # The path to the Glibc binaries such as `crti.o'.
9990 glibc_dir="$(cat $NIX_CC_CROSS/nix-support/orig-libc)"
10091 glibc_libdir="$glibc_dir/lib"
101− configureFlags="$configureFlags --with-native-system-header-dir=$glibc_dir/include"
92+ glibc_devdir="$(cat $NIX_CC_CROSS/nix-support/orig-libc-dev)"
93+ configureFlags="$configureFlags --with-native-system-header-dir=$glibc_devdir/include"
94+
95+ # Use *real* header files, otherwise a limits.h is generated
96+ # that does not include Glibc's limits.h (notably missing
97+ # SSIZE_MAX, which breaks the build).
98+ NIX_FIXINC_DUMMY_CROSS="$glibc_devdir/include"
10299
103100 extraFlags="-I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
104101 extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
@@ -229,19 +226,21 @@ postInstall() {
229226 # More dependencies with the previous gcc or some libs (gccbug stores the build command line)
230227 rm -rf $out/bin/gccbug
231228
232− # Take out the bootstrap-tools from the rpath, as it's not needed at all having $out
233− for i in $(find "$out"/libexec/gcc/*/*/* -type f -a \! -name '*.la'); do
234− PREV_RPATH=`patchelf --print-rpath "$i"`
235− NEW_RPATH=`echo "$PREV_RPATH" | sed 's,:[^:]*bootstrap-tools/lib,,g'`
236− patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK
237− done
238−
239− # For some reason the libs retain RPATH to $out
240− for i in "$lib"/lib/{libtsan,libasan,libubsan}.so.*.*.*; do
241− PREV_RPATH=`patchelf --print-rpath "$i"`
242− NEW_RPATH=`echo "$PREV_RPATH" | sed "s,:${out}[^:]*,,g"`
243− patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK
244− done
229+ if type "patchelf"; then
230+ # Take out the bootstrap-tools from the rpath, as it's not needed at all having $out
231+ for i in $(find "$out"/libexec/gcc/*/*/* -type f -a \! -name '*.la'); do
232+ PREV_RPATH=`patchelf --print-rpath "$i"`
233+ NEW_RPATH=`echo "$PREV_RPATH" | sed 's,:[^:]*bootstrap-tools/lib,,g'`
234+ patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK
235+ done
236+
237+ # For some reason the libs retain RPATH to $out
238+ for i in "$lib"/lib/{libtsan,libasan,libubsan}.so.*.*.*; do
239+ PREV_RPATH=`patchelf --print-rpath "$i"`
240+ NEW_RPATH=`echo "$PREV_RPATH" | sed "s,:${out}[^:]*,,g"`
241+ patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK
242+ done
243+ fi
245244
246245 # Get rid of some "fixed" header files
247246 rm -rfv $out/lib/gcc/*/*/include-fixed/{root,linux}
pkgs/development/interpreters/pypy/default.nix+11
@@ -21,6 +21,17 @@ let
2121 sha256 = "1dmckvffanmh0b50pq34shnw05r55gjxn43kgvnkz5kkvvsbxdg1";
2222 };
2323
24+ # http://bugs.python.org/issue27369
25+ postPatch = let
26+ expatch = fetchurl {
27+ name = "tests-expat-2.2.0.patch";
28+ url = "http://bugs.python.org/file43514/0001-Fix-Python-2.7.11-tests-for-Expat-2.2.0.patch";
29+ sha256 = "1j3pa7ly9xrhp8jjwg5l77z7i3y68gx8f8jchqk6zc39d9glq3il";
30+ };
31+ in ''
32+ patch lib-python/2.7/test/test_pyexpat.py < '${expatch}'
33+ '';
34+
2435 buildInputs = [ bzip2 openssl pkgconfig pythonFull libffi ncurses expat sqlite tk tcl xlibsWrapper libX11 makeWrapper gdbm db ]
2536 ++ stdenv.lib.optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc
2637 ++ stdenv.lib.optional zlibSupport zlib;
pkgs/development/libraries/botan/generic.nix+2
@@ -2,6 +2,7 @@
22# Passed by version specific builders
33, baseVersion, revision, sha256
44, extraConfigureFlags ? ""
5+, postPatch ? null
56, ...
67}:
78
@@ -17,6 +18,7 @@ stdenv.mkDerivation rec {
1718 ];
1819 inherit sha256;
1920 };
21+ inherit postPatch;
2022
2123 buildInputs = [ python bzip2 zlib gmp openssl boost ];
2224
pkgs/development/libraries/botan/unstable.nix+1
@@ -5,4 +5,5 @@ callPackage ./generic.nix (args // {
55 revision = "29";
66 sha256 = "157bp8716h17agrxyj7xpsj2i5sqhafj1nfx4gpzccx7y2kyq176";
77 openssl = null;
8+ postPatch = "sed '1i#include <cmath>' -i src/tests/test_bigint.cpp";
89})
pkgs/development/libraries/expat/CVE-2015-1283-refix.patchdeleted−37
@@ -1,37 +0,0 @@
1−From 29a11774d8ebbafe8418b4a5ffb4cc1160b194a1 Mon Sep 17 00:00:00 2001
2−From: Pascal Cuoq <cuoq@trust-in-soft.com>
3−Date: Sun, 15 May 2016 09:05:46 +0200
4−Subject: [PATCH] Avoid relying on undefined behavior in CVE-2015-1283 fix. It
5− does not really work: https://godbolt.org/g/Zl8gdF
6−
7−---
8− expat/lib/xmlparse.c | 6 ++++--
9− 1 file changed, 4 insertions(+), 2 deletions(-)
10−
11−diff --git a/lib/xmlparse.c b/lib/xmlparse.c
12−index 13e080d..cdb12ef 100644
13−--- a/lib/xmlparse.c
14−+++ b/lib/xmlparse.c
15−@@ -1693,7 +1693,8 @@ XML_GetBuffer(XML_Parser parser, int len)
16− }
17−
18− if (len > bufferLim - bufferEnd) {
19−- int neededSize = len + (int)(bufferEnd - bufferPtr);
20−+ /* Do not invoke signed arithmetic overflow: */
21−+ int neededSize = (int) ((unsigned)len + (unsigned)(bufferEnd - bufferPtr));
22− if (neededSize < 0) {
23− errorCode = XML_ERROR_NO_MEMORY;
24− return NULL;
25−@@ -1725,7 +1726,8 @@ XML_GetBuffer(XML_Parser parser, int len)
26− if (bufferSize == 0)
27− bufferSize = INIT_BUFFER_SIZE;
28− do {
29−- bufferSize *= 2;
30−+ /* Do not invoke signed arithmetic overflow: */
31−+ bufferSize = (int) (2U * (unsigned) bufferSize);
32− } while (bufferSize < neededSize && bufferSize > 0);
33− if (bufferSize <= 0) {
34− errorCode = XML_ERROR_NO_MEMORY;
35−--
36−2.8.2
37−
pkgs/development/libraries/expat/CVE-2016-0718-v2-2-1.patchdeleted−755
@@ -1,755 +0,0 @@
1−From cdfcb1b5c95e93b00ae9e9d25708b4a3bee72c15 Mon Sep 17 00:00:00 2001
2−From: Sebastian Pipping <sebastian@pipping.org>
3−Date: Mon, 2 May 2016 00:02:44 +0200
4−Subject: [PATCH] Address CVE-2016-0718 (/patch/ version 2.2.1)
5−
6−* Out of bounds memory access when doing text conversion on malformed input
7−* Integer overflow related to memory allocation
8−
9−Reported by Gustavo Grieco
10−
11−Patch credits go to
12−* Christian Heimes
13−* Karl Waclawek
14−* Gustavo Grieco
15−* Sebastian Pipping
16−* Pascal Cuoq
17−---
18− expat/lib/xmlparse.c | 34 +++++++++-----
19− expat/lib/xmltok.c | 115 +++++++++++++++++++++++++++++++++++-------------
20− expat/lib/xmltok.h | 10 ++++-
21− expat/lib/xmltok_impl.c | 62 +++++++++++++-------------
22− 4 files changed, 146 insertions(+), 75 deletions(-)
23−
24−diff --git a/lib/xmlparse.c b/lib/xmlparse.c
25−index e308c79..13e080d 100644
26−--- a/lib/xmlparse.c
27−+++ b/lib/xmlparse.c
28−@@ -2426,11 +2426,11 @@ doContent(XML_Parser parser,
29− for (;;) {
30− int bufSize;
31− int convLen;
32−- XmlConvert(enc,
33−+ const enum XML_Convert_Result convert_res = XmlConvert(enc,
34− &fromPtr, rawNameEnd,
35− (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1);
36− convLen = (int)(toPtr - (XML_Char *)tag->buf);
37−- if (fromPtr == rawNameEnd) {
38−+ if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE)) {
39− tag->name.strLen = convLen;
40− break;
41− }
42−@@ -2651,11 +2651,11 @@ doContent(XML_Parser parser,
43− if (MUST_CONVERT(enc, s)) {
44− for (;;) {
45− ICHAR *dataPtr = (ICHAR *)dataBuf;
46−- XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
47−+ const enum XML_Convert_Result convert_res = XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
48− *eventEndPP = s;
49− charDataHandler(handlerArg, dataBuf,
50− (int)(dataPtr - (ICHAR *)dataBuf));
51−- if (s == next)
52−+ if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE))
53− break;
54− *eventPP = s;
55− }
56−@@ -3261,11 +3261,11 @@ doCdataSection(XML_Parser parser,
57− if (MUST_CONVERT(enc, s)) {
58− for (;;) {
59− ICHAR *dataPtr = (ICHAR *)dataBuf;
60−- XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
61−+ const enum XML_Convert_Result convert_res = XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
62− *eventEndPP = next;
63− charDataHandler(handlerArg, dataBuf,
64− (int)(dataPtr - (ICHAR *)dataBuf));
65−- if (s == next)
66−+ if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE))
67− break;
68− *eventPP = s;
69− }
70−@@ -5342,6 +5342,7 @@ reportDefault(XML_Parser parser, const ENCODING *enc,
71− const char *s, const char *end)
72− {
73− if (MUST_CONVERT(enc, s)) {
74−+ enum XML_Convert_Result convert_res;
75− const char **eventPP;
76− const char **eventEndPP;
77− if (enc == encoding) {
78−@@ -5354,11 +5355,11 @@ reportDefault(XML_Parser parser, const ENCODING *enc,
79− }
80− do {
81− ICHAR *dataPtr = (ICHAR *)dataBuf;
82−- XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd);
83−+ convert_res = XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd);
84− *eventEndPP = s;
85− defaultHandler(handlerArg, dataBuf, (int)(dataPtr - (ICHAR *)dataBuf));
86− *eventPP = s;
87−- } while (s != end);
88−+ } while ((convert_res != XML_CONVERT_COMPLETED) && (convert_res != XML_CONVERT_INPUT_INCOMPLETE));
89− }
90− else
91− defaultHandler(handlerArg, (XML_Char *)s, (int)((XML_Char *)end - (XML_Char *)s));
92−@@ -6163,8 +6164,8 @@ poolAppend(STRING_POOL *pool, const ENCODING *enc,
93− if (!pool->ptr && !poolGrow(pool))
94− return NULL;
95− for (;;) {
96−- XmlConvert(enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end);
97−- if (ptr == end)
98−+ const enum XML_Convert_Result convert_res = XmlConvert(enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end);
99−+ if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE))
100− break;
101− if (!poolGrow(pool))
102− return NULL;
103−@@ -6248,8 +6249,13 @@ poolGrow(STRING_POOL *pool)
104− }
105− }
106− if (pool->blocks && pool->start == pool->blocks->s) {
107−- int blockSize = (int)(pool->end - pool->start)*2;
108−- BLOCK *temp = (BLOCK *)
109−+ BLOCK *temp;
110−+ int blockSize = (int)((unsigned)(pool->end - pool->start)*2U);
111−+
112−+ if (blockSize < 0)
113−+ return XML_FALSE;
114−+
115−+ temp = (BLOCK *)
116− pool->mem->realloc_fcn(pool->blocks,
117− (offsetof(BLOCK, s)
118− + blockSize * sizeof(XML_Char)));
119−@@ -6264,6 +6270,10 @@ poolGrow(STRING_POOL *pool)
120− else {
121− BLOCK *tem;
122− int blockSize = (int)(pool->end - pool->start);
123−+
124−+ if (blockSize < 0)
125−+ return XML_FALSE;
126−+
127− if (blockSize < INIT_BLOCK_SIZE)
128− blockSize = INIT_BLOCK_SIZE;
129− else
130−diff --git a/lib/xmltok.c b/lib/xmltok.c
131−index bf09dfc..cb98ce1 100644
132−--- a/lib/xmltok.c
133−+++ b/lib/xmltok.c
134−@@ -318,39 +318,55 @@ enum { /* UTF8_cvalN is value of masked first byte of N byte sequence */
135− UTF8_cval4 = 0xf0
136− };
137−
138−-static void PTRCALL
139−+static enum XML_Convert_Result PTRCALL
140− utf8_toUtf8(const ENCODING *enc,
141− const char **fromP, const char *fromLim,
142− char **toP, const char *toLim)
143− {
144−+ enum XML_Convert_Result res = XML_CONVERT_COMPLETED;
145− char *to;
146− const char *from;
147− if (fromLim - *fromP > toLim - *toP) {
148− /* Avoid copying partial characters. */
149−+ res = XML_CONVERT_OUTPUT_EXHAUSTED;
150− for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--)
151− if (((unsigned char)fromLim[-1] & 0xc0) != 0x80)
152− break;
153− }
154−- for (to = *toP, from = *fromP; from != fromLim; from++, to++)
155−+ for (to = *toP, from = *fromP; (from < fromLim) && (to < toLim); from++, to++)
156− *to = *from;
157− *fromP = from;
158− *toP = to;
159−+
160−+ if ((to == toLim) && (from < fromLim))
161−+ return XML_CONVERT_OUTPUT_EXHAUSTED;
162−+ else
163−+ return res;
164− }
165−
166−-static void PTRCALL
167−+static enum XML_Convert_Result PTRCALL
168− utf8_toUtf16(const ENCODING *enc,
169− const char **fromP, const char *fromLim,
170− unsigned short **toP, const unsigned short *toLim)
171− {
172−+ enum XML_Convert_Result res = XML_CONVERT_COMPLETED;
173− unsigned short *to = *toP;
174− const char *from = *fromP;
175−- while (from != fromLim && to != toLim) {
176−+ while (from < fromLim && to < toLim) {
177− switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) {
178− case BT_LEAD2:
179−+ if (fromLim - from < 2) {
180−+ res = XML_CONVERT_INPUT_INCOMPLETE;
181−+ break;
182−+ }
183− *to++ = (unsigned short)(((from[0] & 0x1f) << 6) | (from[1] & 0x3f));
184− from += 2;
185− break;
186− case BT_LEAD3:
187−+ if (fromLim - from < 3) {
188−+ res = XML_CONVERT_INPUT_INCOMPLETE;
189−+ break;
190−+ }
191− *to++ = (unsigned short)(((from[0] & 0xf) << 12)
192− | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f));
193− from += 3;
194−@@ -358,8 +374,14 @@ utf8_toUtf16(const ENCODING *enc,
195− case BT_LEAD4:
196− {
197− unsigned long n;
198−- if (to + 1 == toLim)
199−+ if (toLim - to < 2) {
200−+ res = XML_CONVERT_OUTPUT_EXHAUSTED;
201− goto after;
202−+ }
203−+ if (fromLim - from < 4) {
204−+ res = XML_CONVERT_INPUT_INCOMPLETE;
205−+ goto after;
206−+ }
207− n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12)
208− | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f);
209− n -= 0x10000;
210−@@ -377,6 +399,7 @@ utf8_toUtf16(const ENCODING *enc,
211− after:
212− *fromP = from;
213− *toP = to;
214−+ return res;
215− }
216−
217− #ifdef XML_NS
218−@@ -425,7 +448,7 @@ static const struct normal_encoding internal_utf8_encoding = {
219− STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_)
220− };
221−
222−-static void PTRCALL
223−+static enum XML_Convert_Result PTRCALL
224− latin1_toUtf8(const ENCODING *enc,
225− const char **fromP, const char *fromLim,
226− char **toP, const char *toLim)
227−@@ -433,30 +456,35 @@ latin1_toUtf8(const ENCODING *enc,
228− for (;;) {
229− unsigned char c;
230− if (*fromP == fromLim)
231−- break;
232−+ return XML_CONVERT_COMPLETED;
233− c = (unsigned char)**fromP;
234− if (c & 0x80) {
235− if (toLim - *toP < 2)
236−- break;
237−+ return XML_CONVERT_OUTPUT_EXHAUSTED;
238− *(*toP)++ = (char)((c >> 6) | UTF8_cval2);
239− *(*toP)++ = (char)((c & 0x3f) | 0x80);
240− (*fromP)++;
241− }
242− else {
243− if (*toP == toLim)
244−- break;
245−+ return XML_CONVERT_OUTPUT_EXHAUSTED;
246− *(*toP)++ = *(*fromP)++;
247− }
248− }
249− }
250−
251−-static void PTRCALL
252−+static enum XML_Convert_Result PTRCALL
253− latin1_toUtf16(const ENCODING *enc,
254− const char **fromP, const char *fromLim,
255− unsigned short **toP, const unsigned short *toLim)
256− {
257−- while (*fromP != fromLim && *toP != toLim)
258−+ while (*fromP < fromLim && *toP < toLim)
259− *(*toP)++ = (unsigned char)*(*fromP)++;
260−+
261−+ if ((*toP == toLim) && (*fromP < fromLim))
262−+ return XML_CONVERT_OUTPUT_EXHAUSTED;
263−+ else
264−+ return XML_CONVERT_COMPLETED;
265− }
266−
267− #ifdef XML_NS
268−@@ -483,13 +511,18 @@ static const struct normal_encoding latin1_encoding = {
269− STANDARD_VTABLE(sb_)
270− };
271−
272−-static void PTRCALL
273−+static enum XML_Convert_Result PTRCALL
274− ascii_toUtf8(const ENCODING *enc,
275− const char **fromP, const char *fromLim,
276− char **toP, const char *toLim)
277− {
278−- while (*fromP != fromLim && *toP != toLim)
279−+ while (*fromP < fromLim && *toP < toLim)
280− *(*toP)++ = *(*fromP)++;
281−+
282−+ if ((*toP == toLim) && (*fromP < fromLim))
283−+ return XML_CONVERT_OUTPUT_EXHAUSTED;
284−+ else
285−+ return XML_CONVERT_COMPLETED;
286− }
287−
288− #ifdef XML_NS
289−@@ -536,13 +569,14 @@ unicode_byte_type(char hi, char lo)
290− }
291−
292− #define DEFINE_UTF16_TO_UTF8(E) \
293−-static void PTRCALL \
294−+static enum XML_Convert_Result PTRCALL \
295− E ## toUtf8(const ENCODING *enc, \
296− const char **fromP, const char *fromLim, \
297− char **toP, const char *toLim) \
298− { \
299−- const char *from; \
300−- for (from = *fromP; from != fromLim; from += 2) { \
301−+ const char *from = *fromP; \
302−+ fromLim = from + (((fromLim - from) >> 1) << 1); /* shrink to even */ \
303−+ for (; from < fromLim; from += 2) { \
304− int plane; \
305− unsigned char lo2; \
306− unsigned char lo = GET_LO(from); \
307−@@ -552,7 +586,7 @@ E ## toUtf8(const ENCODING *enc, \
308− if (lo < 0x80) { \
309− if (*toP == toLim) { \
310− *fromP = from; \
311−- return; \
312−+ return XML_CONVERT_OUTPUT_EXHAUSTED; \
313− } \
314− *(*toP)++ = lo; \
315− break; \
316−@@ -562,7 +596,7 @@ E ## toUtf8(const ENCODING *enc, \
317− case 0x4: case 0x5: case 0x6: case 0x7: \
318− if (toLim - *toP < 2) { \
319− *fromP = from; \
320−- return; \
321−+ return XML_CONVERT_OUTPUT_EXHAUSTED; \
322− } \
323− *(*toP)++ = ((lo >> 6) | (hi << 2) | UTF8_cval2); \
324− *(*toP)++ = ((lo & 0x3f) | 0x80); \
325−@@ -570,7 +604,7 @@ E ## toUtf8(const ENCODING *enc, \
326− default: \
327− if (toLim - *toP < 3) { \
328− *fromP = from; \
329−- return; \
330−+ return XML_CONVERT_OUTPUT_EXHAUSTED; \
331− } \
332− /* 16 bits divided 4, 6, 6 amongst 3 bytes */ \
333− *(*toP)++ = ((hi >> 4) | UTF8_cval3); \
334−@@ -580,7 +614,11 @@ E ## toUtf8(const ENCODING *enc, \
335− case 0xD8: case 0xD9: case 0xDA: case 0xDB: \
336− if (toLim - *toP < 4) { \
337− *fromP = from; \
338−- return; \
339−+ return XML_CONVERT_OUTPUT_EXHAUSTED; \
340−+ } \
341−+ if (fromLim - from < 4) { \
342−+ *fromP = from; \
343−+ return XML_CONVERT_INPUT_INCOMPLETE; \
344− } \
345− plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \
346− *(*toP)++ = ((plane >> 2) | UTF8_cval4); \
347−@@ -596,20 +634,32 @@ E ## toUtf8(const ENCODING *enc, \
348− } \
349− } \
350− *fromP = from; \
351−+ if (from < fromLim) \
352−+ return XML_CONVERT_INPUT_INCOMPLETE; \
353−+ else \
354−+ return XML_CONVERT_COMPLETED; \
355− }
356−
357− #define DEFINE_UTF16_TO_UTF16(E) \
358−-static void PTRCALL \
359−+static enum XML_Convert_Result PTRCALL \
360− E ## toUtf16(const ENCODING *enc, \
361− const char **fromP, const char *fromLim, \
362− unsigned short **toP, const unsigned short *toLim) \
363− { \
364−+ enum XML_Convert_Result res = XML_CONVERT_COMPLETED; \
365−+ fromLim = *fromP + (((fromLim - *fromP) >> 1) << 1); /* shrink to even */ \
366− /* Avoid copying first half only of surrogate */ \
367− if (fromLim - *fromP > ((toLim - *toP) << 1) \
368−- && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \
369−+ && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) { \
370− fromLim -= 2; \
371−- for (; *fromP != fromLim && *toP != toLim; *fromP += 2) \
372−+ res = XML_CONVERT_INPUT_INCOMPLETE; \
373−+ } \
374−+ for (; *fromP < fromLim && *toP < toLim; *fromP += 2) \
375− *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \
376−+ if ((*toP == toLim) && (*fromP < fromLim)) \
377−+ return XML_CONVERT_OUTPUT_EXHAUSTED; \
378−+ else \
379−+ return res; \
380− }
381−
382− #define SET2(ptr, ch) \
383−@@ -1288,7 +1338,7 @@ unknown_isInvalid(const ENCODING *enc, const char *p)
384− return (c & ~0xFFFF) || checkCharRefNumber(c) < 0;
385− }
386−
387−-static void PTRCALL
388−+static enum XML_Convert_Result PTRCALL
389− unknown_toUtf8(const ENCODING *enc,
390− const char **fromP, const char *fromLim,
391− char **toP, const char *toLim)
392−@@ -1299,21 +1349,21 @@ unknown_toUtf8(const ENCODING *enc,
393− const char *utf8;
394− int n;
395− if (*fromP == fromLim)
396−- break;
397−+ return XML_CONVERT_COMPLETED;
398− utf8 = uenc->utf8[(unsigned char)**fromP];
399− n = *utf8++;
400− if (n == 0) {
401− int c = uenc->convert(uenc->userData, *fromP);
402− n = XmlUtf8Encode(c, buf);
403− if (n > toLim - *toP)
404−- break;
405−+ return XML_CONVERT_OUTPUT_EXHAUSTED;
406− utf8 = buf;
407− *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP]
408− - (BT_LEAD2 - 2));
409− }
410− else {
411− if (n > toLim - *toP)
412−- break;
413−+ return XML_CONVERT_OUTPUT_EXHAUSTED;
414− (*fromP)++;
415− }
416− do {
417−@@ -1322,13 +1372,13 @@ unknown_toUtf8(const ENCODING *enc,
418− }
419− }
420−
421−-static void PTRCALL
422−+static enum XML_Convert_Result PTRCALL
423− unknown_toUtf16(const ENCODING *enc,
424− const char **fromP, const char *fromLim,
425− unsigned short **toP, const unsigned short *toLim)
426− {
427− const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc);
428−- while (*fromP != fromLim && *toP != toLim) {
429−+ while (*fromP < fromLim && *toP < toLim) {
430− unsigned short c = uenc->utf16[(unsigned char)**fromP];
431− if (c == 0) {
432− c = (unsigned short)
433−@@ -1340,6 +1390,11 @@ unknown_toUtf16(const ENCODING *enc,
434− (*fromP)++;
435− *(*toP)++ = c;
436− }
437−+
438−+ if ((*toP == toLim) && (*fromP < fromLim))
439−+ return XML_CONVERT_OUTPUT_EXHAUSTED;
440−+ else
441−+ return XML_CONVERT_COMPLETED;
442− }
443−
444− ENCODING *
445−@@ -1503,7 +1558,7 @@ initScan(const ENCODING * const *encodingTable,
446− {
447− const ENCODING **encPtr;
448−
449−- if (ptr == end)
450−+ if (ptr >= end)
451− return XML_TOK_NONE;
452− encPtr = enc->encPtr;
453− if (ptr + 1 == end) {
454−diff --git a/lib/xmltok.h b/lib/xmltok.h
455−index ca867aa..752007e 100644
456−--- a/lib/xmltok.h
457−+++ b/lib/xmltok.h
458−@@ -130,6 +130,12 @@ typedef int (PTRCALL *SCANNER)(const ENCODING *,
459− const char *,
460− const char **);
461−
462−+enum XML_Convert_Result {
463−+ XML_CONVERT_COMPLETED = 0,
464−+ XML_CONVERT_INPUT_INCOMPLETE = 1,
465−+ XML_CONVERT_OUTPUT_EXHAUSTED = 2 /* and therefore potentially input remaining as well */
466−+};
467−+
468− struct encoding {
469− SCANNER scanners[XML_N_STATES];
470− SCANNER literalScanners[XML_N_LITERAL_TYPES];
471−@@ -158,12 +164,12 @@ struct encoding {
472− const char *ptr,
473− const char *end,
474− const char **badPtr);
475−- void (PTRCALL *utf8Convert)(const ENCODING *enc,
476−+ enum XML_Convert_Result (PTRCALL *utf8Convert)(const ENCODING *enc,
477− const char **fromP,
478− const char *fromLim,
479− char **toP,
480− const char *toLim);
481−- void (PTRCALL *utf16Convert)(const ENCODING *enc,
482−+ enum XML_Convert_Result (PTRCALL *utf16Convert)(const ENCODING *enc,
483− const char **fromP,
484− const char *fromLim,
485− unsigned short **toP,
486−diff --git a/lib/xmltok_impl.c b/lib/xmltok_impl.c
487−index 9c2895b..6c5a3ba 100644
488−--- a/lib/xmltok_impl.c
489−+++ b/lib/xmltok_impl.c
490−@@ -93,13 +93,13 @@ static int PTRCALL
491− PREFIX(scanComment)(const ENCODING *enc, const char *ptr,
492− const char *end, const char **nextTokPtr)
493− {
494−- if (ptr != end) {
495−+ if (ptr < end) {
496− if (!CHAR_MATCHES(enc, ptr, ASCII_MINUS)) {
497− *nextTokPtr = ptr;
498− return XML_TOK_INVALID;
499− }
500− ptr += MINBPC(enc);
501−- while (ptr != end) {
502−+ while (ptr < end) {
503− switch (BYTE_TYPE(enc, ptr)) {
504− INVALID_CASES(ptr, nextTokPtr)
505− case BT_MINUS:
506−@@ -147,7 +147,7 @@ PREFIX(scanDecl)(const ENCODING *enc, const char *ptr,
507− *nextTokPtr = ptr;
508− return XML_TOK_INVALID;
509− }
510−- while (ptr != end) {
511−+ while (ptr < end) {
512− switch (BYTE_TYPE(enc, ptr)) {
513− case BT_PERCNT:
514− if (ptr + MINBPC(enc) == end)
515−@@ -233,7 +233,7 @@ PREFIX(scanPi)(const ENCODING *enc, const char *ptr,
516− *nextTokPtr = ptr;
517− return XML_TOK_INVALID;
518− }
519−- while (ptr != end) {
520−+ while (ptr < end) {
521− switch (BYTE_TYPE(enc, ptr)) {
522− CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
523− case BT_S: case BT_CR: case BT_LF:
524−@@ -242,7 +242,7 @@ PREFIX(scanPi)(const ENCODING *enc, const char *ptr,
525− return XML_TOK_INVALID;
526− }
527− ptr += MINBPC(enc);
528−- while (ptr != end) {
529−+ while (ptr < end) {
530− switch (BYTE_TYPE(enc, ptr)) {
531− INVALID_CASES(ptr, nextTokPtr)
532− case BT_QUEST:
533−@@ -305,7 +305,7 @@ static int PTRCALL
534− PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr,
535− const char *end, const char **nextTokPtr)
536− {
537−- if (ptr == end)
538−+ if (ptr >= end)
539− return XML_TOK_NONE;
540− if (MINBPC(enc) > 1) {
541− size_t n = end - ptr;
542−@@ -348,7 +348,7 @@ PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr,
543− ptr += MINBPC(enc);
544− break;
545− }
546−- while (ptr != end) {
547−+ while (ptr < end) {
548− switch (BYTE_TYPE(enc, ptr)) {
549− #define LEAD_CASE(n) \
550− case BT_LEAD ## n: \
551−@@ -391,11 +391,11 @@ PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr,
552− *nextTokPtr = ptr;
553− return XML_TOK_INVALID;
554− }
555−- while (ptr != end) {
556−+ while (ptr < end) {
557− switch (BYTE_TYPE(enc, ptr)) {
558− CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
559− case BT_S: case BT_CR: case BT_LF:
560−- for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) {
561−+ for (ptr += MINBPC(enc); ptr < end; ptr += MINBPC(enc)) {
562− switch (BYTE_TYPE(enc, ptr)) {
563− case BT_S: case BT_CR: case BT_LF:
564− break;
565−@@ -432,7 +432,7 @@ static int PTRCALL
566− PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr,
567− const char *end, const char **nextTokPtr)
568− {
569−- if (ptr != end) {
570−+ if (ptr < end) {
571− switch (BYTE_TYPE(enc, ptr)) {
572− case BT_DIGIT:
573− case BT_HEX:
574−@@ -441,7 +441,7 @@ PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr,
575− *nextTokPtr = ptr;
576− return XML_TOK_INVALID;
577− }
578−- for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) {
579−+ for (ptr += MINBPC(enc); ptr < end; ptr += MINBPC(enc)) {
580− switch (BYTE_TYPE(enc, ptr)) {
581− case BT_DIGIT:
582− case BT_HEX:
583−@@ -464,7 +464,7 @@ static int PTRCALL
584− PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr,
585− const char *end, const char **nextTokPtr)
586− {
587−- if (ptr != end) {
588−+ if (ptr < end) {
589− if (CHAR_MATCHES(enc, ptr, ASCII_x))
590− return PREFIX(scanHexCharRef)(enc, ptr + MINBPC(enc), end, nextTokPtr);
591− switch (BYTE_TYPE(enc, ptr)) {
592−@@ -474,7 +474,7 @@ PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr,
593− *nextTokPtr = ptr;
594− return XML_TOK_INVALID;
595− }
596−- for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) {
597−+ for (ptr += MINBPC(enc); ptr < end; ptr += MINBPC(enc)) {
598− switch (BYTE_TYPE(enc, ptr)) {
599− case BT_DIGIT:
600− break;
601−@@ -506,7 +506,7 @@ PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
602− *nextTokPtr = ptr;
603− return XML_TOK_INVALID;
604− }
605−- while (ptr != end) {
606−+ while (ptr < end) {
607− switch (BYTE_TYPE(enc, ptr)) {
608− CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
609− case BT_SEMI:
610−@@ -529,7 +529,7 @@ PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
611− #ifdef XML_NS
612− int hadColon = 0;
613− #endif
614−- while (ptr != end) {
615−+ while (ptr < end) {
616− switch (BYTE_TYPE(enc, ptr)) {
617− CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
618− #ifdef XML_NS
619−@@ -716,7 +716,7 @@ PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
620− hadColon = 0;
621− #endif
622− /* we have a start-tag */
623−- while (ptr != end) {
624−+ while (ptr < end) {
625− switch (BYTE_TYPE(enc, ptr)) {
626− CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
627− #ifdef XML_NS
628−@@ -740,7 +740,7 @@ PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
629− case BT_S: case BT_CR: case BT_LF:
630− {
631− ptr += MINBPC(enc);
632−- while (ptr != end) {
633−+ while (ptr < end) {
634− switch (BYTE_TYPE(enc, ptr)) {
635− CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
636− case BT_GT:
637−@@ -785,7 +785,7 @@ static int PTRCALL
638− PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
639− const char **nextTokPtr)
640− {
641−- if (ptr == end)
642−+ if (ptr >= end)
643− return XML_TOK_NONE;
644− if (MINBPC(enc) > 1) {
645− size_t n = end - ptr;
646−@@ -832,7 +832,7 @@ PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
647− ptr += MINBPC(enc);
648− break;
649− }
650−- while (ptr != end) {
651−+ while (ptr < end) {
652− switch (BYTE_TYPE(enc, ptr)) {
653− #define LEAD_CASE(n) \
654− case BT_LEAD ## n: \
655−@@ -895,7 +895,7 @@ PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
656− *nextTokPtr = ptr;
657− return XML_TOK_INVALID;
658− }
659−- while (ptr != end) {
660−+ while (ptr < end) {
661− switch (BYTE_TYPE(enc, ptr)) {
662− CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
663− case BT_SEMI:
664−@@ -921,7 +921,7 @@ PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end,
665− *nextTokPtr = ptr;
666− return XML_TOK_INVALID;
667− }
668−- while (ptr != end) {
669−+ while (ptr < end) {
670− switch (BYTE_TYPE(enc, ptr)) {
671− CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
672− case BT_CR: case BT_LF: case BT_S:
673−@@ -941,7 +941,7 @@ PREFIX(scanLit)(int open, const ENCODING *enc,
674− const char *ptr, const char *end,
675− const char **nextTokPtr)
676− {
677−- while (ptr != end) {
678−+ while (ptr < end) {
679− int t = BYTE_TYPE(enc, ptr);
680− switch (t) {
681− INVALID_CASES(ptr, nextTokPtr)
682−@@ -973,7 +973,7 @@ PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
683− const char **nextTokPtr)
684− {
685− int tok;
686−- if (ptr == end)
687−+ if (ptr >= end)
688− return XML_TOK_NONE;
689− if (MINBPC(enc) > 1) {
690− size_t n = end - ptr;
691−@@ -1141,7 +1141,7 @@ PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
692− *nextTokPtr = ptr;
693− return XML_TOK_INVALID;
694− }
695−- while (ptr != end) {
696−+ while (ptr < end) {
697− switch (BYTE_TYPE(enc, ptr)) {
698− CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
699− case BT_GT: case BT_RPAR: case BT_COMMA:
700−@@ -1204,10 +1204,10 @@ PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr,
701− const char *end, const char **nextTokPtr)
702− {
703− const char *start;
704−- if (ptr == end)
705−+ if (ptr >= end)
706− return XML_TOK_NONE;
707− start = ptr;
708−- while (ptr != end) {
709−+ while (ptr < end) {
710− switch (BYTE_TYPE(enc, ptr)) {
711− #define LEAD_CASE(n) \
712− case BT_LEAD ## n: ptr += n; break;
713−@@ -1262,10 +1262,10 @@ PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr,
714− const char *end, const char **nextTokPtr)
715− {
716− const char *start;
717−- if (ptr == end)
718−+ if (ptr >= end)
719− return XML_TOK_NONE;
720− start = ptr;
721−- while (ptr != end) {
722−+ while (ptr < end) {
723− switch (BYTE_TYPE(enc, ptr)) {
724− #define LEAD_CASE(n) \
725− case BT_LEAD ## n: ptr += n; break;
726−@@ -1326,7 +1326,7 @@ PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr,
727− end = ptr + n;
728− }
729− }
730−- while (ptr != end) {
731−+ while (ptr < end) {
732− switch (BYTE_TYPE(enc, ptr)) {
733− INVALID_CASES(ptr, nextTokPtr)
734− case BT_LT:
735−@@ -1373,7 +1373,7 @@ PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
736− {
737− ptr += MINBPC(enc);
738− end -= MINBPC(enc);
739−- for (; ptr != end; ptr += MINBPC(enc)) {
740−+ for (; ptr < end; ptr += MINBPC(enc)) {
741− switch (BYTE_TYPE(enc, ptr)) {
742− case BT_DIGIT:
743− case BT_HEX:
744−@@ -1760,7 +1760,7 @@ PREFIX(updatePosition)(const ENCODING *enc,
745− case BT_CR:
746− pos->lineNumber++;
747− ptr += MINBPC(enc);
748−- if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF)
749−+ if (ptr < end && BYTE_TYPE(enc, ptr) == BT_LF)
750− ptr += MINBPC(enc);
751− pos->columnNumber = (XML_Size)-1;
752− break;
753−--
754−2.8.2
755−
pkgs/development/libraries/expat/default.nix+2−4
@@ -1,11 +1,11 @@
11{ stdenv, fetchurl }:
22
33stdenv.mkDerivation rec {
4− name = "expat-2.1.1";
4+ name = "expat-2.2.0";
55
66 src = fetchurl {
77 url = "mirror://sourceforge/expat/${name}.tar.bz2";
8− sha256 = "0ryyjgvy7jq0qb7a9mhc1giy3bzn56aiwrs8dpydqngplbjq9xdg";
8+ sha256 = "1zq4lnwjlw8s9mmachwfvfjf2x3lk24jm41746ykhdcvs7r0zrfr";
99 };
1010
1111 outputs = [ "dev" "out" ]; # TODO: fix referrers
@@ -15,8 +15,6 @@ stdenv.mkDerivation rec {
1515
1616 outputMan = "dev"; # tiny page for a dev tool
1717
18− patches = [ ./CVE-2015-1283-refix.patch ./CVE-2016-0718-v2-2-1.patch ];
19−
2018 doCheck = true;
2119
2220 meta = with stdenv.lib; {
pkgs/development/libraries/gettext/default.nix+1−1
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
5050 sed -i -e "s/\(am_libgettextlib_la_OBJECTS = \)error.lo/\\1/" gettext-tools/gnulib-lib/Makefile.in
5151 '';
5252
53− buildInputs = [ xz xz.bin libiconv ];
53+ nativeBuildInputs = [ xz xz.bin ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv; # HACK, see #10874 (and 14664)
5454
5555 enableParallelBuilding = true;
5656
pkgs/development/libraries/glibc/builder.shdeleted−58
@@ -1,58 +0,0 @@
1−# Glibc cannot have itself in its RPATH.
2−export NIX_NO_SELF_RPATH=1
3−
4−source $stdenv/setup
5−
6−postConfigure() {
7− # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
8− # This has to be done *after* `configure' because it builds some
9− # test binaries.
10− export NIX_CFLAGS_LINK=
11− export NIX_LDFLAGS_BEFORE=
12−
13− export NIX_DONT_SET_RPATH=1
14− unset CFLAGS
15−
16− # Apparently --bindir is not respected.
17− makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
18−}
19−
20−postInstall() {
21− if test -n "$installLocales"; then
22− make -j${NIX_BUILD_CORES:-1} -l${NIX_BUILD_CORES:-1} localedata/install-locales
23− fi
24−
25− test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
26−
27− if test -n "$linuxHeaders"; then
28− # Include the Linux kernel headers in Glibc, except the `scsi'
29− # subdirectory, which Glibc provides itself.
30− (cd $dev/include && \
31− ln -sv $(ls -d $linuxHeaders/include/* | grep -v 'scsi$') .)
32− fi
33−
34− # Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink
35− # "lib64" to "lib".
36− if test -n "$is64bit"; then
37− ln -s lib $out/lib64
38− fi
39−
40− # Get rid of more unnecessary stuff.
41− rm -rf $out/var $out/sbin/sln
42−
43− for i in $out/lib/*.a; do
44− strip -S "$i"
45− done
46− # Put libraries for static linking in a separate output. Note
47− # that libc_nonshared.a and libpthread_nonshared.a are required
48− # for dynamically-linked applications.
49− mkdir -p $static/lib
50− mv $out/lib/*.a $static/lib
51− mv $static/lib/lib*_nonshared.a $out/lib
52−
53− # Work around a Nix bug: hard links across outputs cause a build failure.
54− cp $bin/bin/getconf $bin/bin/getconf_
55− mv $bin/bin/getconf_ $bin/bin/getconf
56−}
57−
58−genericBuild
pkgs/development/libraries/glibc/common.nix+1
@@ -54,6 +54,7 @@ stdenv.mkDerivation ({
5454 ./glob-simplify-interface.patch
5555 ./cve-2016-1234.patch
5656 ./cve-2016-3706.patch
57+ ./fix_warnings.patch
5758 ];
5859
5960 postPatch =
pkgs/development/libraries/glibc/default.nix+63−2
@@ -17,7 +17,21 @@ in
1717 inherit lib stdenv fetchurl linuxHeaders installLocales
1818 profilingLibraries gccCross withGd gd libpng;
1919
20− builder = ./builder.sh;
20+ NIX_NO_SELF_RPATH = true;
21+
22+ postConfigure = ''
23+ # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
24+ # This has to be done *after* `configure' because it builds some
25+ # test binaries.
26+ export NIX_CFLAGS_LINK=
27+ export NIX_LDFLAGS_BEFORE=
28+
29+ export NIX_DONT_SET_RPATH=1
30+ unset CFLAGS
31+
32+ # Apparently --bindir is not respected.
33+ makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
34+ '';
2135
2236 # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
2337 # any program we run, because the gcc will have been placed at a new
@@ -26,7 +40,7 @@ in
2640 # Building from a proper gcc staying in the path where it was installed,
2741 # libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without
2842 # any special hack.
29− preInstall = if cross != null then "" else ''
43+ preInstall = ''
3044 if [ -f ${stdenv.cc.cc}/lib/libgcc_s.so.1 ]; then
3145 mkdir -p $out/lib
3246 cp ${stdenv.cc.cc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
@@ -35,6 +49,49 @@ in
3549 fi
3650 '';
3751
52+ postInstall = ''
53+ if test -n "$installLocales"; then
54+ make -j''${NIX_BUILD_CORES:-1} -l''${NIX_BUILD_CORES:-1} localedata/install-locales
55+ fi
56+
57+ test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
58+
59+ if test -n "$linuxHeaders"; then
60+ # Include the Linux kernel headers in Glibc, except the `scsi'
61+ # subdirectory, which Glibc provides itself.
62+ (cd $dev/include && \
63+ ln -sv $(ls -d $linuxHeaders/include/* | grep -v scsi\$) .)
64+ fi
65+
66+ # Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink
67+ # "lib64" to "lib".
68+ if test -n "$is64bit"; then
69+ ln -s lib $out/lib64
70+ fi
71+
72+ # Get rid of more unnecessary stuff.
73+ rm -rf $out/var $out/sbin/sln
74+
75+ # For some reason these aren't stripped otherwise and retain reference
76+ # to bootstrap-tools; on cross-arm this stripping would break objects.
77+ if [ -z "$crossConfig" ]; then
78+ for i in "$out"/lib/*.a; do
79+ strip -S "$i"
80+ done
81+ fi
82+
83+ # Put libraries for static linking in a separate output. Note
84+ # that libc_nonshared.a and libpthread_nonshared.a are required
85+ # for dynamically-linked applications.
86+ mkdir -p $static/lib
87+ mv $out/lib/*.a $static/lib
88+ mv $static/lib/lib*_nonshared.a $out/lib
89+
90+ # Work around a Nix bug: hard links across outputs cause a build failure.
91+ cp $bin/bin/getconf $bin/bin/getconf_
92+ mv $bin/bin/getconf_ $bin/bin/getconf
93+ '';
94+
3895 separateDebugInfo = true;
3996
4097 meta.description = "The GNU C Library";
@@ -62,6 +119,10 @@ in
62119 dontStrip=1
63120 '';
64121
122+ preInstall = null; # clobber the native hook
123+
124+ separateDebugInfo = false; # this is currently broken for crossDrv
125+
65126 # To avoid a dependency on the build system 'bash'.
66127 preFixup = ''
67128 rm $bin/bin/{ldd,tzselect,catchsegv,xtrace}
pkgs/development/libraries/glibc/fix_warnings.patchnew file+36
@@ -0,0 +1,36 @@
1+--- a/stdlib/setenv.c 2016-05-30 11:09:14.487180254 +0000
2++++ b/stdlib/setenv.c 2016-05-30 11:08:25.560390748 +0000
3+@@ -277,6 +277,7 @@
4+
5+ ep = __environ;
6+ if (ep != NULL)
7++ {
8+ while (*ep != NULL)
9+ if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
10+ {
11+@@ -290,6 +291,7 @@
12+ }
13+ else
14+ ++ep;
15++ }
16+
17+ UNLOCK;
18+
19+--- a/nis/nis_call.c 2016-05-30 08:05:59.359855696 -0700
20++++ b/nis/nis_call.c 2016-05-30 08:05:55.679873221 -0700
21+@@ -680,6 +680,7 @@
22+ /* Choose which entry should be evicted from the cache. */
23+ loc = &nis_server_cache[0];
24+ if (*loc != NULL)
25++ {
26+ for (i = 1; i < 16; ++i)
27+ if (nis_server_cache[i] == NULL)
28+ {
29+@@ -690,6 +691,7 @@
30+ || ((*loc)->uses == nis_server_cache[i]->uses
31+ && (*loc)->expires > nis_server_cache[i]->expires))
32+ loc = &nis_server_cache[i];
33++ }
34+ old = *loc;
35+ *loc = new;
36+
pkgs/development/libraries/gnutls/3.4.nix+2−2
@@ -1,11 +1,11 @@
11{ callPackage, fetchurl, autoreconfHook, ... } @ args:
22
33callPackage ./generic.nix (args // rec {
4− version = "3.4.11";
4+ version = "3.4.13";
55
66 src = fetchurl {
77 url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-${version}.tar.xz";
8− sha256 = "1f4sbb38xab46h67a3pm6kybgrahjx3vbrn66qq3cbc2jngrrvvh";
8+ sha256 = "0naqs9g5b577j1j7q55ma1vcn78jl2d98h3zrl5rh997wzl8cczx";
99 };
1010
1111 # This fixes some broken parallel dependencies
pkgs/development/libraries/gnutls/3.5.nixnew file+17
@@ -0,0 +1,17 @@
1+{ callPackage, fetchurl, autoreconfHook, ... } @ args:
2+
3+callPackage ./generic.nix (args // rec {
4+ version = "3.5.1";
5+
6+ src = fetchurl {
7+ url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-${version}.tar.xz";
8+ sha256 = "1gdxr1p1sigigwvangqf3v31i8fda07d6ngawykarhr7ls00yjmw";
9+ };
10+
11+ # This fixes some broken parallel dependencies
12+ postPatch = ''
13+ sed -i 's,^BUILT_SOURCES =,\0 systemkey-args.h,g' src/Makefile.am
14+ '';
15+
16+ nativeBuildInputs = [ autoreconfHook ];
17+})
pkgs/development/libraries/gnutls/generic.nix+6−2
@@ -1,6 +1,6 @@
11{ lib, fetchurl, stdenv, zlib, lzo, libtasn1, nettle, pkgconfig, lzip
22, guileBindings, guile, perl, gmp, autogen, libidn, p11_kit, unbound, libiconv
3−, tpmSupport ? false, trousers
3+, tpmSupport ? false, trousers, nettools, bash
44
55# Version dependent args
66, version, src, patches ? [], postPatch ? "", nativeBuildInputs ? []
@@ -29,7 +29,7 @@ stdenv.mkDerivation {
2929 # for the actual fix.
3030 enableParallelBuilding = !guileBindings;
3131
32− buildInputs = [ lzo lzip nettle libtasn1 libidn p11_kit zlib gmp autogen ]
32+ buildInputs = [ lzo lzip nettle libtasn1 libidn p11_kit zlib gmp autogen nettools bash ]
3333 ++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) libiconv
3434 ++ lib.optional (tpmSupport && stdenv.isLinux) trousers
3535 ++ [ unbound ]
@@ -37,6 +37,10 @@ stdenv.mkDerivation {
3737
3838 nativeBuildInputs = [ perl pkgconfig ] ++ nativeBuildInputs;
3939
40+ patchPhase = ''
41+ patchShebangs .
42+ '';
43+
4044 # XXX: Gnulib's `test-select' fails on FreeBSD:
4145 # http://hydra.nixos.org/build/2962084/nixlog/1/raw .
4246 doCheck = (!stdenv.isFreeBSD && !stdenv.isDarwin);
pkgs/development/libraries/kerberos/krb5.nix+2
@@ -26,6 +26,8 @@ stdenv.mkDerivation rec {
2626 buildInputs = [ openssl ]
2727 ++ optionals (!libOnly) [ openldap libedit ];
2828
29+ patches = [ ./path_char_fix.patch ];
30+
2931 preConfigure = "cd ./src";
3032
3133 buildPhase = optionalString libOnly ''
pkgs/development/libraries/kerberos/path_char_fix.patchnew file+38
@@ -0,0 +1,38 @@
1+See https://github.com/krb5/krb5/pull/467
2+diff --git a/src/include/Makefile.in b/src/include/Makefile.in
3+index 4bb11e4..cb4b44b 100644
4+--- a/src/include/Makefile.in
5++++ b/src/include/Makefile.in
6+@@ -57,19 +57,19 @@ SBINDIR = @sbindir@
7+ LIBDIR = @libdir@
8+ SYSCONFCONF = @SYSCONFCONF@
9+
10+-PROCESS_REPLACE = -e "s+@KRB5RCTMPDIR+$(KRB5RCTMPDIR)+" \
11+- -e "s+@PREFIX+$(INSTALL_PREFIX)+" \
12+- -e "s+@EXEC_PREFIX+$(INSTALL_EXEC_PREFIX)+" \
13+- -e "s+@BINDIR+$(BINDIR)+" \
14+- -e "s+@LIBDIR+$(LIBDIR)+" \
15+- -e "s+@SBINDIR+$(SBINDIR)+" \
16+- -e "s+@MODULEDIR+$(MODULE_DIR)+" \
17+- -e "s+@GSSMODULEDIR+$(GSS_MODULE_DIR)+" \
18+- -e 's+@LOCALSTATEDIR+$(LOCALSTATEDIR)+' \
19+- -e 's+@RUNSTATEDIR+$(RUNSTATEDIR)+' \
20+- -e 's+@SYSCONFDIR+$(SYSCONFDIR)+' \
21+- -e 's+@DYNOBJEXT+$(DYNOBJEXT)+' \
22+- -e 's+@SYSCONFCONF+$(SYSCONFCONF)+'
23++PROCESS_REPLACE = -e "s\"@KRB5RCTMPDIR\"$(KRB5RCTMPDIR)\"" \
24++ -e "s\"@PREFIX\"$(INSTALL_PREFIX)\"" \
25++ -e "s\"@EXEC_PREFIX\"$(INSTALL_EXEC_PREFIX)\"" \
26++ -e "s\"@BINDIR\"$(BINDIR)\"" \
27++ -e "s\"@LIBDIR\"$(LIBDIR)\"" \
28++ -e "s\"@SBINDIR\"$(SBINDIR)\"" \
29++ -e "s\"@MODULEDIR\"$(MODULE_DIR)\"" \
30++ -e "s\"@GSSMODULEDIR\"$(GSS_MODULE_DIR)\"" \
31++ -e "s\"@LOCALSTATEDIR\"$(LOCALSTATEDIR)\"" \
32++ -e "s\"@RUNSTATEDIR\"$(RUNSTATEDIR)\"" \
33++ -e "s\"@SYSCONFDIR\"$(SYSCONFDIR)\"" \
34++ -e "s\"@DYNOBJEXT\"$(DYNOBJEXT)\"" \
35++ -e "s\"@SYSCONFCONF\"$(SYSCONFCONF)\""
36+
37+ OSCONFSRC = $(srcdir)/osconf.hin
38+
pkgs/development/libraries/libelf/default.nix+3−3
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
99 };
1010
1111 doCheck = true;
12−
12+
1313 # For cross-compiling, native glibc is needed for the "gencat" program.
1414 crossAttrs = {
15− nativeBuildInputs = [ glibc ];
15+ nativeBuildInputs = [ gettext glibc ];
1616 };
1717
1818 # Libelf's custom NLS macros fail to determine the catalog file extension on
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
2020 # FIXME: Eventually make Gettext a build input on all platforms.
2121 configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-nls";
2222
23− buildInputs = [ gettext ];
23+ nativeBuildInputs = [ gettext ];
2424
2525 meta = {
2626 description = "ELF object file access library";
pkgs/development/libraries/libmicrohttpd/default.nix+10−14
@@ -1,29 +1,25 @@
1−{ lib, stdenv, fetchurl, libgcrypt }:
1+{ stdenv, fetchurl, libgcrypt, curl, gnutls, pkgconfig }:
22
33stdenv.mkDerivation rec {
4− name = "libmicrohttpd-0.9.44";
4+ name = "libmicrohttpd-0.9.50";
55
66 src = fetchurl {
77 url = "mirror://gnu/libmicrohttpd/${name}.tar.gz";
8− sha256 = "07j1p21rvbrrfpxngk8xswzkmjkh94bp1971xfjh1p0ja709qwzj";
8+ sha256 = "1mzbqr6sqisppz88mh73bbh5sw57g8l87qvhcjdx5pmbd183idni";
99 };
1010
1111 outputs = [ "dev" "out" "docdev" ];
12+ buildInputs = [ libgcrypt curl gnutls pkgconfig ];
1213
13− buildInputs = [ libgcrypt ];
14−
15− preCheck =
14+ preCheck = ''
1615 # Since `localhost' can't be resolved in a chroot, work around it.
17− '' for i in "src/test"*"/"*.[ch]
18− do
19− sed -i "$i" -es/localhost/127.0.0.1/g
20− done
21− '';
16+ sed -ie 's/localhost/127.0.0.1/g' src/test*/*.[ch]
17+ '';
2218
2319 # Disabled because the tests can time-out.
2420 doCheck = false;
2521
26− meta = {
22+ meta = with stdenv.lib; {
2723 description = "Embeddable HTTP server library";
2824
2925 longDescription = ''
@@ -31,10 +27,10 @@ stdenv.mkDerivation rec {
3127 it easy to run an HTTP server as part of another application.
3228 '';
3329
34− license = lib.licenses.lgpl2Plus;
30+ license = licenses.lgpl2Plus;
3531
3632 homepage = http://www.gnu.org/software/libmicrohttpd/;
3733
38− maintainers = [ lib.maintainers.eelco ];
34+ maintainers = [ maintainers.eelco maintainers.vrthra ];
3935 };
4036}
pkgs/development/libraries/libxkbcommon/default.nix+5−4
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, pkgconfig, yacc, flex, xkeyboard_config, libxcb }:
1+{ stdenv, fetchurl, pkgconfig, yacc, flex, xkeyboard_config, libxcb, libX11 }:
22
33stdenv.mkDerivation rec {
44 name = "libxkbcommon-0.6.1";
@@ -12,9 +12,10 @@ stdenv.mkDerivation rec {
1212
1313 buildInputs = [ pkgconfig yacc flex xkeyboard_config libxcb ];
1414
15− configureFlags = ''
16− --with-xkb-config-root=${xkeyboard_config}/etc/X11/xkb
17− '';
15+ configureFlags = [
16+ "--with-xkb-config-root=${xkeyboard_config}/etc/X11/xkb"
17+ "--with-x-locale-root=${libX11.out}/share/X11/locale"
18+ ];
1819
1920 preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
2021 sed -i 's/,--version-script=.*$//' Makefile
pkgs/development/libraries/xgboost/default.nix+2
@@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
1111 sha256 = "1d7lnbwxwakclqqfjwyk9w3wd2clkihdr6ljs5z08ydiaspri093";
1212 };
1313
14+ postPatch = "sed '1i#include <cmath>' -i src/tree/param.h";
15+
1416 enableParallelBuilding = true;
1517
1618 installPhase = ''
pkgs/development/python-modules/generic/wrap.sh+6−7
@@ -46,16 +46,15 @@ wrapPythonProgramsIn() {
4646 # wrapProgram creates the executable shell script described
4747 # above. The script will set PYTHONPATH and PATH variables.!
4848 # (see pkgs/build-support/setup-hooks/make-wrapper.sh)
49− local wrap_args="$f \
50− --prefix PYTHONPATH ':' $program_PYTHONPATH \
51− --prefix PATH ':' $program_PATH:$dir/bin"
49+ local -a wrap_args=("$f"
50+ --prefix PYTHONPATH ':' "$program_PYTHONPATH"
51+ --prefix PATH ':' "$program_PATH:$dir/bin")
5252
5353 # Add any additional arguments provided by makeWrapperArgs
5454 # argument to buildPythonPackage.
55− for arg in $makeWrapperArgs; do
56− wrap_args="$wrap_args $arg"
57− done
58− wrapProgram $wrap_args
55+ local -a user_args="($makeWrapperArgs)"
56+ local -a wrapProgramArgs=("${wrap_args[@]}" "${user_args[@]}")
57+ wrapProgram "${wrapProgramArgs[@]}"
5958 fi
6059 fi
6160 done
pkgs/development/tools/analysis/rr/default.nix+2−1
@@ -11,8 +11,9 @@ stdenv.mkDerivation rec {
1111 sha256 = "03fl2wgbc1cilaw8hrhfqjsbpi05cid6k4cr3s2vmv5gx0dnrgy4";
1212 };
1313
14− patchPhase = ''
14+ postPatch = ''
1515 substituteInPlace src/Command.cc --replace '_BSD_SOURCE' '_DEFAULT_SOURCE'
16+ sed '7i#include <math.h>' -i src/Scheduler.cc
1617 patchShebangs .
1718 '';
1819
pkgs/development/tools/misc/hydra/default.nix+7−1
@@ -3,7 +3,7 @@
33, gitAndTools, mercurial, darcs, subversion, bazaar, openssl, bzip2, libxslt
44, guile, perl, postgresql92, aws-sdk-cpp, nukeReferences, git, boehmgc
55, docbook_xsl, openssh, gnused, coreutils, findutils, gzip, lzma, gnutar
6−, rpm, dpkg, cdrkit }:
6+, rpm, dpkg, cdrkit, fetchpatch }:
77
88with stdenv;
99
@@ -70,6 +70,12 @@ in releaseTools.nixBuild rec {
7070 sha256 = "0ngipzm2i2vz5ygfd70hh82d027snpl85r8ncn1rxlkak0g8fxsl";
7171 };
7272
73+ patches = [(fetchpatch {
74+ name = "cmath.diff";
75+ url = https://github.com/vcunat/hydra/commit/3c6fca1ba299.diff; # https://github.com/NixOS/hydra/pull/337
76+ sha256 = "02m9q304ay45s7xfkm2y7lppakrkx3hrq39mm6348isnbqmbarc0";
77+ })];
78+
7379 buildInputs =
7480 [ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig sqlite libpqxx
7581 gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
pkgs/games/cataclysm-dda/default.nix+3
@@ -21,6 +21,9 @@ stdenv.mkDerivation rec {
2121 sed -i Makefile \
2222 -e 's,-Werror,,g' \
2323 -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g'
24+
25+ sed '1i#include <cmath>' \
26+ -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp
2427 '';
2528
2629 makeFlags = "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1";
pkgs/games/dwarf-fortress/dfhack/default.nix+1
@@ -39,6 +39,7 @@ in stdenv.mkDerivation rec {
3939 };
4040
4141 patches = [ ./use-system-libraries.patch ];
42+ postPatch = "sed '1i#include <math.h>' -i plugins/3dveins.cpp";
4243
4344 nativeBuildInputs = [ cmake perl XMLLibXML XMLLibXSLT fakegit ];
4445 # we can't use native Lua; upstream uses private headers
pkgs/games/dwarf-fortress/unfuck.nix+2
@@ -13,6 +13,8 @@ stdenv.mkDerivation {
1313 sha256 = "12bqh3k4wsk1c0bz2zly8h0ilbsdmsbwr9cdjc6i7liwg9906g7i";
1414 };
1515
16+ postPatch = "sed '1i#include <math.h>' -i g_src/ttf_manager.cpp";
17+
1618 cmakeFlags = [
1719 "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
1820 "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
pkgs/games/openspades/default.nix+5−1
@@ -16,7 +16,11 @@ stdenv.mkDerivation rec {
1616 postPatch = ''
1717 substituteInPlace Sources/Client/Client_Input.cpp --replace "isnan(" "std::isnan("
1818 substituteInPlace Sources/Client/Corpse.cpp --replace "isnan(" "std::isnan("
19− substituteInPlace Sources/Draw/SWMapRenderer.cpp --replace "isnan(" "std::isnan(" --replace "isinf(" "std::isinf("
19+ substituteInPlace Sources/Draw/SWMapRenderer.cpp \
20+ --replace "isnan(" "std::isnan(" --replace "isinf(" "std::isinf("
21+ sed '1i#include <cmath>' -i Sources/Client/{Player,Client_Input,Corpse}.cpp \
22+ -i Sources/Draw/SWMapRenderer.cpp
23+ sed '1i#include <math.h>' -i Sources/Draw/SWFeatureLevel.h
2024 '';
2125
2226 nativeBuildInputs =
pkgs/games/openspades/git.nix+2
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
1414 sha256 = "0vyvmgim03q8pcmfa1i0njr4w1lpjq5g3b47f67v9b5c5jcjycwn";
1515 };
1616
17+ postPatch = "sed '1i#include <cmath>' -i Sources/Client/{,Client}Player.cpp";
18+
1719 nativeBuildInputs =
1820 with stdenv.lib;
1921 [ cmake curl glew makeWrapper mesa SDL2 SDL2_image unzip wget zlib ]
pkgs/games/the-butterfly-effect/default.nix+3
@@ -10,10 +10,13 @@ stdenv.mkDerivation rec {
1010 sha256 = "1ag2cp346f9bz9qy6za6q54id44d2ypvkyhvnjha14qzzapwaysj";
1111 };
1212
13+ postPatch = "sed '1i#include <vector>' -i src/model/World.h";
14+
1315 buildInputs = [
1416 qt5.qtbase qt5.qtsvg qt5.qttranslations box2d which cmake
1517 gettext
1618 ];
19+ enableParallelBuilding = true;
1720
1821 installPhase = ''
1922 make DESTDIR=.. install
pkgs/misc/emulators/higan/default.nix+1
@@ -21,6 +21,7 @@ stdenv.mkDerivation rec {
2121 };
2222
2323 patches = [ ./0001-change-flags.diff ];
24+ postPatch = "sed '1i#include <cmath>' -i higan/fc/ppu/ppu.cpp";
2425
2526 buildInputs =
2627 [ p7zip pkgconfig libX11 libXv udev mesa SDL libao openal libpulseaudio gtk gtksourceview ];
pkgs/misc/emulators/pcsx2/default.nix+4
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
1515 sha256 = "0s7mxq2cgzwjfsq0vhpz6ljk7wr725nxg48128iyirf85585l691";
1616 };
1717
18+ postPatch = "sed '1i#include \"x86intrin.h\"' -i common/src/x86emitter/cpudetect.cpp";
19+
1820 configurePhase = ''
1921 mkdir -p build
2022 cd build
@@ -50,6 +52,8 @@ stdenv.mkDerivation rec {
5052 soundtouch wxGTK30 zlib
5153 ];
5254
55+ enableParallelBuilding = true;
56+
5357 meta = with stdenv.lib; {
5458 description = "Playstation 2 emulator";
5559 longDescription= ''
pkgs/os-specific/linux/sysdig/default.nix+3
@@ -18,6 +18,9 @@ stdenv.mkDerivation {
1818 src = fetchurl {
1919 inherit (s) url sha256;
2020 };
21+ postPatch = ''
22+ sed '1i#include <cmath>' -i userspace/libsinsp/{cursesspectro,filterchecks}.cpp
23+ '';
2124
2225 cmakeFlags = [
2326 "-DUSE_BUNDLED_DEPS=OFF"
pkgs/servers/nosql/arangodb/default.nix+7−6
@@ -11,6 +11,13 @@ stdenv.mkDerivation rec {
1111 sha256 = "1v07fghf2jd2mvkfqhag0xblf6sxw7kx9kmhs2xpyrpns58lirvc";
1212 };
1313
14+ postPatch = ''
15+ substituteInPlace 3rdParty/V8-3.31.74.1/build/gyp/gyp --replace /bin/bash ${bash}/bin/bash
16+ substituteInPlace 3rdParty/etcd/build --replace /bin/bash ${bash}/bin/bash
17+ sed '1i#include <cmath>' -i arangod/Aql/Functions.cpp \
18+ -i lib/Basics/string-buffer.cpp
19+ '';
20+
1421 buildInputs = [
1522 openssl zlib python gyp go readline
1623 ];
@@ -19,12 +26,6 @@ stdenv.mkDerivation rec {
1926
2027 NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow";
2128
22−
23− patchPhase = ''
24− substituteInPlace 3rdParty/V8-3.31.74.1/build/gyp/gyp --replace /bin/bash ${bash}/bin/bash
25− substituteInPlace 3rdParty/etcd/build --replace /bin/bash ${bash}/bin/bash
26− '';
27−
2829 enableParallelBuilding = true;
2930
3031 meta = with stdenv.lib; {
pkgs/stdenv/darwin/make-bootstrap-tools.nix+4−2
@@ -3,9 +3,11 @@
33with import ../../.. { inherit system; };
44
55rec {
6− # We want coreutils without ACL support.
7− coreutils_ = coreutils.override (orig: {
6+ coreutils_ = coreutils.override (args: {
7+ # We want coreutils without ACL support.
88 aclSupport = false;
9+ # Our tooling currently can't handle scripts in bin/, only ELFs and symlinks.
10+ singleBinary = "symlinks";
911 });
1012
1113 build = stdenv.mkDerivation {
pkgs/stdenv/generic/setup.sh+4
@@ -827,6 +827,10 @@ showPhaseHeader() {
827827
828828
829829genericBuild() {
830+ if [ -f "$buildCommandPath" ]; then
831+ . "$buildCommandPath"
832+ return
833+ fi
830834 if [ -n "$buildCommand" ]; then
831835 eval "$buildCommand"
832836 return
pkgs/stdenv/linux/make-bootstrap-tools-cross.nix+22−20
@@ -5,7 +5,7 @@ let buildFor = toolsArch: (
55let
66 pkgsFun = import ../../..;
77 pkgsNoParams = pkgsFun {};
8−
8+
99 sheevaplugCrossSystem = {
1010 crossSystem = rec {
1111 config = "armv5tel-unknown-linux-gnueabi";
@@ -18,10 +18,10 @@ let
1818 openssl.system = "linux-generic32";
1919 };
2020 };
21−
21+
2222 raspberrypiCrossSystem = {
2323 crossSystem = rec {
24− config = "armv6l-unknown-linux-gnueabi";
24+ config = "armv6l-unknown-linux-gnueabi";
2525 bigEndian = false;
2626 arch = "arm";
2727 float = "hard";
@@ -33,10 +33,10 @@ let
3333 inherit (platform) gcc;
3434 };
3535 };
36−
36+
3737 armv7l-hf-multiplatform-crossSystem = {
3838 crossSystem = rec {
39− config = "armv7l-unknown-linux-gnueabi";
39+ config = "armv7l-unknown-linux-gnueabi";
4040 bigEndian = false;
4141 arch = "arm";
4242 float = "hard";
@@ -48,7 +48,7 @@ let
4848 inherit (platform) gcc;
4949 };
5050 };
51−
51+
5252 selectedCrossSystem =
5353 if toolsArch == "armv5tel" then sheevaplugCrossSystem else
5454 if toolsArch == "armv6l" then raspberrypiCrossSystem else
@@ -87,17 +87,19 @@ in
8787
8888rec {
8989
90− # We want coreutils without ACL support.
9190 coreutilsMinimal = (pkgs.coreutils.override (args: {
91+ # We want coreutils without ACL support.
9292 aclSupport = false;
93+ # Our tooling currently can't handle scripts in bin/, only ELFs and symlinks.
94+ singleBinary = "symlinks";
9395 })).crossDrv;
94−
96+
9597 curlMinimal = (pkgs.curl.override {
9698 zlibSupport = false;
9799 sslSupport = false;
98100 scpSupport = false;
99101 }).crossDrv;
100−
102+
101103 busyboxMinimal = (pkgs.busybox.override {
102104 # TBD: uClibc is broken.
103105 # useUclibc = true;
@@ -113,10 +115,10 @@ rec {
113115 CONFIG_UNXZ y
114116 '';
115117 }).crossDrv;
116−
118+
117119 inherit pkgs;
118120
119− build =
121+ build =
120122
121123 stdenv.mkDerivation {
122124 name = "build";
@@ -126,7 +128,7 @@ rec {
126128 crossConfig = stdenv.cross.config;
127129
128130 buildCommand = ''
129− set -x
131+ set -x
130132 mkdir -p $out/bin $out/lib $out/libexec
131133
132134 # Copy what we need of Glibc.
@@ -142,20 +144,20 @@ rec {
142144 cp -d ${glibc.out}/lib/libnss*.so* $out/lib
143145 cp -d ${glibc.out}/lib/libresolv*.so* $out/lib
144146 cp -d ${glibc.out}/lib/crt?.o $out/lib
145−
147+
146148 cp -rL ${glibc.dev}/include $out
147149 chmod -R u+w $out/include
148−
150+
149151 # Hopefully we won't need these.
150152 rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video
151153 find $out/include -name .install -exec rm {} \;
152154 find $out/include -name ..install.cmd -exec rm {} \;
153155 mv $out/include $out/include-glibc
154−
156+
155157 # Copy coreutils, bash, etc.
156158 cp ${coreutilsMinimal}/bin/* $out/bin
157159 (cd $out/bin && rm vdir dir sha*sum pinky factor pathchk runcon shuf who whoami shred users)
158−
160+
159161 cp ${bash}/bin/bash $out/bin
160162 cp ${findutils}/bin/find $out/bin
161163 cp ${findutils}/bin/xargs $out/bin
@@ -174,7 +176,7 @@ rec {
174176 cp -d ${curlMinimal}/lib/libcurl* $out/lib
175177
176178 cp -d ${gnugrep.pcre.crossDrv}/lib/libpcre*.so* $out/lib # needed by grep
177−
179+
178180 # Copy what we need of GCC.
179181 cp -d ${gcc}/bin/gcc $out/bin
180182 cp -d ${gcc}/bin/cpp $out/bin
@@ -203,12 +205,12 @@ rec {
203205 cp -d ${libmpc}/lib/libmpc*.so* $out/lib
204206 cp -d ${zlib.out}/lib/libz.so* $out/lib
205207 cp -d ${libelf}/lib/libelf.so* $out/lib
206−
208+
207209 # TBD: Why are these needed for cross but not native tools?
208210 cp -d ${cloogppl}/lib/libcloog*.so* $out/lib
209211 cp -d ${cloog}/lib/libcloog*.so* $out/lib
210212 cp -d ${isl}/lib/libisl*.so* $out/lib
211−
213+
212214 # Copy binutils.
213215 for i in as ld ar ranlib nm strip readelf objdump; do
214216 cp ${binutils}/bin/$i $out/bin
@@ -216,7 +218,7 @@ rec {
216218 cp -d ${binutils.out}/lib/lib*.so* $out/lib
217219
218220 chmod -R u+w $out
219−
221+
220222 # Strip executables even further.
221223 for i in $out/bin/* $out/libexec/gcc/*/*/*; do
222224 if test -x $i -a ! -L $i; then
pkgs/stdenv/linux/make-bootstrap-tools.nix+3−1
@@ -5,9 +5,11 @@ with import ../../.. {inherit system;};
55rec {
66
77
8− # We want coreutils without ACL support.
98 coreutilsMinimal = coreutils.override (args: {
9+ # We want coreutils without ACL support.
1010 aclSupport = false;
11+ # Our tooling currently can't handle scripts in bin/, only ELFs and symlinks.
12+ singleBinary = "symlinks";
1113 });
1214
1315 tarMinimal = gnutar.override { acl = null; };
pkgs/tools/misc/coreutils/default.nix+5−1
@@ -3,6 +3,7 @@
33, selinuxSupport? false, libselinux ? null, libsepol ? null
44, autoconf, automake114x, texinfo
55, withPrefix ? false
6+, singleBinary ? true # you can also pass "symlinks", for example
67}:
78
89assert aclSupport -> acl != null;
@@ -30,7 +31,10 @@ let
3031 outputs = [ "out" "info" ];
3132
3233 nativeBuildInputs = [ perl xz.bin ];
33− configureFlags = optionalString stdenv.isSunOS "ac_cv_func_inotify_init=no";
34+ configureFlags =
35+ optional (singleBinary != false)
36+ ("--enable-single-binary" + optionalString (isString singleBinary) "=${singleBinary}")
37+ ++ optional stdenv.isSunOS "ac_cv_func_inotify_init=no";
3438
3539 buildInputs = [ gmp ]
3640 ++ optional aclSupport acl
pkgs/tools/misc/file/default.nix+2−2
@@ -1,7 +1,7 @@
11{ stdenv, fetchurl, zlib }:
22
33stdenv.mkDerivation rec {
4− name = "file-5.25";
4+ name = "file-5.28";
55
66 buildInputs = [ zlib ];
77
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
1010 "ftp://ftp.astron.com/pub/file/${name}.tar.gz"
1111 "http://distfiles.macports.org/file/${name}.tar.gz"
1212 ];
13− sha256 = "1jhfi5mivdnqvry5la5q919l503ahwdwbf3hjhiv97znccakhd9p";
13+ sha256 = "04p0w9ggqq6cqvwhyni0flji1z0rwrz896hmhkxd2mc6dca5xjqf";
1414 };
1515
1616 meta = {
pkgs/tools/typesetting/xmlto/default.nix+5−4
@@ -1,12 +1,12 @@
11{ fetchurl, stdenv, flex, libxml2, libxslt
2−, docbook_xml_dtd_42, docbook_xsl, w3m
2+, docbook_xml_dtd_45, docbook_xsl, w3m
33, bash, getopt, makeWrapper }:
44
55stdenv.mkDerivation rec {
6− name = "xmlto-0.0.26";
6+ name = "xmlto-0.0.28";
77 src = fetchurl {
88 url = "http://fedorahosted.org/releases/x/m/xmlto/${name}.tar.bz2";
9− sha256 = "1v5mahfg5k9lh3anykl482xnrgxn36zlmqsgwahw29xwncprpd7g";
9+ sha256 = "0xhj8b2pwp4vhl9y16v3dpxpsakkflfamr191mprzsspg4xdyc0i";
1010 };
1111
1212 patchPhase = ''
@@ -20,7 +20,8 @@ stdenv.mkDerivation rec {
2020
2121 # `libxml2' provides `xmllint', needed at build-time and run-time.
2222 # `libxslt' provides `xsltproc', used by `xmlto' at run-time.
23− buildInputs = [ libxml2 libxslt docbook_xml_dtd_42 docbook_xsl getopt makeWrapper ];
23+ nativeBuildInputs = [ makeWrapper ];
24+ buildInputs = [ libxml2 libxslt docbook_xml_dtd_45 docbook_xsl getopt ];
2425
2526 postInstall = ''
2627 wrapProgram "$out/bin/xmlto" \
pkgs/top-level/all-packages.nix+4
@@ -7298,6 +7298,10 @@ in
72987298 guileBindings = config.gnutls.guile or false;
72997299 };
73007300
7301+ gnutls35 = callPackage ../development/libraries/gnutls/3.5.nix {
7302+ guileBindings = config.gnutls.guile or false;
7303+ };
7304+
73017305 gpac = callPackage ../applications/video/gpac { };
73027306
73037307 gpgme = callPackage ../development/libraries/gpgme {