Merge pull request #151151 from veprbl/pr/libcxx_no_apple_availability

llvmPackages.libcxx: unset _LIBCPP_USE_AVAILABILITY_APPLE
This commit is contained in:
Dmitry Kalinkin 2021-12-19 11:42:28 -05:00 committed by GitHub
commit bbea48728b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 54 additions and 43 deletions

View File

@ -27,9 +27,6 @@ stdenv.mkDerivation rec {
] ++ lib.optional stdenv.isDarwin gtk-mac-integration ] ++ lib.optional stdenv.isDarwin gtk-mac-integration
++ lib.optional stdenv.cc.isClang llvmPackages.openmp; ++ 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 = [ cmakeFlags = [
"-DBUILD_USERMANUAL=False" "-DBUILD_USERMANUAL=False"
] ++ lib.optionals stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [

View File

@ -49,9 +49,6 @@ stdenv.mkDerivation rec {
++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}" ++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}"
) + "\n" + "cd build"; ) + "\n" + "cd build";
# ../src/ast/ast.h:183:39: error: 'get<int, int, ast *, symbol, zstring *, rational *, double, unsigned int>' is unavailable: introduced in macOS 10.13
NIX_CFLAGS_COMPILE = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY";
postInstall = '' postInstall = ''
mkdir -p $dev $lib mkdir -p $dev $lib
mv $out/lib $lib/lib mv $out/lib $lib/lib

View File

@ -41,9 +41,6 @@ in stdenv.mkDerivation rec {
propagatedBuildInputs = lib.optional enableMpi mpi; propagatedBuildInputs = lib.optional enableMpi mpi;
propagatedUserEnvPkgs = 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 = [ cmakeFlags = [
"-DGMX_SIMD:STRING=${SIMD cpuAcceleration}" "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}"
"-DGMX_OPENMP:BOOL=TRUE" "-DGMX_OPENMP:BOOL=TRUE"

View File

@ -21,6 +21,12 @@ stdenv.mkDerivation {
../../libcxx-0001-musl-hacks.patch ../../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 = '' preConfigure = ''
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package # 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") cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")

View File

@ -29,6 +29,12 @@ stdenv.mkDerivation {
../../libcxx-0001-musl-hacks.patch ../../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 '' preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py patchShebangs utils/cat_files.py
''; '';

View File

@ -23,6 +23,12 @@ stdenv.mkDerivation {
../../libcxx-0001-musl-hacks.patch ../../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 '' preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py patchShebangs utils/cat_files.py
''; '';

View File

@ -25,6 +25,12 @@ stdenv.mkDerivation rec {
../../libcxx-0001-musl-hacks.patch ../../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 '' preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py patchShebangs utils/cat_files.py
''; '';

View File

@ -19,6 +19,12 @@ stdenv.mkDerivation {
../../libcxx-0001-musl-hacks.patch ../../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 = '' prePatch = ''
substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
''; '';

View File

@ -21,6 +21,12 @@ stdenv.mkDerivation {
../../libcxx-0001-musl-hacks.patch ../../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 = '' prePatch = ''
substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
''; '';

View File

@ -21,6 +21,12 @@ stdenv.mkDerivation {
../../libcxx-0001-musl-hacks.patch ../../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 = '' prePatch = ''
substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
''; '';

View File

@ -21,6 +21,12 @@ stdenv.mkDerivation {
../../libcxx-0001-musl-hacks.patch ../../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 = '' preConfigure = ''
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package # 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") cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")

View File

@ -25,6 +25,12 @@ stdenv.mkDerivation rec {
../../libcxx-0001-musl-hacks.patch ../../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 '' preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py patchShebangs utils/cat_files.py
''; '';

View File

@ -30,10 +30,6 @@ self: super: ({
double-conversion = addExtraLibrary pkgs.libcxx super.double-conversion; 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 [ apecs-physics = addPkgconfigDepends [
darwin.apple_sdk.frameworks.ApplicationServices darwin.apple_sdk.frameworks.ApplicationServices
] super.apecs-physics; ] super.apecs-physics;

View File

@ -26,9 +26,6 @@ stdenv.mkDerivation rec {
export DYLD_LIBRARY_PATH=$PWD/libcaf_core:$PWD/libcaf_io 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; { meta = with lib; {
description = "An open source implementation of the actor model in C++"; description = "An open source implementation of the actor model in C++";
homepage = "http://actor-framework.org/"; homepage = "http://actor-framework.org/";

View File

@ -184,12 +184,6 @@ stdenv.mkDerivation {
''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
] ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"'' ] ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
++ lib.optional stdenv.isLinux "-DUSE_X11" ++ 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 [ ++ lib.optionals withGtk3 [
''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"'' ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"'' ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''

View File

@ -21,9 +21,6 @@ stdenv.mkDerivation rec {
pkg-config 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 = [ cmakeFlags = [
"-DBUILD_EXAMPLES=OFF" "-DBUILD_EXAMPLES=OFF"
]; ];

View File

@ -24,9 +24,6 @@ buildPythonPackage rec {
nativeBuildInputs = [ cmake ninja scikit-build ]; nativeBuildInputs = [ cmake ninja scikit-build ];
dontUseCmakeConfigure = true; 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" ]; pythonImportsCheck = [ "tweedledum" ];
checkInputs = [ pytestCheckHook ]; checkInputs = [ pytestCheckHook ];

View File

@ -47,9 +47,6 @@ stdenv.mkDerivation rec {
./no-double-relative.patch ./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; { meta = with lib; {
description = "Tool that generates a compilation database for clang tooling"; description = "Tool that generates a compilation database for clang tooling";
longDescription = '' longDescription = ''

View File

@ -35,9 +35,6 @@ stdenv.mkDerivation {
nativeBuildInputs = [ cmake ]; 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 = [ buildInputs = [
sfml libGLU libGL bullet glm libmad xlibsWrapper openal SDL2 boost ffmpeg sfml libGLU libGL bullet glm libmad xlibsWrapper openal SDL2 boost ffmpeg
] ++ lib.optionals stdenv.isDarwin [ OpenAL Cocoa ]; ] ++ lib.optionals stdenv.isDarwin [ OpenAL Cocoa ];

View File

@ -22,9 +22,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ]; 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 = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cp ./ImageLOL $out/bin cp ./ImageLOL $out/bin

View File

@ -26,9 +26,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake makeWrapper ]; 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 '' preFixup = lib.optionalString stdenv.isLinux ''
wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib" wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib"
''; '';

View File

@ -78,9 +78,6 @@ common =
propagatedBuildInputs = [ boehmgc ]; 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) [ NIX_LDFLAGS = lib.optionals (!is24) [
# https://github.com/NixOS/nix/commit/3e85c57a6cbf46d5f0fe8a89b368a43abd26daba # https://github.com/NixOS/nix/commit/3e85c57a6cbf46d5f0fe8a89b368a43abd26daba
(lib.optionalString enableStatic "-lssl -lbrotlicommon -lssh2 -lz -lnghttp2 -lcrypto") (lib.optionalString enableStatic "-lssl -lbrotlicommon -lssh2 -lz -lnghttp2 -lcrypto")