diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-06-19 10:18:30 +0200 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-06-19 10:18:30 +0200 |
commit | 97c484a10f4b38efc4fb3dd210defed96003ae7d (patch) | |
tree | 3cf505288a69445d7a0da288197352484942421c | |
parent | d133a168f082d2f4c94984190e836e55f5e389a7 (diff) |
treewide: fix #include errors after gcc-5.4
They were mostly missing <cmath> or <math.h>.
20 files changed, 63 insertions, 6 deletions
diff --git a/pkgs/applications/graphics/leocad/default.nix b/pkgs/applications/graphics/leocad/default.nix index 884dc11585344..96384765bd03a 100644 --- a/pkgs/applications/graphics/leocad/default.nix +++ b/pkgs/applications/graphics/leocad/default.nix @@ -17,6 +17,7 @@ stdenv.mkDerivation rec { buildInputs = [ qt4 qmake4Hook zlib ]; postPatch = '' + sed '1i#include <cmath>' -i common/camera.cpp substituteInPlace common/camera.cpp --replace "isnan(" "std::isnan(" export qmakeFlags="$qmakeFlags INSTALL_PREFIX=$out" ''; diff --git a/pkgs/applications/graphics/photivo/default.nix b/pkgs/applications/graphics/photivo/default.nix index 12816ba96af4a..d84363df899e6 100644 --- a/pkgs/applications/graphics/photivo/default.nix +++ b/pkgs/applications/graphics/photivo/default.nix @@ -10,15 +10,19 @@ stdenv.mkDerivation rec { sha256 = "0f6y18k7db2ci6xn664zcwm1g1k04sdv7gg1yd5jk41bndjb7z8h"; }; - nativeBuildInputs = [ cmake pkgconfig ]; - - buildInputs = [ qt4 fftw graphicsmagick_q16 lcms2 lensfun libjpeg exiv2 liblqr1 ]; - patchPhase = '' # kinda icky + postPatch = '' # kinda icky sed -e '/("@INSTALL@")/d' \ -e s,@INSTALL@,$out/share/photivo, \ -i Sources/ptSettings.cpp + sed '1i#include <math.h>' -i Sources/filters/ptFilter_StdCurve.cpp ''; + nativeBuildInputs = [ cmake pkgconfig ]; + + buildInputs = [ qt4 fftw graphicsmagick_q16 lcms2 lensfun libjpeg exiv2 liblqr1 ]; + + enableParallelBuilding = true; + meta = with stdenv.lib; { platforms = platforms.linux; maintainers = [ maintainers.mornfall ]; diff --git a/pkgs/applications/misc/cli-visualizer/default.nix b/pkgs/applications/misc/cli-visualizer/default.nix index 6b9856a996ac8..1c7fd62f8ecce 100644 --- a/pkgs/applications/misc/cli-visualizer/default.nix +++ b/pkgs/applications/misc/cli-visualizer/default.nix @@ -10,6 +10,10 @@ stdenv.mkDerivation rec { sha256 = "16768gyi85mkizfn874q2q9xf32knw08z27si3k5bk99492dxwzw"; }; + postPatch = '' + sed '1i#include <cmath>' -i src/Transformer/SpectrumCircleTransformer.cpp + ''; + buildInputs = [ fftw ncurses libpulseaudio ]; buildFlags = [ "ENABLE_PULSE=1" ]; diff --git a/pkgs/applications/misc/termite/default.nix b/pkgs/applications/misc/termite/default.nix index 33bc29f871c72..33c42e3dc1ddf 100644 --- a/pkgs/applications/misc/termite/default.nix +++ b/pkgs/applications/misc/termite/default.nix @@ -13,6 +13,8 @@ let sha256 = "1cw4yw7n9m2si8b7zcfyz9pyihncabxm5g39v1mxslfajxgwzmd8"; }; + postPatch = "sed '1i#include <math.h>' -i termite.cc"; + makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ]; buildInputs = [ pkgconfig vte gtk3 ncurses ]; diff --git a/pkgs/applications/science/robotics/qgroundcontrol/default.nix b/pkgs/applications/science/robotics/qgroundcontrol/default.nix index b67da5b551622..37e9c9c858f17 100644 --- a/pkgs/applications/science/robotics/qgroundcontrol/default.nix +++ b/pkgs/applications/science/robotics/qgroundcontrol/default.nix @@ -27,6 +27,11 @@ stdenv.mkDerivation rec { ] ++ qtInputs; patches = [ ./0001-fix-gcc-cmath-namespace-issues.patch ]; + postPatch = '' + sed '1i#include <cmath>' -i src/Vehicle/Vehicle.cc \ + -i src/comm/{QGCFlightGearLink,QGCJSBSimLink}.cc \ + -i src/{uas/UAS,ui/QGCDataPlot2D}.cc + ''; preConfigure = '' mkdir build diff --git a/pkgs/applications/video/simplescreenrecorder/default.nix b/pkgs/applications/video/simplescreenrecorder/default.nix index a5fb122cf897a..3ea04a39393b3 100644 --- a/pkgs/applications/video/simplescreenrecorder/default.nix +++ b/pkgs/applications/video/simplescreenrecorder/default.nix @@ -11,11 +11,15 @@ stdenv.mkDerivation rec { sha256 = "1d89ncspjd8c4mckf0nb6y3hrxpv4rjpbj868pznhvfmdgr5nvql"; }; + postPatch = "sed '1i#include <random>' -i src/Benchmark.cpp"; + buildInputs = [ alsaLib ffmpeg libjack2 libX11 libXext libXfixes mesa pkgconfig libpulseaudio qt4 ]; + enableParallelBuilding = true; + meta = with stdenv.lib; { description = "A screen recorder for Linux"; homepage = http://www.maartenbaert.be/simplescreenrecorder; diff --git a/pkgs/desktops/kde-5/plasma-5.6/plasma-desktop/default.nix b/pkgs/desktops/kde-5/plasma-5.6/plasma-desktop/default.nix index 618e7387e62c3..2a1d95806c107 100644 --- a/pkgs/desktops/kde-5/plasma-5.6/plasma-desktop/default.nix +++ b/pkgs/desktops/kde-5/plasma-5.6/plasma-desktop/default.nix @@ -34,6 +34,9 @@ plasmaPackage rec { }) ./0003-tzdir.patch ]; + postPatch = '' + sed '1i#include <cmath>' -i kcms/touchpad/src/backends/x11/synapticstouchpad.cpp + ''; NIX_CFLAGS_COMPILE = [ "-I${xorgserver.dev}/include/xorg" ]; cmakeFlags = [ "-DEvdev_INCLUDE_DIRS=${xf86inputevdev.dev}/include/xorg" diff --git a/pkgs/development/libraries/botan/generic.nix b/pkgs/development/libraries/botan/generic.nix index 823e50e32272b..4a4ec5d9fe9c0 100644 --- a/pkgs/development/libraries/botan/generic.nix +++ b/pkgs/development/libraries/botan/generic.nix @@ -2,6 +2,7 @@ # Passed by version specific builders , baseVersion, revision, sha256 , extraConfigureFlags ? "" +, postPatch ? null , ... }: @@ -17,6 +18,7 @@ stdenv.mkDerivation rec { ]; inherit sha256; }; + inherit postPatch; buildInputs = [ python bzip2 zlib gmp openssl boost ]; diff --git a/pkgs/development/libraries/botan/unstable.nix b/pkgs/development/libraries/botan/unstable.nix index dd185f21035d5..d952b50aeb8e5 100644 --- a/pkgs/development/libraries/botan/unstable.nix +++ b/pkgs/development/libraries/botan/unstable.nix @@ -5,4 +5,5 @@ callPackage ./generic.nix (args // { revision = "29"; sha256 = "157bp8716h17agrxyj7xpsj2i5sqhafj1nfx4gpzccx7y2kyq176"; openssl = null; + postPatch = "sed '1i#include <cmath>' -i src/tests/test_bigint.cpp"; }) diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix index e3c5d7573107c..4ba366be56f01 100644 --- a/pkgs/development/libraries/xgboost/default.nix +++ b/pkgs/development/libraries/xgboost/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { sha256 = "1d7lnbwxwakclqqfjwyk9w3wd2clkihdr6ljs5z08ydiaspri093"; }; + postPatch = "sed '1i#include <cmath>' -i src/tree/param.h"; + enableParallelBuilding = true; installPhase = '' diff --git a/pkgs/development/tools/misc/hydra/default.nix b/pkgs/development/tools/misc/hydra/default.nix index 510a0679527ef..a4f1a96c6a4cd 100644 --- a/pkgs/development/tools/misc/hydra/default.nix +++ b/pkgs/development/tools/misc/hydra/default.nix @@ -3,7 +3,7 @@ , gitAndTools, mercurial, darcs, subversion, bazaar, openssl, bzip2, libxslt , guile, perl, postgresql92, aws-sdk-cpp, nukeReferences, git, boehmgc , docbook_xsl, openssh, gnused, coreutils, findutils, gzip, lzma, gnutar -, rpm, dpkg, cdrkit }: +, rpm, dpkg, cdrkit, fetchpatch }: with stdenv; @@ -70,6 +70,12 @@ in releaseTools.nixBuild rec { sha256 = "0ngipzm2i2vz5ygfd70hh82d027snpl85r8ncn1rxlkak0g8fxsl"; }; + patches = [(fetchpatch { + name = "cmath.diff"; + url = https://github.com/vcunat/hydra/commit/3c6fca1ba299.diff; # https://github.com/NixOS/hydra/pull/337 + sha256 = "02m9q304ay45s7xfkm2y7lppakrkx3hrq39mm6348isnbqmbarc0"; + })]; + buildInputs = [ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig sqlite libpqxx gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt diff --git a/pkgs/games/cataclysm-dda/default.nix b/pkgs/games/cataclysm-dda/default.nix index 3956c994531e3..b46114ec62bea 100644 --- a/pkgs/games/cataclysm-dda/default.nix +++ b/pkgs/games/cataclysm-dda/default.nix @@ -21,6 +21,9 @@ stdenv.mkDerivation rec { sed -i Makefile \ -e 's,-Werror,,g' \ -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g' + + sed '1i#include <cmath>' \ + -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp ''; makeFlags = "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1"; diff --git a/pkgs/games/dwarf-fortress/dfhack/default.nix b/pkgs/games/dwarf-fortress/dfhack/default.nix index 3d3b1c4d9aa80..1ee0f829571db 100644 --- a/pkgs/games/dwarf-fortress/dfhack/default.nix +++ b/pkgs/games/dwarf-fortress/dfhack/default.nix @@ -39,6 +39,7 @@ in stdenv.mkDerivation rec { }; patches = [ ./use-system-libraries.patch ]; + postPatch = "sed '1i#include <math.h>' -i plugins/3dveins.cpp"; nativeBuildInputs = [ cmake perl XMLLibXML XMLLibXSLT fakegit ]; # we can't use native Lua; upstream uses private headers diff --git a/pkgs/games/dwarf-fortress/unfuck.nix b/pkgs/games/dwarf-fortress/unfuck.nix index 1d6ea1196dabb..5b2327c2ff54f 100644 --- a/pkgs/games/dwarf-fortress/unfuck.nix +++ b/pkgs/games/dwarf-fortress/unfuck.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation { sha256 = "12bqh3k4wsk1c0bz2zly8h0ilbsdmsbwr9cdjc6i7liwg9906g7i"; }; + postPatch = "sed '1i#include <math.h>' -i g_src/ttf_manager.cpp"; + cmakeFlags = [ "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include" "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include" diff --git a/pkgs/games/openspades/default.nix b/pkgs/games/openspades/default.nix index 2203bb6337eb4..d263be3ec1156 100644 --- a/pkgs/games/openspades/default.nix +++ b/pkgs/games/openspades/default.nix @@ -16,7 +16,10 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace Sources/Client/Client_Input.cpp --replace "isnan(" "std::isnan(" substituteInPlace Sources/Client/Corpse.cpp --replace "isnan(" "std::isnan(" - substituteInPlace Sources/Draw/SWMapRenderer.cpp --replace "isnan(" "std::isnan(" --replace "isinf(" "std::isinf(" + substituteInPlace Sources/Draw/SWMapRenderer.cpp \ + --replace "isnan(" "std::isnan(" --replace "isinf(" "std::isinf(" + sed '1i#include <cmath>' -i Sources/Client/{Player,Client_Input,Corpse}.cpp \ + -i Sources/Draw/SWMapRenderer.cpp ''; nativeBuildInputs = diff --git a/pkgs/games/openspades/git.nix b/pkgs/games/openspades/git.nix index 8212f160cda83..7d76573f73452 100644 --- a/pkgs/games/openspades/git.nix +++ b/pkgs/games/openspades/git.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { sha256 = "0vyvmgim03q8pcmfa1i0njr4w1lpjq5g3b47f67v9b5c5jcjycwn"; }; + postPatch = "sed '1i#include <cmath>' -i Sources/Client/{,Client}Player.cpp"; + nativeBuildInputs = with stdenv.lib; [ cmake curl glew makeWrapper mesa SDL2 SDL2_image unzip wget zlib ] diff --git a/pkgs/games/the-butterfly-effect/default.nix b/pkgs/games/the-butterfly-effect/default.nix index 8775fb103d8d4..cf587ce89dd6d 100644 --- a/pkgs/games/the-butterfly-effect/default.nix +++ b/pkgs/games/the-butterfly-effect/default.nix @@ -9,8 +9,12 @@ stdenv.mkDerivation rec { sha256 = "1cs4q9qiakfd2m1lvfsvfgf8yvhxzmc06glng5d80piwyn6ymzxg"; }; + postPatch = "sed '1i#include <vector>' -i src/model/World.h"; + buildInputs = [ qt4 box2d which cmake ]; + enableParallelBuilding = true; + installPhase = '' make DESTDIR=.. install mkdir -p $out/bin diff --git a/pkgs/misc/emulators/higan/default.nix b/pkgs/misc/emulators/higan/default.nix index 1395e3ac3efed..77392913cb1a4 100644 --- a/pkgs/misc/emulators/higan/default.nix +++ b/pkgs/misc/emulators/higan/default.nix @@ -21,6 +21,7 @@ stdenv.mkDerivation rec { }; patches = [ ./0001-change-flags.diff ]; + postPatch = "sed '1i#include <cmath>' -i higan/fc/ppu/ppu.cpp"; buildInputs = [ p7zip pkgconfig libX11 libXv udev mesa SDL libao openal libpulseaudio gtk gtksourceview ]; diff --git a/pkgs/misc/emulators/pcsx2/default.nix b/pkgs/misc/emulators/pcsx2/default.nix index 1b95bca643c7c..673e4c3ed087c 100644 --- a/pkgs/misc/emulators/pcsx2/default.nix +++ b/pkgs/misc/emulators/pcsx2/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { sha256 = "0s7mxq2cgzwjfsq0vhpz6ljk7wr725nxg48128iyirf85585l691"; }; + postPatch = "sed '1i#include \"x86intrin.h\"' -i common/src/x86emitter/cpudetect.cpp"; + configurePhase = '' mkdir -p build cd build @@ -50,6 +52,8 @@ stdenv.mkDerivation rec { soundtouch wxGTK30 zlib ]; + enableParallelBuilding = true; + meta = with stdenv.lib; { description = "Playstation 2 emulator"; longDescription= '' diff --git a/pkgs/os-specific/linux/sysdig/default.nix b/pkgs/os-specific/linux/sysdig/default.nix index 8296ec62c5b20..82e088b76c20a 100644 --- a/pkgs/os-specific/linux/sysdig/default.nix +++ b/pkgs/os-specific/linux/sysdig/default.nix @@ -18,6 +18,9 @@ stdenv.mkDerivation { src = fetchurl { inherit (s) url sha256; }; + postPatch = '' + sed '1i#include <cmath>' -i userspace/libsinsp/{cursesspectro,filterchecks}.cpp + ''; cmakeFlags = [ "-DUSE_BUNDLED_DEPS=OFF" |