vim: add +gtk variant to pair with +gui (#30520)

* vim: add +gtk3 variant to pair with +gui

* address review comments
This commit is contained in:
Ryan Marcellino 2022-05-07 19:49:33 -04:00 committed by GitHub
parent 5ab526185a
commit 89775e32c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,6 +42,7 @@ class Vim(AutotoolsPackage):
variant('python', default=False, description="build with Python")
variant('ruby', default=False, description="build with Ruby")
variant('x', default=False, description="use the X Window System")
variant('gtk', default=False, when='+gui', description="use the GTKv3 gui.")
for _f in _features[1:]:
conflicts('+gui', when='features=' + _f,
@ -61,6 +62,7 @@ class Vim(AutotoolsPackage):
depends_on('libxpm', when="+x")
depends_on('libxt', when="+x")
depends_on('libxtst', when="+x")
depends_on('gtkplus@3:', when="+gtk")
provides('xxd')
@ -88,8 +90,12 @@ def yes_or_no(variant):
else:
args.append("--enable-python3interp=no")
if '+gui' in spec:
args.append("--enable-gui={}".format('gtk3' if '+gtk' in spec else 'auto'))
else:
args.append("--enable-gui=no")
args.extend([
"--enable-gui=" + ('auto' if '+gui' in spec else 'no'),
"--enable-luainterp=" + yes_or_no('lua'),
"--enable-perlinterp=" + yes_or_no('perl'),
"--enable-rubyinterp=" + yes_or_no('ruby'),