Page MenuHomeFreeBSD

Use ${USESDIR} instead of ${PORTSDIR}/Mk/Uses
AbandonedPublic

Authored by sunpoet on Mar 19 2018, 2:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 10:46 AM
Unknown Object (File)
Dec 11 2023, 2:17 AM
Unknown Object (File)
Nov 14 2023, 6:24 PM
Unknown Object (File)
Oct 10 2023, 8:43 PM
Unknown Object (File)
Aug 23 2023, 11:31 PM
Unknown Object (File)
May 7 2023, 4:43 AM
Unknown Object (File)
Feb 13 2023, 4:19 PM
Unknown Object (File)
Dec 11 2022, 6:40 AM
Subscribers

Details

Reviewers
ale
brnrd
tz
antoine
Group Reviewers
O5: Ports Framework(Owns No Changed Paths)
portmgr
Summary

Do as other Mk/Uses/*.mk. It fixes r464175.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 15646
Build 15680: arc lint + arc unit

Event Timeline

I wonder why USES+= apache:xx is not enough in the lang/phpXX ports, why is the direct include needed?

I wonder why USES+= apache:xx is not enough in the lang/phpXX ports, why is the direct include needed?

I see now that it's below bsd.port.pre.mk, this is wrong...

It should probably be :



Index: lang/php72/Makefile
===================================================================
--- lang/php72/Makefile (revision 465011)
+++ lang/php72/Makefile (working copy)
@@ -59,6 +59,22 @@

DESTDIRNAME= INSTALL_ROOT

+.include <bsd.port.options.mk>
+
+.if defined(PKGNAMEPREFIX)
+USES+= apache:2.2+
+.if ${PORT_OPTIONS:MAP2FILTER}
+CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
+.else
+CONFIGURE_ARGS+=--with-apxs2=${APXS}
+.endif
+PLIST= ${PKGDIR}/pkg-plist.mod
+PKGMESSAGE= ${PKGDIR}/pkg-message.mod
+MODULENAME= libphp7
+SHORTMODNAME= php7
+WARNING= "!!! If you have a threaded Apache, you must build ${PHP_PORT} with ZTS support to enable thread-safety in extensions !!!"
+.endif
+
.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MCLI}
@@ -81,21 +97,6 @@
--with-fpm-group=${WWWGRP}
.endif

-.if defined(PKGNAMEPREFIX)
-USES+= apache:2.2+
-.include "${PORTSDIR}/Mk/Uses/apache.mk"
-.if ${PORT_OPTIONS:MAP2FILTER}
-CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
-.else
-CONFIGURE_ARGS+=--with-apxs2=${APXS}
-.endif
-PLIST= ${PKGDIR}/pkg-plist.mod
-PKGMESSAGE= ${PKGDIR}/pkg-message.mod
-MODULENAME= libphp7
-SHORTMODNAME= php7
-WARNING= "!!! If you have a threaded Apache, you must build ${PHP_PORT} with ZTS support to enable thread-safety in extensions !!!"
-.endif
-
.if ${PORT_OPTIONS:MEMBED}
PHP_SAPI+= embed
CONFIGURE_ARGS+=--enable-embed

The inclusion of <bsd.port.pre.mk> and apache.mk is dated May 6 2006, at that time that was very likely the correct/only way to to do it. I haven't verified if the behavior is 100% preserved with your patch, but at first sight it seems correct.

I wonder why USES+= apache:xx is not enough in the lang/phpXX ports, why is the direct include needed?

I see now that it's below bsd.port.pre.mk, this is wrong...

It should probably be :
<snip>

This is what I also did in D12398 ?

Additionally, I'm not sure if this is proper. In my ports tree USESDIR is only used by the ports framework, nowhere in the ports.
Additionally it is not documented as a variable you can use in the header/comments of bsd.ports.mk.

OTOH... If portmgr is OK with using USESDIR in ports, I'm not complaining!

OK for me if @antoine is OK with it

antoine requested changes to this revision.Apr 23 2018, 7:34 PM

USES must be before bsd.port.pre.mk inclusion.

This revision now requires changes to proceed.Apr 23 2018, 7:34 PM