treewide: move CFLAGS into env for structuredAttrs (#492201)
This commit is contained in:
@@ -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*
|
||||
|
||||
@@ -166,7 +166,7 @@ stdenv.mkDerivation rec {
|
||||
"CONF_MODPATH_NVIDIA=${nvidia_x11.bin}/lib/xorg/modules"
|
||||
];
|
||||
|
||||
CFLAGS = [
|
||||
env.CFLAGS = toString [
|
||||
"-DX_MODULE_APPENDS=\\\"${xmodules}\\\""
|
||||
];
|
||||
|
||||
|
||||
@@ -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
|
||||
];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 " ")
|
||||
];
|
||||
|
||||
@@ -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)" ];
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
|
||||
sha256 = "1c1fhc0v1m452lgnfcijnvrc0by06qfbhn3zkliqi60kv8l2isbp";
|
||||
};
|
||||
|
||||
CFLAGS = [ "-O2" ];
|
||||
env.CFLAGS = toString [ "-O2" ];
|
||||
|
||||
installFlags = [ "DESTDIR=$(out)" ];
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-ymGAVOkfHtXvBD/MQ1ALutcByVnDGETUaI/yKEmsJS0=";
|
||||
};
|
||||
|
||||
CFLAGS = "-std=gnu99";
|
||||
env.CFLAGS = "-std=gnu99";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
enableParallelBuilding = true;
|
||||
strictDeps = true;
|
||||
|
||||
CFLAGS = [
|
||||
env.CFLAGS = toString [
|
||||
"-O2"
|
||||
"-DNDEBUG"
|
||||
];
|
||||
|
||||
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
|
||||
"--with-gtk3"
|
||||
];
|
||||
|
||||
CFLAGS = [
|
||||
env.CFLAGS = toString [
|
||||
"-DSCM_DEBUG_TYPING_STRICTNESS=2"
|
||||
];
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ stdenv.mkDerivation {
|
||||
"--with-gd"
|
||||
"--with-glib"
|
||||
];
|
||||
CFLAGS = [
|
||||
|
||||
env.CFLAGS = toString [
|
||||
"-Wall"
|
||||
"-std=c90"
|
||||
];
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 .";
|
||||
|
||||
@@ -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 ];
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -25,7 +25,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
linuxHeaders
|
||||
];
|
||||
|
||||
CFLAGS = [ "-I${linuxHeaders}/include" ];
|
||||
env.CFLAGS = toString [ "-I${linuxHeaders}/include" ];
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)"
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user