diff --git a/Mk/Uses/gettext-runtime.mk b/Mk/Uses/gettext-runtime.mk index 374a19b45ec4..1d0f0b8900b9 100644 --- a/Mk/Uses/gettext-runtime.mk +++ b/Mk/Uses/gettext-runtime.mk @@ -1,26 +1,27 @@ # Handle dependency on the gettext-runtime (libintl) port # # Feature: gettext-runtime # Usage: USES=gettext-runtime or USES=gettext-runtime:ARGS # Valid ARGS: lib (default), build, run # # MAINTAINER: tijl@FreeBSD.org .if !defined(_INCLUDE_USES_GETTEXT_RUNTIME_MK) _INCLUDE_USES_GETTEXT_RUNTIME_MK= yes . if empty(gettext-runtime_ARGS) gettext-runtime_ARGS= lib . endif . if ${gettext-runtime_ARGS:Mlib} +BUILD_DEPENDS+= gettext-runtime>=0.22_1:devel/gettext-runtime LIB_DEPENDS+= libintl.so:devel/gettext-runtime . endif . if ${gettext-runtime_ARGS:Mbuild} -BUILD_DEPENDS+= gettext:devel/gettext-runtime +BUILD_DEPENDS+= gettext-runtime>=0.22_1:devel/gettext-runtime . endif . if ${gettext-runtime_ARGS:Mrun} -RUN_DEPENDS+= gettext:devel/gettext-runtime +RUN_DEPENDS+= gettext-runtime>=0.22_1:devel/gettext-runtime . endif .endif diff --git a/devel/gettext-runtime/Makefile b/devel/gettext-runtime/Makefile index 618340e867f9..1e57b4fb24d7 100644 --- a/devel/gettext-runtime/Makefile +++ b/devel/gettext-runtime/Makefile @@ -1,43 +1,43 @@ # NOTE: before committing to this port, contact portmgr to arrange for an # experimental ports run. Untested commits may be backed out at portmgr's # discretion. PORTNAME= gettext-runtime -PORTREVISION= 0 +PORTREVISION= 1 COMMENT= GNU gettext runtime libraries and programs WWW= https://www.gnu.org/software/gettext/ LICENSE= LGPL21+ GPLv3+ LICENSE_COMB= multi LICENSE_FILE_LGPL21+ = ${WRKSRC}/intl/COPYING.LIB LICENSE_FILE_GPLv3+ = ${WRKSRC}/../COPYING .include "${.CURDIR}/../gettext/Makefile.common" USES= charsetfix cpe iconv libtool tar:xz USE_LDCONFIG= yes CPE_PRODUCT= gettext CPE_VENDOR= gnu GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-csharp --disable-java --with-included-gettext \ ac_cv_lib_rt_sched_yield=no INSTALL_TARGET= install-strip TEST_TARGET= check WRKSRC_SUBDIR= gettext-runtime DATADIR= ${PREFIX}/share/gettext DOCSDIR= ${PREFIX}/share/doc/gettext INFO= autosprintf OPTIONS_DEFINE= DOCS .include .if ${OPSYS} == DragonFly CONFIGURE_ARGS+=--disable-threads .endif .include diff --git a/devel/gettext-runtime/files/patch-intl_osdep.c b/devel/gettext-runtime/files/patch-intl_osdep.c new file mode 100644 index 000000000000..1f1825303b65 --- /dev/null +++ b/devel/gettext-runtime/files/patch-intl_osdep.c @@ -0,0 +1,28 @@ +--- intl/osdep.c.orig 2019-05-11 11:29:32 UTC ++++ intl/osdep.c +@@ -18,6 +18,25 @@ + # include "intl-exports.c" + #elif defined __EMX__ && !defined __KLIBC__ + # include "os2compat.c" ++#elif defined __FreeBSD__ ++#include ++#include ++#include ++#include ++static __attribute__((constructor)) void ++libintl_init (void) ++{ ++#if __FreeBSD_version >= 1400094 ++ /* We don't link with libpthread in order to avoid the overhead for ++ non-threaded programs. Instead we dlopen it with RTLD_NOLOAD here ++ to ensure it is initialised when present. */ ++ (void) dlopen ("libpthread.so", RTLD_LAZY | RTLD_GLOBAL | RTLD_NOLOAD); ++#else ++ /* For older versions this hack also triggers libpthread ++ initialisation. */ ++ (void) pthread_self (); ++#endif ++} + #else + /* Avoid AIX compiler warning. */ + typedef int dummy;