summary refs log tree commit diff
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2020-09-30 17:49:32 +0200
committerJulien Lepiller <julien@lepiller.eu>2020-10-15 17:59:18 +0200
commitaea459a50474b98f31f6ce7da9468a98958ef949 (patch)
tree087df3ede8288e68f23a7984142bf56416e339e2
parent057a8868fb9a38661adbf5e94b8a2b0803871dff (diff)
downloadguix-aea459a50474b98f31f6ce7da9468a98958ef949.tar.gz
gnu: unison: Build with ocaml-4.09.
* gnu/packages/ocaml.scm (unison)[sources]: Add an upstream patch.
[native-inputs]: Use ocaml-4.09.
* gnu/packages/patches/unison-fix-ocaml-4.08.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/ocaml.scm5
-rw-r--r--gnu/packages/patches/unison-fix-ocaml-4.08.patch81
3 files changed, 85 insertions, 2 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index e29ff89d9e..d41b65957e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1641,6 +1641,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ucx-tcp-iface-ioctl.patch		\
   %D%/packages/patches/udiskie-no-appindicator.patch		\
   %D%/packages/patches/ungoogled-chromium-system-nspr.patch	\
+  %D%/packages/patches/unison-fix-ocaml-4.08.patch		\
   %D%/packages/patches/unknown-horizons-python-3.8-distro.patch	\
   %D%/packages/patches/unzip-CVE-2014-8139.patch		\
   %D%/packages/patches/unzip-CVE-2014-8140.patch		\
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index d61948afc3..394db50150 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -861,12 +861,13 @@ libpanel, librsvg and quartz.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1bykiyc0dc5pkw8x370qkg2kygq9pq7yqzsgczd3y13b6ivm4sdq"))))
+                "1bykiyc0dc5pkw8x370qkg2kygq9pq7yqzsgczd3y13b6ivm4sdq"))
+              (patches (search-patches "unison-fix-ocaml-4.08.patch"))))
     (build-system gnu-build-system)
     (outputs '("out"
                "doc"))                  ; 1.9 MiB of documentation
     (native-inputs
-     `(("ocaml" ,ocaml-4.07)
+     `(("ocaml" ,ocaml-4.09)
        ;; For documentation
        ("ghostscript" ,ghostscript)
        ("texlive" ,texlive-tiny)
diff --git a/gnu/packages/patches/unison-fix-ocaml-4.08.patch b/gnu/packages/patches/unison-fix-ocaml-4.08.patch
new file mode 100644
index 0000000000..811f590721
--- /dev/null
+++ b/gnu/packages/patches/unison-fix-ocaml-4.08.patch
@@ -0,0 +1,81 @@
+This patch is taken from the opam repository:
+https://github.com/ocaml/opam-repository/blob/master/packages/unison/unison.2.51.2/files/ocaml48.patch
+
+It fixes compatibility with changes introduced in OCaml 4.08.
+
+diff --git a/src/Makefile.OCaml b/src/Makefile.OCaml
+index 7cefa2e..378fc8b 100644
+--- a/src/Makefile.OCaml
++++ b/src/Makefile.OCaml
+@@ -272,7 +272,7 @@ endif
+ 
+ # Gtk GUI
+ ifeq ($(UISTYLE), gtk)
+-  CAMLFLAGS+=-I +lablgtk
++  CAMLFLAGS+=-I $(LABLGTKLIB)
+   OCAMLOBJS+=pixmaps.cmo uigtk.cmo linkgtk.cmo
+   OCAMLLIBS+=lablgtk.cma
+ endif
+@@ -282,7 +282,7 @@ OCAMLFIND := $(shell command -v ocamlfind 2> /dev/null)
+ 
+ ifeq ($(UISTYLE), gtk2)
+   ifndef OCAMLFIND
+-    CAMLFLAGS+=-I +lablgtk2
++    CAMLFLAGS+=-I $(LABLGTK2LIB)
+   else
+     CAMLFLAGS+=$(shell $(OCAMLFIND) query -i-format lablgtk2 )
+   endif
+diff --git a/src/files.ml b/src/files.ml
+index 5ff1881..1d1fbcc 100644
+--- a/src/files.ml
++++ b/src/files.ml
+@@ -734,7 +734,7 @@ let get_files_in_directory dir =
+   with End_of_file ->
+     dirh.System.closedir ()
+   end;
+-  Sort.list (<) !files
++  List.sort String.compare !files
+ 
+ let ls dir pattern =
+   Util.convertUnixErrorsToTransient
+diff --git a/src/recon.ml b/src/recon.ml
+index 2c619bb..2412c18 100644
+--- a/src/recon.ml
++++ b/src/recon.ml
+@@ -661,8 +661,8 @@ let rec reconcile
+ 
+ (* Sorts the paths so that they will be displayed in order                   *)
+ let sortPaths pathUpdatesList =
+-  Sort.list
+-    (fun (p1, _) (p2, _) -> Path.compare p1 p2 <= 0)
++  List.sort
++    Path.compare
+     pathUpdatesList
+ 
+ let rec enterPath p1 p2 t =
+diff --git a/src/system/system_generic.ml b/src/system/system_generic.ml
+index 453027d..c2288b8 100755
+--- a/src/system/system_generic.ml
++++ b/src/system/system_generic.ml
+@@ -47,7 +47,7 @@ let open_out_gen = open_out_gen
+ let chmod = Unix.chmod
+ let chown = Unix.chown
+ let utimes = Unix.utimes
+-let link = Unix.link
++let link s d = Unix.link s d
+ let openfile = Unix.openfile
+ let opendir f =
+   let h = Unix.opendir f in
+diff --git a/src/uigtk2.ml b/src/uigtk2.ml
+index fbc5d8f..4e82cc2 100644
+--- a/src/uigtk2.ml
++++ b/src/uigtk2.ml
+@@ -94,7 +94,7 @@ let icon =
+ let icon =
+   let p = GdkPixbuf.create ~width:48 ~height:48 ~has_alpha:true () in
+   Gpointer.blit
+-    (Gpointer.region_of_string Pixmaps.icon_data) (GdkPixbuf.get_pixels p);
++    (Gpointer.region_of_bytes Pixmaps.icon_data) (GdkPixbuf.get_pixels p);
+   p
+ 
+ let leftPtrWatch =