Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / interpreters / proglodyte-wasm / default.nix
blob2d4acbd398ea17443a118a6d5699049779a1f6b1
1 { lib, stdenv, fetchFromGitHub, cmake, clang, python, v8, coreutils }:
3 let
4   sexpr_wasm_prototype = stdenv.mkDerivation {
5     name = "sexpr_wasm_prototype";
6     src = fetchFromGitHub {
7       owner = "WebAssembly";
8       repo = "sexpr-wasm-prototype";
9       rev = "1347a367c34876bfe92562f244a8c8b770372479";
10       sha256 = "1v1mph5fp1rffhvh8bbx937gpjqjrdgm7yhffdxzdn4pih9d0grn";
11     };
13     configurePhase = ''
14       # set this to nonempty string to disable default cmake configure
15     '';
17     nativeBuildInputs = [ cmake ];
18     buildInputs = [ clang python ];
20     buildPhase = "make clang-debug-no-tests";
22     hardeningDisable = [ "format" ];
24     installPhase = ''
25       mkdir -p $out/bin
26       cp out/clang/Debug/no-tests/sexpr-wasm $out/bin
27     '';
28   };
32 stdenv.mkDerivation {
33   name = "wasm-0.0.1";
35   src = fetchFromGitHub {
36     owner = "proglodyte";
37     repo = "wasm";
38     rev = "650188eecaaf4b64f12b341986b4e89e5fdb3bbe";
39     sha256 = "1f5mdl0l2448lx7h36b4bdr541a4q1wapn1kdwrd4z7s94n7a5gq";
40   };
42   configurePhase = ''
43     sed -i -e "s|sudo ||g" Makefile
44   '';
46   installPhase = ''
47     export DESTDIR=$out
48     export MKTEMPDIR=${coreutils}/bin
49     export D8DIR=${v8}/bin
50     export SWDIR=${sexpr_wasm_prototype}/bin
51     make install
52   '';
54   meta = with lib; {
55     description = "wasm runs WebAssembly from the command line";
56     maintainers = with maintainers; [ proglodyte ];
57     platforms = platforms.linux;
58     license = licenses.asl20;
59     broken = true;
60   };