about summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2023-02-05 14:56:47 +0100
committerVladimír Čunát <v@cunat.cz>2023-02-05 15:29:43 +0100
commit555f300879332a5989c1130b8e78bf8bdbac20ea (patch)
treec945d3def2ca90d81dd12eff8c024e92a2248898 /pkgs/tools
parent39c285eb4f1f6706bb4d07bd7cb3afc798412f1e (diff)
downloadnixlib-555f300879332a5989c1130b8e78bf8bdbac20ea.tar
nixlib-555f300879332a5989c1130b8e78bf8bdbac20ea.tar.gz
nixlib-555f300879332a5989c1130b8e78bf8bdbac20ea.tar.bz2
nixlib-555f300879332a5989c1130b8e78bf8bdbac20ea.tar.lz
nixlib-555f300879332a5989c1130b8e78bf8bdbac20ea.tar.xz
nixlib-555f300879332a5989c1130b8e78bf8bdbac20ea.tar.zst
nixlib-555f300879332a5989c1130b8e78bf8bdbac20ea.zip
treewide: another round of gcc12 fixups
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/misc/yafetch/default.nix2
-rw-r--r--pkgs/tools/networking/ip2unix/default.nix4
-rw-r--r--pkgs/tools/networking/uqmi/default.nix4
-rw-r--r--pkgs/tools/text/justify/default.nix4
-rw-r--r--pkgs/tools/text/qgrep/default.nix4
5 files changed, 14 insertions, 4 deletions
diff --git a/pkgs/tools/misc/yafetch/default.nix b/pkgs/tools/misc/yafetch/default.nix
index f55926d0ae39..4ebaea963c29 100644
--- a/pkgs/tools/misc/yafetch/default.nix
+++ b/pkgs/tools/misc/yafetch/default.nix
@@ -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
diff --git a/pkgs/tools/networking/ip2unix/default.nix b/pkgs/tools/networking/ip2unix/default.nix
index c4c03cae3a7f..fabbbb40e7a7 100644
--- a/pkgs/tools/networking/ip2unix/default.nix
+++ b/pkgs/tools/networking/ip2unix/default.nix
@@ -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
diff --git a/pkgs/tools/networking/uqmi/default.nix b/pkgs/tools/networking/uqmi/default.nix
index 93be3b78cee1..067bc51854ad 100644
--- a/pkgs/tools/networking/uqmi/default.nix
+++ b/pkgs/tools/networking/uqmi/default.nix
@@ -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"
   ];
 
diff --git a/pkgs/tools/text/justify/default.nix b/pkgs/tools/text/justify/default.nix
index 1e18e22db8e2..86de7365663e 100644
--- a/pkgs/tools/text/justify/default.nix
+++ b/pkgs/tools/text/justify/default.nix
@@ -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 = ''
diff --git a/pkgs/tools/text/qgrep/default.nix b/pkgs/tools/text/qgrep/default.nix
index 20c85e76e160..4145ec656d20 100644
--- a/pkgs/tools/text/qgrep/default.nix
+++ b/pkgs/tools/text/qgrep/default.nix
@@ -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"
   ];