summary refs log tree commit diff
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2023-02-05 18:34:47 +0100
committerVladimír Čunát <v@cunat.cz>2023-02-05 18:34:47 +0100
commitcfc056287cb29a7bc434f0a2334b149f6a057094 (patch)
treeca179e1e48318685d498356f9cc7642878184684
parent52bef350535ed22e1fbf9e7ef20c437d223ee92b (diff)
downloadnixpkgs-cfc056287cb29a7bc434f0a2334b149f6a057094.tar
nixpkgs-cfc056287cb29a7bc434f0a2334b149f6a057094.tar.gz
nixpkgs-cfc056287cb29a7bc434f0a2334b149f6a057094.tar.bz2
nixpkgs-cfc056287cb29a7bc434f0a2334b149f6a057094.tar.lz
nixpkgs-cfc056287cb29a7bc434f0a2334b149f6a057094.tar.xz
nixpkgs-cfc056287cb29a7bc434f0a2334b149f6a057094.tar.zst
nixpkgs-cfc056287cb29a7bc434f0a2334b149f6a057094.zip
treewide: another round of gcc12 fixups
-rw-r--r--pkgs/applications/audio/odin2/default.nix5
-rw-r--r--pkgs/applications/misc/mysql-workbench/default.nix7
-rw-r--r--pkgs/development/libraries/belle-sip/default.nix5
-rw-r--r--pkgs/development/libraries/maplibre-gl-native/default.nix5
-rw-r--r--pkgs/games/liquidwar/default.nix7
-rw-r--r--pkgs/games/zod/default.nix7
-rw-r--r--pkgs/tools/graphics/libyafaray/default.nix5
-rw-r--r--pkgs/tools/misc/mpdscribble/default.nix4
-rw-r--r--pkgs/tools/system/facter/default.nix4
-rw-r--r--pkgs/tools/system/rocm-smi/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix2
11 files changed, 45 insertions, 10 deletions
diff --git a/pkgs/applications/audio/odin2/default.nix b/pkgs/applications/audio/odin2/default.nix
index beb12646793..de89f9aedea 100644
--- a/pkgs/applications/audio/odin2/default.nix
+++ b/pkgs/applications/audio/odin2/default.nix
@@ -28,6 +28,11 @@ stdenv.mkDerivation rec {
     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
diff --git a/pkgs/applications/misc/mysql-workbench/default.nix b/pkgs/applications/misc/mysql-workbench/default.nix
index 935a9582fca..e5e0f92ed1d 100644
--- a/pkgs/applications/misc/mysql-workbench/default.nix
+++ b/pkgs/applications/misc/mysql-workbench/default.nix
@@ -140,13 +140,16 @@ in stdenv.mkDerivation rec {
     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"
diff --git a/pkgs/development/libraries/belle-sip/default.nix b/pkgs/development/libraries/belle-sip/default.nix
index a33b9f16360..a7606854812 100644
--- a/pkgs/development/libraries/belle-sip/default.nix
+++ b/pkgs/development/libraries/belle-sip/default.nix
@@ -29,12 +29,13 @@ stdenv.mkDerivation rec {
   # 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"
   ];
 
diff --git a/pkgs/development/libraries/maplibre-gl-native/default.nix b/pkgs/development/libraries/maplibre-gl-native/default.nix
index 568f3fbe64e..9f9cb576c77 100644
--- a/pkgs/development/libraries/maplibre-gl-native/default.nix
+++ b/pkgs/development/libraries/maplibre-gl-native/default.nix
@@ -55,6 +55,11 @@ mkDerivation rec {
     "-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/";
diff --git a/pkgs/games/liquidwar/default.nix b/pkgs/games/liquidwar/default.nix
index a3532fa6e19..9d9e4243452 100644
--- a/pkgs/games/liquidwar/default.nix
+++ b/pkgs/games/liquidwar/default.nix
@@ -30,11 +30,12 @@ stdenv.mkDerivation rec {
 
   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"
   ];
diff --git a/pkgs/games/zod/default.nix b/pkgs/games/zod/default.nix
index 737fed1e7f6..e0c2031dde2 100644
--- a/pkgs/games/zod/default.nix
+++ b/pkgs/games/zod/default.nix
@@ -22,6 +22,9 @@ let
     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
   ];
@@ -37,7 +40,7 @@ let
   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";
@@ -48,7 +51,7 @@ let
     '';
   };
   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";
diff --git a/pkgs/tools/graphics/libyafaray/default.nix b/pkgs/tools/graphics/libyafaray/default.nix
index db48aa678cc..22bbfddbcf5 100644
--- a/pkgs/tools/graphics/libyafaray/default.nix
+++ b/pkgs/tools/graphics/libyafaray/default.nix
@@ -26,6 +26,11 @@ stdenv.mkDerivation rec {
     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"
   '';
diff --git a/pkgs/tools/misc/mpdscribble/default.nix b/pkgs/tools/misc/mpdscribble/default.nix
index dc446d3f0a1..46bf31ed667 100644
--- a/pkgs/tools/misc/mpdscribble/default.nix
+++ b/pkgs/tools/misc/mpdscribble/default.nix
@@ -28,6 +28,10 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-3wLfQvbwx+OFrCl5vMV7Zps4e4iEYFhqPiVCo5hDqgw=";
   })];
 
+  postPatch = ''
+    sed '1i#include <ctime>' -i src/Log.cxx # gcc12
+  '';
+
   nativeBuildInputs = [ pkg-config meson ninja ];
   buildInputs = [
     libmpdclient
diff --git a/pkgs/tools/system/facter/default.nix b/pkgs/tools/system/facter/default.nix
index de4acffa63e..0e746b0d07a 100644
--- a/pkgs/tools/system/facter/default.nix
+++ b/pkgs/tools/system/facter/default.nix
@@ -11,6 +11,10 @@ stdenv.mkDerivation rec {
     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";
 
diff --git a/pkgs/tools/system/rocm-smi/default.nix b/pkgs/tools/system/rocm-smi/default.nix
index 47542d25370..d7e23a9acb0 100644
--- a/pkgs/tools/system/rocm-smi/default.nix
+++ b/pkgs/tools/system/rocm-smi/default.nix
@@ -17,6 +17,10 @@ stdenv.mkDerivation (finalAttrs: {
     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 ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index cf8288b203c..4a4f706c4c0 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -26358,7 +26358,7 @@ with pkgs;
 
   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 { };