treewide: move CFLAGS into env for structuredAttrs (#492201)

This commit is contained in:
Jo
2026-02-20 11:38:29 +00:00
committed by GitHub
27 changed files with 56 additions and 37 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
buildInputs = [ libxcrypt ];
CFLAGS = "-std=gnu89";
env.CFLAGS = "-std=gnu89";
preConfigure = ''
sed -re 's/-[og] 0//g' -i Makefile*
+1 -1
View File
@@ -166,7 +166,7 @@ stdenv.mkDerivation rec {
"CONF_MODPATH_NVIDIA=${nvidia_x11.bin}/lib/xorg/modules"
];
CFLAGS = [
env.CFLAGS = toString [
"-DX_MODULE_APPENDS=\\\"${xmodules}\\\""
];
+1 -1
View File
@@ -22,7 +22,7 @@ stdenv.mkDerivation (finalAttrs: {
cmake
pkg-config
];
CFLAGS = "-D_GLIBCXX_USE_NANOSLEEP";
env.CFLAGS = "-D_GLIBCXX_USE_NANOSLEEP";
patches = [
./01-fix-sleep_for.patch
];
+3 -1
View File
@@ -39,7 +39,9 @@ stdenv.mkDerivation (finalAttrs: {
zlib
];
CFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-D__off_t=off_t";
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
CFLAGS = "-D__off_t=off_t";
};
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# Fix the build on macOS with macFUSE installed. Needs autoreconfHook for
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
--replace "RXPATH=/usr/bin/ssh" "RXPATH=ssh"
'';
CFLAGS = "-D_DARWIN_C_SOURCE";
env.CFLAGS = "-D_DARWIN_C_SOURCE";
makeFlags = [ "DESTDIR=$(out)" ];
buildInputs = [
libx11
+1 -1
View File
@@ -27,7 +27,7 @@ stdenv.mkDerivation (finalAttrs: {
sha256 = "sha256-DR98pxHPwzbcioXmcsq5z9giOgL+LaCkp661jJ4RNjQ=";
};
CFLAGS = lib.pipe (lib.attrNames dflags) [
env.CFLAGS = lib.pipe (lib.attrNames dflags) [
(map (name: "-D${name}=\\\"${dflags.${name}}\\\""))
(lib.concatStringsSep " ")
];
+1 -1
View File
@@ -14,7 +14,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-r40czSLdjCYbt73zK7exCoP/kMq6+pyJfz9LKJLLaXM=";
};
CFLAGS = ''-DDUMPASN1_CONFIG_PATH='"$(out)/etc/"' '';
env.CFLAGS = ''-DDUMPASN1_CONFIG_PATH='"$(out)/etc/"' '';
makeFlags = [ "prefix=$(out)" ];
+3 -1
View File
@@ -44,7 +44,9 @@ stdenv.mkDerivation (finalAttrs: {
./format.patch
];
CFLAGS = lib.optionalString debug " -DDEBUG=2";
env = lib.optionalAttrs debug {
CFLAGS = " -DDEBUG=2";
};
meta = {
homepage = "https://eflite.sourceforge.net";
+1 -1
View File
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
sha256 = "1c1fhc0v1m452lgnfcijnvrc0by06qfbhn3zkliqi60kv8l2isbp";
};
CFLAGS = [ "-O2" ];
env.CFLAGS = toString [ "-O2" ];
installFlags = [ "DESTDIR=$(out)" ];
+1 -1
View File
@@ -12,7 +12,7 @@ stdenv.mkDerivation (finalAttrs: {
sha256 = "0l1qsk949vnz18k4vjf3ppq8p497966x4c7f2yx18x8pk35whn2a";
};
CFLAGS = "-std=gnu89";
env.CFLAGS = "-std=gnu89";
# 'fcrackzip --use-unzip' cannot deal with file names containing a single quote
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=430387
@@ -31,7 +31,10 @@ stdenv.mkDerivation (finalAttrs: {
"-DFMI_VERSION=${toString FMIVersion}"
(lib.cmakeBool "WITH_FMUSIM" false)
];
CFLAGS = lib.optionalString (FMIVersion == 3) "-Wno-stringop-truncation";
env = lib.optionalAttrs (FMIVersion == 3) {
CFLAGS = "-Wno-stringop-truncation";
};
meta = {
# CMakeLists.txt explicitly states support for aarch64-darwin, but
+1 -1
View File
@@ -138,7 +138,7 @@ stdenv.mkDerivation {
# recommended build flags for performance optimized foot builds
# https://codeberg.org/dnkl/foot/src/branch/master/INSTALL.md#release-build
CFLAGS = if !doPgo then "-O3" else pgoCflags;
env.CFLAGS = if !doPgo then "-O3" else pgoCflags;
# ar with gcc plugins for lto objects
preConfigure = ''
@@ -78,7 +78,7 @@ stdenv.mkDerivation (finalAttrs: {
Hence, this is not necessarily an upstream issue, but could be something
wrong with how our gst_all_1 depend on each other.
*/
CFLAGS = "-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0";
env.CFLAGS = "-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0";
preConfigure = ''
patchShebangs ./build-aux/meson/postinstall.py
+1 -1
View File
@@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-ymGAVOkfHtXvBD/MQ1ALutcByVnDGETUaI/yKEmsJS0=";
};
CFLAGS = "-std=gnu99";
env.CFLAGS = "-std=gnu99";
nativeBuildInputs = [ makeWrapper ];
+1 -1
View File
@@ -98,7 +98,7 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true;
strictDeps = true;
CFLAGS = [
env.CFLAGS = toString [
"-O2"
"-DNDEBUG"
];
+1 -1
View File
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
"--with-gtk3"
];
CFLAGS = [
env.CFLAGS = toString [
"-DSCM_DEBUG_TYPING_STRICTNESS=2"
];
+2 -1
View File
@@ -45,7 +45,8 @@ stdenv.mkDerivation {
"--with-gd"
"--with-glib"
];
CFLAGS = [
env.CFLAGS = toString [
"-Wall"
"-std=c90"
];
+1 -1
View File
@@ -28,7 +28,7 @@ stdenv.mkDerivation (finalAttrs: {
-e '/bin_PROGRAMS/s/spf_example_static//' src/spf_example/Makefile.am
'';
CFLAGS = "-Wno-error=implicit-function-declaration";
env.CFLAGS = "-Wno-error=implicit-function-declaration";
doCheck = true;
+1 -1
View File
@@ -14,7 +14,7 @@ stdenv.mkDerivation (finalAttrs: {
sha256 = "03d4ikh29l38rl1wavb0icw7m5pp7yilnv7bb2k8qij1dinsymlx";
};
CFLAGS = "-std=gnu89";
env.CFLAGS = "-std=gnu89";
# For the x86_64 GNU/Linux arch to be recognized by 'configure'
preConfigure = "cp ${libtool}/share/libtool/build-aux/config.sub .";
+1 -1
View File
@@ -16,7 +16,7 @@ stdenv.mkDerivation (finalAttrs: {
# does not apply cleanly with patchPhase/fetchpatch
# https://sources.debian.net/src/nasty/0.6-3/debian/patches/02_add_largefile_support.patch
CFLAGS = "-D_FILE_OFFSET_BITS=64";
env.CFLAGS = "-D_FILE_OFFSET_BITS=64";
buildInputs = [ gpgme ];
+4 -3
View File
@@ -103,9 +103,10 @@ stdenv.mkDerivation (finalAttrs: {
# ++ lib.optional withRygel rygel
;
CFLAGS = [ "-DHAVE_PARANOIA_NEW_INCLUDES" ];
env.NIX_CFLAGS_COMPILE = "-I${lib.getDev gst_all_1.gst-plugins-base}/include/gstreamer-1.0";
env = {
CFLAGS = toString [ "-DHAVE_PARANOIA_NEW_INCLUDES" ];
NIX_CFLAGS_COMPILE = "-I${lib.getDev gst_all_1.gst-plugins-base}/include/gstreamer-1.0";
};
postInstall = ''
qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
+1 -1
View File
@@ -25,7 +25,7 @@ stdenv.mkDerivation (finalAttrs: {
linuxHeaders
];
CFLAGS = [ "-I${linuxHeaders}/include" ];
env.CFLAGS = toString [ "-I${linuxHeaders}/include" ];
passthru.updateScript = nix-update-script { };
+1 -1
View File
@@ -109,7 +109,7 @@ stdenv.mkDerivation (finalAttrs: {
#
# TODO: Remove these CFLAGS when they update to the version that pulls `abc` in with a submodule.
# https://github.com/stp/stp/issues/498#issuecomment-2611251631
CFLAGS = [ "-fsigned-char" ];
env.CFLAGS = toString [ "-fsigned-char" ];
outputs = [
"dev"
+4 -1
View File
@@ -29,7 +29,10 @@ stdenv.mkDerivation (finalAttrs: {
# clang warning: passing arguments to '...' without a prototype is deprecated
# in all versions of C and is not supported in C23.
CFLAGS = "-std=c99 -Wno-deprecated-non-prototype";
env.CFLAGS = toString [
"-std=c99"
"-Wno-deprecated-non-prototype"
];
enableParallelBuilding = true;
+11 -9
View File
@@ -24,16 +24,18 @@ stdenv.mkDerivation (finalAttrs: {
# We can't use sourceRoot, as the cherry-picked patches apply to files outside of it.
postPatch = "cd src/syncterm";
CFLAGS = [
"-DHAS_INTTYPES_H"
"-DXPDEV_DONT_DEFINE_INTTYPES"
env.CFLAGS = toString (
[
"-DHAS_INTTYPES_H"
"-DXPDEV_DONT_DEFINE_INTTYPES"
"-Wno-unused-result"
"-Wformat-overflow=0"
]
++ (lib.optionals stdenv.hostPlatform.isLinux [
"-DUSE_ALSA_SOUND" # Don't use OSS for beeps.
]);
"-Wno-unused-result"
"-Wformat-overflow=0"
]
++ lib.optionals stdenv.hostPlatform.isLinux [
"-DUSE_ALSA_SOUND" # Don't use OSS for beeps.
]
);
makeFlags = [
"PREFIX=$(out)"
+4 -1
View File
@@ -43,7 +43,10 @@ stdenv.mkDerivation (finalAttrs: {
ncurses
];
CFLAGS = "-lasound -lpulse-simple";
env.CFLAGS = toString [
"-lasound"
"-lpulse-simple"
];
meta = {
description = "Sound characters as Morse code on the soundcard or console speaker";
+3 -1
View File
@@ -17,7 +17,9 @@ stdenv.mkDerivation {
patches
;
CFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-D_DARWIN_C_SOURCE";
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
CFLAGS = "-D_DARWIN_C_SOURCE";
};
postPatch = lib.optionalString (customConfig != null) ''
cp ${builtins.toFile "config.h" customConfig} ./config.h