treewide: another round of gcc12 fixups

This commit is contained in:
Vladimír Čunát 2023-02-05 14:56:47 +01:00
parent 39c285eb4f
commit 555f300879
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
19 changed files with 64 additions and 12 deletions

View File

@ -66,6 +66,10 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
postPatch = ''
sed '1i#include <memory>' -i Source/TitleBar.h # gcc12
'';
cmakeBuildType = "Release";
cmakeFlags = lib.optionals enableVST2 [ "-DBESPOKE_VST2_SDK_LOCATION=${vst-sdk}/VST2_SDK" ];

View File

@ -12,6 +12,11 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
postPatch = ''
sed '1i#include <utility>' -i \
lib/JUCE/modules/juce_gui_basics/windows/juce_ComponentPeer.h # gcc12
'';
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [

View File

@ -80,6 +80,11 @@ stdenv.mkDerivation rec {
# guile warning
GUILE_AUTO_COMPILE="0";
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc
"-Wno-error=use-after-free"
];
# `make check` target does not define its prerequisites but expects them to
# have already been built. The list of targets below was built through trial
# and error based on failing tests.

View File

@ -3,7 +3,7 @@
, cmake
, corrosion
, extra-cmake-modules
, gcc11
, gcc12
, kconfig
, kcoreaddons
, kdbusaddons
@ -45,7 +45,7 @@ mkDerivation rec {
cmake
corrosion
extra-cmake-modules
gcc11 # doesn't build with GCC 9 from stdenv on aarch64
gcc12 # doesn't build with GCC 9 from stdenv on aarch64
] ++ (with rustPlatform; [
cargoSetupHook
rust.cargo

View File

@ -2,7 +2,7 @@
, mkDerivation
, extra-cmake-modules
, gcc11
, gcc12
, wrapGAppsHook
, gst_all_1
@ -22,7 +22,7 @@ mkDerivation rec {
nativeBuildInputs = [
extra-cmake-modules
wrapGAppsHook
gcc11 # doesn't build with GCC 9 from stdenv on aarch64
gcc12 # doesn't build with GCC 9 from stdenv on aarch64
python3Packages.wrapPython
python3Packages.pybind11
];

View File

@ -60,8 +60,8 @@ stdenv.mkDerivation rec {
--prefix PATH : "$out/share/cbmc" \
'';
NIX_CFLAGS_COMPILE = [
# Needed with GCC 12
NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
# Needed with GCC 12 but breaks on darwin (with clang)
"-Wno-error=maybe-uninitialized"
] ++ lib.optionals stdenv.cc.isClang [
# fix "argument unused during compilation"

View File

@ -99,6 +99,8 @@ stdenv.mkDerivation rec {
cp -r ${expected-wrap} ${expected-wrap.name}
cp -r ${wlroots-wrap} ${wlroots-wrap.name}
)
sed '1i#include <functional>' -i cardboard/ViewAnimation.h # gcc12
'';
# "Inherited" from Nixpkgs expression for wlroots
@ -108,6 +110,8 @@ stdenv.mkDerivation rec {
"-Dwlroots:libseat=disabled"
];
NIX_CFLAGS_COMPILE = [ "-Wno-error=array-bounds" ]; # gcc12
meta = with lib; {
homepage = "https://gitlab.com/cardboardwm/cardboard";
description = "A scrollable, tiling Wayland compositor inspired on PaperWM";

View File

@ -30,6 +30,8 @@ mkDerivation rec {
# Change default optional terminal program path to one that is more likely to work on NixOS.
substituteInPlace ./src/Configuration.cpp --replace "/usr/bin/xterm" "xterm";
sed '1i#include <memory>' -i include/{RegisterViewModelBase,State,IState}.h # gcc12
'';
meta = with lib; {

View File

@ -63,6 +63,10 @@ mkDerivation rec {
})
];
postPatch = ''
sed '1i#include <memory>' -i components/myguiplatform/myguidatamanager.cpp # gcc12
'';
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
buildInputs = [

View File

@ -18,6 +18,10 @@ stdenv.mkDerivation rec {
./0001-fix-build-with-ffmpeg-4.patch
];
postPatch = ''
sed '1i#include <ctime>' -i src/arch/ArchHooks/ArchHooks.h # gcc12
'';
nativeBuildInputs = [ cmake nasm ];
buildInputs = [

View File

@ -29,6 +29,10 @@ stdenv.mkDerivation rec {
sha256 = "1xkr3ka2sxp5s0spp84iv294i29s1vxqzazb6kmjc0n415h0x57p";
};
postPatch = ''
sed '1i#include <memory>' -i external/partio_zip/zip_manager.hpp # gcc12
'';
nativeBuildInputs = [ pkg-config cmake ];
buildInputs = [

View File

@ -42,6 +42,11 @@ let
python3
];
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc
"-Wno-error=maybe-uninitialized"
];
meta = with lib; {
homepage = "https://github.com/ClusterLabs/resource-agents";
description = "Combined repository of OCF agents from the RHCS and Linux-HA projects";

View File

@ -13,6 +13,10 @@ mkDerivation rec {
sha256 = "sha256-kg6oYtJ4H5A6RNATBg+XvMfCb9FlhEBFjfxamGosMQg=";
};
postPatch = ''
sed '1i#include <array>' -i src/device.h # gcc12
'';
buildInputs = [ qtbase qtgraphicaleffects ];
nativeBuildInputs = [ wrapQtAppsHook cmake pkg-config ];

View File

@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
prePatch = ''
substituteInPlace ./config.h --replace \
"#include \"ascii/gnu.h\"" "#include \"ascii/nixos.h\""
sed '1i#include <array>' -i config.h # gcc12
'';
# Fixes installation path

View File

@ -14,6 +14,10 @@ stdenv.mkDerivation rec {
sha256 = "1pl8ayadxb0zzh5s26yschkjhr1xffbzzv347m88f9y0jv34d24r";
};
postPatch = ''
sed '1i#include <array>' -i src/dynports/dynports.cc # gcc12
'';
nativeBuildInputs = [
meson ninja pkg-config asciidoc libxslt.bin docbook_xml_dtd_45 docbook_xsl
libxml2.bin docbook5 python3Packages.pytest python3Packages.pytest-timeout

View File

@ -18,8 +18,8 @@ stdenv.mkDerivation {
nativeBuildInputs = [ cmake perl ];
buildInputs = [ libubox json_c ];
NIX_CFLAGS_COMPILE = [
# Needed with GCC 12
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc
"-Wno-error=dangling-pointer"
];

View File

@ -16,6 +16,10 @@ stdenv.mkDerivation rec {
sha256 = "sha256-406OhJt2Ila/LIhfqJXhbFqFxJJiRyMVI4/VK8Y43kc=";
};
postPatch = ''
sed '1i#include <algorithm>' -i src/stringHelper.h # gcc12
'';
nativeBuildInputs = [ cmake ];
installPhase = ''

View File

@ -21,8 +21,8 @@ stdenv.mkDerivation rec {
buildInputs = lib.optionals stdenv.isDarwin [ CoreServices CoreFoundation ];
NIX_CFLAGS_COMPILE = [
# Needed with GCC 12
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc
"-Wno-error=mismatched-new-delete"
];

View File

@ -2532,7 +2532,7 @@ with pkgs;
writefreely = callPackage ../applications/misc/writefreely { };
iqueue = callPackage ../development/libraries/iqueue { stdenv = gcc10StdenvCompat; };
iqueue = callPackage ../development/libraries/iqueue { };
lifecycled = callPackage ../tools/misc/lifecycled { };
@ -15237,7 +15237,7 @@ with pkgs;
mitama-cpp-result = callPackage ../development/libraries/mitama-cpp-result { };
mitscheme = callPackage ../development/compilers/mit-scheme
{ stdenv = gcc10StdenvCompat; texLive = texlive.combine { inherit (texlive) scheme-small epsf texinfo; }; };
{ texLive = texlive.combine { inherit (texlive) scheme-small epsf texinfo; }; };
mitschemeX11 = mitscheme.override {
enableX11 = true;
@ -17497,6 +17497,7 @@ with pkgs;
libgcc = callPackage ../development/libraries/gcc/libgcc {
stdenvNoLibs = gccStdenvNoLibs; # cannot be built with clang it seems
gcc = gcc11; # fails to build with gcc12
};
# This is for e.g. LLVM libraries on linux.