treewide: move CXXFLAGS into env for structuredAttrs (#490778)
This commit is contained in:
@@ -139,7 +139,7 @@ stdenv.mkDerivation rec {
|
||||
# Find FLTK without requiring an OpenGL library in buildInputs
|
||||
++ lib.optional (guiModule == "fltk") "-DFLTK_SKIP_OPENGL=ON";
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
# GCC 13: error: 'uint8_t' does not name a type
|
||||
"-include cstdint"
|
||||
];
|
||||
|
||||
@@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
|
||||
zeromq
|
||||
];
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
"-I${lib.getDev utf8cpp}/include/utf8cpp"
|
||||
"-I${lib.getDev cxx-rs}/include"
|
||||
];
|
||||
|
||||
@@ -191,7 +191,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
(lib.cmakeBool "USE_SVMLIGHT" withSvmLight)
|
||||
];
|
||||
|
||||
CXXFLAGS = "-faligned-new";
|
||||
env.CXXFLAGS = "-faligned-new";
|
||||
|
||||
doCheck = true;
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
|
||||
{} +
|
||||
'';
|
||||
|
||||
CXXFLAGS = " --std=c++11 ";
|
||||
env.CXXFLAGS = " --std=c++11 ";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
|
||||
@@ -46,7 +46,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
# https://github.com/clMathLibraries/clFFT/issues/237
|
||||
CXXFLAGS = "-std=c++98";
|
||||
env.CXXFLAGS = "-std=c++98";
|
||||
|
||||
meta = {
|
||||
description = "Library containing FFT functions written in OpenCL";
|
||||
|
||||
@@ -42,7 +42,10 @@ stdenv.mkDerivation rec {
|
||||
|
||||
enableParallelBuilding = true;
|
||||
hardeningDisable = [ "fortify" ];
|
||||
CXXFLAGS = lib.optionals withOpenMP [ "-fopenmp" ];
|
||||
|
||||
env = lib.optionalAttrs withOpenMP {
|
||||
CXXFLAGS = "-fopenmp";
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
|
||||
SysCPU
|
||||
]);
|
||||
|
||||
CXXFLAGS = "-std=c++98";
|
||||
env.CXXFLAGS = "-std=c++98";
|
||||
|
||||
postInstall = ''
|
||||
substituteInPlace $out/bin/compiler_test.pl \
|
||||
|
||||
@@ -47,7 +47,7 @@ stdenv.mkDerivation {
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
"-DCOMPILE_WITH_LZFSE=1"
|
||||
"-llzfse"
|
||||
];
|
||||
|
||||
@@ -61,9 +61,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"-DDRACO_TINYGLTF_PATH=${tinygltf}"
|
||||
];
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
# error: expected ')' before 'value' in 'explicit GltfValue(uint8_t value)'
|
||||
"-include cstdint"
|
||||
"-include"
|
||||
"cstdint"
|
||||
];
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
@@ -61,7 +61,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
CXXFLAGS = "-std=c++11";
|
||||
env.CXXFLAGS = "-std=c++11";
|
||||
configureFlags = [
|
||||
"--enable-liblilv"
|
||||
"--with-extra-cppflags=-Dnullptr=0"
|
||||
|
||||
@@ -28,7 +28,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
./autogen.sh
|
||||
'';
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
"-O0"
|
||||
"-I${lib.getDev utf8cpp}/include/utf8cpp"
|
||||
];
|
||||
|
||||
@@ -61,7 +61,7 @@ flutter332.buildFlutterApplication rec {
|
||||
];
|
||||
|
||||
# https://github.com/juliansteenbakker/flutter_secure_storage/issues/965
|
||||
CXXFLAGS = [ "-Wno-deprecated-literal-operator" ];
|
||||
env.CXXFLAGS = toString [ "-Wno-deprecated-literal-operator" ];
|
||||
|
||||
# Based on https://github.com/ente-io/ente/blob/main/auth/linux/packaging/rpm/make_config.yaml
|
||||
# and https://github.com/ente-io/ente/blob/main/auth/linux/packaging/enteauth.appdata.xml
|
||||
|
||||
@@ -45,9 +45,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"-DDISABLE_CRASH_LOG=TRUE"
|
||||
];
|
||||
|
||||
CXXFLAGS = lib.optionals stdenv.cc.isClang [
|
||||
"-std=c++17"
|
||||
];
|
||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
||||
CXXFLAGS = toString [ "-std=c++17" ];
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
|
||||
|
||||
@@ -159,17 +159,19 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
"-Wno-error"
|
||||
# https://github.com/signalwire/freeswitch/issues/2495
|
||||
"-Wno-incompatible-pointer-types"
|
||||
];
|
||||
env = {
|
||||
NIX_CFLAGS_COMPILE = toString [
|
||||
"-Wno-error"
|
||||
# https://github.com/signalwire/freeswitch/issues/2495
|
||||
"-Wno-incompatible-pointer-types"
|
||||
];
|
||||
|
||||
# Using c++14 because of build error
|
||||
# gsm_at.h:94:32: error: ISO C++17 does not allow dynamic exception specifications
|
||||
CXXFLAGS = "-std=c++14";
|
||||
# Using c++14 because of build error
|
||||
# gsm_at.h:94:32: error: ISO C++17 does not allow dynamic exception specifications
|
||||
CXXFLAGS = "-std=c++14";
|
||||
|
||||
CFLAGS = "-D_ANSI_SOURCE";
|
||||
CFLAGS = "-D_ANSI_SOURCE";
|
||||
};
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
# Without the std explicitly set, we may run into abseil-cpp
|
||||
# compilation errors.
|
||||
CXXFLAGS = "-std=gnu++23";
|
||||
env.CXXFLAGS = "-std=gnu++23";
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
|
||||
@@ -42,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
# https://github.com/AGWA/git-crypt/issues/232
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
"-DOPENSSL_API_COMPAT=0x30000000L"
|
||||
];
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
freetype
|
||||
];
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
# GCC 13: error: 'uint32_t' has not been declared
|
||||
"-include cstdint"
|
||||
];
|
||||
|
||||
@@ -33,7 +33,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
pkg-config
|
||||
];
|
||||
|
||||
CXXFLAGS = "-std=c++98";
|
||||
env.CXXFLAGS = "-std=c++98";
|
||||
|
||||
buildInputs = [
|
||||
freetype
|
||||
|
||||
@@ -49,7 +49,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
"-DHAVE_LROUND"
|
||||
"-fpermissive"
|
||||
];
|
||||
|
||||
@@ -32,13 +32,13 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
HYPERROGUE_USE_GLEW = 1;
|
||||
HYPERROGUE_USE_PNG = 1;
|
||||
HYPERROGUE_USE_ROGUEVIZ = 1;
|
||||
};
|
||||
|
||||
CXXFLAGS = [
|
||||
"-I${lib.getDev SDL}/include/SDL"
|
||||
"-DHYPERPATH='\"${placeholder "out"}/share/hyperrogue/\"'"
|
||||
"-DRESOURCEDESTDIR=HYPERPATH"
|
||||
];
|
||||
CXXFLAGS = toString [
|
||||
"-I${lib.getDev SDL}/include/SDL"
|
||||
"-DHYPERPATH='\"${placeholder "out"}/share/hyperrogue/\"'"
|
||||
"-DRESOURCEDESTDIR=HYPERPATH"
|
||||
];
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
|
||||
@@ -32,7 +32,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
pcre
|
||||
];
|
||||
nativeBuildInputs = [ cmake ];
|
||||
CXXFLAGS = [
|
||||
|
||||
env.CXXFLAGS = toString [
|
||||
"-fPIC"
|
||||
"-O2"
|
||||
"-w"
|
||||
|
||||
@@ -27,7 +27,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-JARpxp6Z2VioBfY0pZSyQU2mG/EllbaF3qteSFM9u8o=";
|
||||
};
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
# GCC 13: error: 'int16_t' has not been declared in 'std'
|
||||
"-include cstdint"
|
||||
];
|
||||
|
||||
@@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
# compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554
|
||||
CXXFLAGS = [ "-DU_USING_ICU_NAMESPACE=1" ];
|
||||
env.CXXFLAGS = toString [ "-DU_USING_ICU_NAMESPACE=1" ];
|
||||
|
||||
passthru = {
|
||||
updateScript = gitUpdater { rev-prefix = "v"; };
|
||||
|
||||
@@ -20,7 +20,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
patches = [ ./libpar2-0.4-external-verification.patch ];
|
||||
|
||||
CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11";
|
||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
||||
CXXFLAGS = "-std=c++11";
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://parchive.sourceforge.net/";
|
||||
|
||||
@@ -32,7 +32,7 @@ flutter329.buildFlutterApplication rec {
|
||||
];
|
||||
|
||||
# https://github.com/juliansteenbakker/flutter_secure_storage/issues/965
|
||||
CXXFLAGS = [ "-Wno-deprecated-literal-operator" ];
|
||||
env.CXXFLAGS = toString [ "-Wno-deprecated-literal-operator" ];
|
||||
|
||||
postInstall = ''
|
||||
substituteInPlace snap/gui/org.proninyaroslav.libretrack.desktop \
|
||||
|
||||
@@ -28,7 +28,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
buildInputs = [ gcc-unwrapped ];
|
||||
|
||||
CXXFLAGS = [ "-std=c++14" ];
|
||||
env.CXXFLAGS = toString [ "-std=c++14" ];
|
||||
|
||||
configureFlags = [
|
||||
"--disable-build-html"
|
||||
|
||||
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook ];
|
||||
|
||||
CXXFLAGS = "-std=c++11";
|
||||
env.CXXFLAGS = "-std=c++11";
|
||||
|
||||
meta = {
|
||||
description = "Forked version of log4cpp that has been created for the Shibboleth project";
|
||||
|
||||
@@ -21,7 +21,7 @@ buildNpmPackage rec {
|
||||
nodejs = nodejs_20;
|
||||
|
||||
# Prevent Cypress binary download.
|
||||
CYPRESS_INSTALL_BINARY = 0;
|
||||
env.CYPRESS_INSTALL_BINARY = 0;
|
||||
|
||||
preConfigure = ''
|
||||
# Make the build.zip target do nothing, since we will just copy these files later.
|
||||
|
||||
@@ -35,7 +35,7 @@ flutter338.buildFlutterApplication {
|
||||
];
|
||||
|
||||
# https://github.com/juliansteenbakker/flutter_secure_storage/issues/965
|
||||
CXXFLAGS = [ "-Wno-deprecated-literal-operator" ];
|
||||
env.CXXFLAGS = toString [ "-Wno-deprecated-literal-operator" ];
|
||||
|
||||
postInstall = ''
|
||||
install -Dm644 flatpak/io.github.friesi23.mhabit.desktop --target-directory=$out/share/applications
|
||||
|
||||
@@ -257,9 +257,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
]
|
||||
++ lib.optional (builtins.elem "documentation" features_) "man";
|
||||
|
||||
CXXFLAGS = lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
"-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0"
|
||||
];
|
||||
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
|
||||
CXXFLAGS = toString [
|
||||
"-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0"
|
||||
];
|
||||
};
|
||||
|
||||
mesonFlags = [
|
||||
(lib.mesonBool "test" true)
|
||||
|
||||
@@ -133,7 +133,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"build" + lib.optionalString enableDoxygen " doxygen" + lib.optionalString withManual "sphinx";
|
||||
|
||||
# to prevent fatal error: 'backward_warning.h' file not found
|
||||
CXXFLAGS = "-D_GLIBCXX_PERMIT_BACKWARD_HASH";
|
||||
env.CXXFLAGS = "-D_GLIBCXX_PERMIT_BACKWARD_HASH";
|
||||
|
||||
# Make generated python bindings discoverable in customized python environment
|
||||
passthru = {
|
||||
|
||||
@@ -56,9 +56,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
qpdf
|
||||
];
|
||||
|
||||
CXXFLAGS =
|
||||
env = lib.optionalAttrs (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "13") {
|
||||
# Pending upstream compatibility with GCC 13
|
||||
lib.optional (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "13") "-Wno-changes-meaning";
|
||||
CXXFLAGS = "-Wno-changes-meaning";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Simple application to extract, merge, rotate and reorder pages of PDF documents";
|
||||
|
||||
@@ -59,9 +59,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"-DNLOHMANN_JSON_ORIGIN=external"
|
||||
"-DEXE_SQLITE3=${buildPackages.sqlite}/bin/sqlite3"
|
||||
];
|
||||
CXXFLAGS = [
|
||||
|
||||
env.CXXFLAGS = toString [
|
||||
# GCC 13: error: 'int64_t' in namespace 'std' does not name a type
|
||||
"-include cstdint"
|
||||
"-include"
|
||||
"cstdint"
|
||||
];
|
||||
|
||||
preCheck =
|
||||
|
||||
@@ -26,10 +26,13 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"-DRAPIDFUZZ_BUILD_TESTING=ON"
|
||||
];
|
||||
|
||||
CXXFLAGS = lib.optionals stdenv.cc.isClang [
|
||||
# error: no member named 'fill' in namespace 'std'
|
||||
"-include algorithm"
|
||||
];
|
||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
||||
CXXFLAGS = toString [
|
||||
# error: no member named 'fill' in namespace 'std'
|
||||
"-include"
|
||||
"algorithm"
|
||||
];
|
||||
};
|
||||
|
||||
nativeCheckInputs = [
|
||||
catch2_3
|
||||
|
||||
@@ -27,7 +27,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"prefix=${placeholder "out"}"
|
||||
];
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
# GCC 13: error: 'intptr_t' does not name a type
|
||||
"-include cstdint"
|
||||
"-include system_error"
|
||||
|
||||
@@ -36,7 +36,7 @@ flutter338.buildFlutterApplication {
|
||||
];
|
||||
|
||||
# https://github.com/juliansteenbakker/flutter_secure_storage/issues/965
|
||||
CXXFLAGS = [ "-Wno-deprecated-literal-operator" ];
|
||||
env.CXXFLAGS = toString [ "-Wno-deprecated-literal-operator" ];
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
|
||||
@@ -133,7 +133,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
]
|
||||
);
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
# GCC 13: error: 'uintptr_t' in namespace 'std' does not name a type
|
||||
"-include cstdint"
|
||||
];
|
||||
|
||||
@@ -40,7 +40,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
expat
|
||||
];
|
||||
|
||||
CXXFLAGS = "-std=c++98";
|
||||
env.CXXFLAGS = "-std=c++98";
|
||||
|
||||
meta = {
|
||||
description = "Open source full text search server";
|
||||
|
||||
@@ -125,7 +125,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"-DOpenGL_GL_PREFERENCE=GLVND"
|
||||
];
|
||||
|
||||
CXXFLAGS = [
|
||||
env.CXXFLAGS = toString [
|
||||
# GCC 13: error: 'snprintf' was not declared in this scope
|
||||
"-include cstdio"
|
||||
# GCC 13: error: 'runtime_error' is not a member of 'std'
|
||||
|
||||
@@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
# use C++14 Standard until error handling code gets updated upstream
|
||||
CXXFLAGS = [ "-std=c++14" ];
|
||||
env.CXXFLAGS = toString [ "-std=c++14" ];
|
||||
|
||||
# disable flaky networking test
|
||||
postPatch = ''
|
||||
|
||||
@@ -20,14 +20,20 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
perl # for pod2man
|
||||
];
|
||||
|
||||
CPPFLAGS = [
|
||||
"-Dunix"
|
||||
]
|
||||
++ lib.optional (!stdenv.hostPlatform.isi686 && !stdenv.hostPlatform.isx86_64) "-DNOJIT";
|
||||
CXXFLAGS = [
|
||||
"-O3"
|
||||
"-DNDEBUG"
|
||||
];
|
||||
env = {
|
||||
CPPFLAGS = toString (
|
||||
[
|
||||
"-Dunix"
|
||||
]
|
||||
++ lib.optionals (!stdenv.hostPlatform.isi686 && !stdenv.hostPlatform.isx86_64) [
|
||||
"-DNOJIT"
|
||||
]
|
||||
);
|
||||
CXXFLAGS = toString [
|
||||
"-O3"
|
||||
"-DNDEBUG"
|
||||
];
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
# Gcc blindly tries to optimize all float operations instead of just marked ones.
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122304
|
||||
CXXFLAGS = "-ffp-contract=on";
|
||||
env.CXXFLAGS = "-ffp-contract=on";
|
||||
cmakeFlags = [
|
||||
"-DOCIO_INSTALL_EXT_PACKAGES=NONE"
|
||||
"-DOCIO_USE_SSE2NEON=OFF"
|
||||
|
||||
@@ -15,7 +15,9 @@ stdenv.mkDerivation rec {
|
||||
patches = [ ./2.7.7-fixes.patch ];
|
||||
buildInputs = [ jdk ];
|
||||
|
||||
CXXFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION";
|
||||
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
|
||||
CXXFLAGS = "-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Powerful parser generator";
|
||||
|
||||
Reference in New Issue
Block a user