From e1aaaa90fee8665ef84c87eae558f387196d220e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 17 Dec 2021 21:39:30 -0500 Subject: llvmPackages.libcxx: unset _LIBCPP_USE_AVAILABILITY_APPLE --- pkgs/applications/graphics/darktable/default.nix | 3 --- pkgs/applications/science/logic/z3/default.nix | 3 --- pkgs/applications/science/molecular-dynamics/gromacs/default.nix | 3 --- pkgs/development/compilers/llvm/10/libcxx/default.nix | 6 ++++++ pkgs/development/compilers/llvm/11/libcxx/default.nix | 6 ++++++ pkgs/development/compilers/llvm/12/libcxx/default.nix | 6 ++++++ pkgs/development/compilers/llvm/13/libcxx/default.nix | 6 ++++++ pkgs/development/compilers/llvm/6/libcxx/default.nix | 6 ++++++ pkgs/development/compilers/llvm/7/libcxx/default.nix | 6 ++++++ pkgs/development/compilers/llvm/8/libcxx/default.nix | 6 ++++++ pkgs/development/compilers/llvm/9/libcxx/default.nix | 6 ++++++ pkgs/development/compilers/llvm/git/libcxx/default.nix | 6 ++++++ pkgs/development/haskell-modules/configuration-darwin.nix | 4 ---- pkgs/development/libraries/caf/default.nix | 3 --- pkgs/development/libraries/qt-5/modules/qtbase.nix | 6 ------ pkgs/development/libraries/zxing-cpp/default.nix | 3 --- pkgs/development/python-modules/tweedledum/default.nix | 3 --- pkgs/development/tools/build-managers/bear/default.nix | 3 --- pkgs/games/openrw/default.nix | 3 --- pkgs/tools/compression/imagelol/default.nix | 3 --- pkgs/tools/graphics/waifu2x-converter-cpp/default.nix | 3 --- pkgs/tools/package-management/nix/default.nix | 3 --- 22 files changed, 54 insertions(+), 43 deletions(-) diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix index 1f5732f9e36..50e26677377 100644 --- a/pkgs/applications/graphics/darktable/default.nix +++ b/pkgs/applications/graphics/darktable/default.nix @@ -27,9 +27,6 @@ stdenv.mkDerivation rec { ] ++ lib.optional stdenv.isDarwin gtk-mac-integration ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; - # VC5Decompressor.cpp:718:55: error: 'value' is unavailable: introduced in macOS 10.13 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - cmakeFlags = [ "-DBUILD_USERMANUAL=False" ] ++ lib.optionals stdenv.isDarwin [ diff --git a/pkgs/applications/science/logic/z3/default.nix b/pkgs/applications/science/logic/z3/default.nix index 0e500af6a59..4153ba5f66f 100644 --- a/pkgs/applications/science/logic/z3/default.nix +++ b/pkgs/applications/science/logic/z3/default.nix @@ -49,9 +49,6 @@ stdenv.mkDerivation rec { ++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}" ) + "\n" + "cd build"; - # ../src/ast/ast.h:183:39: error: 'get' is unavailable: introduced in macOS 10.13 - NIX_CFLAGS_COMPILE = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - postInstall = '' mkdir -p $dev $lib mv $out/lib $lib/lib diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix index 5743d8df041..f30e94f03d8 100644 --- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix +++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix @@ -41,9 +41,6 @@ in stdenv.mkDerivation rec { propagatedBuildInputs = lib.optional enableMpi mpi; propagatedUserEnvPkgs = lib.optional enableMpi mpi; - # error: 'value' is unavailable: introduced in macOS 10.13 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - cmakeFlags = [ "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}" "-DGMX_OPENMP:BOOL=TRUE" diff --git a/pkgs/development/compilers/llvm/10/libcxx/default.nix b/pkgs/development/compilers/llvm/10/libcxx/default.nix index 7c01e731711..d438294bdd0 100644 --- a/pkgs/development/compilers/llvm/10/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/10/libcxx/default.nix @@ -21,6 +21,12 @@ stdenv.mkDerivation { ../../libcxx-0001-musl-hacks.patch ]; + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" + postPatch = '' + substituteInPlace include/__config \ + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" + ''; + preConfigure = '' # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR") diff --git a/pkgs/development/compilers/llvm/11/libcxx/default.nix b/pkgs/development/compilers/llvm/11/libcxx/default.nix index 596d7f9976b..9aa49c9a009 100644 --- a/pkgs/development/compilers/llvm/11/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/11/libcxx/default.nix @@ -29,6 +29,12 @@ stdenv.mkDerivation { ../../libcxx-0001-musl-hacks.patch ]; + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" + postPatch = '' + substituteInPlace include/__config \ + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" + ''; + preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' patchShebangs utils/cat_files.py ''; diff --git a/pkgs/development/compilers/llvm/12/libcxx/default.nix b/pkgs/development/compilers/llvm/12/libcxx/default.nix index 3ddcb799750..30dc3f4f206 100644 --- a/pkgs/development/compilers/llvm/12/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/12/libcxx/default.nix @@ -23,6 +23,12 @@ stdenv.mkDerivation { ../../libcxx-0001-musl-hacks.patch ]; + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" + postPatch = '' + substituteInPlace include/__config \ + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" + ''; + preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' patchShebangs utils/cat_files.py ''; diff --git a/pkgs/development/compilers/llvm/13/libcxx/default.nix b/pkgs/development/compilers/llvm/13/libcxx/default.nix index 0ce73ed97af..ddf51d9a2fa 100644 --- a/pkgs/development/compilers/llvm/13/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/13/libcxx/default.nix @@ -25,6 +25,12 @@ stdenv.mkDerivation rec { ../../libcxx-0001-musl-hacks.patch ]; + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" + postPatch = '' + substituteInPlace include/__config \ + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" + ''; + preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' patchShebangs utils/cat_files.py ''; diff --git a/pkgs/development/compilers/llvm/6/libcxx/default.nix b/pkgs/development/compilers/llvm/6/libcxx/default.nix index 3e39dd84042..7077081c591 100644 --- a/pkgs/development/compilers/llvm/6/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/6/libcxx/default.nix @@ -19,6 +19,12 @@ stdenv.mkDerivation { ../../libcxx-0001-musl-hacks.patch ]; + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" + postPatch = '' + substituteInPlace include/__config \ + --replace "#define _LIBCPP_USE_AVAILABILITY_APPLE" "" + ''; + prePatch = '' substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" ''; diff --git a/pkgs/development/compilers/llvm/7/libcxx/default.nix b/pkgs/development/compilers/llvm/7/libcxx/default.nix index ac10e8eb77e..07d84432d42 100644 --- a/pkgs/development/compilers/llvm/7/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/7/libcxx/default.nix @@ -21,6 +21,12 @@ stdenv.mkDerivation { ../../libcxx-0001-musl-hacks.patch ]; + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" + postPatch = '' + substituteInPlace include/__config \ + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" + ''; + prePatch = '' substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" ''; diff --git a/pkgs/development/compilers/llvm/8/libcxx/default.nix b/pkgs/development/compilers/llvm/8/libcxx/default.nix index 804b9a53c24..87cd734899f 100644 --- a/pkgs/development/compilers/llvm/8/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/8/libcxx/default.nix @@ -21,6 +21,12 @@ stdenv.mkDerivation { ../../libcxx-0001-musl-hacks.patch ]; + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" + postPatch = '' + substituteInPlace include/__config \ + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" + ''; + prePatch = '' substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" ''; diff --git a/pkgs/development/compilers/llvm/9/libcxx/default.nix b/pkgs/development/compilers/llvm/9/libcxx/default.nix index b2022f23e51..27197110310 100644 --- a/pkgs/development/compilers/llvm/9/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/9/libcxx/default.nix @@ -21,6 +21,12 @@ stdenv.mkDerivation { ../../libcxx-0001-musl-hacks.patch ]; + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" + postPatch = '' + substituteInPlace include/__config \ + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" + ''; + preConfigure = '' # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR") diff --git a/pkgs/development/compilers/llvm/git/libcxx/default.nix b/pkgs/development/compilers/llvm/git/libcxx/default.nix index 0ddf28909b8..bedfd5afee1 100644 --- a/pkgs/development/compilers/llvm/git/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/git/libcxx/default.nix @@ -25,6 +25,12 @@ stdenv.mkDerivation rec { ../../libcxx-0001-musl-hacks.patch ]; + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" + postPatch = '' + substituteInPlace include/__config \ + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" + ''; + preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' patchShebangs utils/cat_files.py ''; diff --git a/pkgs/development/haskell-modules/configuration-darwin.nix b/pkgs/development/haskell-modules/configuration-darwin.nix index 13367c61be3..5248523e0cd 100644 --- a/pkgs/development/haskell-modules/configuration-darwin.nix +++ b/pkgs/development/haskell-modules/configuration-darwin.nix @@ -30,10 +30,6 @@ self: super: ({ double-conversion = addExtraLibrary pkgs.libcxx super.double-conversion; - hercules-ci-cnix-store = super.hercules-ci-cnix-store.overrideAttrs (drv: { - NIX_CFLAGS_COMPILE = "-D_LIBCPP_DISABLE_AVAILABILITY"; - }); - apecs-physics = addPkgconfigDepends [ darwin.apple_sdk.frameworks.ApplicationServices ] super.apecs-physics; diff --git a/pkgs/development/libraries/caf/default.nix b/pkgs/development/libraries/caf/default.nix index 71db183afc6..045595a84fd 100644 --- a/pkgs/development/libraries/caf/default.nix +++ b/pkgs/development/libraries/caf/default.nix @@ -26,9 +26,6 @@ stdenv.mkDerivation rec { export DYLD_LIBRARY_PATH=$PWD/libcaf_core:$PWD/libcaf_io ''; - # error: 'get< ... >' is unavailable: introduced in macOS 10.13 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - meta = with lib; { description = "An open source implementation of the actor model in C++"; homepage = "http://actor-framework.org/"; diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index b97a4dd5492..44f08699824 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -184,12 +184,6 @@ stdenv.mkDerivation { ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' ] ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"'' ++ lib.optional stdenv.isLinux "-DUSE_X11" - ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-darwin") [ - # fix "introduced in macOS 10.13" - "-D_LIBCPP_DISABLE_AVAILABILITY" - # ignore "is only available on macOS 10.12.2 or newer" in obj-c code - "-Wno-error=unguarded-availability" - ] ++ lib.optionals withGtk3 [ ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"'' ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"'' diff --git a/pkgs/development/libraries/zxing-cpp/default.nix b/pkgs/development/libraries/zxing-cpp/default.nix index a6f83f2859d..aa7db78c4c3 100644 --- a/pkgs/development/libraries/zxing-cpp/default.nix +++ b/pkgs/development/libraries/zxing-cpp/default.nix @@ -21,9 +21,6 @@ stdenv.mkDerivation rec { pkg-config ]; - # error: 'path' is unavailable: introduced in macOS 10.15 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - cmakeFlags = [ "-DBUILD_EXAMPLES=OFF" ]; diff --git a/pkgs/development/python-modules/tweedledum/default.nix b/pkgs/development/python-modules/tweedledum/default.nix index d0d989d2912..69b126481d3 100644 --- a/pkgs/development/python-modules/tweedledum/default.nix +++ b/pkgs/development/python-modules/tweedledum/default.nix @@ -24,9 +24,6 @@ buildPythonPackage rec { nativeBuildInputs = [ cmake ninja scikit-build ]; dontUseCmakeConfigure = true; - # error: 'value' is unavailable: introduced in macOS 10.13 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - pythonImportsCheck = [ "tweedledum" ]; checkInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/tools/build-managers/bear/default.nix b/pkgs/development/tools/build-managers/bear/default.nix index 552cb057366..21f7512588c 100644 --- a/pkgs/development/tools/build-managers/bear/default.nix +++ b/pkgs/development/tools/build-managers/bear/default.nix @@ -47,9 +47,6 @@ stdenv.mkDerivation rec { ./no-double-relative.patch ]; - # 'path' is unavailable: introduced in macOS 10.15 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - meta = with lib; { description = "Tool that generates a compilation database for clang tooling"; longDescription = '' diff --git a/pkgs/games/openrw/default.nix b/pkgs/games/openrw/default.nix index d86962b9abe..95ec3d64cfb 100644 --- a/pkgs/games/openrw/default.nix +++ b/pkgs/games/openrw/default.nix @@ -35,9 +35,6 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake ]; - # error: 'path' is unavailable: introduced in macOS 10.15 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - buildInputs = [ sfml libGLU libGL bullet glm libmad xlibsWrapper openal SDL2 boost ffmpeg ] ++ lib.optionals stdenv.isDarwin [ OpenAL Cocoa ]; diff --git a/pkgs/tools/compression/imagelol/default.nix b/pkgs/tools/compression/imagelol/default.nix index 5a175611b93..187435d4eb3 100644 --- a/pkgs/tools/compression/imagelol/default.nix +++ b/pkgs/tools/compression/imagelol/default.nix @@ -22,9 +22,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - # error: 'path' is unavailable: introduced in macOS 10.15 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - installPhase = '' mkdir -p $out/bin cp ./ImageLOL $out/bin diff --git a/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix b/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix index 8afca16eb09..8d8ae6e71e4 100644 --- a/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix +++ b/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix @@ -26,9 +26,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake makeWrapper ]; - # main.cpp:498:12: error: 'is_directory' is unavailable: introduced in macOS 10.15 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - preFixup = lib.optionalString stdenv.isLinux '' wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib" ''; diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 1a8a4889346..59651c973c3 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -78,9 +78,6 @@ common = propagatedBuildInputs = [ boehmgc ]; - # src/nix-build/nix-build.cc:463:41: error: 'value' is unavailable: introduced in macOS 10.13 - NIX_CFLAGS_COMPILE = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; - NIX_LDFLAGS = lib.optionals (!is24) [ # https://github.com/NixOS/nix/commit/3e85c57a6cbf46d5f0fe8a89b368a43abd26daba (lib.optionalString enableStatic "-lssl -lbrotlicommon -lssh2 -lz -lnghttp2 -lcrypto") -- cgit 1.4.1