diff options
author | Matthew Bauer <mbauer@machost.office> | 2019-01-25 18:04:50 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2019-04-26 21:54:46 -0400 |
commit | f76c7b8fab2f4e5e3866d4dced0f18ceeae562b4 (patch) | |
tree | 256ca7ee74972a7378b5bd51ac93e89414fb1877 /pkgs/os-specific/darwin | |
parent | 0fe315c9b6080cd75f92fea1f97714b04abb4315 (diff) |
libtapi: init
(cherry picked from commit 69347697d3336d4b6add8276d9f75daf6f0cacf3)
Diffstat (limited to 'pkgs/os-specific/darwin')
-rw-r--r-- | pkgs/os-specific/darwin/cctools/port.nix | 10 | ||||
-rw-r--r-- | pkgs/os-specific/darwin/libtapi/default.nix | 29 |
2 files changed, 37 insertions, 2 deletions
diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index caf85b227bed1..b379933f3c807 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -2,6 +2,7 @@ , libcxxabi, libuuid, llvm , libobjc ? null, maloader ? null , enableDumpNormalizedLibArgs ? false +, enableTapiSupport ? stdenv.hostPlatform != stdenv.targetPlatform, libtapi }: let @@ -52,7 +53,8 @@ let nativeBuildInputs = [ autoconf automake libtool_2 autoreconfHook ]; buildInputs = [ libuuid ] - ++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi libobjc ]; + ++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi libobjc ] + ++ stdenv.lib.optional enableTapiSupport libtapi; patches = [ ./ld-rpath-nonfinal.patch ./ld-ignore-rpath-link.patch @@ -74,7 +76,11 @@ let # TODO(@Ericson2314): Always pass "--target" and always targetPrefix. configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target"; - configureFlags = [ "--disable-clang-as" ]; + configureFlags = [ "--disable-clang-as" ] + ++ stdenv.lib.optionals enableTapiSupport [ + "--enable-tapi-support" + "--with-libtapi=${libtapi}" + ]; postPatch = '' sed -i -e 's/addStandardLibraryDirectories = true/addStandardLibraryDirectories = false/' cctools/ld64/src/ld/Options.cpp diff --git a/pkgs/os-specific/darwin/libtapi/default.nix b/pkgs/os-specific/darwin/libtapi/default.nix new file mode 100644 index 0000000000000..e68e77f55afe0 --- /dev/null +++ b/pkgs/os-specific/darwin/libtapi/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchFromGitHub, cmake, python }: + +stdenv.mkDerivation { + name = "libtapi"; + src = fetchFromGitHub { + owner = "tpoechtrager"; + repo = "apple-libtapi"; + rev = "e56673694db395e25b31808b4fbb9a7005e6875f"; + sha256 = "1lnl1af9sszp9wxfk0wljrpdmwcx83j0w5c0y4qw4pqrdkdgwks7"; + }; + + nativeBuildInputs = [ cmake python ]; + + preConfigure = '' + cd src/apple-llvm/src + ''; + + cmakeFlags = [ "-DLLVM_INCLUDE_TESTS=OFF" ]; + + buildFlags = "libtapi"; + + installTarget = "install-libtapi"; + + meta = with lib; { + license = licenses.apsl20; + maintainers = with maintainers; [ matthewbauer ]; + }; + +} |