When installing math/gnuplot on a machine with emacs or xemacs installed, the port will attempt to install some lisp files. USE_EMACS is set conditionally based on the presence of emacs or xemacs binaries, and having USE_EMACS set is what includes bsd.emacs.mk. However, bsd.emacs.mk does not seem to ever be loaded, and thus variables such as EMACS_SITE_LISPDIR are not set. The packing list incorrectly includes %%EMACS_SITE_LISPDIR%%/gnuplot-gui.el and %%EMACS_SITE_LISPDIR%%/gnuplot.el (without substituting), and gnuplot-gui.el and gnuplot.el get installed in ${PREFIX} rather than ${PREFIX}/${EMACS_SITE_LISPDIR} I think this might be because USE_EMACS is only conditionally set after bsd.port.pre.mk is included in the makefile. Portlint does complain about the fact that EMACS_PORT_NAME is set after including bsd.port.pre.mk. Fix: This patch does something similar to what is done in net/gnu-radius--explicitly includes bsd.emacs.mk if it is needed. A better way to solve this problem may be to set USE_EMACS, EMACS_PORT_NAME, EMACS_NO_BUILD_DEPENDS, and EMACS_NO_RUN_DEPENDS unconditionally, before including bsd.port.pre.mk, but only add --with-lisp-files to the configure args and install the .el files if emacs or xemacs is actually installed on the system. Patch attached with submission follows: How-To-Repeat: Try to make install or make package for math/gnuplot on a system with emacs installed.
Responsible Changed From-To: freebsd-ports-bugs->glewis Over to maintainer
glewis 2007-03-07 20:05:47 UTC FreeBSD ports repository Modified files: math/gnuplot Makefile Log: . (Potentially) set USE_EMACS before we include bsd.port.pre.mk, not after, so that we pick up bsd.emacs.mk. PR: 109580 Revision Changes Path 1.66 +2 -2 ports/math/gnuplot/Makefile _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->feedback I've committed a change that sets USE_EMACS before it includes bsd.ports.pre.mk, which should also fix this. Please give this a try.
The change committed today does not fully resolve the problem. The test for emacs (.if exists(${PREFIX}/bin/emacs) || exists(${PREFIX}/ bin/xemacs)) occurs before bsd.port.pre.mk is included, so PREFIX is undefined. Therefore unless you have emacs or xemacs installed in / bin, USE_EMACS and other EMACS variables do not get set. However, later on in the Makefile the same test is run again to determine if ${INSTALL_DATA} ${WRKSRC}/lisp/gnuplot*.el ${PREFIX}/$ {EMACS_SITE_LISPDIR} should be executed. Since PREFIX is now defined, it will pass if you have emacs installed. But, since EMACS_SITE_LISPDIR never got defined (due to bsd.emacs.mk never being loaded by USE_EMACS), gnuplot.el and gnuplot-gui.el get installed into PREFIX. These files are not accounted for at all in the packing list for the port, so in addition to being in the wrong place, they aren't removed when the port is removed. I tested an idea I mentioned when I opened the PR, but it doesn't seem to work: if USE_EMACS and the other EMACS variables are always defined, but the port adds --without-lisp-files to the configure arguments if emacs isn't installed, gnuplot's build process seems to install .el files itself anyway. Perhaps this is because of various environmental variables set by bsd.emacs.mk. I can't find a way to get gnuplot to behave correctly with emacs installed other than by reverting the last commit and applying the patch I initially submitted with the PR. I do think explicitly including bsd.emacs.mk like my patch does is pretty ugly though. I also discovered that if my patch is used, the port will install some additional .el and .elc files not accounted for in the packing list. The first patch attached below will do the same thing my original patch did, which is ugly but seems to work, and also updates the packing list to account for those extra files. As an alternative, the second patch entirely removes support for installing these emacs related lisp files. This seems to work well, and simplifies things greatly!
State Changed From-To: feedback->open There has to be a better way...
State Changed From-To: open->analyzed A commit has been done, but it reportedly does not solve the problem.
Adding dependencies conditionally is why we hate autobreak. Emacs support should just been an option.
Maintainer feedback, please!
The bug is very old and all patches here no longer apply to the port. There is nothing Emacs related in pkg-plist anymore and ports are staged now, so I'm assuming that this is fixed or no longer relevant.