Question

This is what I did:

# 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

But the ./configure step returns:

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

I can verify that lua.h can't be found in those locations, but I don't know where it can be found.

Was it helpful?

Solution

Edit

I tried this again, ran into problems, and discovered a package vim-nox that already has vim support.

Original answer

I'm not entirely sure how I did this in the end, but thanks to @wrikken for the tip about headers.

# 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

At this point, check the output of ./configure to see that it found lua.h. If not, find out where it is (I'm afraid I can't remember where it was). Symlink to it in /usr/local with e.g. sudo ln -s ../lua.h and rerun ./configure.

Finally:

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

If it still won't work, post on a forum somewhere and go for a walk in the outdoors. You'll find it suddenly starts to behave.

OTHER TIPS

What worked for me:

sudo apt-get install liblua5.1-dev

copy all files from /usr/include/lua5.1/ to /usr/include/lua5.1/include/

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

Go to the vim source folder

 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

This will also install the GUI version, remove the --enable-gui=gnome2 if you will only use it in the command line.

Most of these I found it in here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top