【发布时间】:2019-06-15 05:39:35
【问题描述】:
我今天尝试使用自制软件在 Mac (Mojave 10.14.2) 上安装 gnuplot,但 brew 不接受 --with-qt 和 --with-x11
(我尝试了其他变体,例如 --with-qt5 和 --with-x,但没有运气。)
酿造选项 gnuplot 没有报告任何选项。
我们现在应该如何在 gnuplot 上安装 qt 和 x11 终端?
【问题讨论】:
我今天尝试使用自制软件在 Mac (Mojave 10.14.2) 上安装 gnuplot,但 brew 不接受 --with-qt 和 --with-x11
(我尝试了其他变体,例如 --with-qt5 和 --with-x,但没有运气。)
酿造选项 gnuplot 没有报告任何选项。
我们现在应该如何在 gnuplot 上安装 qt 和 x11 终端?
【问题讨论】:
经过多次尝试,对我来说唯一的方法是删除 gnuplot 并使用自制软件重新安装。但是如果我做了brew install gnuplot 我得到/usr/local 不可写的错误,我无法将权限更改为/usr/local。所以我使用了here的方法。
所以对我有用的顺序是:
使用取决于安装方式的方法卸载 gnuplot。
使用卸载自制软件
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
重新安装自制软件:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
使用安装 gnuplot
brew install gnuplot
【讨论】:
Mojave 上的默认 brew gnuplot 安装已损坏。解决此问题的最佳方法是安装带有工作公式的自定义“tap”,如下所述:https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap
如果您只是想要一个快速的解决方案:以下带有必要选项的手动重新编译可以正常工作。以下是安装 gnuplot 时 brew 为我报告的内容:
$ 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
? ~/brew/Cellar/gnuplot/5.2.7_1: 48 files, 2.9MB, built in 1 minute 47 seconds
卸载 gnuplot,下载软件包,根据自己的喜好进行配置,然后手动重新安装到 brew 位置:
brew uninstall gnuplot
### Downloading sources
mkdir ~/src
cd ~/src
wget https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.2.7/gnuplot-5.2.7.tar.gz
tar zxvf gnuplot-5.2.7.tar.gz
cd gnuplot-5.2.7
### Configuring with x11
./configure --disable-silent-rules --prefix=~/brew/Cellar/gnuplot/5.2.7_1 --with-readline=~/brew/opt/readline --without-tutorial --with-cairo --with-qt --with-x
### Uninstall gnuplot from brew and install the substitute
make -j
make install # installs to the same location where brew would
brew link gnuplot
【讨论】:
自制团队正在从核心公式中删除所有选项。 https://github.com/Homebrew/homebrew-core/issues/31510
【讨论】:
我联系了最近修改 gnuplot 公式的 brew 维护人员。 Brew 不再允许公式中的选项,因此无法再执行“brew install gnuplot --with-x11”,但“brew install gnuplot”会安装 cairo 包中的 qt 终端和有用的终端,但不能安装 x11 终端。当公式被打破时,我在几个小时的窗口中抓住了公式。它现在可以工作,但无法安装 x11 终端。 (对于愿意维护公式的人来说,这可能是值得的
【讨论】:
我不知道官方的台词/故事/解释,我只是通过实验得出以下结论。如果有人知道更好,请告诉我,我会删除。
我刚刚运行 brew info gnuplot 并且出现了 X11 和 Qt 选项。然后我跑了brew update,他们现在确实走了。我注意到brew info gnuplot 现在将Qt 显示为“必需”。
所以,我用brew rm gnuplot 删除了gnuplot,然后用brew install gnuplot 再次安装它,它安装了所需的和迄今为止缺少的依赖项Qt。
如果我现在这样做:
export GNUTERM=qt
gnuplot
它报告:
Terminal type is now 'qt'
下面会弹出一个Qt 窗口:
gnuplot> plot sin(x)
【讨论】: