4

这就是我所做的:

# Install lua
curl -R -O http://www.lua.org/ftp/lua-5.2.2.tar.gz
tar zxf lua-5.2.2.tar.gz
cd lua-5.2.2
sudo make linux install

# build vim
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev mercurial
sudo apt-get remove vim vim-runtime gvim
sudo apt-get remove vim-tiny vim-common vim-gui-common
cd ~
hg clone https://code.google.com/p/vim/
cd vim
./configure --with-features=huge \
            --enable-rubyinterp \
            --enable-pythoninterp \
            --with-python-config-dir=/usr/lib/python2.7-config \
            --enable-perlinterp \
            --enable-gui=gtk2 --enable-cscope --prefix=/usr \
            --enable-luainterp \
            --with-lua-prefix=/usr/local/bin/lua
make VIMRUNTIMEDIR=/usr/share/vim/vim74
sudo make install

./configure步骤返回:

checking --enable-luainterp argument... yes
checking --with-lua-prefix argument... /usr/local/bin/lua
checking --with-luajit... no
checking for lua... (cached) /usr/local/bin/lua
checking Lua version... (cached) 5.2
checking if lua.h can be found in /usr/local/bin/lua/include... no
checking if lua.h can be found in /usr/local/bin/lua/include/lua5.2... no

我可以验证在那些位置找不到 lua.h,但我不知道在哪里可以找到它。

4

2 回答 2

8

编辑

我又试了一次,遇到了问题,发现了一个vim-nox已经支持 vim 的包。

原始答案

我不完全确定我最终是如何做到的,但感谢@wrikken 关于标题的提示。

# Install lua from binaries (these are out-of-date but at least they worked).
sudo apt-get install lua50 liblua50-dev liblualib50-dev

# Remove old vims
sudo apt-get remove vim vim-runtime gvim
sudo apt-get remove vim-tiny vim-common vim-gui-common

# Download and build a new vim
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev mercurial
cd ~
hg clone https://code.google.com/p/vim/
cd vim
cd ~/vim
./configure --with-features=huge \                                            
            --enable-rubyinterp \
            --enable-pythoninterp \
            --with-python-config-dir=/usr/lib/python2.7-config \
            --enable-perlinterp \
            --enable-gui=gtk2 --enable-cscope --prefix=/usr \
            --enable-luainterp \
            --with-lua-prefix=/usr/local

此时,查看./configure的输出,发现它找到了lua.h。如果没有,找出它在哪里(恐怕我不记得它在哪里了)。在 /usr/local 中使用 eg 符号链接到它,sudo ln -s ../lua.h然后重新运行 ./configure。

最后:

sudo make VIMRUNTIMEDIR=/usr/share/vim/vim74       
sudo make install

如果它仍然不起作用,请在某个地方的论坛上发帖,然后去户外散步。你会发现它突然开始表现。

于 2013-10-20T08:28:19.977 回答
4

什么对我有用:

sudo apt-get install liblua5.1-dev

将所有文件复制/usr/include/lua5.1//usr/include/lua5.1/include/

sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.1.so /usr/local/lib/liblua.so

转到 vim 源文件夹

 cd src
 make distclean
 clear
 ./configure --with-features=huge --enable-cscope --enable-pythoninterp=yes --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --enable-multibyte --enable-fontset --enable-gui=gnome2 --disable-netbeans --enable-luainterp=yes --with-lua-prefix=/usr/include/lua5.1 --enable-largefile --enable-rubyinterp
 sudo make
 sudo make install

这也将安装 GUI 版本,--enable-gui=gnome2如果您只在命令行中使用它,请删除它。

其中大部分是我在这里找到的

于 2014-05-07T10:36:20.117 回答