nixpkgs/pkgs/development/compilers/binaryen/default.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, cmake, python3, fetchFromGitHub, emscriptenRev ? null, substituteAll }:
let
2020-06-14 10:34:50 +01:00
defaultVersion = "94";
# Map from git revs to SHA256 hashes
sha256s = {
2020-06-14 10:34:50 +01:00
version_94 = "1wk20fhyppb2ljni7ifqnsx9kl1kcl6c0svc0qljf0bs6rvr9qdm";
"1.39.1" = "0ygm9m5322h4vfpf3j63q32qxk2l26yk62hh7dkb49j51zwl1y3y";
};
in
2017-06-04 04:49:46 +01:00
stdenv.mkDerivation rec {
version = if emscriptenRev == null
then defaultVersion
else "emscripten-${emscriptenRev}";
rev = if emscriptenRev == null
then "version_${version}"
else emscriptenRev;
pname = "binaryen";
2017-06-04 04:49:46 +01:00
src = fetchFromGitHub {
owner = "WebAssembly";
repo = "binaryen";
sha256 =
if builtins.hasAttr rev sha256s
then builtins.getAttr rev sha256s
else null;
2017-06-04 04:49:46 +01:00
inherit rev;
};
patches = stdenv.lib.optional (emscriptenRev != null) (substituteAll {
src = ./0001-Get-rid-of-git-dependency.patch;
emscriptenv = "1.39.1";
});
nativeBuildInputs = [ cmake python3 ];
2017-06-04 04:49:46 +01:00
meta = with stdenv.lib; {
homepage = "https://github.com/WebAssembly/binaryen";
2017-06-04 04:49:46 +01:00
description = "Compiler infrastructure and toolchain library for WebAssembly, in C++";
platforms = platforms.all;
maintainers = with maintainers; [ asppsa ];
license = licenses.asl20;
};
}