2020-07-25 08:26:54 +02:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, python3, ncurses }:
|
2019-01-26 00:04:50 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2019-09-21 22:28:13 +02:00
|
|
|
name = "libtapi-1000.10.8";
|
2019-01-26 00:04:50 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tpoechtrager";
|
|
|
|
repo = "apple-libtapi";
|
2020-07-21 17:30:19 +02:00
|
|
|
rev = "3cb307764cc5f1856c8a23bbdf3eb49dfc6bea48";
|
|
|
|
sha256 = "1zb10p6xkls8x7wsdwgy9c0v16z97rfkgidii9ffq5rfczgvrhjh";
|
2019-01-26 00:04:50 +01:00
|
|
|
};
|
|
|
|
|
2020-07-26 10:27:15 +02:00
|
|
|
sourceRoot = "source/src/llvm";
|
|
|
|
|
2020-01-13 10:45:16 +01:00
|
|
|
nativeBuildInputs = [ cmake python3 ];
|
2019-01-26 00:04:50 +01:00
|
|
|
|
2020-07-25 08:26:54 +02:00
|
|
|
# ncurses is required here to avoid a reference to bootstrap-tools, which is
|
|
|
|
# not allowed for the stdenv.
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
|
2020-07-26 10:27:15 +02:00
|
|
|
cmakeFlags = [ "-DLLVM_INCLUDE_TESTS=OFF" ];
|
|
|
|
|
|
|
|
# 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
|
2019-01-26 00:04:50 +01:00
|
|
|
preConfigure = ''
|
2020-07-26 10:27:15 +02:00
|
|
|
INCLUDE_FIX="-I $PWD/projects/clang/include"
|
|
|
|
INCLUDE_FIX+=" -I $PWD/build/projects/clang/include"
|
|
|
|
|
|
|
|
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="$INCLUDE_FIX")
|
2019-01-26 00:04:50 +01:00
|
|
|
'';
|
|
|
|
|
2020-07-26 10:27:15 +02:00
|
|
|
buildFlags = [ "clangBasic" "libtapi" ];
|
2019-01-26 00:04:50 +01:00
|
|
|
|
2020-07-26 10:27:15 +02:00
|
|
|
installTargets = [ "install-libtapi" "install-tapi-headers" ];
|
2019-01-26 00:04:50 +01:00
|
|
|
|
2020-07-26 10:27:15 +02:00
|
|
|
postInstall = ''
|
|
|
|
install_name_tool -id $out/lib/libtapi.dylib $out/lib/libtapi.dylib
|
|
|
|
'';
|
2019-01-26 00:04:50 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
license = licenses.apsl20;
|
|
|
|
maintainers = with maintainers; [ matthewbauer ];
|
|
|
|
};
|
|
|
|
}
|