I would like to update emulators/dolphin-emu and use the new options framework to handle the DEBUG option (see the attached patch). Unfortunately, with the DEBUG option set to on, INSTALL_TARGET keeps being defined to 'install/strip' while it should be set to 'install'. FYI, including <bsd.port.options.mk> just before <bsd.port.pre.mk> in the port fixes the problem (but that's not a clean way of fixing it :p). Fix: Patch attached with submission follows: How-To-Repeat: Use the attached patch, then : # cd /usr/ports/dolphin-emu && make config => uncheck the DEBUG option # make -V INSTALL_TARGET install/strip => that is OK # make config => check the DEBUG option # make -V INSTALL_TARGET install/strip => still the same, should be 'install'
Class Changed From-To: sw-bug->maintainer-update Fix category (submitter is maintainer) (via the GNATS Auto Assign Tool)
Responsible Changed From-To: freebsd-ports-bugs->martymac Submitter is maintainer and has GNATS access (via the GNATS Auto Assign Tool)
Responsible Changed From-To: martymac->freebsd-ports-bugs Release PR as it is not related to dolphin-emu itself. I think we have a bug somewhere in options handling that prevents INSTALL_TARGET from being defined to the correct by Uses/cmake.mk.
Responsible Changed From-To: freebsd-ports-bugs->martymac Over to maintainer.
Responsible Changed From-To: martymac->freebsd-ports-bugs Again, release PR as it is not related to dolphin-emu itself.
(the original patch included in this PR is no more useful, as Dolphin has now been updated and includes a fix for the described problem. Anyway, the problem still exists, so here is a more detailed explanation) Well, here is what happens : - ${STRIP} is set by default to '-s' by /usr/share/mk/bsd.own.mk - ${INSTALL_TARGET} is defined by Mk/Uses/cmake.mk:70 given ${STRIP} value : if ${STRIP} is not empty, ${INSTALL_TARGET} is forced to 'install/strip'. In my case, the problem is that ${STRIP} is never empty, even when DEBUG is on (through PORT_OPTIONS) - Mk/Uses/cmake.mk is included by Mk/bsd.ports.mk:1518 (within pre-makefile section) - ${STRIP} can be unset by Mk/bsd.ports.mk:1312 (within options section) if DEBUG is on (it currently only handles WITH_DEBUG, not DEBUG through PORT_OPTIONS) This means that if I want to handle DEBUG as a standard PORT_OPTIONS, I can : - patch line 1311 of bsd.ports.mk to handle PORT_OPTIONS, i.e. : -.if defined(WITH_DEBUG) && !defined(WITHOUT_DEBUG) +.if (defined(WITH_DEBUG) || !empty(PORT_OPTIONS:MDEBUG)) && !defined(WITHOUT_DEBUG) - include <bsd.port.options.mk> before <bsd.port.pre.mk> or else ${STRIP} will never be set properly when used by Mk/Uses/cmake.mk The port currently fixes the problem by manually resetting ${INSTALL_TARGET} to 'install' if DEBUG is set. The fix described above would also have worked, but required to patch bsd.ports.mk and include <bsd.port.options.mk> before <bsd.port.pre.mk>, which seems weird, just to handle the DEBUG option. Find attached a patch that removes the need for a fix within the port itself. It handles PORT_OPTIONS as well as moves the section that unsets ${STRIP} (Mk/bsd.ports.mk:1312) from the options section to the beginning of the pre-makefile section. That fixes the problem for emulators/dolphin-emu but I don't know if it can have side-effects for other ports or usage. Also note that handling DEBUG as a standard PORT_OPTIONS will probably need more code, see for example : http://lists.freebsd.org/pipermail/freebsd-ports/2013-November/088064.html -- Ganael LAPLANCHE <ganael.laplanche@martymac.org> http://www.martymac.org | http://contribs.martymac.org FreeBSD: martymac <martymac@FreeBSD.org>, http://www.FreeBSD.org
hmmm? Seems the submitter is the maintainer? So assigning it back to maintainer...
This bug was related to the way the ports' infrastructure handled DEBUG and INSTALL_TARGET. I've just made new tests and it seems to be fixed by now, so I'll close that PR.