about summary refs log tree commit diff
path: root/pkgs/development/compilers/binaryen
diff options
context:
space:
mode:
authorAlastair Pharo <asppsa@gmail.com>2018-03-21 01:45:19 +1100
committerJoachim Schiele <js@lastlog.de>2018-03-20 15:45:19 +0100
commit497e50cf161f2873490e19ae392553f6d2bdcac3 (patch)
treefb7d64f9f6544f37b5d66ccf6b30442d31a6c37b /pkgs/development/compilers/binaryen
parent06828573e7009ed3c2cfebe67e72871acf691a18 (diff)
downloadnixlib-497e50cf161f2873490e19ae392553f6d2bdcac3.tar
nixlib-497e50cf161f2873490e19ae392553f6d2bdcac3.tar.gz
nixlib-497e50cf161f2873490e19ae392553f6d2bdcac3.tar.bz2
nixlib-497e50cf161f2873490e19ae392553f6d2bdcac3.tar.lz
nixlib-497e50cf161f2873490e19ae392553f6d2bdcac3.tar.xz
nixlib-497e50cf161f2873490e19ae392553f6d2bdcac3.tar.zst
nixlib-497e50cf161f2873490e19ae392553f6d2bdcac3.zip
emscripten: use matching binaryen version (#37427)
This changes the emscripten package so that it specifies the rev from
the binaryen repo to use, and sets it to always use the version that has
been tagged for use with that version of emscripten.  This should force
future updates of emscripten to also update binaryen.

Binaryen can also be installed as a stand-alone package, so there's some
logic added to the binaryen package to allow building in both ways, and
distinguishing between them.
Diffstat (limited to 'pkgs/development/compilers/binaryen')
-rw-r--r--pkgs/development/compilers/binaryen/default.nix25
1 files changed, 21 insertions, 4 deletions
diff --git a/pkgs/development/compilers/binaryen/default.nix b/pkgs/development/compilers/binaryen/default.nix
index 2b3919160e47..2c2869f76e72 100644
--- a/pkgs/development/compilers/binaryen/default.nix
+++ b/pkgs/development/compilers/binaryen/default.nix
@@ -1,14 +1,31 @@
-{ stdenv, cmake, fetchFromGitHub }:
+{ stdenv, cmake, fetchFromGitHub, emscriptenRev ? null }:
+
+let
+  defaultVersion = "44";
+
+  # Map from git revs to SHA256 hashes
+  sha256s = {
+    "version_44" = "0zsqppc05fm62807w6vyccxkk2y2gar7kxbxxixq8zz3xsp6w84p";
+    "1.37.36" = "1wgzfzjjzkiaz0rf2lnwrcvlcsjvjhyvbyh58jxhqq43vi34zyjc";
+  };
+in
 
 stdenv.mkDerivation rec {
-  version = "44";
-  rev = "version_${version}";
+  version = if emscriptenRev == null
+            then defaultVersion
+            else "emscripten-${emscriptenRev}";
+  rev = if emscriptenRev == null
+        then "version_${version}"
+        else emscriptenRev;
   name = "binaryen-${version}";
 
   src = fetchFromGitHub {
     owner = "WebAssembly";
     repo = "binaryen";
-    sha256 = "0zsqppc05fm62807w6vyccxkk2y2gar7kxbxxixq8zz3xsp6w84p";
+    sha256 =
+      if builtins.hasAttr rev sha256s
+      then builtins.getAttr rev sha256s
+      else null;
     inherit rev;
   };