Wednesday, August 10, 2022

Building VIM 9 on Ubuntu

I tried building the latest VIM on a Ubuntu system, and it worked, except...

I followed the instructions on the VIM page, which consists of 3 steps:

1) git clone http://...
2) cd vim/src
3) make


This worked, and 8 minutes later, I had a new vim executable.  However, I noticed that the first thing the "make" did was to run the usual "configure" script, which is good, but the thing is, I usually like to pass some args to "configure", such as setting the "prefix" to something under my $HOME (so that I can later do "make install" without "sudo")

I also noticed that the resulting binary did not include the GUI.  Now, I think that VIM without a GUI is virtually useless (Yes, I know, some people may disagree with this, but that's irrelevant).  The version of VIM that is already installed on my system (which is old) is the "gtk3" version, and I would like the new version to also be GTK3.  Note that installing Vim9 from a repo is not an option here; I need to compile it myself.

Now, I figured out that if I do:

1) make distclean
2) ./configure ...
3) make

It will re-do the make, using the version of the configure stuff that I ran manually (i.e., it won't run it again).  This is good.  However, despite trying several times, I was not able to make a GUI version of Vim9.  (I keep getting the error message "GUI not enabled at compile time")

Therefore, my questions and comments are:

1) Can someone give me a good list of all the dependencies and packages that I need to install on my Ubuntu 18.04 (Yes, I know that is old, but that also cannot be changed) system so that I can build a GTK3 version of Vim9? (N.B.  This is the most important paragraph of this post; everything else is just information!)

2) I hate the fact that it goes ahead and builds it (which takes a non-trivial amount of time and computing resources - as I said, about 8 to 10 minutes) even though the resulting file is junk (useless).  I know that Vim is not alone in this behavior - other modern programs are like this - where if they figure out that you don't have the necessary dependencies installed, they go ahead and silently fail (i.e., build an output file that is junk).  I wish there were a way - a ./configure option - that would tell it to fail immediately if it is not going to work.

Note: I was using the ./configure option: --enable-gui=gtk3
I also tried adding: --with-x

Note that when I added those options, it did make the resulting file much larger (18 meg vs only 3 meg originally), but it still refused to run the GUI.

No comments: