--- Makefile (revision 457815) +++ Makefile (working copy) @@ -3,7 +3,7 @@ PORTNAME= glib PORTVERSION= 2.50.2 -PORTREVISION= 7 +PORTREVISION= 8 PORTEPOCH= 1 CATEGORIES= devel MASTER_SITES= GNOME @@ -34,7 +34,6 @@ --enable-static=yes \ --with-pcre=system \ --disable-fam -CONFIGURE_ENV= ac_cv_header_sys_inotify_h= INSTALL_TARGET= install-strip SHEBANG_FILES= */*.pl @@ -49,6 +48,9 @@ gobject_MAN= glib-genmarshal.1 glib-mkenums.1 gobject-query.1 OPTIONS_DEFINE= COLLATION_FIX DEBUG NLS +OPTIONS_SINGLE= GIO_BACKEND +OPTIONS_SINGLE_GIO_BACKEND= INOTIFY KQUEUE +OPTIONS_DEFAULT= INOTIFY OPTIONS_SUB= yes # libc collation was fixed by https://svnweb.freebsd.org/changeset/base/290494 COLLATION_FIX_DESC= Use ICU for UTF-8 string collation (if libc is broken) @@ -65,6 +67,14 @@ # http://www.freebsd.org/cgi/query-pr.cgi?pr=175930 see comment by ed@ #COLLATION_FIX_CONFIGURE_ENV+= CFLAGS="-D__STDC_ISO_10646__" +GIO_BACKEND_DESC= Gio backend +INOTIFY_DESC= Use gio/inotify backend +INOTIFY_CONFIGURE_ENV= ac_cv_header_sys_event_h= +INOTIFY_LDFLAGS= -linotify +INOTIFY_LIB_DEPENDS= libinotify.so:devel/libinotify +KQUEUE_DESC= Use gio/kqueue backend +KQUEUE_CONFIGURE_ENV= ac_cv_header_sys_inotify_h= + .include # doesn't build yet @@ -71,7 +81,7 @@ CONFIGURE_ARGS+=--disable-dtrace .if empty(ICONV_LIB) -CONFIGURE_ARGS+= --with-libiconv=no +CONFIGURE_ARGS+= --with-libiconv=maybe .else CONFIGURE_ARGS+= --with-libiconv=gnu .endif @@ -94,8 +104,11 @@ @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g ; \ s|/usr/share/locale/locale|${LOCALBASE}/share/locale/locale|g' \ ${WRKSRC}/glib/gutils.c - @${REINPLACE_CMD} -e 's|inotify_support=yes|inotify_support=no| ; \ - s|-Werror|| ; \ + @${REINPLACE_CMD} -e 's|-Werror||' ${WRKSRC}/configure + +post-patch-KQUEUE-on: + @${REINPLACE_CMD} -i '.kqueue' -e \ + 's|inotify_support=yes|inotify_support=no| ; \ s|#define HAVE_SYS_INOTIFY_H 1||' ${WRKSRC}/configure post-install: --- files/patch-gio_inotify_inotify-path.c (nonexistent) +++ files/patch-gio_inotify_inotify-path.c (working copy) @@ -0,0 +1,16 @@ +--- gio/inotify/inotify-path.c.orig 2016-10-22 05:18:16 UTC ++++ gio/inotify/inotify-path.c +@@ -36,7 +36,13 @@ + #include "inotify-path.h" + #include "inotify-missing.h" + ++#ifdef __linux__ + #define IP_INOTIFY_DIR_MASK (IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_DELETE|IN_CREATE|IN_DELETE_SELF|IN_UNMOUNT|IN_MOVE_SELF|IN_CLOSE_WRITE) ++#else ++/* libinotify-kqueue opens each file in watched directory if one of IN_MODIFY, ++ * IN_ATTRIB or IN_CLOSE_WRITE flags specified. Exclude them from mask */ ++#define IP_INOTIFY_DIR_MASK (IN_MOVED_FROM|IN_MOVED_TO|IN_DELETE|IN_CREATE|IN_DELETE_SELF|IN_UNMOUNT|IN_MOVE_SELF) ++#endif + + #define IP_INOTIFY_FILE_MASK (IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE) +