treewide: fix #include errors after gcc-5.4

They were mostly missing <cmath> or <math.h>.
This commit is contained in:
Vladimír Čunát 2016-06-19 10:18:30 +02:00
parent d133a168f0
commit 97c484a10f
20 changed files with 63 additions and 6 deletions

View File

@ -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"
'';

View File

@ -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 ];

View File

@ -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" ];

View File

@ -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 ];

View File

@ -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

View File

@ -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;

View File

@ -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"

View File

@ -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 ];

View File

@ -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";
})

View File

@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
sha256 = "1d7lnbwxwakclqqfjwyk9w3wd2clkihdr6ljs5z08ydiaspri093";
};
postPatch = "sed '1i#include <cmath>' -i src/tree/param.h";
enableParallelBuilding = true;
installPhase = ''

View File

@ -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

View File

@ -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";

View File

@ -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

View File

@ -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"

View File

@ -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 =

View File

@ -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 ]

View File

@ -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

View File

@ -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 ];

View File

@ -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= ''

View File

@ -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"