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.
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.
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.
(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.
I didn't realize that this patch was conditionally approved; I'll take the PR.
A commit references this bug:
Date: Thu Nov 3 17:38:51 UTC 2016
New revision: 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.
Submitted by: Michael Neumann
Approved by: Kevin Zheng (maintainer)
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)
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.
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.
A commit references this bug:
Date: Thu Nov 3 18:06:34 UTC 2016
New revision: 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.
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.