1
votes

I'm trying to build it myself since the version in debian apt-get is too old for a plugin I need, and this plugin needs lua.

I did apt-get install libtolua-dev

And am runnning the command

./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 \

When I run this command, at some point the program will say checking Lua version... (cached) 5.0.3 when I actually have version 5.2 installed. When I run the configure I get:

checking for lua... (cached) /usr/bin/lua
checking if lua.h can be found in /usr/include... no
checking if lua.h can be found in /usr/include/lua5.0.3... no

So I tried to copy all the files from /usr/include/lua5.2 to a new directory /usr/include/lua5.0.3 Then I'll get

checking if lua.h can be found in /usr/include... no
checking if lua.h can be found in /usr/include/lua5.0.3... yes
checking if link with -L/usr/lib -llua5.0.3 is sane... no

I don't understand how to make it use lua 5.2.

2
That copying was a mistake. You should never mess around in /usr like that. You will only succeed in confusing and/or breaking your system. - Etan Reisner
What version of vim does the plugin need? What version of vim is available from packages? Does vim support lua 5.2? - Etan Reisner
The plugin needs 7.3.885 or later with lua support (it's neocomplete) With apt get I get version 7.3.547-7 I don't know how to find if Vim supports lua 5.2 - Percee
7.4.488 is available in wheezy-backports. - Etan Reisner
I just tried this, but this version still has no lua (-lua) - Percee

2 Answers

2
votes

For those who are interested by a manner that worked for me to build vim with lua support and a solid basis to setup spf13 with full Neocomplete support here are the steps followed to do it:

  1. Download the vim sources from git:

    git clone https://github.com/vim/vim.git
    
  2. Setup dependancies (on ArchLinux, adapt according to your distribution):

    pacman -Suy ruby perl python2 python lua luajit
    
  3. Link luajit headers for the compilation:

    cd /usr/local/include
    sudo ln -sv /usr/include/luajit-2.0/lua.h
    sudo ln -sv /usr/include/luajit-2.0/luaconf.h
    sudo ln -sv /usr/include/luajit-2.0/lualib.h
    sudo ln -sv /usr/include/luajit-2.0/lauxlib.h
    
  4. Run the following commands to build vim (include lua support as desired):

    ./configure --with-features=huge --enable-multibyte --enable-rubyinterp --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config --enable-gui=no --without-x enable-cscope --enable-multibyte --enable-fontset --enable-largefile --enable-cscope --enable-perlinterp --enable-luainterp --enable-fail-if-missing --with-lua-prefix=/usr/local/  --with-luajit --prefix=/usr
    
  5. Compile:

    make VIMRUNTIMEDIR=/usr/share/vim/vim80
    
  6. Install Vim:

    sudo make install
    
  7. Use vim --version command to verify lua support (+lua):

    vim --version
    

And that's it!

0
votes

You need to include the --with-lua-prefix=<dir> flag when running configure. This flag tells the configure script where lua is installed. (You could also set the LUA_PREFIX environment variable if you do not pass the flag).


I would also recommend running configure with --enable-fail-if-missing so that the configure script will fail instead of quietly warning that it didn't find a lua config directory or executable.