Index: head/net/unison/Makefile =================================================================== --- head/net/unison/Makefile (revision 436801) +++ head/net/unison/Makefile (revision 436802) @@ -1,69 +1,84 @@ # Created by: Dan Pelleg # $FreeBSD$ PORTNAME= unison PORTVERSION= 2.48.4 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= net MASTER_SITES= http://www.cis.upenn.edu/~bcpierce/unison/download/releases/${DISTNAME}/ DISTFILES= ${EXTRACT_ONLY} ${EXTRA_DOCS} DIST_SUBDIR= ${DISTNAME} EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER?= madpilot@FreeBSD.org COMMENT?= User-level file synchronization tool LICENSE= GPLv3 PLIST_SUB= PORTVERSION=${PORTVERSION} -USES= gmake +USES= gmake localbase USE_OCAML= yes WRKSRC= ${WRKDIR}/src NO_OCAML_RUNDEPENDS=yes WANT_GNOME= yes -MAKE_ARGS= CFLAGS="" CONFLICTS?= unison-devel-[0-9]* unison-nox11-[0-9]* - +MAKE_ENV= CLIBS="${LIBS:S/^-/-ccopt -/}" COFLAGS="${CFLAGS:C/ *(-[^ ]*) */ -ccopt \"\1 \"/gW}" MAKE_JOBS_UNSAFE= yes ALL_TARGET= unison all DOCS= BUGS.txt NEWS README EXTRA_DOCS= ${DISTNAME}-manual.html \ ${DISTNAME}-manual.pdf ${DISTNAME}-manual.ps -OPTIONS_DEFINE= DOCS X11 -OPTIONS_DEFAULT?= X11 +OPTIONS_DEFINE= DOCS FSMONITOR X11 +OPTIONS_DEFAULT?= FSMONITOR X11 +FSMONITOR_DESC= Compile and install fsmonitor plugin + +OPTIONS_SUB= YES + +FSMONITOR_LIB_DEPENDS= libinotify.so:devel/libinotify + X11_MAKE_ARGS= UISTYLE=gtk2 -X11_PLIST_SUB= TEXT="" X11_BUILD_DEPENDS= lablgtk2:x11-toolkits/ocaml-lablgtk2 \ icotool:graphics/icoutils X11_RUN_DEPENDS= lablgtk2:x11-toolkits/ocaml-lablgtk2 X11_SUB_FILES= ${PORTNAME}.desktop X11_MAKE_ARGS_OFF= UISTYLE=text -X11_PLIST_SUB_OFF= TEXT="@comment " X11_VARS_OFF= PKGMESSAGE=${PKGDIR}/pkg-message.nox11 +post-patch-FSMONITOR-off: + @${REINPLACE_CMD} -e 's/-include fsmonitor/#&/' \ + ${WRKSRC}/Makefile.OCaml + +post-patch-X11-off: + @${REINPLACE_CMD} -e 's/CFLAGS/COFLAGS/g' \ + ${WRKSRC}/Makefile.OCaml ${WRKSRC}/fsmonitor/linux/Makefile + post-patch-X11-on: @${REINPLACE_CMD} -Ee 's@(\+|/)(lablgtk2)@\1site-lib/\2@' \ - ${WRKSRC}/Makefile.OCaml + -e 's/CFLAGS/COFLAGS/g' \ + ${WRKSRC}/Makefile.OCaml ${WRKSRC}/fsmonitor/linux/Makefile post-build-X11-on: @${ECHO} Building text-only version @${ECHO} ${WRKSRC} - ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${WRKSRC} CFLAGS="" UISTYLE=text NAME=unison-text + ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${WRKSRC} UISTYLE=text NAME=unison-text @cd ${WRKSRC}/win32rc && ${LOCALBASE}/bin/icotool -x U.ico do-install: ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin @${MKDIR} ${STAGEDIR}${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR} cd ${DISTDIR}/${DIST_SUBDIR} && ${INSTALL_DATA} ${EXTRA_DOCS} ${STAGEDIR}${DOCSDIR} + +do-install-FSMONITOR-on: + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME}-fsmonitor ${STAGEDIR}${PREFIX}/bin do-install-X11-on: ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME}-text ${STAGEDIR}${PREFIX}/bin ${INSTALL_DATA} ${WRKDIR}/${PORTNAME}.desktop ${STAGEDIR}${DESKTOPDIR} ${INSTALL_DATA} ${WRKSRC}/win32rc/U_4_48x48x32.png ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}.png .include Index: head/net/unison/files/patch-Makefile.OCaml =================================================================== --- head/net/unison/files/patch-Makefile.OCaml (nonexistent) +++ head/net/unison/files/patch-Makefile.OCaml (revision 436802) @@ -0,0 +1,34 @@ +--- Makefile.OCaml.orig 2017-03-23 16:39:49 UTC ++++ Makefile.OCaml +@@ -32,7 +32,11 @@ ifeq ($(shell uname),OpenBSD) + else + ifeq ($(shell uname),NetBSD) + OSARCH=NetBSD ++else ++ifeq ($(shell uname),FreeBSD) ++ OSARCH=FreeBSD + endif ++endif + ifeq ($(shell uname),Linux) + OSARCH=Linux + endif +@@ -311,6 +315,10 @@ ifeq ($(OSARCH),Linux) + -include fsmonitor/linux/Makefile src/fsmonitor/linux/Makefile + endif + ++ifeq ($(OSARCH),FreeBSD) ++-include fsmonitor/linux/Makefile src/fsmonitor/linux/Makefile ++endif ++ + ifeq ($(OSARCH),win32gnuc) + -include fsmonitor/windows/Makefile src/fsmonitor/windows/Makefile + endif +@@ -436,7 +444,7 @@ win32rc/unison.res.lib: win32rc/unison.res + + %.o %.obj: %.c + @echo "$(OCAMLOPT): $< ---> $@" +- $(CAMLC) $(CAMLFLAGS) -ccopt $(OUTPUT_SEL)$(CWD)/$@ -c $(CWD)/$< ++ $(CAMLC) $(CAMLFLAGS) -ccopt $(OUTPUT_SEL)$(CWD)/$@ -c $(CFLAGS) $(CWD)/$< + + $(NAME)$(EXEC_EXT): $(CAMLOBJS) $(COBJS) + @echo Linking $@ Property changes on: head/net/unison/files/patch-Makefile.OCaml ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/unison/files/patch-fsmonitor_linux_Makefile =================================================================== --- head/net/unison/files/patch-fsmonitor_linux_Makefile (nonexistent) +++ head/net/unison/files/patch-fsmonitor_linux_Makefile (revision 436802) @@ -0,0 +1,20 @@ +--- fsmonitor/linux/Makefile.orig 2017-03-23 16:47:46 UTC ++++ fsmonitor/linux/Makefile +@@ -18,6 +18,10 @@ else + FSMCAMLLIBS=$(FSMOCAMLLIBS) + endif + ++ifeq ($(OSARCH),FreeBSD) ++ CLIBS+=-cclib -linotify ++endif ++ + buildexecutable:: $(FSMONITOR)$(EXEC_EXT) + + $(FSMONITOR)$(EXEC_EXT): $(FSMCAMLOBJS) $(FSMCOBJS) +@@ -26,4 +30,4 @@ $(FSMONITOR)$(EXEC_EXT): $(FSMCAMLOBJS) $(FSMCOBJS) + + clean:: + rm -f $(DIR)/*.cm[iox] $(DIR)/*.o $(DIR)/*~ +- rm -f $(FSMONITOR)$(EXEC_EXT) +\ No newline at end of file ++ rm -f $(FSMONITOR)$(EXEC_EXT) Property changes on: head/net/unison/files/patch-fsmonitor_linux_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/unison/files/patch-fsmonitor_linux_inotify__stubs.c =================================================================== --- head/net/unison/files/patch-fsmonitor_linux_inotify__stubs.c (nonexistent) +++ head/net/unison/files/patch-fsmonitor_linux_inotify__stubs.c (revision 436802) @@ -0,0 +1,17 @@ +--- fsmonitor/linux/inotify_stubs.c.orig 2017-03-23 16:25:03 UTC ++++ fsmonitor/linux/inotify_stubs.c +@@ -27,9 +27,13 @@ + #include + #include + ++#include ++ ++#if !defined(__FreeBSD__) + #include ++#endif + +-#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 4 ++#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 4) || defined(__FreeBSD__) + #define GLIBC_SUPPORT_INOTIFY 1 + #else + #define GLIBC_SUPPORT_INOTIFY 0 Property changes on: head/net/unison/files/patch-fsmonitor_linux_inotify__stubs.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/unison/pkg-plist =================================================================== --- head/net/unison/pkg-plist (revision 436801) +++ head/net/unison/pkg-plist (revision 436802) @@ -1,10 +1,11 @@ bin/unison -%%TEXT%%share/applications/unison.desktop -%%TEXT%%bin/unison-text -%%TEXT%%share/pixmaps/unison.png +%%FSMONITOR%%bin/unison-fsmonitor +%%X11%%share/applications/unison.desktop +%%X11%%bin/unison-text +%%X11%%share/pixmaps/unison.png %%PORTDOCS%%%%DOCSDIR%%/BUGS.txt %%PORTDOCS%%%%DOCSDIR%%/NEWS %%PORTDOCS%%%%DOCSDIR%%/README %%PORTDOCS%%%%DOCSDIR%%/unison-%%PORTVERSION%%-manual.html %%PORTDOCS%%%%DOCSDIR%%/unison-%%PORTVERSION%%-manual.pdf %%PORTDOCS%%%%DOCSDIR%%/unison-%%PORTVERSION%%-manual.ps