treewide: another round of gcc12 fixups

This commit is contained in:
Vladimír Čunát 2023-02-05 18:34:47 +01:00
parent 52bef35053
commit cfc056287c
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
11 changed files with 45 additions and 10 deletions

View File

@ -28,6 +28,11 @@ stdenv.mkDerivation rec {
sha256 = "sha256-N96Nb7G6hqfh8DyMtHbttl/fRZUkS8f2KfPSqeMAhHY="; sha256 = "sha256-N96Nb7G6hqfh8DyMtHbttl/fRZUkS8f2KfPSqeMAhHY=";
}; };
postPatch = ''
sed '1i#include <utility>' -i \
libs/JUCELV2/modules/juce_gui_basics/windows/juce_ComponentPeer.h # gcc12
'';
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
pkg-config pkg-config

View File

@ -140,13 +140,16 @@ in stdenv.mkDerivation rec {
patchShebangs tools/get_wb_version.sh patchShebangs tools/get_wb_version.sh
''; '';
NIX_CFLAGS_COMPILE = toString ([ NIX_CFLAGS_COMPILE = [
# error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated # error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
"-Wno-error=deprecated-declarations" "-Wno-error=deprecated-declarations"
] ++ lib.optionals stdenv.isAarch64 [ ] ++ lib.optionals stdenv.isAarch64 [
# error: narrowing conversion of '-1' from 'int' to 'char' # error: narrowing conversion of '-1' from 'int' to 'char'
"-Wno-error=narrowing" "-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 = [ cmakeFlags = [
"-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config" "-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"

View File

@ -29,12 +29,13 @@ stdenv.mkDerivation rec {
# Do not build static libraries # Do not build static libraries
cmakeFlags = [ "-DENABLE_STATIC=NO" ]; cmakeFlags = [ "-DENABLE_STATIC=NO" ];
NIX_CFLAGS_COMPILE = toString [ NIX_CFLAGS_COMPILE = [
"-Wno-error=cast-function-type" "-Wno-error=cast-function-type"
"-Wno-error=deprecated-declarations" "-Wno-error=deprecated-declarations"
"-Wno-error=format-truncation" "-Wno-error=format-truncation"
"-Wno-error=stringop-overflow" "-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" "-Wno-error=use-after-free"
]; ];

View File

@ -55,6 +55,11 @@ mkDerivation rec {
"-DMBGL_WITH_QT_HEADLESS=OFF" "-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; { meta = with lib; {
description = "Open-source alternative to Mapbox GL Native"; description = "Open-source alternative to Mapbox GL Native";
homepage = "https://maplibre.org/"; homepage = "https://maplibre.org/";

View File

@ -30,11 +30,12 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
NIX_CFLAGS_COMPILE = [ NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
"-Wno-error=deprecated-declarations" # Needed with GCC 12 but problematic with some old GCCs
# Needed with GCC 12
"-Wno-error=address" "-Wno-error=address"
"-Wno-error=use-after-free" "-Wno-error=use-after-free"
] ++ [
"-Wno-error=deprecated-declarations"
# Avoid GL_GLEXT_VERSION double definition # Avoid GL_GLEXT_VERSION double definition
" -DNO_SDL_GLEXT" " -DNO_SDL_GLEXT"
]; ];

View File

@ -22,6 +22,9 @@ let
url = "mirror://sourceforge/zod/linux_releases/zod_linux-${version}.tar.gz"; url = "mirror://sourceforge/zod/linux_releases/zod_linux-${version}.tar.gz";
sha256 = "017v96aflrv07g8j8zk9mq8f8rqxl5228rjff5blq8dxpsv1sx7h"; sha256 = "017v96aflrv07g8j8zk9mq8f8rqxl5228rjff5blq8dxpsv1sx7h";
}; };
postPatch = ''
sed '1i#include <ctime>' -i zod_src/common.cpp # gcc12
'';
nativeBuildInputs = [ nativeBuildInputs = [
makeWrapper makeWrapper
]; ];
@ -37,7 +40,7 @@ let
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
NIX_LDFLAGS = "-L${libmysqlclient}/lib/mysql"; NIX_LDFLAGS = "-L${libmysqlclient}/lib/mysql";
zod_engine = stdenv.mkDerivation { zod_engine = stdenv.mkDerivation {
inherit version src nativeBuildInputs buildInputs hardeningDisable NIX_LDFLAGS; inherit version src postPatch nativeBuildInputs buildInputs hardeningDisable NIX_LDFLAGS;
pname = "${name}-engine"; pname = "${name}-engine";
enableParallelBuilding = true; enableParallelBuilding = true;
preBuild = "cd zod_src"; preBuild = "cd zod_src";
@ -48,7 +51,7 @@ let
''; '';
}; };
zod_map_editor = stdenv.mkDerivation { 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"; pname = "${name}-map_editor";
enableParallelBuilding = true; enableParallelBuilding = true;
preBuild = "cd zod_src"; preBuild = "cd zod_src";

View File

@ -26,6 +26,11 @@ stdenv.mkDerivation rec {
sha256 = "sha256-UVBA1vXOuLg4RT+BdF4rhbZ6I9ySeZX0N81gh3MH84I="; sha256 = "sha256-UVBA1vXOuLg4RT+BdF4rhbZ6I9ySeZX0N81gh3MH84I=";
}; };
postPatch = ''
sed '1i#include <memory>' -i \
include/geometry/poly_double.h include/noise/noise_generator.h # gcc12
'';
preConfigure = '' preConfigure = ''
NIX_CFLAGS_COMPILE+=" -isystem ${ilmbase.dev}/include/OpenEXR" NIX_CFLAGS_COMPILE+=" -isystem ${ilmbase.dev}/include/OpenEXR"
''; '';

View File

@ -28,6 +28,10 @@ stdenv.mkDerivation rec {
sha256 = "sha256-3wLfQvbwx+OFrCl5vMV7Zps4e4iEYFhqPiVCo5hDqgw="; sha256 = "sha256-3wLfQvbwx+OFrCl5vMV7Zps4e4iEYFhqPiVCo5hDqgw=";
})]; })];
postPatch = ''
sed '1i#include <ctime>' -i src/Log.cxx # gcc12
'';
nativeBuildInputs = [ pkg-config meson ninja ]; nativeBuildInputs = [ pkg-config meson ninja ];
buildInputs = [ buildInputs = [
libmpdclient libmpdclient

View File

@ -11,6 +11,10 @@ stdenv.mkDerivation rec {
owner = "puppetlabs"; 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"; CXXFLAGS = lib.optionalString stdenv.cc.isGNU "-fpermissive -Wno-error=catch-value";
NIX_LDFLAGS = lib.optionalString stdenv.isLinux "-lblkid"; NIX_LDFLAGS = lib.optionalString stdenv.isLinux "-lblkid";

View File

@ -17,6 +17,10 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-nkidiDNNU6MGhne9EbYClkODJZw/zZu3LWzlniJKyJE="; hash = "sha256-nkidiDNNU6MGhne9EbYClkODJZw/zZu3LWzlniJKyJE=";
}; };
postPatch = ''
sed '1i#include <cstring>' -i src/rocm_smi{,_gpu_metrics}.cc # since gcc12 probably
'';
nativeBuildInputs = [ cmake wrapPython ]; nativeBuildInputs = [ cmake wrapPython ];
patches = [ ./cmake.patch ]; patches = [ ./cmake.patch ];

View File

@ -26358,7 +26358,7 @@ with pkgs;
pipework = callPackage ../os-specific/linux/pipework { }; 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 { }; plymouth = callPackage ../os-specific/linux/plymouth { };