Merge pull request #151151 from veprbl/pr/libcxx_no_apple_availability

llvmPackages.libcxx: unset _LIBCPP_USE_AVAILABILITY_APPLE

authored by Dmitry Kalinkin and committed by GitHub bbea4872 df275836

+54 -43
-3
pkgs/applications/graphics/darktable/default.nix
··· 27 ] ++ lib.optional stdenv.isDarwin gtk-mac-integration 28 ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; 29 30 - # VC5Decompressor.cpp:718:55: error: 'value' is unavailable: introduced in macOS 10.13 31 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 32 - 33 cmakeFlags = [ 34 "-DBUILD_USERMANUAL=False" 35 ] ++ lib.optionals stdenv.isDarwin [
··· 27 ] ++ lib.optional stdenv.isDarwin gtk-mac-integration 28 ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; 29 30 cmakeFlags = [ 31 "-DBUILD_USERMANUAL=False" 32 ] ++ lib.optionals stdenv.isDarwin [
-3
pkgs/applications/science/logic/z3/default.nix
··· 49 ++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}" 50 ) + "\n" + "cd build"; 51 52 - # ../src/ast/ast.h:183:39: error: 'get<int, int, ast *, symbol, zstring *, rational *, double, unsigned int>' is unavailable: introduced in macOS 10.13 53 - NIX_CFLAGS_COMPILE = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 54 - 55 postInstall = '' 56 mkdir -p $dev $lib 57 mv $out/lib $lib/lib
··· 49 ++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}" 50 ) + "\n" + "cd build"; 51 52 postInstall = '' 53 mkdir -p $dev $lib 54 mv $out/lib $lib/lib
-3
pkgs/applications/science/molecular-dynamics/gromacs/default.nix
··· 41 propagatedBuildInputs = lib.optional enableMpi mpi; 42 propagatedUserEnvPkgs = lib.optional enableMpi mpi; 43 44 - # error: 'value' is unavailable: introduced in macOS 10.13 45 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 46 - 47 cmakeFlags = [ 48 "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}" 49 "-DGMX_OPENMP:BOOL=TRUE"
··· 41 propagatedBuildInputs = lib.optional enableMpi mpi; 42 propagatedUserEnvPkgs = lib.optional enableMpi mpi; 43 44 cmakeFlags = [ 45 "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}" 46 "-DGMX_OPENMP:BOOL=TRUE"
+6
pkgs/development/compilers/llvm/10/libcxx/default.nix
··· 21 ../../libcxx-0001-musl-hacks.patch 22 ]; 23 24 preConfigure = '' 25 # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package 26 cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
··· 21 ../../libcxx-0001-musl-hacks.patch 22 ]; 23 24 + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" 25 + postPatch = '' 26 + substituteInPlace include/__config \ 27 + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" 28 + ''; 29 + 30 preConfigure = '' 31 # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package 32 cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
+6
pkgs/development/compilers/llvm/11/libcxx/default.nix
··· 29 ../../libcxx-0001-musl-hacks.patch 30 ]; 31 32 preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 33 patchShebangs utils/cat_files.py 34 '';
··· 29 ../../libcxx-0001-musl-hacks.patch 30 ]; 31 32 + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" 33 + postPatch = '' 34 + substituteInPlace include/__config \ 35 + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" 36 + ''; 37 + 38 preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 39 patchShebangs utils/cat_files.py 40 '';
+6
pkgs/development/compilers/llvm/12/libcxx/default.nix
··· 23 ../../libcxx-0001-musl-hacks.patch 24 ]; 25 26 preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 27 patchShebangs utils/cat_files.py 28 '';
··· 23 ../../libcxx-0001-musl-hacks.patch 24 ]; 25 26 + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" 27 + postPatch = '' 28 + substituteInPlace include/__config \ 29 + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" 30 + ''; 31 + 32 preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 33 patchShebangs utils/cat_files.py 34 '';
+6
pkgs/development/compilers/llvm/13/libcxx/default.nix
··· 25 ../../libcxx-0001-musl-hacks.patch 26 ]; 27 28 preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 29 patchShebangs utils/cat_files.py 30 '';
··· 25 ../../libcxx-0001-musl-hacks.patch 26 ]; 27 28 + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" 29 + postPatch = '' 30 + substituteInPlace include/__config \ 31 + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" 32 + ''; 33 + 34 preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 35 patchShebangs utils/cat_files.py 36 '';
+6
pkgs/development/compilers/llvm/6/libcxx/default.nix
··· 19 ../../libcxx-0001-musl-hacks.patch 20 ]; 21 22 prePatch = '' 23 substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" 24 '';
··· 19 ../../libcxx-0001-musl-hacks.patch 20 ]; 21 22 + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" 23 + postPatch = '' 24 + substituteInPlace include/__config \ 25 + --replace "#define _LIBCPP_USE_AVAILABILITY_APPLE" "" 26 + ''; 27 + 28 prePatch = '' 29 substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" 30 '';
+6
pkgs/development/compilers/llvm/7/libcxx/default.nix
··· 21 ../../libcxx-0001-musl-hacks.patch 22 ]; 23 24 prePatch = '' 25 substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" 26 '';
··· 21 ../../libcxx-0001-musl-hacks.patch 22 ]; 23 24 + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" 25 + postPatch = '' 26 + substituteInPlace include/__config \ 27 + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" 28 + ''; 29 + 30 prePatch = '' 31 substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" 32 '';
+6
pkgs/development/compilers/llvm/8/libcxx/default.nix
··· 21 ../../libcxx-0001-musl-hacks.patch 22 ]; 23 24 prePatch = '' 25 substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" 26 '';
··· 21 ../../libcxx-0001-musl-hacks.patch 22 ]; 23 24 + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" 25 + postPatch = '' 26 + substituteInPlace include/__config \ 27 + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" 28 + ''; 29 + 30 prePatch = '' 31 substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" 32 '';
+6
pkgs/development/compilers/llvm/9/libcxx/default.nix
··· 21 ../../libcxx-0001-musl-hacks.patch 22 ]; 23 24 preConfigure = '' 25 # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package 26 cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
··· 21 ../../libcxx-0001-musl-hacks.patch 22 ]; 23 24 + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" 25 + postPatch = '' 26 + substituteInPlace include/__config \ 27 + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" 28 + ''; 29 + 30 preConfigure = '' 31 # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package 32 cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
+6
pkgs/development/compilers/llvm/git/libcxx/default.nix
··· 25 ../../libcxx-0001-musl-hacks.patch 26 ]; 27 28 preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 29 patchShebangs utils/cat_files.py 30 '';
··· 25 ../../libcxx-0001-musl-hacks.patch 26 ]; 27 28 + # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" 29 + postPatch = '' 30 + substituteInPlace include/__config \ 31 + --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" 32 + ''; 33 + 34 preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 35 patchShebangs utils/cat_files.py 36 '';
-4
pkgs/development/haskell-modules/configuration-darwin.nix
··· 30 31 double-conversion = addExtraLibrary pkgs.libcxx super.double-conversion; 32 33 - hercules-ci-cnix-store = super.hercules-ci-cnix-store.overrideAttrs (drv: { 34 - NIX_CFLAGS_COMPILE = "-D_LIBCPP_DISABLE_AVAILABILITY"; 35 - }); 36 - 37 apecs-physics = addPkgconfigDepends [ 38 darwin.apple_sdk.frameworks.ApplicationServices 39 ] super.apecs-physics;
··· 30 31 double-conversion = addExtraLibrary pkgs.libcxx super.double-conversion; 32 33 apecs-physics = addPkgconfigDepends [ 34 darwin.apple_sdk.frameworks.ApplicationServices 35 ] super.apecs-physics;
-3
pkgs/development/libraries/caf/default.nix
··· 26 export DYLD_LIBRARY_PATH=$PWD/libcaf_core:$PWD/libcaf_io 27 ''; 28 29 - # error: 'get< ... >' is unavailable: introduced in macOS 10.13 30 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 31 - 32 meta = with lib; { 33 description = "An open source implementation of the actor model in C++"; 34 homepage = "http://actor-framework.org/";
··· 26 export DYLD_LIBRARY_PATH=$PWD/libcaf_core:$PWD/libcaf_io 27 ''; 28 29 meta = with lib; { 30 description = "An open source implementation of the actor model in C++"; 31 homepage = "http://actor-framework.org/";
-6
pkgs/development/libraries/qt-5/modules/qtbase.nix
··· 184 ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' 185 ] ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"'' 186 ++ lib.optional stdenv.isLinux "-DUSE_X11" 187 - ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-darwin") [ 188 - # fix "introduced in macOS 10.13" 189 - "-D_LIBCPP_DISABLE_AVAILABILITY" 190 - # ignore "is only available on macOS 10.12.2 or newer" in obj-c code 191 - "-Wno-error=unguarded-availability" 192 - ] 193 ++ lib.optionals withGtk3 [ 194 ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"'' 195 ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
··· 184 ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' 185 ] ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"'' 186 ++ lib.optional stdenv.isLinux "-DUSE_X11" 187 ++ lib.optionals withGtk3 [ 188 ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"'' 189 ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
-3
pkgs/development/libraries/zxing-cpp/default.nix
··· 21 pkg-config 22 ]; 23 24 - # error: 'path' is unavailable: introduced in macOS 10.15 25 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 26 - 27 cmakeFlags = [ 28 "-DBUILD_EXAMPLES=OFF" 29 ];
··· 21 pkg-config 22 ]; 23 24 cmakeFlags = [ 25 "-DBUILD_EXAMPLES=OFF" 26 ];
-3
pkgs/development/python-modules/tweedledum/default.nix
··· 24 nativeBuildInputs = [ cmake ninja scikit-build ]; 25 dontUseCmakeConfigure = true; 26 27 - # error: 'value' is unavailable: introduced in macOS 10.13 28 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 29 - 30 pythonImportsCheck = [ "tweedledum" ]; 31 32 checkInputs = [ pytestCheckHook ];
··· 24 nativeBuildInputs = [ cmake ninja scikit-build ]; 25 dontUseCmakeConfigure = true; 26 27 pythonImportsCheck = [ "tweedledum" ]; 28 29 checkInputs = [ pytestCheckHook ];
-3
pkgs/development/tools/build-managers/bear/default.nix
··· 47 ./no-double-relative.patch 48 ]; 49 50 - # 'path' is unavailable: introduced in macOS 10.15 51 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 52 - 53 meta = with lib; { 54 description = "Tool that generates a compilation database for clang tooling"; 55 longDescription = ''
··· 47 ./no-double-relative.patch 48 ]; 49 50 meta = with lib; { 51 description = "Tool that generates a compilation database for clang tooling"; 52 longDescription = ''
-3
pkgs/games/openrw/default.nix
··· 35 36 nativeBuildInputs = [ cmake ]; 37 38 - # error: 'path' is unavailable: introduced in macOS 10.15 39 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 40 - 41 buildInputs = [ 42 sfml libGLU libGL bullet glm libmad xlibsWrapper openal SDL2 boost ffmpeg 43 ] ++ lib.optionals stdenv.isDarwin [ OpenAL Cocoa ];
··· 35 36 nativeBuildInputs = [ cmake ]; 37 38 buildInputs = [ 39 sfml libGLU libGL bullet glm libmad xlibsWrapper openal SDL2 boost ffmpeg 40 ] ++ lib.optionals stdenv.isDarwin [ OpenAL Cocoa ];
-3
pkgs/tools/compression/imagelol/default.nix
··· 22 23 nativeBuildInputs = [ cmake ]; 24 25 - # error: 'path' is unavailable: introduced in macOS 10.15 26 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 27 - 28 installPhase = '' 29 mkdir -p $out/bin 30 cp ./ImageLOL $out/bin
··· 22 23 nativeBuildInputs = [ cmake ]; 24 25 installPhase = '' 26 mkdir -p $out/bin 27 cp ./ImageLOL $out/bin
-3
pkgs/tools/graphics/waifu2x-converter-cpp/default.nix
··· 26 27 nativeBuildInputs = [ cmake makeWrapper ]; 28 29 - # main.cpp:498:12: error: 'is_directory' is unavailable: introduced in macOS 10.15 30 - CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 31 - 32 preFixup = lib.optionalString stdenv.isLinux '' 33 wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib" 34 '';
··· 26 27 nativeBuildInputs = [ cmake makeWrapper ]; 28 29 preFixup = lib.optionalString stdenv.isLinux '' 30 wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib" 31 '';
-3
pkgs/tools/package-management/nix/default.nix
··· 78 79 propagatedBuildInputs = [ boehmgc ]; 80 81 - # src/nix-build/nix-build.cc:463:41: error: 'value' is unavailable: introduced in macOS 10.13 82 - NIX_CFLAGS_COMPILE = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY"; 83 - 84 NIX_LDFLAGS = lib.optionals (!is24) [ 85 # https://github.com/NixOS/nix/commit/3e85c57a6cbf46d5f0fe8a89b368a43abd26daba 86 (lib.optionalString enableStatic "-lssl -lbrotlicommon -lssh2 -lz -lnghttp2 -lcrypto")
··· 78 79 propagatedBuildInputs = [ boehmgc ]; 80 81 NIX_LDFLAGS = lib.optionals (!is24) [ 82 # https://github.com/NixOS/nix/commit/3e85c57a6cbf46d5f0fe8a89b368a43abd26daba 83 (lib.optionalString enableStatic "-lssl -lbrotlicommon -lssh2 -lz -lnghttp2 -lcrypto")