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=";
};
postPatch = ''
sed '1i#include <utility>' -i \
libs/JUCELV2/modules/juce_gui_basics/windows/juce_ComponentPeer.h # gcc12
'';
nativeBuildInputs = [
cmake
pkg-config

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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