about summary refs log tree commit diff
path: root/pkgs/development/compilers/mezzo
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2015-07-23 21:45:14 +0200
committerVincent Laporte <Vincent.Laporte@gmail.com>2015-07-23 21:45:14 +0200
commit8897299e8f375555d9c9819612fede3d5c86ccc9 (patch)
treedcd17559d331053b0f208ba6809df08820762d37 /pkgs/development/compilers/mezzo
parent80d6b708ac4d6573c361eedf64ebbe87ec3ce53e (diff)
mezzo: fix build with OCaml-4.02
Diffstat (limited to 'pkgs/development/compilers/mezzo')
-rw-r--r--pkgs/development/compilers/mezzo/default.nix22
1 files changed, 18 insertions, 4 deletions
diff --git a/pkgs/development/compilers/mezzo/default.nix b/pkgs/development/compilers/mezzo/default.nix
index 183640f5985d6..a0fe441b15385 100644
--- a/pkgs/development/compilers/mezzo/default.nix
+++ b/pkgs/development/compilers/mezzo/default.nix
@@ -1,16 +1,30 @@
-{stdenv, fetchurl, ocaml, findlib, menhir, yojson, ulex, pprint, fix, functory}:
+{ stdenv, fetchFromGitHub, ocaml, findlib, menhir, yojson, ulex, pprint, fix, functory }:
+
+let
+  check-ocaml-version = with stdenv.lib; versionAtLeast (getVersion ocaml);
+in
+
+assert check-ocaml-version "4";
 
 stdenv.mkDerivation {
 
   name = "mezzo-0.0.m8";
 
-  src = fetchurl {
-    url = https://github.com/protz/mezzo/archive/m8.tar.gz;
-    sha256 = "17mfapgqp8ssa5x9blv72zg9l561zbiwv3ikwi6nl9dd36lwkkc6";
+  src = fetchFromGitHub {
+    owner = "protz";
+    repo = "mezzo";
+    rev = "m8";
+    sha256 = "0yck5r6di0935s3iy2mm9538jkf77ssr789qb06ms7sivd7g3ip6";
   };
 
   buildInputs = [ ocaml findlib yojson menhir ulex pprint fix functory ];
 
+  # Sets warning 3 as non-fatal
+  prePatch = stdenv.lib.optionalString (check-ocaml-version "4.02") ''
+    substituteInPlace myocamlbuild.pre.ml \
+    --replace '@1..3' '@1..2+3'
+  '';
+
   createFindlibDestdir = true;
 
   postInstall = ''