treewide: another round of gcc12 fixups

Changed files
+45 -10
pkgs
applications
audio
odin2
misc
mysql-workbench
development
libraries
belle-sip
maplibre-gl-native
games
liquidwar
zod
tools
graphics
libyafaray
misc
mpdscribble
system
facter
rocm-smi
top-level
+5
pkgs/applications/audio/odin2/default.nix
···
sha256 = "sha256-N96Nb7G6hqfh8DyMtHbttl/fRZUkS8f2KfPSqeMAhHY=";
};
+
postPatch = ''
+
sed '1i#include <utility>' -i \
+
libs/JUCELV2/modules/juce_gui_basics/windows/juce_ComponentPeer.h # gcc12
+
'';
+
nativeBuildInputs = [
cmake
pkg-config
+5 -2
pkgs/applications/misc/mysql-workbench/default.nix
···
patchShebangs tools/get_wb_version.sh
'';
-
NIX_CFLAGS_COMPILE = toString ([
+
NIX_CFLAGS_COMPILE = [
# error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
"-Wno-error=deprecated-declarations"
] ++ lib.optionals stdenv.isAarch64 [
# error: narrowing conversion of '-1' from 'int' to 'char'
"-Wno-error=narrowing"
-
]);
+
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
+
# Needed with GCC 12 but problematic with some old GCCs
+
"-Wno-error=maybe-uninitalized"
+
];
cmakeFlags = [
"-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"
+3 -2
pkgs/development/libraries/belle-sip/default.nix
···
# Do not build static libraries
cmakeFlags = [ "-DENABLE_STATIC=NO" ];
-
NIX_CFLAGS_COMPILE = toString [
+
NIX_CFLAGS_COMPILE = [
"-Wno-error=cast-function-type"
"-Wno-error=deprecated-declarations"
"-Wno-error=format-truncation"
"-Wno-error=stringop-overflow"
-
# Needed with GCC 12
+
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
+
# Needed with GCC 12 but problematic with some old GCCs and probably clang
"-Wno-error=use-after-free"
];
+5
pkgs/development/libraries/maplibre-gl-native/default.nix
···
"-DMBGL_WITH_QT_HEADLESS=OFF"
];
+
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
+
# Needed with GCC 12 but problematic with some old GCCs
+
"-Wno-error=use-after-free"
+
];
+
meta = with lib; {
description = "Open-source alternative to Mapbox GL Native";
homepage = "https://maplibre.org/";
+4 -3
pkgs/games/liquidwar/default.nix
···
hardeningDisable = [ "format" ];
-
NIX_CFLAGS_COMPILE = [
-
"-Wno-error=deprecated-declarations"
-
# Needed with GCC 12
+
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
+
# Needed with GCC 12 but problematic with some old GCCs
"-Wno-error=address"
"-Wno-error=use-after-free"
+
] ++ [
+
"-Wno-error=deprecated-declarations"
# Avoid GL_GLEXT_VERSION double definition
" -DNO_SDL_GLEXT"
];
+5 -2
pkgs/games/zod/default.nix
···
url = "mirror://sourceforge/zod/linux_releases/zod_linux-${version}.tar.gz";
sha256 = "017v96aflrv07g8j8zk9mq8f8rqxl5228rjff5blq8dxpsv1sx7h";
};
+
postPatch = ''
+
sed '1i#include <ctime>' -i zod_src/common.cpp # gcc12
+
'';
nativeBuildInputs = [
makeWrapper
];
···
hardeningDisable = [ "format" ];
NIX_LDFLAGS = "-L${libmysqlclient}/lib/mysql";
zod_engine = stdenv.mkDerivation {
-
inherit version src nativeBuildInputs buildInputs hardeningDisable NIX_LDFLAGS;
+
inherit version src postPatch nativeBuildInputs buildInputs hardeningDisable NIX_LDFLAGS;
pname = "${name}-engine";
enableParallelBuilding = true;
preBuild = "cd zod_src";
···
'';
};
zod_map_editor = stdenv.mkDerivation {
-
inherit version src nativeBuildInputs buildInputs hardeningDisable NIX_LDFLAGS;
+
inherit version src postPatch nativeBuildInputs buildInputs hardeningDisable NIX_LDFLAGS;
pname = "${name}-map_editor";
enableParallelBuilding = true;
preBuild = "cd zod_src";
+5
pkgs/tools/graphics/libyafaray/default.nix
···
sha256 = "sha256-UVBA1vXOuLg4RT+BdF4rhbZ6I9ySeZX0N81gh3MH84I=";
};
+
postPatch = ''
+
sed '1i#include <memory>' -i \
+
include/geometry/poly_double.h include/noise/noise_generator.h # gcc12
+
'';
+
preConfigure = ''
NIX_CFLAGS_COMPILE+=" -isystem ${ilmbase.dev}/include/OpenEXR"
'';
+4
pkgs/tools/misc/mpdscribble/default.nix
···
sha256 = "sha256-3wLfQvbwx+OFrCl5vMV7Zps4e4iEYFhqPiVCo5hDqgw=";
})];
+
postPatch = ''
+
sed '1i#include <ctime>' -i src/Log.cxx # gcc12
+
'';
+
nativeBuildInputs = [ pkg-config meson ninja ];
buildInputs = [
libmpdclient
+4
pkgs/tools/system/facter/default.nix
···
owner = "puppetlabs";
};
+
postPatch = ''
+
sed '1i#include <array>' -i lib/src/facts/glib/load_average_resolver.cc # gcc12
+
'';
+
CXXFLAGS = lib.optionalString stdenv.cc.isGNU "-fpermissive -Wno-error=catch-value";
NIX_LDFLAGS = lib.optionalString stdenv.isLinux "-lblkid";
+4
pkgs/tools/system/rocm-smi/default.nix
···
hash = "sha256-nkidiDNNU6MGhne9EbYClkODJZw/zZu3LWzlniJKyJE=";
};
+
postPatch = ''
+
sed '1i#include <cstring>' -i src/rocm_smi{,_gpu_metrics}.cc # since gcc12 probably
+
'';
+
nativeBuildInputs = [ cmake wrapPython ];
patches = [ ./cmake.patch ];
+1 -1
pkgs/top-level/all-packages.nix
···
pipework = callPackage ../os-specific/linux/pipework { };
-
pktgen = callPackage ../os-specific/linux/pktgen { stdenv = gcc10StdenvCompat; };
+
pktgen = callPackage ../os-specific/linux/pktgen { };
plymouth = callPackage ../os-specific/linux/plymouth { };