Index: head/devel/glib20/Makefile =================================================================== --- head/devel/glib20/Makefile (revision 566631) +++ head/devel/glib20/Makefile (revision 566632) @@ -1,113 +1,114 @@ # Created by: Vanilla I. Shu # $FreeBSD$ PORTNAME= glib DISTVERSION= 2.66.7 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= devel MASTER_SITES= GNOME DIST_SUBDIR= gnome MAINTAINER= desktop@FreeBSD.org COMMENT= Some useful routines of C programming (current stable version) LICENSE= LGPL20 LIB_DEPENDS= libffi.so:devel/libffi \ libpcre.so:devel/pcre # iconv:wchar_t - our iconv in base doesn't support utf-8 -> wchar_t (boooo) # (wchar_t is used by glibmm, rawtherapee triggered this) USES= compiler:c11 gettext gnome iconv:wchar_t localbase:ldflags \ meson perl5 pkgconfig python:3.6+ tar:xz USE_LDCONFIG= yes USE_PERL5= build USE_PYTHON= py3kplist MESON_ARGS= -Db_lundef=false \ -Ddefault_library=both \ -Dinstalled_tests=false \ -Dlibmount=disabled \ -Dselinux=disabled \ -Dxattr=false BINARY_ALIAS= python3=${PYTHON_CMD} PORTSCOUT= limitw:1,even _LIBVERSION= 0.6600.7 PLIST_SUB= LIBVERSION=${_LIBVERSION} OPTIONS_DEFINE= DEBUG FAM_ALTBACKEND MANPAGES NLS OPTIONS_DEFAULT= MANPAGES OPTIONS_SUB= yes FAM_ALTBACKEND_DESC= Alternate file monitor backend MANPAGES_BUILD_DEPENDS= docbook-xml>4.1.2:textproc/docbook-xml \ docbook-xsl>0:textproc/docbook-xsl MANPAGES_USE= GNOME=libxslt:build MANPAGES_MESON_TRUE= man .include # doesn't build yet MESON_ARGS+= -Ddtrace=false .if empty(ICONV_LIB) # native? MESON_ARGS+= -Diconv=libc .else MESON_ARGS+= -Diconv=external .endif .if ${ARCH} == powerpc64 EXTRA_PATCHES= ${FILESDIR}/extra-arch-powerpc64 .endif pre-configure-FAM_ALTBACKEND-on: @${REINPLACE_CMD} -e 's|kqueue-helper.c|kqueue_fnm.c|g ; \ s|.*kqueue-missing.c.*||g ; \ s|.*dep-list.c.*||g' \ ${WRKSRC}/gio/kqueue/meson.build @${CP} -f ${FILESDIR}/gkqueuefilemonitor.c ${WRKSRC}/gio/kqueue/gkqueuefilemonitor.c @${CP} ${FILESDIR}/kqueue_fnm.c ${WRKSRC}/gio/kqueue/kqueue_fnm.c @${CP} ${FILESDIR}/kqueue_fnm.h ${WRKSRC}/gio/kqueue/kqueue_fnm.h post-patch: ${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|@PYTHON@|${PYTHON_CMD}|g' \ ${WRKSRC}/gio/gdbus-2.0/codegen/gdbus-codegen.in \ ${WRKSRC}/glib/gtester-report.in \ ${WRKSRC}/gobject/glib-genmarshal.in \ ${WRKSRC}/gobject/glib-mkenums.in ${REINPLACE_CMD} -e '/inotify_init1/d' \ -e '/inotify.h/d' \ ${WRKSRC}/meson.build ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ ${WRKSRC}/gio/xdgmime/xdgmime.c \ ${WRKSRC}/glib/gutils.c \ ${WRKSRC}/glib/tests/utils.c CODEGENDIR= ${PREFIX}/share/glib-2.0/codegen post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/share/GConf/gsettings ${MKDIR} ${STAGEDIR}${PREFIX}/lib/gio/modules # generates .py[co] files for installed modules # if that's not done, ${PYTHON_SITELIBDIR}/gps will be polluted # with these files when module is imported from root user ${FIND} ${STAGEDIR}${PREFIX} -name \*.pyc -delete (cd ${STAGEDIR}${PREFIX} && \ ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \ -d ${CODEGENDIR} -f ${CODEGENDIR:S;${PREFIX}/;;} && \ ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \ -d ${CODEGENDIR} -f ${CODEGENDIR:S;${PREFIX}/;;}) # install bash completion regardless if bash is present ${MKDIR} ${STAGEDIR}${PREFIX}/share/bash-completion/completions .for file in gapplication gdbus gio gresource gsettings ${INSTALL_DATA} ${WRKSRC}/gio/completion/${file} \ ${STAGEDIR}${PREFIX}/share/bash-completion/completions/ .endfor ${RM} -r ${STAGEDIR}${PREFIX}/libexec/installed-tests .include Index: head/devel/glib20/files/patch-glib_gspawn.c =================================================================== --- head/devel/glib20/files/patch-glib_gspawn.c (revision 566631) +++ head/devel/glib20/files/patch-glib_gspawn.c (revision 566632) @@ -1,81 +1,62 @@ ---- glib/gspawn.c 2018-09-21 12:29:23.000000000 +0300 -+++ glib/gspawn.c 2019-07-20 18:05:15.486558000 +0300 -@@ -51,6 +51,13 @@ +--- glib/gspawn.c.orig 2020-12-17 03:47:11.474608400 -0800 ++++ glib/gspawn.c 2021-02-17 13:58:15.271434000 -0800 +@@ -51,6 +51,12 @@ #include /* for syscall and SYS_getdents64 */ #endif +#ifdef __FreeBSD__ -+#include -+#include ++#include +#include -+#include ++#include +#endif + #include "gspawn.h" #include "gspawn-private.h" #include "gthread.h" -@@ -1204,6 +1211,51 @@ +@@ -1204,6 +1210,33 @@ filename_to_fd (const char *p) } #endif +#ifdef __FreeBSD__ +static int -+fdwalk2(int (*func)(void *, int), void *udata, int *ret) { -+ size_t i, bufsz = 0; -+ struct xfile *xfbuf, *xf; -+ int uret = 0, pid_found = 0; -+ int mib[2] = { CTL_KERN, KERN_FILE }; -+ pid_t pid; ++fdwalk2(int (*func)(void *, int), void *udata, gint *ret) ++{ ++ struct kinfo_file *kf; ++ int i, cnt; + + if (NULL == func) + return EINVAL; + -+ if (sysctl (mib, nitems(mib), NULL, &bufsz, NULL, 0) == -1) -+ return (errno); -+ bufsz += 65536; -+ xfbuf = alloca (bufsz); -+ if (xfbuf == NULL) -+ return errno; -+ if (sysctl (mib, 2, xfbuf, &bufsz, NULL, 0) == -1) -+ return errno; -+ bufsz /= sizeof(struct xfile); ++ kf = kinfo_getfile(getpid(), &cnt); ++ if (kf == NULL) ++ return ENOMEM; + -+ pid = getpid(); -+ for (i = 0; i < bufsz; i++) { -+ xf = &xfbuf[i]; -+ if (pid != xf->xf_pid) { -+ if (pid_found) { -+ return 0; -+ } else { -+ continue; -+ } -+ } -+ pid_found = 1; -+ if (0 > xf->xf_fd) ++ for (i = 0; i < cnt; i++) { ++ if (0 > kf[i].kf_fd) + continue; -+ uret = func (udata, xf->xf_fd); -+ if (uret != 0) ++ *ret = func (udata, kf[i].kf_fd); ++ if (*ret != 0) + break; -+ + } + ++ free(kf); + return 0; +} +#endif + /* This function is called between fork() and exec() and hence must be * async-signal-safe (see signal-safety(7)). */ static int -@@ -1228,6 +1280,12 @@ +@@ -1228,6 +1261,12 @@ safe_fdwalk (int (*cb)(void *data, int fd), void *data #if 0 && defined(HAVE_SYS_RESOURCE_H) struct rlimit rl; +#endif + +#ifdef __FreeBSD__ + if (fdwalk2(cb, data, &res) == 0) + return res; + /* If any sysctl/malloc call fails continue with the fall back method */ #endif #ifdef __linux__ Index: head/devel/glib20/files/patch-glib_meson.build =================================================================== --- head/devel/glib20/files/patch-glib_meson.build (nonexistent) +++ head/devel/glib20/files/patch-glib_meson.build (revision 566632) @@ -0,0 +1,11 @@ +--- glib/meson.build.orig 2021-02-18 15:31:48.638470000 -0800 ++++ glib/meson.build 2021-02-18 15:32:08.983695000 -0800 +@@ -376,7 +376,7 @@ + # intl.lib is not compatible with SAFESEH + link_args : [noseh_link_args, glib_link_flags, win32_ldflags], + include_directories : configinc, +- dependencies : pcre_deps + [thread_dep, librt] + libintl_deps + libiconv + platform_deps + gnulib_libm_dependency + [libsysprof_capture_dep], ++ dependencies : pcre_deps + [thread_dep, librt] + libintl_deps + libiconv + platform_deps + gnulib_libm_dependency + [libsysprof_capture_dep] + libutil, + c_args : glib_c_args, + objc_args : glib_c_args, + ) Property changes on: head/devel/glib20/files/patch-glib_meson.build ___________________________________________________________________ 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/devel/glib20/files/patch-meson.build =================================================================== --- head/devel/glib20/files/patch-meson.build (nonexistent) +++ head/devel/glib20/files/patch-meson.build (revision 566632) @@ -0,0 +1,11 @@ +--- meson.build.orig 2021-02-11 04:24:55.280943200 -0800 ++++ meson.build 2021-02-18 15:34:48.476370000 -0800 +@@ -2287,6 +2287,8 @@ + test_timeout = 60 + test_timeout_slow = 180 + ++libutil = [cc.find_library('util', required : true)] ++ + pkg = import('pkgconfig') + windows = import('windows') + subdir('glib') Property changes on: head/devel/glib20/files/patch-meson.build ___________________________________________________________________ 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