2019-01-30 02:01:24 +00:00
|
|
|
{ stdenv, fetchFromGitHub, lib }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2021-05-10 15:04:11 +00:00
|
|
|
pname = "wasilibc";
|
|
|
|
version = "20190712";
|
2019-01-30 02:01:24 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CraneStation";
|
2019-07-17 15:19:08 +00:00
|
|
|
repo = "wasi-libc";
|
|
|
|
rev = "8df0d4cd6a559b58d4a34b738a5a766b567448cf";
|
|
|
|
sha256 = "1n4gvgzacpagar2mx8g9950q0brnhwz7jg2q44sa5mnjmlnkiqhh";
|
2019-01-30 02:01:24 +00:00
|
|
|
};
|
|
|
|
makeFlags = [
|
|
|
|
"WASM_CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"WASM_NM=${stdenv.cc.targetPrefix}nm"
|
|
|
|
"WASM_AR=${stdenv.cc.targetPrefix}ar"
|
|
|
|
"INSTALL_DIR=${placeholder "out"}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/lib/*/* $out/lib
|
2019-04-17 23:49:12 +00:00
|
|
|
ln -s $out/share/wasm32-wasi/undefined-symbols.txt $out/lib/wasi.imports
|
2019-01-30 02:01:24 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2019-01-30 02:01:24 +00:00
|
|
|
description = "WASI libc implementation for WebAssembly";
|
|
|
|
homepage = "https://wasi.dev";
|
2020-06-27 09:54:24 +00:00
|
|
|
platforms = platforms.wasi;
|
|
|
|
maintainers = [ maintainers.matthewbauer ];
|
|
|
|
license = with licenses; [ asl20 mit llvm-exception ];
|
2019-01-30 02:01:24 +00:00
|
|
|
};
|
|
|
|
}
|