My PREFIX is /opt, but trying to build the port displayed errors related to /usr/local It looks like the port uses a do-patch target to replace references to PREFIX with the values of the PREFIX. Seems like it does not get them all. The better way of achieving the same is to simply tell make(1) to prefer values of environment variables over those found in the Makefile: --- Makefile (revision 489054) +++ Makefile (working copy) @@ -16,7 +16,6 @@ NO_BUILD= yes NO_ARCH= yes -do-patch: - ${REINPLACE_CMD} 's%\$$(PREFIX)%${STAGEDIR}/$$(PREFIX)%g' ${WRKSRC}/Makefile +MAKE_ARGS+= -e .include <bsd.port.mk> With the above change, PREFIX used by make will be that found in the MAKE_ENV...
I apologize, the do-patch is still necessary (though, maybe, it should be post-patch -- in case any real patches are added to the port later). Adding MAKE_ARGS=-e makes the port PREFIX-safe - and is necessary too.
Thank you for the report Mikhail Please include the proposed changes as an attachment, that way we (I) can set maintainer-approval on it as it is a blanket approved change
Created attachment 200734 [details] Add -e to MAKE_ARGS for PREFIX from the environment to overwrite the value set inside Makefile
Mikhail, thanks for the patch! But I think it is not necessary: Try: $ make PREFIX=/opt # make PREFIX=/opt install chyves will get installed into /opt then.
(In reply to Lars Engels from comment #4) > $ make PREFIX=/opt That's because you have it on command line (which seems to be passed to the child make). If you have it set in /etc/make.conf, you'll get the error I got...
A commit references this bug: Author: lme Date: Wed Jan 9 13:05:32 UTC 2019 New revision: 489777 URL: https://svnweb.freebsd.org/changeset/ports/489777 Log: sysutils/chyves: Fix installation to custom PREFIX PR: 234554 Submitted by: mi@ Changes: head/sysutils/chyves/Makefile
I see. Thanks for your patch!