brew install gnuplot --with-qt --with-x11 not work

2020-07-11 09:25发布

问题:

I tried installing gnuplot on a Mac (Mojave 10.14.2) using homebrew today, and it brew is not accepting --with-qt nor --with-x11

(I tried other variants, such as --with-qt5 and --with-x, with no luck.)

brew options gnuplot did not report any options.

How are we supposed to get the qt and x11 terminals installed on gnuplot now?

回答1:

I contacted the brew maintainer who had most recently modified the gnuplot formula. Brew is no longer allowing options in formulas, so "brew install gnuplot --with-x11" can no longer be done, but "brew install gnuplot" installs the qt terminal and useful terminals from the cairo package, but not the x11 terminal. I caught the formula during a couple of hour window when the formula was broken. It is now working, but with no way to install the x11 terminal. (It might be worthwhile for someone willing to maintain the formula to



回答2:

I don't know the official line/story/explanation, I only worked out the following by experiment. If someone knows better, please let me know and I will delete this.

I just ran brew info gnuplot and the X11 and Qt options were present. I then ran brew update and they are indeed now gone. I noticed that brew info gnuplot now shows Qt as "required".

So, I removed gnuplot with brew rm gnuplot and then installed it again with brew install gnuplot and it installed the required and hitherto missing dependency Qt.

If I now do:

export GNUTERM=qt
gnuplot

It reports:

Terminal type is now 'qt'

and the following throws up a Qt window:

gnuplot> plot sin(x)



回答3:

The homebrew team is removing all options from core formulas. https://github.com/Homebrew/homebrew-core/issues/31510



回答4:

Default brew gnuplot installation on Mojave is broken. The best way to solve this problem would be to install a custom "tap" with a working formula, as described here: https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap

If you just want a quick solution: the following manual recompilation with necessary options works just fine. Here's what brew was reporting for me when installing gnuplot:

$ brew reinstall gnuplot
==> Reinstalling gnuplot 
==> Downloading https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.2.7/gnuplot-5.2.7.tar.gz
==> Downloading from https://versaweb.dl.sourceforge.net/project/gnuplot/gnuplot/5.2.7/gnuplot-5.2.7.tar.gz
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=~/brew/Cellar/gnuplot/5.2.7_1 --with-readline=~/brew/opt/readline --without-tutorial --disable-wxwidgets --with-qt --without-x
==> make
==> make install