about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/sync/unison/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/sync/unison/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/sync/unison/default.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/applications/networking/sync/unison/default.nix b/nixpkgs/pkgs/applications/networking/sync/unison/default.nix
index 23bbd19b00e8..9ab8d4415082 100644
--- a/nixpkgs/pkgs/applications/networking/sync/unison/default.nix
+++ b/nixpkgs/pkgs/applications/networking/sync/unison/default.nix
@@ -1,4 +1,4 @@
-{lib, stdenv, fetchFromGitHub, ocamlPackages, fontschumachermisc, xset, makeWrapper, ncurses, gnugrep
+{lib, stdenv, fetchFromGitHub, ocamlPackages, fontschumachermisc, xset, makeWrapper, ncurses, gnugrep, fetchpatch
 , enableX11 ? true}:
 
 let inherit (ocamlPackages) ocaml lablgtk; in
@@ -17,6 +17,16 @@ stdenv.mkDerivation (rec {
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ ocaml ncurses ];
 
+  patches = [
+    # Patch to fix build with ocaml 4.12. Remove in 2.51.4
+    # https://github.com/bcpierce00/unison/pull/481
+    (fetchpatch {
+      name = "fix-compile-with-ocaml-4.12.patch";
+      url = "https://github.com/bcpierce00/unison/commit/14b885316e0a4b41cb80fe3daef7950f88be5c8f.patch?full_index=1";
+      sha256 = "0j1rma1cwdsfql19zvzhfj2ys5c4lbhjcp6jrnck04xnckxxiy3d";
+    })
+  ];
+
   preBuild = (if enableX11 then ''
     sed -i "s|\(OCAMLOPT=.*\)$|\1 -I $(echo "${lablgtk}"/lib/ocaml/*/site-lib/lablgtk2)|" src/Makefile.OCaml
   '' else "") + ''