mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 00:08:32 +01:00
libtapi: fix build, install phase and install name
installTarget looks like a typo for installTargets. This causes a lot of llvm and clang to be built and installed. Clang is not intended to be an external dependency. The source bundle includes llvm and clang. Adding include paths and building clangBasic first is sufficient to use the internal clang components.
This commit is contained in:
parent
1e6079d819
commit
b418d4c6a4
1 changed files with 19 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
|||
{ lib, stdenv, fetchFromGitHub, cmake, python3, clang_6 }:
|
||||
{ lib, stdenv, fetchFromGitHub, cmake, python3 }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "libtapi-1000.10.8";
|
||||
|
@ -9,22 +9,32 @@ stdenv.mkDerivation {
|
|||
sha256 = "1a19h39a48agvnmal99n9j1fjadiqwib7hfzmn342wmgh9z3vk0g";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake python3 ];
|
||||
buildInputs = [ clang_6.cc ];
|
||||
sourceRoot = "source/src/llvm";
|
||||
|
||||
preConfigure = ''
|
||||
cd src/llvm
|
||||
'';
|
||||
nativeBuildInputs = [ cmake python3 ];
|
||||
|
||||
cmakeFlags = [ "-DLLVM_INCLUDE_TESTS=OFF" ];
|
||||
|
||||
buildFlags = [ "libtapi" ];
|
||||
# fixes: fatal error: 'clang/Basic/Diagnostic.h' file not found
|
||||
# adapted from upstream
|
||||
# https://github.com/tpoechtrager/apple-libtapi/blob/3cb307764cc5f1856c8a23bbdf3eb49dfc6bea48/build.sh#L58-L60
|
||||
preConfigure = ''
|
||||
INCLUDE_FIX="-I $PWD/projects/clang/include"
|
||||
INCLUDE_FIX+=" -I $PWD/build/projects/clang/include"
|
||||
|
||||
installTarget = "install-libtapi";
|
||||
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="$INCLUDE_FIX")
|
||||
'';
|
||||
|
||||
buildFlags = [ "clangBasic" "libtapi" ];
|
||||
|
||||
installTargets = [ "install-libtapi" "install-tapi-headers" ];
|
||||
|
||||
postInstall = ''
|
||||
install_name_tool -id $out/lib/libtapi.dylib $out/lib/libtapi.dylib
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
license = licenses.apsl20;
|
||||
maintainers = with maintainers; [ matthewbauer ];
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue