Unison qpackage

Ask community developers’ help for your most wanted Apps and also discover what the hottest and ultimate Apps are.
linuxnutzer
Starting out
Posts: 17
Joined: Wed Jun 24, 2009 5:23 pm

Re: Unison qpackage

Post by linuxnutzer »

halol wrote: Sun Oct 13, 2019 8:06 pm - vi tools/check-parser-uptodate-or-warn.sh and replace (line 35)

Code: Select all

else MTIME="stat -f %m"
with

Code: Select all

else MTIME="stat -c %Y"
Instead of this you can install coreutils-stat.

I had to recompile unison 2.48.4 with ocaml 4.08.1 due to changes of unison of Ubuntu 20.04. In addition to install coreutils-stat to compile ocaml 4.08.1 you need to patch unison sources 2.48.4 to be compatible with the new ocaml version. The patch comes from debian/ubuntu:
https://salsa.debian.org/ocaml-team/uni ... e3b9906817

0001-Fix-compilation-with-OCaml-4.08.1.patch:

Code: Select all

From: Stephane Glondu <steph@glondu.net>
Date: Mon, 25 Nov 2019 10:52:48 +0100
Subject: Fix compilation with OCaml 4.08.1

---
 Makefile.OCaml           | 2 +-
 files.ml                 | 2 +-
 recon.ml                 | 4 ++--
 system/system_generic.ml | 2 +-
 uigtk2.ml                | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile.OCaml b/Makefile.OCaml
index 21610ce..7549907 100644
--- a/Makefile.OCaml
+++ b/Makefile.OCaml
@@ -95,7 +95,7 @@ buildexecutable::
 ### Default parameters
 
 # Generate backtrace information for exceptions
-CAMLFLAGS+=-g
+CAMLFLAGS+=-g -unsafe-string
 
 INCLFLAGS=-I lwt -I ubase -I system
 CAMLFLAGS+=$(INCLFLAGS)
diff --git a/files.ml b/files.ml
index ba42ad5..02d52f3 100644
--- a/files.ml
+++ b/files.ml
@@ -722,7 +722,7 @@ let get_files_in_directory dir =
   with End_of_file ->
     dirh.System.closedir ()
   end;
-  Sort.list (<) !files
+  List.sort compare !files
 
 let ls dir pattern =
   Util.convertUnixErrorsToTransient
diff --git a/recon.ml b/recon.ml
index 5ed358d..a8719c4 100644
--- a/recon.ml
+++ b/recon.ml
@@ -651,8 +651,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
+    (fun (p1, _) (p2, _) -> Path.compare p1 p2)
     pathUpdatesList
 
 let rec enterPath p1 p2 t =
diff --git a/system/system_generic.ml b/system/system_generic.ml
index 9230cdc..ee457c5 100755
--- a/system/system_generic.ml
+++ b/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 s1 s2 = Unix.link s1 s2
 let openfile = Unix.openfile
 let opendir f =
   let h = Unix.opendir f in
diff --git a/uigtk2.ml b/uigtk2.ml
index 206d8ad..b2a17e2 100644
--- a/uigtk2.ml
+++ b/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 =
Copy this patch in the unison source folder, install the patch utility and execute:

patch -p1 < 0001-Fix-compilation-with-OCaml-4.08.1.patch

Hope this helps if someone runs into trouble after installing/update Ubuntu 20.04.

Linuxnutzer
halol
Getting the hang of things
Posts: 96
Joined: Thu Aug 09, 2012 9:43 pm

Re: Unison qpackage

Post by halol »

Thanks for the tip. But be careful: coreutils-stat is required to compile ocaml, but installing it won't fix the problem I mentioned with ocaml 4.09. The ocaml source code for this specific version is simply using a syntax not compatible with the BusyBox version of stat (which is what we have on QNAP). So to compile ocaml 4.09 on QNAP you still need the little change I suggested.
This has apparently been fixed in ocaml 4.10, although I haven't tried to compile it yet.
TVS-663
linuxnutzer
Starting out
Posts: 17
Joined: Wed Jun 24, 2009 5:23 pm

Re: Unison qpackage

Post by linuxnutzer »

halol wrote: Tue Aug 18, 2020 2:32 pm Thanks for the tip. But be careful: coreutils-stat is required to compile ocaml, but installing it won't fix the problem I mentioned with ocaml 4.09. The ocaml source code for this specific version is simply using a syntax not compatible with the BusyBox version of stat (which is what we have on QNAP). So to compile ocaml 4.09 on QNAP you still need the little change I suggested.
This has apparently been fixed in ocaml 4.10, although I haven't tried to compile it yet.
I did not compile ocaml 4.09, but for compiling 4.08.1 it is sufficient to install coreutils-stat (gnu coreutils) from entware etc. to /opt/bin.
The suspect code in tools/check-parser-uptodate-or-warn.sh is:

Code: Select all

stat . 2>/dev/null 1>/dev/null
if test $? != 0
then MTIME=""
elif test -n "$(stat --version 2>/dev/null | grep coreutils)"
then MTIME="stat --format %Y"
else MTIME="stat -f %m"
fi
So if the output of "stat --version" contains the word coreutils "MTIME="stat --format %Y"" is used which is correct for gnu stat.
Excuse me for picking raisins, your fix for busybox-stat of course also works. But it has been my experience that it is better to not use the qnap busybox utils due to several incompatibilities.

Linuxnutzer
ulikio
Starting out
Posts: 14
Joined: Mon Dec 07, 2009 3:05 am

Re: Unison qpackage

Post by ulikio »

dear all

I've been trying to install unison from the latest ocaml + unison sources (2023.03.16) and am constantly failing in the first step of the build (of ocaml). can someone help? here's what I'm doing - I'm basically following the posts above (thanks a lot for your step-by-step instructions, they always worked in the past!).

# install entware-std with sherpa
# opkg install make gcc diffutils coreutils-stat gawk
# opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
# cd /share/Public (or to any path with no space in the pathname)
# wget --secure-protocol=TLSv1_2 https://github.com/ocaml/ocaml/archive/4.14.tar.gz
# tar xvfz ocaml-4.14.tar.gz
# cd ocaml-4.14
# vi tools/check-parser-uptodate-or-warn.sh and replace (used to be line 35, now different)
else MTIME="stat -f %m"
with
else MTIME="stat -c %Y"
# ./configure -prefix /opt
---- everything works OK until here ----
# make world.opt
---- here's where the error occurs and the output is the following ----
gcc -c -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -fPIC -D_FILE_OFFSET_BITS=64 -DCAML_NAME_SPACE -I../../runtime \
-o fork.o fork.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -fPIC -D_FILE_OFFSET_BITS=64 -DCAML_NAME_SPACE -I../../runtime \
-o ftruncate.o ftruncate.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -fPIC -D_FILE_OFFSET_BITS=64 -DCAML_NAME_SPACE -I../../runtime \
-o getaddrinfo.o getaddrinfo.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -fPIC -D_FILE_OFFSET_BITS=64 -DCAML_NAME_SPACE -I../../runtime \
-o getcwd.o getcwd.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -fPIC -D_FILE_OFFSET_BITS=64 -DCAML_NAME_SPACE -I../../runtime \
-o getegid.o getegid.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -fPIC -D_FILE_OFFSET_BITS=64 -DCAML_NAME_SPACE -I../../runtime \
-o geteuid.o geteuid.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -fPIC -D_FILE_OFFSET_BITS=64 -DCAML_NAME_SPACE -I../../runtime \
-o getgid.o getgid.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -fPIC -D_FILE_OFFSET_BITS=64 -DCAML_NAME_SPACE -I../../runtime \
-o getgr.o getgr.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -fPIC -D_FILE_OFFSET_BITS=64 -DCAML_NAME_SPACE -I../../runtime \
-o getgroups.o getgroups.c
getgroups.c: In function 'unix_getgroups':
getgroups.c:31:16: error: 'NGROUPS_MAX' undeclared (first use in this function)
gid_t gidset[NGROUPS_MAX];
^~~~~~~~~~~
getgroups.c:31:16: note: each undeclared identifier is reported only once for each function it appears in
getgroups.c:31:9: error: unused variable 'gidset' [-Werror=unused-variable]
gid_t gidset[NGROUPS_MAX];
^~~~~~
cc1: all warnings being treated as errors
make[4]: *** [../../Makefile.common:128: getgroups.o] Error 1
make[4]: Leaving directory '/share/MD0_DATA/Public/ocaml-4.14/otherlibs/unix'
make[3]: *** [Makefile:34: all] Error 2
make[3]: Leaving directory '/share/MD0_DATA/Public/ocaml-4.14/otherlibs'
make[2]: *** [Makefile:960: otherlibraries] Error 2
make[2]: Leaving directory '/share/MD0_DATA/Public/ocaml-4.14'
make[1]: *** [Makefile:251: opt.opt] Error 2
make[1]: Leaving directory '/share/MD0_DATA/Public/ocaml-4.14'
make: *** [Makefile:312: world.opt] Error 2
[/share/Public/ocaml-4.14] #

any thoughts?
Post Reply

Return to “Apps Wanted”