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

42 lines
1.1 KiB
Nix
Raw Normal View History

2019-02-25 12:13:55 +00:00
{ stdenv, cmake, python, fetchFromGitHub, emscriptenRev ? null }:
let
defaultVersion = "89";
# Map from git revs to SHA256 hashes
sha256s = {
2019-08-13 21:52:01 +00:00
version_89 = "0rh1dq33ilq54szfgi1ajaiaj7rbylai02rhp9zm9vpwp0rw8mij";
2019-02-25 12:13:55 +00:00
"1.38.28" = "172s7y5f38736ic8ri3mnbdqcrkadd40a26cxcfwbscc53phl11v";
};
in
2017-06-04 03:49:46 +00: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 03:49:46 +00:00
src = fetchFromGitHub {
owner = "WebAssembly";
repo = "binaryen";
sha256 =
if builtins.hasAttr rev sha256s
then builtins.getAttr rev sha256s
else null;
2017-06-04 03:49:46 +00:00
inherit rev;
};
2019-02-25 12:13:55 +00:00
nativeBuildInputs = [ cmake python ];
2017-06-04 03:49:46 +00:00
meta = with stdenv.lib; {
homepage = https://github.com/WebAssembly/binaryen;
description = "Compiler infrastructure and toolchain library for WebAssembly, in C++";
platforms = platforms.all;
maintainers = with maintainers; [ asppsa ];
license = licenses.asl20;
};
}