feat: symlink all deps using symlinkJoin
This commit is contained in:
parent
68fbcfb32e
commit
7e18cfab68
3 changed files with 17 additions and 49 deletions
33
default.nix
33
default.nix
|
|
@ -1,34 +1,21 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
wasm-llvm = import ./wasm-llvm.nix { inherit pkgs; };
|
||||
wasm-libcxx = import ./wasm-libcxx.nix { inherit pkgs; };
|
||||
wasi-libc = import ./wasi-libc.nix { inherit pkgs; };
|
||||
wasm-compiler-rt = import ./wasm-compiler-rt.nix { inherit pkgs; };
|
||||
|
||||
paths = {
|
||||
WASM_LLVM = wasm-llvm;
|
||||
WASM_LIBCXX_LIB = "${wasm-libcxx}/lib";
|
||||
WASM_LIBCXX_INC = "${wasm-libcxx}/include/c++/v1";
|
||||
WASM_COMPILER_RT_LIB = "${wasm-compiler-rt}/lib/wasi";
|
||||
WASI_LIBC_LIB = "${wasi-libc}/lib";
|
||||
WASI_LIBC_INC = "${wasi-libc.dev}/include";
|
||||
};
|
||||
|
||||
pathsFileContents = lib.strings.concatLines (
|
||||
lib.attrsets.mapAttrsToList (name: value: name + "=" + value) paths
|
||||
);
|
||||
in
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pkgs.symlinkJoin {
|
||||
name = "wasm-sdk";
|
||||
version = "1.0.0";
|
||||
|
||||
paths = [
|
||||
wasm-llvm
|
||||
wasm-libcxx
|
||||
wasi-libc
|
||||
wasi-libc.dev
|
||||
wasm-compiler-rt
|
||||
];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
echo "${pathsFileContents}" > $out
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit paths;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue