summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ashton <data@gtf.org>2021-06-17 23:36:09 -0700
committerVincent Laporte <vbgl@users.noreply.github.com>2021-06-29 08:23:38 +0200
commit5079a07985c85553fcc07778fd8ed6041610db7f (patch)
tree76e03c30e3752e1d799fd9102a428900e0554ae3
parentMerge pull request #128441 from NixOS/backport-126532-to-release-21.05 (diff)
downloadnixpkgs-5079a07985c85553fcc07778fd8ed6041610db7f.tar.gz
unison: patch 2.51.3
Add patch which fixes builds with (at least) ocaml 4.12.0, and remove build constraint for 4.09. Necessary because unison built with 4.09 is not compatible with unison built with 4.12, e.g. on recent Homebrew. (cherry picked from commit 7282b4fc0389217c60fe788cb80d10f3e80e447d)
-rw-r--r--pkgs/applications/networking/sync/unison/default.nix12
-rw-r--r--pkgs/top-level/all-packages.nix1
2 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/applications/networking/sync/unison/default.nix b/pkgs/applications/networking/sync/unison/default.nix
index 23bbd19b00e8..9ab8d4415082 100644
--- a/pkgs/applications/networking/sync/unison/default.nix
+++ b/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 "") + ''
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 417c2e0faf88..bf2d987a2cfb 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -26878,7 +26878,6 @@ in
unipicker = callPackage ../applications/misc/unipicker { };
unison = callPackage ../applications/networking/sync/unison {
- ocamlPackages = ocaml-ng.ocamlPackages_4_09;
enableX11 = config.unison.enableX11 or true;
};