<div dir="ltr">two comments to my own patch:<br><div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-18 7:13 GMT+02:00 Stefan Hellermann <span dir="ltr"><<a href="mailto:stefan@the2masters.de" target="_blank">stefan@the2masters.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">should probably be sent to the packages repo on github.<br>
<br>
Signed-of-by: Stefan Hellermann <<a href="mailto:stefan@the2masters.de">stefan@the2masters.de</a>><br>
---<br>
package/network/utils/unison/Makefile | 36 ++++<br>
.../utils/unison/patches/100-ocamlopt.patch | 225 +++++++++++++++++++++<br>
2 files changed, 261 insertions(+)<br>
create mode 100644 package/network/utils/unison/Makefile<br>
create mode 100644 package/network/utils/unison/patches/100-ocamlopt.patch<br>
<br>
diff --git a/package/network/utils/unison/Makefile b/package/network/utils/unison/Makefile<br>
new file mode 100644<br>
index 0000000..91d9516<br>
--- /dev/null<br>
+++ b/package/network/utils/unison/Makefile<br>
@@ -0,0 +1,36 @@<br>
+#<br>
+# Copyright (C) 2009-2011 OpenWrt.org<br>
+#<br>
+# This is free software, licensed under the GNU General Public License v2.<br>
+# See /LICENSE for more information.<br>
+#<br>
+<br>
+include $(TOPDIR)/<a href="http://rules.mk" rel="noreferrer" target="_blank">rules.mk</a><br>
+<br>
+PKG_NAME:=unison<br>
+PKG_VERSION:=2.48.3<br>
+PKG_RELEASE:=1<br>
+<br>
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz<br>
+PKG_SOURCE_URL:=<a href="http://www.seas.upenn.edu/~bcpierce/unison//download/releases/$(PKG_NAME)-$(PKG_VERSION)/" rel="noreferrer" target="_blank">http://www.seas.upenn.edu/~bcpierce/unison//download/releases/$(PKG_NAME)-$(PKG_VERSION)/</a><br>
+<br>
+include $(INCLUDE_DIR)/<a href="http://package.mk" rel="noreferrer" target="_blank">package.mk</a><br>
+<br>
+define Package/unison<br>
+ SECTION:=utilities<br>
+ CATEGORY:=Utilities<br>
+ TITLE:=Unison file synchronizer<br>
+ URL:=<a href="http://www.cis.upenn.edu/~bcpierce/unison/" rel="noreferrer" target="_blank">http://www.cis.upenn.edu/~bcpierce/unison/</a><br>
+ DEPENDS:= libncurses<br>
+endef<br>
+<br></blockquote><div><br></div><div>There is a # missing in front of next line<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+Stripping OCaml binaries is not possible<br>
+RSTRIP:=:<br>
+STRIP:=:<br>
+<br>
+define Package/unison/install<br>
+ $(INSTALL_DIR) $(1)/usr/bin<br>
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/unison $(1)/usr/bin<br>
+endef<br>
+<br>
+$(eval $(call BuildPackage,unison))<br>
diff --git a/package/network/utils/unison/patches/100-ocamlopt.patch b/package/network/utils/unison/patches/100-ocamlopt.patch<br>
new file mode 100644<br>
index 0000000..a8132e2<br></blockquote><div><br></div><div>inotify_compat.h is missing in unison, this is known upstream.<br><a href="https://www.marc.info/?l=unison-hackers&m=138390422022273&w=2">https://www.marc.info/?l=unison-hackers&m=138390422022273&w=2</a><br></div><div>Another option is to remove fsmonitor from unison, as the binary "unison-fsmonitor" is not currently installed onto the target.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
--- /dev/null<br>
+++ b/package/network/utils/unison/patches/100-ocamlopt.patch<br>
@@ -0,0 +1,225 @@<br>
+--- /dev/null 2015-08-24 10:52:13.180000000 +0200<br>
++++ unison-2.48.3/fsmonitor/linux/inotify_compat.h 2015-09-11 22:59:01.056000000 +0200<br>
+@@ -0,0 +1,167 @@<br>
++/*<br>
++ * This header is used if <sys/inotify.h> cannot be found.<br>
++ *<br>
++ * Inode based directory notification for Linux<br>
++ *<br>
++ * Copyright (C) 2005 John McCutchan<br>
++ */<br>
++<br>
++#ifndef _LINUX_INOTIFY_H<br>
++#define _LINUX_INOTIFY_H<br>
++<br>
++#include <stdint.h><br>
++#include <sys/syscall.h><br>
++#include <unistd.h><br>
++<br>
++/*<br>
++ * struct inotify_event - structure read from the inotify device for each event<br>
++ *<br>
++ * When you are watching a directory, you will receive the filename for events<br>
++ * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.<br>
++ */<br>
++struct inotify_event {<br>
++ int wd; /* watch descriptor */<br>
++ uint32_t mask; /* watch mask */<br>
++ uint32_t cookie; /* cookie to synchronize two events */<br>
++ uint32_t len; /* length (including nulls) of name */<br>
++ char name __flexarr; /* stub for possible name */<br>
++};<br>
++<br>
++/* the following are legal, implemented events that user-space can watch for */<br>
++#define IN_ACCESS 0x00000001 /* File was accessed */<br>
++#define IN_MODIFY 0x00000002 /* File was modified */<br>
++#define IN_ATTRIB 0x00000004 /* Metadata changed */<br>
++#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */<br>
++#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */<br>
++#define IN_OPEN 0x00000020 /* File was opened */<br>
++#define IN_MOVED_FROM 0x00000040 /* File was moved from X */<br>
++#define IN_MOVED_TO 0x00000080 /* File was moved to Y */<br>
++#define IN_CREATE 0x00000100 /* Subfile was created */<br>
++#define IN_DELETE 0x00000200 /* Subfile was deleted */<br>
++#define IN_DELETE_SELF 0x00000400 /* Self was deleted */<br>
++#define IN_MOVE_SELF 0x00000800 /* Self was moved */<br>
++<br>
++/* the following are legal events. they are sent as needed to any watch */<br>
++#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */<br>
++#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */<br>
++#define IN_IGNORED 0x00008000 /* File was ignored */<br>
++<br>
++/* helper events */<br>
++#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */<br>
++#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */<br>
++<br>
++/* special flags */<br>
++#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */<br>
++#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */<br>
++#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */<br>
++#define IN_ISDIR 0x40000000 /* event occurred against dir */<br>
++#define IN_ONESHOT 0x80000000 /* only send event once */<br>
++<br>
++/*<br>
++ * All of the events - we build the list by hand so that we can add flags in<br>
++ * the future and not break backward compatibility. Apps will get only the<br>
++ * events that they originally wanted. Be sure to add new events here!<br>
++ */<br>
++#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \<br>
++ IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \<br>
++ IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \<br>
++ IN_MOVE_SELF)<br>
++<br>
++#if defined (__alpha__)<br>
++# define __NR_inotify_init 444<br>
++# define __NR_inotify_add_watch 445<br>
++# define __NR_inotify_rm_watch 446<br>
++<br>
++#elif defined (__arm__)<br>
++# define __NR_inotify_init (__NR_SYSCALL_BASE+316)<br>
++# define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)<br>
++# define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)<br>
++<br>
++#elif defined (__frv__)<br>
++# define __NR_inotify_init 291<br>
++# define __NR_inotify_add_watch 292<br>
++# define __NR_inotify_rm_watch 293<br>
++<br>
++#elif defined(__i386__)<br>
++# define __NR_inotify_init 291<br>
++# define __NR_inotify_add_watch 292<br>
++# define __NR_inotify_rm_watch 293<br>
++<br>
++#elif defined (__ia64__)<br>
++# define __NR_inotify_init 1277<br>
++# define __NR_inotify_add_watch 1278<br>
++# define __NR_inotify_rm_watch 1279<br>
++<br>
++#elif defined (__mips__)<br>
++# if _MIPS_SIM == _MIPS_SIM_ABI32<br>
++# define __NR_inotify_init (__NR_Linux + 284)<br>
++# define __NR_inotify_add_watch (__NR_Linux + 285)<br>
++# define __NR_inotify_rm_watch (__NR_Linux + 286)<br>
++# endif<br>
++# if _MIPS_SIM == _MIPS_SIM_ABI64<br>
++# define __NR_inotify_init (__NR_Linux + 243)<br>
++# define __NR_inotify_add_watch (__NR_Linux + 243)<br>
++# define __NR_inotify_rm_watch (__NR_Linux + 243)<br>
++# endif<br>
++# if _MIPS_SIM == _MIPS_SIM_NABI32<br>
++# define __NR_inotify_init (__NR_Linux + 247)<br>
++# define __NR_inotify_add_watch (__NR_Linux + 248)<br>
++# define __NR_inotify_rm_watch (__NR_Linux + 249)<br>
++# endif<br>
++<br>
++#elif defined(__parisc__)<br>
++# define __NR_inotify_init (__NR_Linux + 269)<br>
++# define __NR_inotify_add_watch (__NR_Linux + 270)<br>
++# define __NR_inotify_rm_watch (__NR_Linux + 271)<br>
++<br>
++#elif defined(__powerpc__) || defined(__powerpc64__)<br>
++# define __NR_inotify_init 275<br>
++# define __NR_inotify_add_watch 276<br>
++# define __NR_inotify_rm_watch 277<br>
++<br>
++#elif defined (__s390__)<br>
++# define __NR_inotify_init 284<br>
++# define __NR_inotify_add_watch 285<br>
++# define __NR_inotify_rm_watch 286<br>
++<br>
++#elif defined (__sh__)<br>
++# define __NR_inotify_init 290<br>
++# define __NR_inotify_add_watch 291<br>
++# define __NR_inotify_rm_watch 292<br>
++<br>
++#elif defined (__sh64__)<br>
++# define __NR_inotify_init 318<br>
++# define __NR_inotify_add_watch 319<br>
++# define __NR_inotify_rm_watch 320<br>
++<br>
++#elif defined (__sparc__) || defined (__sparc64__)<br>
++# define __NR_inotify_init 151<br>
++# define __NR_inotify_add_watch 152<br>
++# define __NR_inotify_rm_watch 156<br>
++<br>
++#elif defined(__x86_64__)<br>
++# define __NR_inotify_init 253<br>
++# define __NR_inotify_add_watch 254<br>
++# define __NR_inotify_rm_watch 255<br>
++<br>
++#else<br>
++# error "Unsupported architecture!"<br>
++#endif<br>
++<br>
++static inline int inotify_init (void)<br>
++{<br>
++ return syscall (__NR_inotify_init);<br>
++}<br>
++<br>
++static inline int inotify_add_watch (int fd, const char *name, uint32_t mask)<br>
++{<br>
++ return syscall (__NR_inotify_add_watch, fd, name, mask);<br>
++}<br>
++<br>
++static inline int inotify_rm_watch (int fd, uint32_t wd)<br>
++{<br>
++ return syscall (__NR_inotify_rm_watch, fd, wd);<br>
++}<br>
++<br>
++<br>
++#endif /* _LINUX_INOTIFY_H */<br>
+--- unison-2.48.3_alt/fsmonitor/linux/Makefile 2012-09-18 18:10:59.000000000 +0200<br>
++++ unison-2.48.3/fsmonitor/linux/Makefile 2015-09-11 23:07:33.492000000 +0200<br>
+@@ -22,8 +22,8 @@<br>
+<br>
+ $(FSMONITOR)$(EXEC_EXT): $(FSMCAMLOBJS) $(FSMCOBJS)<br>
+ @echo Linking $@<br>
+- $(CAMLC) -verbose $(CAMLFLAGS) -o $@ $(CFLAGS) $(FSMCAMLLIBS) $^ $(CLIBS)<br>
++ $(CAMLC) -verbose $(CAMLFLAGS) -o $@ $(FSMCAMLLIBS) $^ $(CLIBS)<br>
+<br>
+ clean::<br>
+ rm -f $(DIR)/*.cm[iox] $(DIR)/*.o $(DIR)/*~<br>
+- rm -f $(FSMONITOR)$(EXEC_EXT)<br>
+\ No newline at end of file<br>
++ rm -f $(FSMONITOR)$(EXEC_EXT)<br>
+--- unison-2.48.3_alt/Makefile.OCaml 2014-09-28 18:48:05.000000000 +0200<br>
++++ unison-2.48.3/Makefile.OCaml 2015-09-12 09:33:22.220000000 +0200<br>
+@@ -48,6 +48,7 @@<br>
+ OSARCH=win32gnuc<br>
+ EXEC_PREFIX=i686-w64-mingw32-<br>
+ endif<br>
++EXEC_PREFIX=$(CROSS)<br>
+<br>
+ # The OCaml lib dir is used by all versions<br>
+ # It is extracted from 'ocamlc -v' and Windows '\' separators are turned<br>
+@@ -58,7 +59,7 @@<br>
+ # Better(?) version, June 2005:<br>
+ # OCAMLLIBDIR=$(shell ocamlc -v | tail -1 | sed -e 's/.* //g' | sed -e 's/\\/\//g' | tr -d '\r')<br>
+ # Another try, Feb 2011, suggested by Ron Isaacson<br>
+-OCAMLLIBDIR=$(shell ocamlc -v | tail -1 | sed -e 's/.* //g' | tr '\\' '/' | tr -d '\r')<br>
++OCAMLLIBDIR=$(shell $(EXEC_PREFIX)ocamlc -v | tail -1 | sed -e 's/.* //g' | tr '\\' '/' | tr -d '\r')<br>
+<br>
+ ## BCP (6/05) an alternative, but not quite working, version<br>
+ ## suggested by Nick Montfort:<br>
+--- unison-2.48.3_alt/Makefile 2013-07-18 11:37:09.000000000 +0200<br>
++++ unison-2.48.3/Makefile 2015-09-12 10:16:56.728000000 +0200<br>
+@@ -11,7 +11,7 @@<br>
+ # If you set NATIVE=false, then make sure that the THREADS option below is<br>
+ # also set to false unless your OCaml installation has true posix-compliant<br>
+ # threads (i.e., -with-pthreads was given as an option to the config script).<br>
+-NATIVE=true<br>
++NATIVE=false<br>
+<br>
+ # Use THREADS=false if your OCaml installation is not configured with the<br>
+ # -with-pthreads option. (Unison will crash when compiled with THREADS=true<br>
+@@ -23,7 +23,9 @@<br>
+ # an appropriate value automatically, depending on whether the lablgtk<br>
+ # library is available.<br>
+ #<br>
+-# UISTYLE=text<br>
++UISTYLE=text<br>
++<br>
++CFLAGS=<br>
+<br>
+ ########################################################################<br>
+ ########################################################################<br>
<span class=""><font color="#888888">--<br>
2.1.4<br>
<br>
</font></span></blockquote></div><br></div></div></div>