On Wed, Jan 04, 2023 at 09:22:35PM +0000, Klemens Nanni wrote: > net/qbittorrent uses python with MODPY_BUILDDEP=No MODPY_TESTDEP=No. > I've switched it to cmake and the way its Makefile.inc is now means that > lang/python comes before devel/cmake in MODULES. > > I expected this to work without further tweaks since python is just RDEP > but turns out the module still sets do-build and do-install, so cmake > loses unless I manually define it first (and explain with a comment). > > > Is there a reason those targets are still defined? > If not, the following obvious diff makes any MODULES order work, given > MODPY_*DEP=No. > > Feedback? Objection? OK?
This will definitely require a full bulk for testing, considering how many ports use python. Just to be on the safe side. > Index: python.port.mk > =================================================================== > RCS file: /cvs/ports/lang/python/python.port.mk,v > retrieving revision 1.178 > diff -u -p -r1.178 python.port.mk > --- python.port.mk 6 Dec 2022 16:18:16 -0000 1.178 > +++ python.port.mk 4 Jan 2023 21:16:38 -0000 > @@ -356,13 +356,15 @@ MODPY_TEST_TARGET += ${TEST_TARGET} > > # dirty way to do it with no modifications in bsd.port.mk > .if empty(CONFIGURE_STYLE) > -. if !target(do-build) > +. if !target(do-build) && \ > + ${MODPY_BUILDDEP:L} == "yes" Please don't do this. It fits in a line, use a line > do-build: > @${MODPY_BUILD_TARGET} > . endif > > # extra documentation or scripts should be installed via post-install > -. if !target(do-install) > +. if !target(do-install) && \ > + ${MODPY_BUILDDEP:L} == "yes" > do-install: > @${MODPY_INSTALL_TARGET} > . endif > @@ -372,6 +374,7 @@ do-install: > # (possibly with MODPY_PYTEST_ARGS pointed at test dirs/files if the > automatic > # search picks up files in lib/). > . if !target(do-test) && \ > + ${MODPY_TESTDEP:L} == "yes" && \ > (${MODPY_SETUPUTILS:L} == "yes" || ${MODPY_PYTEST:L} == "yes") > do-test: > @${MODPY_TEST_TARGET} > >