Date: Thu, 06 Feb 2014 07:44:15 -0000 From: "Ganael LAPLANCHE" <martymac@FreeBSD.org> To: bug-followup@FreeBSD.org Cc: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/184540: emulators/dolphin-emu: New options framework + DEBUG option set = wrong INSTALL_TARGET Message-ID: <20140206072818.M27367@FreeBSD.org> In-Reply-To: <201312160755.rBG7tYv6074177@freefall.freebsd.org> References: <201312160755.rBG7tYv6074177@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. ------=OPENWEBMAIL_ATT_0.499544649458588 Content-Type: text/plain; charset=iso-8859-15 (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 ------=OPENWEBMAIL_ATT_0.499544649458588 Content-Type: text/plain; name="patch-INSTALL_TARGET.txt" Content-Disposition: attachment; filename="patch-INSTALL_TARGET.txt" Content-Transfer-Encoding: base64 LS0tIGJzZC5wb3J0Lm1rLm9yaWcJMjAxNC0wMi0wMyAwODozOTozOS4wMDAwMDAwMDAgKzAxMDAK KysrIGJzZC5wb3J0Lm1rCTIwMTQtMDItMDUgMTg6MTk6MzMuNzg5NDU0MDQxICswMTAwCkBAIC0x MzAxLDYgKzEzMDEsMTUgQEAKIENPTkZJR1VSRV9FTlYrPQlUTVBESVI9IiR7VE1QRElSfSIKIC5l bmRpZiAjIGRlZmluZWQoVE1QRElSKQogCisuaW5jbHVkZSAiJHtQT1JUU0RJUn0vTWsvYnNkLm9w dGlvbnMubWsiCisKKyMgU3RhcnQgb2YgcHJlLW1ha2VmaWxlIHNlY3Rpb24uCisuaWYgIWRlZmlu ZWQoQUZURVJQT1JUTUspICYmICFkZWZpbmVkKElOT1BUSU9OU01LKQorCisuaW5jbHVkZSAiJHtQ T1JUU0RJUn0vTWsvYnNkLnNhbml0eS5tayIKKworX1BSRU1LSU5DTFVERUQ9CXllcworCiAuaWYg ZGVmaW5lZChXSVRIX0RFQlVHX1BPUlRTKQogLmlmICR7V0lUSF9ERUJVR19QT1JUUzpNJHtQS0dP UklHSU59fQogV0lUSF9ERUJVRz0JeWVzCkBAIC0xMzA4LDIwICsxMzE3LDExIEBACiAuZW5kaWYK IAogIyBSZXNldCB2YWx1ZSBmcm9tIGJzZC5vd24ubWsuCi0uaWYgZGVmaW5lZChXSVRIX0RFQlVH KSAmJiAhZGVmaW5lZChXSVRIT1VUX0RFQlVHKQorLmlmIChkZWZpbmVkKFdJVEhfREVCVUcpIHx8 ICFlbXB0eShQT1JUX09QVElPTlM6TURFQlVHKSkgJiYgIWRlZmluZWQoV0lUSE9VVF9ERUJVRykK IFNUUklQPQkjbm9uZQogTUFLRV9FTlYrPQlET05UU1RSSVA9eWVzCiAuZW5kaWYKIAotLmluY2x1 ZGUgIiR7UE9SVFNESVJ9L01rL2JzZC5vcHRpb25zLm1rIgotCi0jIFN0YXJ0IG9mIHByZS1tYWtl ZmlsZSBzZWN0aW9uLgotLmlmICFkZWZpbmVkKEFGVEVSUE9SVE1LKSAmJiAhZGVmaW5lZChJTk9Q VElPTlNNSykKLQotLmluY2x1ZGUgIiR7UE9SVFNESVJ9L01rL2JzZC5zYW5pdHkubWsiCi0KLV9Q UkVNS0lOQ0xVREVEPQl5ZXMKLQogLmlmIGRlZmluZWQoUE9SVFZFUlNJT04pCiAuaWYgJHtQT1JU VkVSU0lPTjpNKlstXyxdKn14ICE9IHgKIElHTk9SRT0JCQlQT1JUVkVSU0lPTiAke1BPUlRWRVJT SU9OfSBtYXkgbm90IGNvbnRhaW4gJy0nICdfJyBvciAnLCcK ------=OPENWEBMAIL_ATT_0.499544649458588--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140206072818.M27367>