Bug 218194

Summary: Mk/Uses/go.mk uses ${LOCALBASE} instead of ${PREFIX} in do-install target
Product: Ports & Packages Reporter: Athanasios Douitsis <aduitsis>
Component: Ports FrameworkAssignee: Julien Laffaye <jlaffaye>
Status: New ---    
Severity: Affects Many People CC: ports-bugs, woodsb02
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Athanasios Douitsis 2017-03-28 21:07:50 UTC
(Apologies if I have figured something wrong in this)

In Mk/Uses/go.mk do-install target, line 88 says:

	${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${_TARGET:T} {STAGEDIR}/${LOCALBASE}/bin; \

In many cases, one wants to install in different places than ${LOCALBASE}, which if left unchanged will default to /usr/local. 

Example 1 is when running "port test", which will try to set ${PREFIX} directly, but leave ${LOCALBASE} untouched. So, running 'port test' in a USES=go port and with the default do-install target will cause failure during the install phase.

Example 2 is running 'make clean; make package PREFIX=/var/tmp/`make -V PORTNAME`', as suggested in https://www.freebsd.org/doc/en/books/porters-handbook/porting-prefix.html. Again, changing ${PREFIX} does not change the install location which is still /usr/local and the make package command fails.

I respectfully submit that perhaps ${LOCALBASE} should be changed to ${PREFIX}.
Comment 1 Ben Woods freebsd_committer 2018-01-06 06:47:05 UTC
Assign to go maintainer.