Use variables for minvers, partly fixes #4132.

This commit is contained in:
Félix Piédallu 2019-10-25 10:46:53 +02:00
parent 6124be59b7
commit 86c5720375

View file

@ -312,46 +312,49 @@ dl = platform_windows ? no_dep : cc.find_library('dl')
rpc = platform_windows ? cc.find_library('rpcrt4') : no_dep rpc = platform_windows ? cc.find_library('rpcrt4') : no_dep
dbghelp = platform_windows ? cc.find_library('dbghelp') : no_dep dbghelp = platform_windows ? cc.find_library('dbghelp') : no_dep
winsock = platform_windows ? cc.find_library('ws2_32') : no_dep winsock = platform_windows ? cc.find_library('ws2_32') : no_dep
atk_minver = '2.4.0'
atk = dependency('atk', version: '>=2.4.0') atk = dependency('atk', version: '>='+atk_minver)
babl_minver = '0.1.72'
babl = dependency('babl', version: '>=0.1.72') babl = dependency('babl', version: '>='+babl_minver)
cairo_minver = '1.12.2'
cairo = dependency('cairo', version: '>=1.12.2') cairo = dependency('cairo', version: '>='+cairo_minver)
dbus_glib = dependency('dbus-glib-1') dbus_glib = dependency('dbus-glib-1')
# fontconfig_name = platform_windows ? 'fontconfig_win32' : 'fontconfig' # fontconfig_name = platform_windows ? 'fontconfig_win32' : 'fontconfig'
fontconfig_name = 'fontconfig' fontconfig_name = 'fontconfig'
fontconfig = dependency(fontconfig_name, version: '>=2.12.4') fontconfig_minver = '2.12.4'
fontconfig = dependency(fontconfig_name, version: '>='+fontconfig_minver)
freetype2 = dependency('freetype2', version: '>=2.1.7') freetype2_minver = '2.1.7'
freetype2 = dependency('freetype2', version: '>='+freetype2_minver)
gdk_pixbuf = dependency('gdk-pixbuf-2.0', version: '>=2.30.8') gdk_pixbuf_minver = '2.30.8'
gdk_pixbuf = dependency('gdk-pixbuf-2.0', version: '>='+gdk_pixbuf_minver)
gegl = dependency('gegl-0.4', version: '>=0.4.18') gegl_minver = '0.4.18'
gegl = dependency('gegl-0.4', version: '>='+gegl_minver)
gexiv2 = dependency('gexiv2', version: '>=0.10.6') gexiv2_minver = '0.10.6'
gexiv2 = dependency('gexiv2', version: '>='+gexiv2_minver)
gio = dependency('gio-2.0') gio = dependency('gio-2.0')
gio_specific_name = platform_windows ? 'gio-windows-2.0' : 'gio-unix-2.0' gio_specific_name = platform_windows ? 'gio-windows-2.0' : 'gio-unix-2.0'
gio_specific = dependency(gio_specific_name) gio_specific = dependency(gio_specific_name)
glib_version = platform_windows ? '>=2.56.2' : '>=2.54.2' glib_minver = platform_windows ? '2.56.2' : '2.54.2'
glib = dependency('glib-2.0', version: glib_version) glib = dependency('glib-2.0', version: '>='+glib_minver)
conf.set('G_DISABLE_DEPRECATED', glib.version().version_compare('>=2.57')) conf.set('G_DISABLE_DEPRECATED', glib.version().version_compare('>=2.57'))
gobject = dependency('gobject-2.0', version: '>=2.54.2') gobject = dependency('gobject-2.0', version: '>='+glib_minver)
gmodule = dependency('gmodule-no-export-2.0') gmodule = dependency('gmodule-no-export-2.0')
gtk3 = dependency('gtk+-3.0', version: '>=3.16.10') gtk3_minver = '3.16.10'
gtk3 = dependency('gtk+-3.0', version: '>='+gtk3_minver)
harfbuzz = dependency('harfbuzz', version: '>=0.9.19') harfbuzz_minver = '0.9.19'
lcms = dependency('lcms2', version: '>=2.8') harfbuzz = dependency('harfbuzz', version: '>='+harfbuzz_minver)
lcms_minver = '2.8'
libmypaint = dependency('libmypaint', version: '>=1.3.0') lcms = dependency('lcms2', version: '>='+lcms_minver)
libmypaint_minver = '1.3.0'
libmypaint = dependency('libmypaint', version: '>='+libmypaint_minver)
mypaint_brushes = dependency('mypaint-brushes-1.0',version: '>='+libmypaint_minver)
if not libmypaint.version().version_compare('>=1.4.0') if not libmypaint.version().version_compare('>=1.4.0')
libmypaint_warning=''' libmypaint_warning='''
@ -362,19 +365,21 @@ if not libmypaint.version().version_compare('>=1.4.0')
warnings += libmypaint_warning warnings += libmypaint_warning
endif endif
mypaint_brushes = dependency('mypaint-brushes-1.0', version: '>=1.3.0')
if relocatable_bundle if relocatable_bundle
mypaint_brushes_dir = '${gimp_installation_dir}'/'share'/'mypaint-data'/'1.0'/'brushes' mypaint_brushes_dir = '${gimp_installation_dir}'\
/'share'/'mypaint-data'/'1.0'/'brushes'
else else
mypaint_brushes_dir = mypaint_brushes.get_pkgconfig_variable('brushesdir') mypaint_brushes_dir = mypaint_brushes.get_pkgconfig_variable('brushesdir')
endif endif
conf.set_quoted('MYPAINT_BRUSHES_DIR', mypaint_brushes_dir) conf.set_quoted('MYPAINT_BRUSHES_DIR', mypaint_brushes_dir)
pangocairo = dependency('pangocairo', version: '>=1.42.0') pangocairo_minver = '1.42.0'
pangocairo = dependency('pangocairo', version: '>='+pangocairo_minver)
pangoft2 = dependency('pangoft2', version: '>=1.29.4') pangoft2 = dependency('pangoft2', version: '>=1.29.4')
rsvg = dependency('librsvg-2.0', version: '>=2.40.6') rsvg_minver = '2.40.6'
rsvg = dependency('librsvg-2.0', version: '>='+rsvg_minver)
conf.set('PANGO_DISABLE_DEPRECATED',pangocairo.version().version_compare('<1.43')) conf.set('PANGO_DISABLE_DEPRECATED',pangocairo.version().version_compare('<1.43'))
@ -467,7 +472,8 @@ conf.set('HAVE_LIBSOCKET', libsocket.found())
################################################################################ ################################################################################
# Check for extension support # Check for extension support
appstream_glib = dependency('appstream-glib', version: '>=0.7.7') appstream_glib_minver = '0.7.7'
appstream_glib = dependency('appstream-glib', version: '>='+appstream_glib_minver)
libarchive = dependency('libarchive') libarchive = dependency('libarchive')
@ -577,8 +583,10 @@ if x11_target
endif endif
endforeach endforeach
endif endif
conf.set('HAVE_X11_EXTENSIONS_SHAPE_H', x11_target and cc.has_header('X11/extensions/shape.h')) conf.set('HAVE_X11_EXTENSIONS_SHAPE_H',
conf.set('HAVE_X11_XMU_WINUTIL_H', x11_target and cc.has_header('X11/Xmu/WinUtil.h')) x11_target and cc.has_header('X11/extensions/shape.h'))
conf.set('HAVE_X11_XMU_WINUTIL_H',
x11_target and cc.has_header('X11/Xmu/WinUtil.h'))
# Features requiring x11 # Features requiring x11
@ -648,7 +656,8 @@ MIMEtypes += 'image/x-psp'
bz2 = cc.find_library('bz2') bz2 = cc.find_library('bz2')
liblzma = dependency('liblzma', version: '>=5.0.0') liblzma_minver = '5.0.0'
liblzma = dependency('liblzma', version: '>='+liblzma_minver)
ghostscript = cc.find_library('gs', required: get_option('ghostscript')) ghostscript = cc.find_library('gs', required: get_option('ghostscript'))
@ -658,8 +667,10 @@ else
ghostscript = disabler() ghostscript = disabler()
endif endif
libpng_minver = '1.6.25'
libpng = dependency('libpng', version: '>=1.6.25', required: get_option('png')) libpng = dependency('libpng', version: '>='+libpng_minver,
required: get_option('png')
)
if libpng.found() if libpng.found()
MIMEtypes += [ 'image/png', 'image/x-icon'] MIMEtypes += [ 'image/png', 'image/x-icon']
endif endif
@ -674,16 +685,19 @@ if libxpm.found()
MIMEtypes += 'image/x-xpixmap' MIMEtypes += 'image/x-xpixmap'
endif endif
openexr_minver = '1.6.1'
openexr = dependency('OpenEXR', version: '>=1.6.1', required: get_option('openexr')) openexr = dependency('OpenEXR', version: '>='+openexr_minver,
required: get_option('openexr')
)
if openexr.found() if openexr.found()
MIMEtypes += 'image/x-exr' MIMEtypes += 'image/x-exr'
endif endif
webp_minver = '0.6.0'
webp_libs = [ webp_libs = [
dependency('libwebp', version: '>=0.6.0', required: get_option('webp')), dependency('libwebp', version: '>='+webp_minver, required: get_option('webp')),
dependency('libwebpmux', version: '>=0.6.0', required: get_option('webp')), dependency('libwebpmux', version: '>='+webp_minver, required: get_option('webp')),
dependency('libwebpdemux',version: '>=0.6.0', required: get_option('webp')), dependency('libwebpdemux',version: '>='+webp_minver, required: get_option('webp')),
] ]
webp_found = true webp_found = true
foreach lib : webp_libs foreach lib : webp_libs
@ -694,8 +708,10 @@ if webp_found
MIMEtypes += 'image/x-webp' MIMEtypes += 'image/x-webp'
endif endif
libheif_minver = '1.3.2'
libheif = dependency('libheif', version: '>=1.3.2', required: get_option('heif')) libheif = dependency('libheif', version: '>='+libheif_minver,
required: get_option('heif')
)
conf.set('HAVE_LIBHEIF_1_4_0', libheif.version().version_compare('>=1.4.0')) conf.set('HAVE_LIBHEIF_1_4_0', libheif.version().version_compare('>=1.4.0'))
conf.set('HAVE_LIBHEIF_1_6_0', libheif.version().version_compare('>=1.6.0')) conf.set('HAVE_LIBHEIF_1_6_0', libheif.version().version_compare('>=1.6.0'))
@ -717,32 +733,43 @@ if libheif.version().version_compare('==1.5.0') or libheif.version().version_com
warnings += libheif_warning warnings += libheif_warning
endif endif
webkit = dependency('webkit2gtk-4.0', version: '>=2.20.3', required: get_option('webkit')) webkit_minver = '2.20.3'
webkit = dependency('webkit2gtk-4.0', version: '>=' + webkit_minver,
required: get_option('webkit')
)
conf.set('HAVE_WEBKIT', webkit.found()) conf.set('HAVE_WEBKIT', webkit.found())
poppler_minver = '0.69.0'
poppler_data_minver = '0.4.9'
if get_option('poppler') if get_option('poppler')
poppler = [ poppler = [
dependency('poppler-glib', version: '>=0.69.0'), dependency('poppler-glib', version: '>='+poppler_minver),
dependency('poppler-data', version: '>=0.4.9'), dependency('poppler-data', version: '>='+poppler_data_minver),
] ]
else else
poppler = no_dep poppler = no_dep
endif endif
cairopdf_minver = '1.12.2'
cairopdf = dependency('cairo-pdf', version: '>=1.12.2', required: get_option('cairo-pdf')) cairopdf = dependency('cairo-pdf', version: '>='+cairopdf_minver,
required: get_option('cairo-pdf')
)
# PDF import support is a granted feature. # PDF import support is a granted feature.
MIMEtypes += 'application/pdf' MIMEtypes += 'application/pdf'
wmf = dependency('libwmf', version: '>=0.2.8', required: get_option('wmf')) wmf_minver = '0.2.8'
wmf = dependency('libwmf', version: '>='+wmf_minver,
required: get_option('wmf')
)
if wmf.found() if wmf.found()
MIMEtypes += 'image/x-wmf' MIMEtypes += 'image/x-wmf'
endif endif
openjpeg_minver = '2.1.0'
openjpeg = dependency('libopenjp2', version: '>=2.1.0', required: get_option('jpeg2000')) openjpeg = dependency('libopenjp2', version: '>='+openjpeg_minver,
required: get_option('jpeg2000')
)
if openjpeg.found() if openjpeg.found()
MIMEtypes += [ 'image/jp2', 'image/jpeg2000', 'image/jpx', ] MIMEtypes += [ 'image/jp2', 'image/jpeg2000', 'image/jpx', ]
endif endif
@ -854,7 +881,7 @@ perl = find_program('perl5', 'perl', 'perl5.005', 'perl5.004', 'perl')
# This can be useful in particular when cross-compiling since anyway # This can be useful in particular when cross-compiling since anyway
# the interpreter is not useful at build time. # the interpreter is not useful at build time.
python3_required_version = '>=3.6.0' python3_minver = '>=3.6.0'
if get_option('python') == 'never' if get_option('python') == 'never'
python_warning = ''' python_warning = '''
@ -862,8 +889,8 @@ if get_option('python') == 'never'
as it won't provide the full GIMP experience. as it won't provide the full GIMP experience.
Note that you may install the Python plug-ins even if you have no Python Note that you may install the Python plug-ins even if you have no Python
interpreter at build-time by passing the configure option -Dpython=always. interpreter at build-time by passing the configure option -Dpython=always.
Just make sure that a Python @0@ interpreter is available at run-time. Just make sure that a Python >=@0@ interpreter is available at run-time.
'''.format(python3_required_version) '''.format(python3_minver)
warning(python_warning) warning(python_warning)
warnings += python_warning warnings += python_warning
@ -876,7 +903,7 @@ else
python_found = ( python_found = (
python.found() and python.found() and
python.language_version().version_compare(python3_required_version) python.language_version().version_compare('>='+python3_minver)
) )
if python_found if python_found
pygobject_found = run_command( pygobject_found = run_command(
@ -1105,42 +1132,49 @@ meson_install_subdir= find_program('tools'/'meson_install_subdir.py')
gimp_mkenums = find_program('tools'/'gimp-mkenums') gimp_mkenums = find_program('tools'/'gimp-mkenums')
gimp_mkenums_custom_target_commonargs = [ gimp_mkenums_custom_target_commonargs = [
'--fprod','/* enumerations from "@basename@" */', '--fprod',
'--vhead','GType\n'+ '/* enumerations from "@basename@" */',
'@enum_name@_get_type (void)\n'+ '--vhead',
'{\n'+ 'GType\n'+
' static const G@Type@Value values[] =\n'+ '@enum_name@_get_type (void)\n'+
' {', '{\n'+
'--vprod',' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },', ' static const G@Type@Value values[] =\n'+
'--vtail',' { 0, NULL, NULL }\n'+ ' {',
' };\n', '--vprod',
'--dhead',' static const Gimp@Type@Desc descs[] =\n'+ ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
' {', '--vtail',
'--dprod',' { @VALUENAME@, @valuedesc@, @valuehelp@ },'+ ' { 0, NULL, NULL }\n'+
'@if (\'@valueabbrev@\' ne \'NULL\')@\n'+ ' };\n',
' /* Translators: this is an abbreviated version of @valueudesc@.\n'+ '--dhead',
' Keep it short. */\n'+ ' static const Gimp@Type@Desc descs[] =\n'+
' { @VALUENAME@, @valueabbrev@, NULL },'+ ' {',
'@endif@', '--dprod',
' { @VALUENAME@, @valuedesc@, @valuehelp@ },'+
'@if (\'@valueabbrev@\' ne \'NULL\')@\n'+
' /* Translators: this is an abbreviated version of @valueudesc@.\n'+
' Keep it short. */\n'+
' { @VALUENAME@, @valueabbrev@, NULL },'+
'@endif@',
] ]
libgimp_mkenums_custom_target_commonargs = [ libgimp_mkenums_custom_target_commonargs = [
gimp_mkenums_custom_target_commonargs, gimp_mkenums_custom_target_commonargs,
'--dtail',' { 0, NULL, NULL }\n'+ '--dtail',
' };\n'+ ' { 0, NULL, NULL }\n'+
'\n'+ ' };\n'+
' static GType type = 0;\n'+ '\n'+
'\n'+ ' static GType type = 0;\n'+
' if (G_UNLIKELY (! type))\n'+ '\n'+
' {\n'+ ' if (G_UNLIKELY (! type))\n'+
' type = g_@type@_register_static ("@EnumName@", values);\n'+ ' {\n'+
' gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");\n'+ ' type = g_@type@_register_static ("@EnumName@", values);\n'+
' gimp_type_set_translation_context (type, "@enumnick@");\n'+ ' gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");\n'+
' gimp_@type@_set_value_descriptions (type, descs);\n'+ ' gimp_type_set_translation_context (type, "@enumnick@");\n'+
' }\n'+ ' gimp_@type@_set_value_descriptions (type, descs);\n'+
'\n'+ ' }\n'+
' return type;\n'+ '\n'+
'}\n', ' return type;\n'+
'}\n',
] ]
conf.set('ENABLE_NLS', true) conf.set('ENABLE_NLS', true)
@ -1395,36 +1429,36 @@ install_conf = configuration_data()
install_conf.set('GIMP_APP_VERSION', gimp_app_version) install_conf.set('GIMP_APP_VERSION', gimp_app_version)
install_conf.set('GIMP_PKGCONFIG_VERSION', gimp_version) install_conf.set('GIMP_PKGCONFIG_VERSION', gimp_version)
install_conf.set('GIMP_VERSION', gimp_version) install_conf.set('GIMP_VERSION', gimp_version)
install_conf.set('APPSTREAM_GLIB_REQUIRED_VERSION', appstream_glib.version()) install_conf.set('APPSTREAM_GLIB_REQUIRED_VERSION', appstream_glib_minver)
install_conf.set('ATK_REQUIRED_VERSION', atk .version()) install_conf.set('ATK_REQUIRED_VERSION', atk_minver)
install_conf.set('BABL_REQUIRED_VERSION', babl .version()) install_conf.set('BABL_REQUIRED_VERSION', babl_minver)
install_conf.set('CAIRO_PDF_REQUIRED_VERSION', cairopdf .version()) install_conf.set('CAIRO_PDF_REQUIRED_VERSION', cairopdf_minver)
install_conf.set('CAIRO_REQUIRED_VERSION', cairo .version()) install_conf.set('CAIRO_REQUIRED_VERSION', cairo_minver)
install_conf.set('FONTCONFIG_REQUIRED_VERSION', fontconfig .version()) install_conf.set('FONTCONFIG_REQUIRED_VERSION', fontconfig_minver)
install_conf.set('FREETYPE2_REQUIRED_VERSION', freetype2 .version()) install_conf.set('FREETYPE2_REQUIRED_VERSION', freetype2_minver)
install_conf.set('GDK_PIXBUF_REQUIRED_VERSION', gdk_pixbuf .version()) install_conf.set('GDK_PIXBUF_REQUIRED_VERSION', gdk_pixbuf_minver)
install_conf.set('GEGL_REQUIRED_VERSION', gegl .version()) install_conf.set('GEGL_REQUIRED_VERSION', gegl_minver)
install_conf.set('GEXIV2_REQUIRED_VERSION', gexiv2.version()) install_conf.set('GEXIV2_REQUIRED_VERSION', gexiv2_minver)
install_conf.set('GLIB_REQUIRED_VERSION', glib .version()) install_conf.set('GLIB_REQUIRED_VERSION', glib_minver)
install_conf.set('GTK_REQUIRED_VERSION', gtk3 .version()) install_conf.set('GTK_REQUIRED_VERSION', gtk3_minver)
install_conf.set('HARFBUZZ_REQUIRED_VERSION', harfbuzz .version()) install_conf.set('HARFBUZZ_REQUIRED_VERSION', harfbuzz_minver)
install_conf.set('INTLTOOL_REQUIRED_VERSION', '0.40.1') install_conf.set('INTLTOOL_REQUIRED_VERSION', '0.40.1')
install_conf.set('LCMS_REQUIRED_VERSION', lcms .version()) install_conf.set('LCMS_REQUIRED_VERSION', lcms_minver)
install_conf.set('LIBHEIF_REQUIRED_VERSION', libheif .version()) install_conf.set('LIBHEIF_REQUIRED_VERSION', libheif_minver)
install_conf.set('LIBLZMA_REQUIRED_VERSION', liblzma .version()) install_conf.set('LIBLZMA_REQUIRED_VERSION', liblzma_minver)
install_conf.set('LIBMYPAINT_REQUIRED_VERSION', libmypaint .version()) install_conf.set('LIBMYPAINT_REQUIRED_VERSION', libmypaint_minver)
install_conf.set('LIBPNG_REQUIRED_VERSION', libpng .version()) install_conf.set('LIBPNG_REQUIRED_VERSION', libpng_minver)
install_conf.set('OPENEXR_REQUIRED_VERSION', openexr .version()) install_conf.set('OPENEXR_REQUIRED_VERSION', openexr_minver)
install_conf.set('OPENJPEG_REQUIRED_VERSION', openjpeg.version()) install_conf.set('OPENJPEG_REQUIRED_VERSION', openjpeg_minver)
install_conf.set('PANGOCAIRO_REQUIRED_VERSION', pangocairo .version()) install_conf.set('PANGOCAIRO_REQUIRED_VERSION', pangocairo_minver)
install_conf.set('POPPLER_DATA_REQUIRED_VERSION', poppler[1] .version()) install_conf.set('POPPLER_DATA_REQUIRED_VERSION', poppler_data_minver)
install_conf.set('POPPLER_REQUIRED_VERSION', poppler[0] .version()) install_conf.set('POPPLER_REQUIRED_VERSION', poppler_minver)
install_conf.set('PYTHON3_REQUIRED_VERSION', '3.6.0') install_conf.set('PYTHON3_REQUIRED_VERSION', python3_minver)
install_conf.set('RSVG_REQUIRED_VERSION', rsvg .version()) install_conf.set('RSVG_REQUIRED_VERSION', rsvg_minver)
install_conf.set('WEBKITGTK_REQUIRED_VERSION', webkit .version()) install_conf.set('WEBKITGTK_REQUIRED_VERSION', webkit_minver)
install_conf.set('WEBP_REQUIRED_VERSION', webp_libs[0].version()) install_conf.set('WEBP_REQUIRED_VERSION', webp_minver)
install_conf.set('WMF_REQUIRED_VERSION', wmf .version()) install_conf.set('WMF_REQUIRED_VERSION', wmf_minver)
install_conf.set('XGETTEXT_REQUIRED_VERSION', '0.19') install_conf.set('XGETTEXT_REQUIRED_VERSION', '0.19')
configure_file( configure_file(
input : 'INSTALL.in', input : 'INSTALL.in',