From b1928704d440f6c2ec36444d709c340dd1dec469 Mon Sep 17 00:00:00 2001 From: Volth Date: Fri, 16 Jun 2017 15:47:38 +0000 Subject: [PATCH] sbt: support build scala-native targets --- .../tools/build-managers/sbt/scala-native.nix | 14 ++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 15 insertions(+) create mode 100644 pkgs/development/tools/build-managers/sbt/scala-native.nix diff --git a/pkgs/development/tools/build-managers/sbt/scala-native.nix b/pkgs/development/tools/build-managers/sbt/scala-native.nix new file mode 100644 index 000000000000..6c8b44605a35 --- /dev/null +++ b/pkgs/development/tools/build-managers/sbt/scala-native.nix @@ -0,0 +1,14 @@ +{ lib, sbt, makeWrapper, boehmgc, libunwind, re2, llvmPackages, zlib }: + +sbt.overrideDerivation(old: { + nativeBuildInputs = [ makeWrapper ]; + + postFixup = '' + wrapProgram $out/bin/sbt \ + --set CLANG_PATH "${llvmPackages.clang}/bin/clang" \ + --set CLANGPP_PATH "${llvmPackages.clang}/bin/clang" \ + --set CPATH "${lib.makeSearchPathOutput "dev" "include" [ re2 zlib boehmgc libunwind llvmPackages.libcxxabi llvmPackages.libcxx ]}/c++/v1" \ + --set LIBRARY_PATH "${lib.makeLibraryPath [ re2 zlib boehmgc libunwind llvmPackages.libcxxabi llvmPackages.libcxx ]}" \ + --set NIX_CFLAGS_LINK "-lc++abi -lc++" + ''; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d929c23dd8cd..104c1b90c40e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7062,6 +7062,7 @@ with pkgs; scons = callPackage ../development/tools/build-managers/scons { }; sbt = callPackage ../development/tools/build-managers/sbt { }; + sbt-with-scala-native = callPackage ../development/tools/build-managers/sbt/scala-native.nix { }; simpleBuildTool = sbt; shards = callPackage ../development/tools/build-managers/shards { };