Index: Mk/bsd.port.mk =================================================================== --- Mk/bsd.port.mk +++ Mk/bsd.port.mk @@ -1050,7 +1050,8 @@ MINIMAL_PKG_VERSION= 1.17.2 _PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} \ - ${STAGEDIR}${PREFIX} ${WRKDIR}/pkg ${BINARY_LINKDIR} + ${STAGEDIR}${PREFIX} ${WRKDIR}/pkg ${BINARY_LINKDIR} \ + ${PKGCONFIG_LINKDIR} # Ensure .CURDIR contains an absolute path without a trailing slash. Failed # builds can occur when PORTSDIR is a symbolic link, or with something like @@ -1681,6 +1682,13 @@ CONFIGURE_ENV+= PATH=${PATH} . endif +PKGCONFIG_LINKDIR= ${WRKDIR}/.pkgconfig +PKGCONFIG_BASEDIR= /usr/libdata/pkgconfig +. if !${MAKE_ENV:MPKG_CONFIG_LIBDIR=*} && !${CONFIGURE_ENV:MPKG_CONFIG_LIBDIR=*} +MAKE_ENV+= PKG_CONFIG_LIBDIR=${PKGCONFIG_LINKDIR}:${LOCALBASE}/libdata/pkgconfig:${PKGCONFIG_BASEDIR} +CONFIGURE_ENV+= PKG_CONFIG_LIBDIR=${PKGCONFIG_LINKDIR}:${LOCALBASE}/libdata/pkgconfig:${PKGCONFIG_BASEDIR} +. endif + . if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB) && empty(USE_GITHUB:Mnodefault) . if defined(WRKSRC) DEV_WARNING+= "You are using USE_GITHUB and WRKSRC is set which is wrong. Set GH_PROJECT correctly or set WRKSRC_SUBDIR and remove WRKSRC entirely." @@ -2204,11 +2212,11 @@ . if defined(PKG_NOCOMPRESS) PKG_COMPRESSION_FORMAT?= tar . else -.if ${OSVERSION} > 1400000 +. if ${OSVERSION} > 1400000 PKG_COMPRESSION_FORMAT?= tzst -.else +. else PKG_COMPRESSION_FORMAT?= txz -.endif +. endif . endif # where pkg(8) stores its data @@ -2609,12 +2617,12 @@ PKGLATESTREPOSITORY?= ${PACKAGES}/Latest PKGBASE?= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX} PKGLATESTFILE= ${PKGLATESTREPOSITORY}/${PKGBASE}${PKG_SUFX} -.if ${PKG_COMPRESSION_FORMAT} == txz +. if ${PKG_COMPRESSION_FORMAT} == txz PKGOLDLATESTFILE= ${PKGLATESTREPOSITORY}/${PKGBASE}.${PKG_COMPRESSION_FORMAT} # Temporary workaround to be deleted once every supported version of FreeBSD # have a bootstrap which handles the pkg extension. PKGOLDSIGFILE= ${PKGLATESTREPOSITORY}/${PKGBASE}.${PKG_COMPRESSION_FORMAT}.sig -.endif +. endif CONFIGURE_SCRIPT?= configure CONFIGURE_CMD?= ./${CONFIGURE_SCRIPT} @@ -2790,13 +2798,13 @@ # Check the user interaction and legal issues . if !defined(NO_IGNORE) -.for v in ${OSREL} ${OSREL:R} -.for f in ${FLAVOR} -.if defined($f_IGNORE_${OPSYS}_${v}) +. for v in ${OSREL} ${OSREL:R} +. for f in ${FLAVOR} +. if defined($f_IGNORE_${OPSYS}_${v}) IGNORE+= "${${f}_IGNORE_${OPSYS}_${v}}" -.endif -.endfor -.endfor +. endif +. endfor +. endfor . if (defined(IS_INTERACTIVE) && defined(BATCH)) IGNORE= is an interactive port . elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE)) @@ -5147,6 +5155,20 @@ . endif . endif +. if !empty(PKGCONFIG_BASE) +. if !target(create-base-pkgconfig) +create-base-pkgconfig: ${PKGCONFIG_LINKDIR} +. for pcfile in ${PKGCONFIG_BASE:S/$/.pc/} + @if `test -f ${PKGCONFIG_BASEDIR}/${pcfile}`; then \ + ${RLN} ${PKGCONFIG_BASEDIR}/${pcfile} ${PKGCONFIG_LINKDIR}/${pcfile}; \ + else \ + ${ECHO_MSG} "===> Missing \"${pcfile}\" to create a link at \"${PKGCONFIG_LINKDIR}/${pcfile}\" "; \ + ${FALSE}; \ + fi +. endfor +. endif +. endif + . if !empty(BINARY_WRAPPERS) . if !target(create-binary-wrappers) create-binary-wrappers: ${BINARY_LINKDIR} @@ -5256,7 +5278,7 @@ ${_OPTIONS_patch} ${_USES_patch} _CONFIGURE_DEP= patch _CONFIGURE_SEQ= 150:build-depends 151:lib-depends 160:create-binary-alias \ - 161:create-binary-wrappers \ + 161:create-binary-wrappers 170:create-base-pkgconfig \ 200:configure-message 210:apply-slist \ 300:pre-configure 450:pre-configure-script \ 490:run-autotools-fixup 500:do-configure 700:post-configure \