Bug 212357 - cad/ngspice_rework "Can't open viewport for graphics."
Summary: cad/ngspice_rework "Can't open viewport for graphics."
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: John Marino
Keywords: needs-qa
Depends on:
Reported: 2016-09-03 17:31 UTC by mneumann
Modified: 2016-11-03 18:09 UTC (History)
3 users (show)

See Also:
kevinz5000: maintainer-feedback+


Note You need to log in before you can comment on or make changes to this bug.
Description mneumann 2016-09-03 17:31:40 UTC
When trying to plot signals with ngspice, a message "Can't open viewport for graphics." is shown, when the binary package (pkg ins ngspice_rework) is used on DragonFlyBSD. When compiled from ports, it works (see below for the reason).

I reported this issue to the DragonFlyBSD ports maintainer:


I think this issue occurs as well on FreeBSD. The patch below fixes it for DragonFly (and probably for FreeBSD as well):


The problem is that during package building, X11 is not installed and as such autoconf will not find the appropriate X11 headers. The port should explicitly specify X11 as a dependency in this case.

Note that --enable-xspice should only be passed to CONFIGURATION_ARGS in case the X11 option is actually choosen.
Comment 1 Kevin Zheng 2016-09-03 17:41:36 UTC
Thanks for the report; I'll take a look. Let me try a couple of build options; I'm hesitant to pull in the X11 libraries by default.
Comment 2 John Marino freebsd_committer 2016-10-05 13:46:13 UTC
As a potentially affected party, has there been any progress on this PR?

x11 doesn't have to be the default option, and having it off would pass --disable-xspice if the option is correctly defined.
Comment 3 Kevin Zheng 2016-10-06 07:24:31 UTC
(In reply to John Marino from comment #2)
Sorry for the belated response. Thanks for poking me on the PR.

I think enabling X11 by default is reasonable.

I believe the correct configure argument is '--with-x'. '--with-xpsice' is related to additional modeling features. In any case, it looks like the configure script enables X11 by default if it finds it.

Patch as-is is mostly correct. Just need to pass --without-x to disable X11 if the option is turned off.
Comment 4 John Marino freebsd_committer 2016-11-03 17:16:04 UTC
I didn't realize that this patch was conditionally approved; I'll take the PR.
Comment 5 commit-hook freebsd_committer 2016-11-03 17:39:43 UTC
A commit references this bug:

Author: marino
Date: Thu Nov  3 17:38:51 UTC 2016
New revision: 425264
URL: https://svnweb.freebsd.org/changeset/ports/425264

  cad/ngspice_rework: Enable X support by default (introduce X11 option)

  Ngspice built inside a package builder will not have x11 support which
  results in errors such as "Can't open viewport in graphics." when
  trying to plot.

  This change adds the X11 option which is on by default.

  PR:		212357
  Submitted by:	Michael Neumann
  Approved by:	Kevin Zheng (maintainer)

Comment 6 John Marino freebsd_committer 2016-11-03 17:41:36 UTC
Kevin, the arg was (dis|en)able-xspice, not with(out)-xspice.
There were also 4 more XORG dependencies that needed to be added (per synth, which now builds cleanly)
Comment 7 Kevin Zheng 2016-11-03 17:50:36 UTC
Thanks for committing the fix. I believe the 'xspice' option is not related to X11, but rather extended SPICE modeling. I think the line "X11_CONFIGURE_ENABLE=   xspice" should be removed because xspice is enabled by default from the configure script.
Comment 8 John Marino freebsd_committer 2016-11-03 18:03:34 UTC
well, that's why a real patch should have been attached.  Normally a PR wouldn't have progressed with no patch.  I didn't understand they weren't related.
Comment 9 commit-hook freebsd_committer 2016-11-03 18:06:46 UTC
A commit references this bug:

Author: marino
Date: Thu Nov  3 18:06:34 UTC 2016
New revision: 425266
URL: https://svnweb.freebsd.org/changeset/ports/425266

  cad/ngspice_rework: configure xspice unconditionally

  There was confusion about xspice option.  The "x" stands for "extended",
  not x11, and it should always be enabled.  Adjust accordingly.

  PR:		212357

Comment 10 John Marino freebsd_committer 2016-11-03 18:09:04 UTC
okay, it's fixed Kevin.

In the future, please do not use "+" when there is no patch to approve.  "+" means "approved exactly as provided" but no patch was actually provided.  

What should have happened is that either you or michael generate a patch (test it before submitting) then approve it with "+" and then somebody can commit it.