From 13a1c7b8c1ae5c4558aa5dc3a173fb15d55d4656 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 1 Apr 2016 13:36:59 +0200 Subject: [PATCH] useOldCXXAbi: Change into a setup hook Stdenv adapters considered weird. --- pkgs/build-support/setup-hooks/use-old-cxx-abi.sh | 1 + pkgs/games/steam/chrootenv.nix | 4 ++-- pkgs/stdenv/adapters.nix | 6 ------ pkgs/top-level/all-packages.nix | 2 ++ 4 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 pkgs/build-support/setup-hooks/use-old-cxx-abi.sh diff --git a/pkgs/build-support/setup-hooks/use-old-cxx-abi.sh b/pkgs/build-support/setup-hooks/use-old-cxx-abi.sh new file mode 100644 index 000000000000..53335d7a9a7a --- /dev/null +++ b/pkgs/build-support/setup-hooks/use-old-cxx-abi.sh @@ -0,0 +1 @@ +export NIX_CFLAGS_COMPILE+=" -D_GLIBCXX_USE_CXX11_ABI=0" diff --git a/pkgs/games/steam/chrootenv.nix b/pkgs/games/steam/chrootenv.nix index 35b3611812b5..8bb73fc5cef3 100644 --- a/pkgs/games/steam/chrootenv.nix +++ b/pkgs/games/steam/chrootenv.nix @@ -25,8 +25,8 @@ buildFHSUserEnv { ] ++ lib.optional withJava jdk ++ lib.optional withPrimus (primus.override { - stdenv = useOldCXXAbi stdenv; - stdenv_i686 = useOldCXXAbi pkgsi686Linux.stdenv; + stdenv = overrideInStdenv stdenv [ useOldCXXAbi ]; + stdenv_i686 = overrideInStdenv pkgsi686Linux.stdenv [ useOldCXXAbi ]; }) ; diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 8398c45400e4..87d3938f13d3 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -242,10 +242,4 @@ rec { else pkgs.stdenv; }; - /* Modify a stdenv so a build uses pre-C++11 ABI by default. */ - useOldCXXAbi = stdenv: stdenv // - { mkDerivation = args: stdenv.mkDerivation (args // { - NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -D_GLIBCXX_USE_CXX11_ABI=0"; - }); - }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cca23969c83d..22303669f9c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -325,6 +325,8 @@ in separateDebugInfo = makeSetupHook { } ../build-support/setup-hooks/separate-debug-info.sh; + useOldCXXAbi = makeSetupHook { } ../build-support/setup-hooks/use-old-cxx-abi.sh; + ### TOOLS