nixpkgs/pkgs/development/tools/build-managers/sbt/scala-native.nix
Artturin aae9f2ca22 sbt-with-scala-native: use overrideAttrs to fix nativeBuildInputs splicing
preserve old nativeBuildInputs which includes autoPatchelfHook which was
not there when this override was added

drop the `sha256` and `version` overrides which have never worked
properly because they haven't been overriding src.

`sha256` and `version` were added in 49c7bed763
2023-08-15 01:40:12 +03:00

15 lines
742 B
Nix

{ lib, sbt, makeWrapper, boehmgc, libunwind, re2, llvmPackages, zlib }:
sbt.overrideAttrs(previousAttrs: {
nativeBuildInputs = (previousAttrs.nativeBuildInputs or [ ]) ++ [ makeWrapper ];
postFixup = (previousAttrs.postFixup or "") + ''
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++"
'';
})