Patch 8.2.2439

23 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 31, 2021, 10:46:58 AM1/31/21
to vim...@googlegroups.com

Patch 8.2.2439
Problem: Not easy to figure out what packages to get when installing Vim on
a new Ubuntu system.
Solution: Mention explicit commands that are easy to follow.
Files: src/INSTALL


*** ../vim-8.2.2438/src/INSTALL 2020-07-14 23:02:38.184781049 +0200
--- src/INSTALL 2021-01-31 16:42:47.262795582 +0100
***************
*** 39,51 ****
to disable the GUI and X11. If you don't have GUI libraries and/or X11, these
features will be disabled automatically.

See the start of Makefile for more detailed instructions about how to compile
Vim.

If you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS
before starting configure. Example:

! env CFLAGS=-I/usr/local/include LIBS=-lm make

This is only needed for things that configure doesn't offer a specific argument
for or figures out by itself. First try running configure without extra
--- 39,91 ----
to disable the GUI and X11. If you don't have GUI libraries and/or X11, these
features will be disabled automatically.

+ To built Vim on Ubuntu from scratch on a clean system using git:
+ Install tools required to be able to get and build Vim:
+ % sudo apt install git
+ % sudo apt install make
+ % sudo apt install clang
+
+ Build Vim with default features:
+ % git clone https://github.com/vim/vim.git
+ % cd vim/src
+ % make
+
+ Run tests to check there are no problems:
+ % make test
+
+ Install Vim in /usr/local:
+ % sudo make install
+
+ Add X windows clipboard support (also needed for GUI):
+ % sudo apt install libxt-dev
+ % make reconfig
+
+ Add GUI support (ignore compiler warnings):
+ % sudo apt install libgtk2.0-dev
+ % make reconfig
+
+ Add Python 3 support:
+ % sudo apt install libpython3-dev
+ Uncomment this line in Makefile:
+ "CONF_OPT_PYTHON3 = --enable-python3interp"
+ % make reconfig
+
+ Debugging:
+ % sudo apt install valgrind
+ Uncomment this line in Makefile:
+ CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
+ % make reconfig
+ % make test_{test-name}
+ See output in testdir/valgrind.test_{test-name}
+
+
See the start of Makefile for more detailed instructions about how to compile
Vim.

If you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS
before starting configure. Example:

! env CFLAGS=-I/usr/local/include LIBS=-lm make

This is only needed for things that configure doesn't offer a specific argument
for or figures out by itself. First try running configure without extra
*** ../vim-8.2.2438/src/version.c 2021-01-31 14:45:56.925141860 +0100
--- src/version.c 2021-01-31 16:44:55.610336638 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2439,
/**/

--
A KNIGHT rides into shot and hacks him to the ground. He rides off.
We stay for a moment on the glade. A MIDDLE-AGED LADY in a C. & A.
twin-set emerges from the trees and looks in horror at the body of her
HUSBAND.
MRS HISTORIAN: FRANK!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

James McCoy

unread,
Jan 31, 2021, 11:33:41 AM1/31/21
to vim...@googlegroups.com
On Sun, Jan 31, 2021 at 04:46:51PM +0100, Bram Moolenaar wrote:
>
> Patch 8.2.2439
> Problem: Not easy to figure out what packages to get when installing Vim on
> a new Ubuntu system.
> Solution: Mention explicit commands that are easy to follow.
> Files: src/INSTALL
>
>
> *** ../vim-8.2.2438/src/INSTALL 2020-07-14 23:02:38.184781049 +0200
> --- src/INSTALL 2021-01-31 16:42:47.262795582 +0100
> ***************
> *** 39,51 ****
> [...]
> +
> + Add GUI support (ignore compiler warnings):
> + % sudo apt install libgtk2.0-dev

This should really be libgtk-3-dev. GTK+2 has been unsupported for
years and GTK+3 is already going to maintenance mode as work transitions
to GTK+4.

Cheers,
--
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB

Christian Brabandt

unread,
Jan 31, 2021, 12:00:30 PM1/31/21
to vim...@googlegroups.com

On So, 31 Jan 2021, James McCoy wrote:

> On Sun, Jan 31, 2021 at 04:46:51PM +0100, Bram Moolenaar wrote:
> >
> > Patch 8.2.2439
> > Problem: Not easy to figure out what packages to get when installing Vim on
> > a new Ubuntu system.
> > Solution: Mention explicit commands that are easy to follow.
> > Files: src/INSTALL
> >
> >
> > *** ../vim-8.2.2438/src/INSTALL 2020-07-14 23:02:38.184781049 +0200
> > --- src/INSTALL 2021-01-31 16:42:47.262795582 +0100
> > ***************
> > *** 39,51 ****
> > [...]
> > +
> > + Add GUI support (ignore compiler warnings):
> > + % sudo apt install libgtk2.0-dev
>
> This should really be libgtk-3-dev. GTK+2 has been unsupported for

While at it, can we please make gtk3 the default GTK GUI instead of the
old GTK2?

> years and GTK+3 is already going to maintenance mode as work
> transitions to GTK+4.

So while Gnome is dropping the leading major number (GTK version I
believe), GTK continues to use it? Confusing...

Best,
Christian
--
Wer sich der Einsamkeit ergibt, ach! der ist bald allein!
-- Johann Wolfgang von Goethe (Wilhelm Meister)

Bram Moolenaar

unread,
Jan 31, 2021, 12:11:53 PM1/31/21
to vim...@googlegroups.com, James McCoy

James McCoy wrote:

> On Sun, Jan 31, 2021 at 04:46:51PM +0100, Bram Moolenaar wrote:
> >
> > [...]
> > + Add GUI support (ignore compiler warnings):
> > + % sudo apt install libgtk2.0-dev
>
> This should really be libgtk-3-dev. GTK+2 has been unsupported for
> years and GTK+3 is already going to maintenance mode as work transitions
> to GTK+4.

Well, the GTK 2 version works well, while GTK 3 still has a few
drawbacks, I believe it's slower.

Also, that one package does not appear to be sufficient. If I remove
the libgtk2.0-dev package and install libgtk-3-dev:

configure:9420: checking for pkg-config
configure:9438: found /usr/bin/pkg-config
configure:9450: result: /usr/bin/pkg-config
configure:9477: checking --disable-gtktest argument
configure:9487: result: gtk test enabled
configure:9533: checking for GTK -dev package
configure:9611: result: no

Hmm, pkg-config does list "gtk+-3.0", not sure what is wrong...
It seems configure doesn't check for GTK 3 for some reason.
Debugging shell scripts...


--
Error:015 - Unable to exit Windows. Try the door.

Christian Brabandt

unread,
Jan 31, 2021, 12:27:56 PM1/31/21
to vim...@googlegroups.com

On So, 31 Jan 2021, Bram Moolenaar wrote:

>
> James McCoy wrote:
>
> > On Sun, Jan 31, 2021 at 04:46:51PM +0100, Bram Moolenaar wrote:
> > >
> > > [...]
> > > + Add GUI support (ignore compiler warnings):
> > > + % sudo apt install libgtk2.0-dev
> >
> > This should really be libgtk-3-dev. GTK+2 has been unsupported for
> > years and GTK+3 is already going to maintenance mode as work transitions
> > to GTK+4.
>
> Well, the GTK 2 version works well, while GTK 3 still has a few
> drawbacks, I believe it's slower.
>
> Also, that one package does not appear to be sufficient. If I remove
> the libgtk2.0-dev package and install libgtk-3-dev:
>
> configure:9420: checking for pkg-config
> configure:9438: found /usr/bin/pkg-config
> configure:9450: result: /usr/bin/pkg-config
> configure:9477: checking --disable-gtktest argument
> configure:9487: result: gtk test enabled
> configure:9533: checking for GTK -dev package
> configure:9611: result: no
>
> Hmm, pkg-config does list "gtk+-3.0", not sure what is wrong...
> It seems configure doesn't check for GTK 3 for some reason.
> Debugging shell scripts...

For GTK3 you explicitly need to call configure with the --gui=gtk3
argument, else it will always try to use the gtk2 toolkit and fail if
that is not available.

Best,
Christian
--
Einen Raucher zu küssen muß so ähnlich schmecken, wie an einem
Aschenbecher zu lecken.

Ingo Karkat

unread,
Jan 31, 2021, 12:55:43 PM1/31/21
to vim...@googlegroups.com, Bram Moolenaar
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 31/01/2021 18:11, Bram Moolenaar wrote:
>
> James McCoy wrote:
>
>> On Sun, Jan 31, 2021 at 04:46:51PM +0100, Bram Moolenaar wrote:
>>>
>>> [...] + Add GUI support (ignore compiler warnings): + % sudo
>>> apt install libgtk2.0-dev
>>
>> This should really be libgtk-3-dev. GTK+2 has been unsupported
>> for years and GTK+3 is already going to maintenance mode as work
>> transitions to GTK+4.
>
> Well, the GTK 2 version works well, while GTK 3 still has a few
> drawbacks, I believe it's slower.

One drawback of GTK3 is that Vim doesn't support a vertical button
layout for dialogs (:set guioptions+=v); I recently discovered and
reported that (https://github.com/vim/vim/issues/7746). That's why I
switched back to GTK2. Regarding the slowness, I noticed visibly
slower screen redraw in GTK2 (e.g. after GVIM becomes the active
foreground application again), but only on my Ubuntu 20.04 machine,
not on 16.04.

> Also, that one package does not appear to be sufficient. If I
> remove the libgtk2.0-dev package and install libgtk-3-dev:
>
> configure:9420: checking for pkg-config configure:9438: found
> /usr/bin/pkg-config configure:9450: result: /usr/bin/pkg-config
> configure:9477: checking --disable-gtktest argument configure:9487:
> result: gtk test enabled configure:9533: checking for GTK -dev
> package configure:9611: result: no

Instead of explicitly installing the compiler and various dev
packages, I have been using
$ apt-get build-dep vim-gtk3
- From the apt-get man page: "build-dep causes apt-get to install/remove
packages in an attempt to satisfy the build dependencies for a source
package".

So if you want a Vim with similar build options as the distribution's
version, this seems to be a really convenient and future-proof
alternative command. (You still need "apt install git", as Ubuntu
doesn't know how you obtain the source code.)

(This is for Ubuntu 20.04, which ships the GTK3 variant by default. On
Ubuntu 16.04, it used to be build-dep vim-gnome, for the GTK2 variant.)

Interestingly, build-dep installs gcc as the compiler - I don't even
have clang installed; always compiled Vim with gcc.

> Hmm, pkg-config does list "gtk+-3.0", not sure what is wrong... It
> seems configure doesn't check for GTK 3 for some reason. Debugging
> shell scripts...

- -- regards, ingo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJgFu8OAAoJEA7ziXlAzQ/vBCkH+wczQLafXuuzDsuxsOMcasGx
49AenMfu1XpkDhDz9RTfh3ZzdX8XVYWNa5d4vL2ZgGIMtmC54GsCmAO68+hmutuF
IzSy5wva6boqxm3GsJU/B9bPDqHNCjTYDm57+0dlFT6L/RbeKDwgrv0KMuj5ydpX
oWzqBZIKP/cPoN/4dpC6eP05ag51FTTb5BurgK71Lj1JL/Piijg/PVHS/8ZxhVM8
NJw6lShM9j5tKRC1opX6Dr/nMGLuUax38Xr6GK9Nh2+2fqQvWHTTeIwiBDl61aDb
qwsoDX5gugeWXSY/yVwJP9s23mPE/zQeKylpk83Ra2XtGmMlkuglOkFCZu+SrmI=
=JvtC
-----END PGP SIGNATURE-----

Bram Moolenaar

unread,
Jan 31, 2021, 3:00:57 PM1/31/21
to vim...@googlegroups.com, Christian Brabandt

> On So, 31 Jan 2021, James McCoy wrote:
>
> > On Sun, Jan 31, 2021 at 04:46:51PM +0100, Bram Moolenaar wrote:
> > >
> > > Patch 8.2.2439
> > > Problem: Not easy to figure out what packages to get when installing Vim on
> > > a new Ubuntu system.
> > > Solution: Mention explicit commands that are easy to follow.
> > > Files: src/INSTALL
> > >
> > >
> > > *** ../vim-8.2.2438/src/INSTALL 2020-07-14 23:02:38.184781049 +0200
> > > --- src/INSTALL 2021-01-31 16:42:47.262795582 +0100
> > > ***************
> > > *** 39,51 ****
> > > [...]
> > > +
> > > + Add GUI support (ignore compiler warnings):
> > > + % sudo apt install libgtk2.0-dev
> >
> > This should really be libgtk-3-dev. GTK+2 has been unsupported for
>
> While at it, can we please make gtk3 the default GTK GUI instead of the
> old GTK2?

Does GTK3 really work better than GTK2? Last I heard GTK3 still had
performance problems. I haven't seen any problems reported for GTK2.

> > years and GTK+3 is already going to maintenance mode as work
> > transitions to GTK+4.

There is a difference between what the developers say and what the
actual observed code quality is. There is always a strong tendency to
point at the latest version and say how wonderful it is (just need to
fix a few bugs!). And mentioning "maintenance mode" and "no longer
maintained" as if that means the code is broken. Quite often it works
better than the latest (unfinished) version.

Look at this from the point of view of an end-user, who just want things
to work.


--
Microsoft: "Windows NT 4.0 now has the same user-interface as Windows 95"
Windows 95: "Press CTRL-ALT-DEL to reboot"
Windows NT 4.0: "Press CTRL-ALT-DEL to login"

Bram Moolenaar

unread,
Jan 31, 2021, 3:00:58 PM1/31/21
to vim...@googlegroups.com, Christian Brabandt
Yeah, the configure script had a few half-finished changes for GTK3,
made by someone who copy-pasted GTK2 checks without considering all
situations.

I made patch 8.2.2442 which hopefully fixes this. Now when GTK2 is not
installed and GTK3 is, then it should automatically pick up GTK3. The
implementation is a bit hacky because I feel uncomfortable changing this
shell script stuff.

--
This is an airconditioned room, do not open Windows.

Bram Moolenaar

unread,
Jan 31, 2021, 3:00:59 PM1/31/21
to vim...@googlegroups.com, Ingo Karkat, Bram Moolenaar

Ingo Karkat wrote:

> Instead of explicitly installing the compiler and various dev
> packages, I have been using
> $ apt-get build-dep vim-gtk3
> - From the apt-get man page: "build-dep causes apt-get to install/remove
> packages in an attempt to satisfy the build dependencies for a source
> package".
>
> So if you want a Vim with similar build options as the distribution's
> version, this seems to be a really convenient and future-proof
> alternative command. (You still need "apt install git", as Ubuntu
> doesn't know how you obtain the source code.)

It's a safe alternative, but most likely will pull in more than what you
need.

> (This is for Ubuntu 20.04, which ships the GTK3 variant by default. On
> Ubuntu 16.04, it used to be build-dep vim-gnome, for the GTK2 variant.)
>
> Interestingly, build-dep installs gcc as the compiler - I don't even
> have clang installed; always compiled Vim with gcc.

Somehow gcc is a dependency of one of the packages. Might very well be
the gtk one. Before building the X11 and GUI version running libvterm
tests failed because they strangely depend on gcc (through libtool,
which appears to be a messy shell script with gcc hard coded).

Clang is often a better compiler than gcc (better error message,
faster), but it apparently can't completely replace it.


--
The software said it requires Windows 95 or better, so I installed Linux.
Reply all
Reply to author
Forward
0 new messages