Bug 109580 - [patch] math/gnuplot does not include bsd.emacs.mk when emacs is installed
Summary: [patch] math/gnuplot does not include bsd.emacs.mk when emacs is installed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Tobias Kortkamp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-26 23:50 UTC by Nick Barkas
Modified: 2019-01-25 20:36 UTC (History)
2 users (show)

See Also:


Attachments
file.diff (308 bytes, patch)
2007-02-26 23:50 UTC, Nick Barkas
no flags Details | Diff
with-lisp.patch (1.06 KB, patch)
2007-03-08 01:32 UTC, Nick Barkas
no flags Details | Diff
no-lisp.patch (1.47 KB, patch)
2007-03-08 01:32 UTC, Nick Barkas
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Barkas 2007-02-26 23:50:04 UTC
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.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-02-26 23:50:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->glewis

Over to maintainer
Comment 2 dfilter service freebsd_committer freebsd_triage 2007-03-07 20:05:53 UTC
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"
Comment 3 Greg Lewis freebsd_committer freebsd_triage 2007-03-07 20:05:59 UTC
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.
Comment 4 Nick Barkas 2007-03-08 01:32:12 UTC
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!
Comment 5 Greg Lewis freebsd_committer freebsd_triage 2007-03-08 05:19:25 UTC
State Changed
From-To: feedback->open

There has to be a better way...
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2008-02-29 01:52:05 UTC
State Changed
From-To: open->analyzed

A commit has been done, but it reportedly does not solve the problem.
Comment 7 Dominic Fandrey freebsd_committer freebsd_triage 2017-02-04 15:21:19 UTC
Adding dependencies conditionally is why we hate autobreak. Emacs support should just been an option.
Comment 8 Walter Schwarzenfeld freebsd_triage 2018-01-12 00:36:36 UTC
Maintainer feedback, please!
Comment 9 Tobias Kortkamp freebsd_committer freebsd_triage 2019-01-25 20:36:53 UTC
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.