Commit e77d9517 authored by Jehan's avatar Jehan

meson, autotools, CI: simplify plug-in binding build options.

For Python, Lua and Javascript, make the option boolean (with 'yes'
being the default). No need of a warning when not installing the
plug-ins as this would have been disabled explicitly anyway. When
installing the plug-ins, only make interpreter checks as precautionnary
verifications which don't actually change anything (except outputting
some warnings if interpreters are not found). Basically for these 3
bindings, the interpreters are only runtime dependencies anyway. So it
doesn't matter if they are not available at build time. In particular,
we get rid of the 'force' option.

Vala rules do not change as the vala compiler is indeed needed at build
time and current checks work correctly. I just add a "Vala plug-ins"
line in the summary message of the meson configuration, as it was
missing.
parent 47663730
Pipeline #220791 passed with stages
in 37 minutes and 2 seconds
...@@ -139,9 +139,6 @@ gimp-autotools-debian: ...@@ -139,9 +139,6 @@ gimp-autotools-debian:
- ../autogen.sh - ../autogen.sh
--prefix="${INSTALL_PREFIX}" --prefix="${INSTALL_PREFIX}"
--enable-debug --enable-debug
--with-python=force
--with-javascript=force
--with-lua=force
- make -j "$(nproc)" - make -j "$(nproc)"
- make check - make check
...@@ -153,9 +150,6 @@ gimp-distcheck-debian: ...@@ -153,9 +150,6 @@ gimp-distcheck-debian:
- ../autogen.sh - ../autogen.sh
--prefix="${INSTALL_PREFIX}" --prefix="${INSTALL_PREFIX}"
--enable-debug --enable-debug
--with-python=force
--with-javascript=force
--with-lua=force
--enable-gtk-doc --enable-gtk-doc
- make -j "$(nproc)" - make -j "$(nproc)"
- make -j "$(nproc)" distcheck - make -j "$(nproc)" distcheck
...@@ -165,9 +159,6 @@ gimp-meson-debian: ...@@ -165,9 +159,6 @@ gimp-meson-debian:
script: script:
- meson _build - meson _build
--prefix="${INSTALL_PREFIX}" --prefix="${INSTALL_PREFIX}"
-Dpython=always
-Djavascript=always
-Dlua=always
- ninja -C _build - ninja -C _build
- ninja -C _build test - ninja -C _build test
...@@ -182,9 +173,6 @@ gimp-clang-debian: ...@@ -182,9 +173,6 @@ gimp-clang-debian:
clang libomp-dev clang libomp-dev
- meson _build - meson _build
--prefix="${INSTALL_PREFIX}" --prefix="${INSTALL_PREFIX}"
-Dpython=always
-Djavascript=always
-Dlua=always
- ninja -C _build - ninja -C _build
- ninja -C _build test - ninja -C _build test
...@@ -237,9 +225,7 @@ gimp-win64: ...@@ -237,9 +225,7 @@ gimp-win64:
- export PATH="`pwd`/.local/bin:$PATH" - export PATH="`pwd`/.local/bin:$PATH"
- mkdir _build && cd _build - mkdir _build && cd _build
- echo 'crossroad meson .. - echo 'crossroad meson ..
-Dgtk-doc=false -Dgtk-doc=false && ninja install &&
-Dpython=always -Dlua=always
-Djavascript=always && ninja install &&
cp -fr $CROSSROAD_PREFIX/ ../gimp-prefix/ cp -fr $CROSSROAD_PREFIX/ ../gimp-prefix/
' | ' |
crossroad w64 gimp --run="-" crossroad w64 gimp --run="-"
...@@ -298,9 +284,7 @@ gimp-win32: ...@@ -298,9 +284,7 @@ gimp-win32:
- export PATH="`pwd`/.local/bin:$PATH" - export PATH="`pwd`/.local/bin:$PATH"
- mkdir _build && cd _build - mkdir _build && cd _build
- echo 'crossroad meson .. - echo 'crossroad meson ..
-Dwmf=disabled -Dgtk-doc=false -Dwmf=disabled -Dgtk-doc=false && ninja install &&
-Dpython=always -Dlua=always
-Djavascript=always && ninja install &&
cp -fr $CROSSROAD_PREFIX/ ../gimp-prefix/ cp -fr $CROSSROAD_PREFIX/ ../gimp-prefix/
' | ' |
crossroad w32 gimp --run="-" crossroad w32 gimp --run="-"
......
...@@ -2275,21 +2275,11 @@ GOAT_EXERCISES="goat-exercise-c$BUILD_EXEEXT" ...@@ -2275,21 +2275,11 @@ GOAT_EXERCISES="goat-exercise-c$BUILD_EXEEXT"
# useful at build time. # useful at build time.
# --with-python=no won't install Python plug-ins. It is discouraged. # --with-python=no won't install Python plug-ins. It is discouraged.
AC_ARG_WITH(python, AC_ARG_WITH(python,
[ --with-python=no|yes|force install Python 3 plug-ins (default=yes)], , [ --with-python=no|yes install Python 3 plug-ins (default=yes)], ,
[with_python=yes]) [with_python=yes])
if test "x$with_python" = xno; then warning_python=
warning_python=" if test "x$with_python" = xyes; then
WARNING: you disabled the installation of core Python plug-ins. This is
discouraged as it won't provide the full GIMP experience.
Note that you may install the Python plug-ins even if you have
no Python interpreter at build-time by passing the configure
option --with-python=force.
Just make sure that a Python python3_required_version or newer
interpreter is available at run-time."
elif test "x$with_python" = xforce; then
with_python="yes"
warning_python=
AM_PATH_PYTHON3(python3_required_version, , AM_PATH_PYTHON3(python3_required_version, ,
warning_python="Python python3_required_version or newer not found") warning_python="Python python3_required_version or newer not found")
if test "x$warning_python" = "x"; then if test "x$warning_python" = "x"; then
...@@ -2305,28 +2295,7 @@ WARNING: ${warning_python} ...@@ -2305,28 +2295,7 @@ WARNING: ${warning_python}
be usable." be usable."
with_python="yes (see warning below)" with_python="yes (see warning below)"
fi fi
else
with_python="yes"
error_python=
AM_PATH_PYTHON3(python3_required_version,,
error_python="- Python python3_required_version or newer not found")
if test "x$error_python" = "x"; then
AM_PYTHON_CHECK_PYGOBJECT("$PYTHON", , ,
error_python="PyGObject 3.0 not found")
fi
if test "x$error_python" != "x"; then
required_deps="$required_deps
$error_python
*** Please install Python 3 and PyGObject 3.
*** Note that you may install the Python plug-ins even if you have
*** no Python interpreter at build-time by passing the configure
*** option --with-python=force.
*** Just make sure that the Python dependencies are available at run-time."
with_python="no"
fi
fi
if test "x$with_python" = "xyes"; then
if test "x$platform_win32" = "xyes"; then if test "x$platform_win32" = "xyes"; then
PYBIN_PATH="$py_exec_prefix\pythonw.exe" PYBIN_PATH="$py_exec_prefix\pythonw.exe"
else else
...@@ -2335,7 +2304,10 @@ if test "x$with_python" = "xyes"; then ...@@ -2335,7 +2304,10 @@ if test "x$with_python" = "xyes"; then
AC_SUBST(PYBIN_PATH) AC_SUBST(PYBIN_PATH)
GOAT_EXERCISES="$GOAT_EXERCISES:goat-exercise-py3.py" GOAT_EXERCISES="$GOAT_EXERCISES:goat-exercise-py3.py"
else
with_python="no (disabled)"
fi fi
AM_CONDITIONAL(HAS_PYTHON_INTERP, test "x$PYBIN_PATH" != "x") AM_CONDITIONAL(HAS_PYTHON_INTERP, test "x$PYBIN_PATH" != "x")
AM_CONDITIONAL(BUILD_PYTHON, test "x$with_python" != xno) AM_CONDITIONAL(BUILD_PYTHON, test "x$with_python" != xno)
...@@ -2344,20 +2316,12 @@ AM_CONDITIONAL(BUILD_PYTHON, test "x$with_python" != xno) ...@@ -2344,20 +2316,12 @@ AM_CONDITIONAL(BUILD_PYTHON, test "x$with_python" != xno)
########################################### ###########################################
AC_ARG_WITH(javascript, AC_ARG_WITH(javascript,
[ --with-javascript=no|yes|force install JavaScript plug-ins (default=yes)], , [ --with-javascript=no|yes install JavaScript plug-ins (default=yes)], ,
[with_javascript=yes]) [with_javascript=yes])
if test "x$with_javascript" = xno; then warning_javascript=
warning_javascript=" if test "x$with_javascript" = xyes; then
WARNING: you disabled the installation of core JavaScript plug-ins. This
is discouraged as it won't provide the full GIMP experience.
Note that you may install the JavaScript plug-ins even if the
GJS interpreter is not installed at build-time by passing the
configure option --with-javascript=force.
Just make sure that GJS is available at run-time."
elif test "x$with_javascript" = xforce; then
with_javascript="yes" with_javascript="yes"
warning_javascript=
AC_CHECK_PROGS(GJS, gjs, no) AC_CHECK_PROGS(GJS, gjs, no)
if test "x$GJS" = xno; then if test "x$GJS" = xno; then
warning_javascript=" warning_javascript="
...@@ -2367,23 +2331,10 @@ WARNING: GJS not found. ...@@ -2367,23 +2331,10 @@ WARNING: GJS not found.
installation, otherwise installed plug-ins won't be usable." installation, otherwise installed plug-ins won't be usable."
with_javascript="yes (see warning below)" with_javascript="yes (see warning below)"
fi fi
else
with_javascript="yes"
AC_CHECK_PROGS(GJS, gjs, no)
if test "x$GJS" = xno; then
required_deps="$required_deps
- GJS not found.
*** Please install the JavaScript interpreter GJS.
*** Note that you may install the JavaScript plug-ins even if
*** GJS is not installed at build-time by passing the configure
*** option --with-javascript=force.
*** Just make sure that GJS is available at run-time."
with_javascript="no"
fi
fi
if test "x$with_javascript" = "xyes"; then
GOAT_EXERCISES="$GOAT_EXERCISES:goat-exercise-gjs.js" GOAT_EXERCISES="$GOAT_EXERCISES:goat-exercise-gjs.js"
else
with_javascript="no (disabled)"
fi fi
AM_CONDITIONAL(HAS_JAVASCRIPT_INTERP, test "x$GJS" != "xno") AM_CONDITIONAL(HAS_JAVASCRIPT_INTERP, test "x$GJS" != "xno")
...@@ -2394,20 +2345,11 @@ AM_CONDITIONAL(BUILD_JAVASCRIPT, test "x$with_javascript" != xno) ...@@ -2394,20 +2345,11 @@ AM_CONDITIONAL(BUILD_JAVASCRIPT, test "x$with_javascript" != xno)
#################################### ####################################
AC_ARG_WITH(lua, AC_ARG_WITH(lua,
[ --with-lua=no|yes|force install Lua plug-ins (default=yes)], , [ --with-lua=no|yes install Lua plug-ins (default=yes)], ,
[with_lua=yes]) [with_lua=yes])
if test "x$with_lua" = xno; then warning_lua=
warning_lua=" if test "x$with_lua" = xyes; then
WARNING: you disabled the installation of core Lua plug-ins. This
is discouraged as it won't provide the full GIMP experience.
Note that you may install the Lua plug-ins even if Lua LGI
is not installed at build-time by passing the configure option
--with-lua=force.
Just make sure that it is available at run-time."
elif test "x$with_lua" = xforce; then
with_lua="yes"
warning_lua=
AC_CHECK_PROGS(LUA, luajit, no) AC_CHECK_PROGS(LUA, luajit, no)
if test "x$LUA" = xno; then if test "x$LUA" = xno; then
warning_lua=" warning_lua="
...@@ -2417,23 +2359,10 @@ WARNING: luajit not found. ...@@ -2417,23 +2359,10 @@ WARNING: luajit not found.
otherwise installed plug-ins won't be usable." otherwise installed plug-ins won't be usable."
with_lua="yes (see warning below)" with_lua="yes (see warning below)"
fi fi
else
with_lua="yes"
AC_CHECK_PROGS(LUA, luajit, no)
if test "x$LUA" = xno; then
required_deps="$required_deps
- luajit not found.
*** Please install the Lua interpreter luajit.
*** Note that you may install the Lua plug-ins even if luajit
*** is not installed at build-time by passing the configure
*** option --with-lua=force.
*** Just make sure that luajit and LGI are available at run-time."
with_lua="no"
fi
fi
if test "x$with_lua" = "xyes"; then
GOAT_EXERCISES="$GOAT_EXERCISES:goat-exercise-lua.lua" GOAT_EXERCISES="$GOAT_EXERCISES:goat-exercise-lua.lua"
else
with_lua="no (disabled)"
fi fi
AM_CONDITIONAL(HAS_LUA_INTERP, test "x$LUA" != "xno") AM_CONDITIONAL(HAS_LUA_INTERP, test "x$LUA" != "xno")
......
...@@ -908,22 +908,9 @@ perl = find_program('perl5', 'perl', 'perl5.005', 'perl5.004', 'perl') ...@@ -908,22 +908,9 @@ perl = find_program('perl5', 'perl', 'perl5.005', 'perl5.004', 'perl')
python3_minver = '>=3.6' python3_minver = '>=3.6'
if get_option('python') == 'never' have_python = get_option('python')
python_warning = '''
You disabled the installation of core Python plug-ins. This is discouraged
as it won't provide the full GIMP experience.
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.
Just make sure that a Python >=@0@ interpreter is available at run-time.
'''.format(python3_minver)
warning(python_warning)
warnings += python_warning
have_python = false
else
always_install = get_option('python') == 'always'
if have_python
python = pythonmod.find_installation('python3', required: false) python = pythonmod.find_installation('python3', required: false)
message('Found Python @0@'.format(python.language_version())) message('Found Python @0@'.format(python.language_version()))
...@@ -944,16 +931,7 @@ else ...@@ -944,16 +931,7 @@ else
python_found = python_found and pygobject_found python_found = python_found and pygobject_found
endif endif
if (not python_found) and (not always_install) if not python_found
error('''
Python @0@ or PyGObject was not found.
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.
Just make sure that a Python @0@ interpreter is available at run-time.
'''.format(python3_minver))
endif
if (not python_found) and (always_install)
python_warning = ''' python_warning = '''
Python @0@ or PyGObject was not found. Python @0@ or PyGObject was not found.
Python plug-ins will be installed anyway but you should make sure that Python plug-ins will be installed anyway but you should make sure that
...@@ -963,39 +941,14 @@ else ...@@ -963,39 +941,14 @@ else
warning(python_warning) warning(python_warning)
warnings += python_warning warnings += python_warning
endif endif
have_python = python_found or always_install
endif endif
## Javascript ## Javascript
if get_option('javascript') == 'never' have_javascript = get_option('javascript')
js_warning = ''' if have_javascript
You disabled the installation of core Javascript plug-ins. This is
discouraged as it won't provide the full GIMP experience.
Note that you may install the Javascript plug-ins even if you have no GJS
interpreter at build-time by passing the configure option -Djavascript=always.
Just make sure that the GJS interpreter is available at run-time.
'''
warning(js_warning)
warnings += js_warning
have_javascript = false
else
always_install = get_option('javascript') == 'always'
gjs = find_program('gjs', required: false) gjs = find_program('gjs', required: false)
if not gjs.found()
if (not gjs.found()) and (not always_install)
error('''
GJS was not found.
Note that you may install the Javascript plug-ins even if you have no GJS
interpreter at build-time by passing the configure option -Djavascript=always.
Just make sure that the GJS interpreter is available at run-time.
''')
endif
if (not gjs.found()) and (always_install)
js_warning = ''' js_warning = '''
GJS was not found. GJS was not found.
JavaScript plug-ins will be installed anyway but you should make sure that JavaScript plug-ins will be installed anyway but you should make sure that
...@@ -1005,39 +958,14 @@ else ...@@ -1005,39 +958,14 @@ else
warning(js_warning) warning(js_warning)
warnings += js_warning warnings += js_warning
endif endif
have_javascript = gjs.found() or always_install
endif endif
## Lua ## Lua
if get_option('lua') == 'never' have_lua = get_option('lua')
lua_warning = ''' if have_lua
You disabled the installation of core Lua plug-ins. This is discouraged
as it won't provide the full GIMP experience.
Note that you may install the Lua plug-ins even if you have no Lua LGI
interpreter at build-time by passing the configure option -Dlua=always.
Just make sure that the Lua LGI interpreter is available at run-time.
'''
warning(lua_warning)
warnings += lua_warning
have_lua = false
else
always_install = get_option('lua') == 'always'
lua = find_program('luajit', required: false) lua = find_program('luajit', required: false)
if not lua.found()
if (not lua.found()) and (not always_install)
error('''
Luajit was not found.
Note that you may install the Lua plug-ins even if you have no Lua LGI
interpreter at build-time by passing the configure option -Dlua=always.
Just make sure that the Lua LGI interpreter is available at run-time.
''')
endif
if (not lua.found()) and always_install
lua_warning = ''' lua_warning = '''
Luajit was not found. Luajit was not found.
Lua plug-ins will be installed anyway but you should make sure that Lua plug-ins will be installed anyway but you should make sure that
...@@ -1047,8 +975,6 @@ else ...@@ -1047,8 +975,6 @@ else
warning(lua_warning) warning(lua_warning)
warnings += lua_warning warnings += lua_warning
endif endif
have_lua = lua.found() or always_install
endif endif
...@@ -1834,6 +1760,7 @@ final_message = [ ...@@ -1834,6 +1760,7 @@ final_message = [
''' Python 3 plug-ins: @0@'''.format(have_python), ''' Python 3 plug-ins: @0@'''.format(have_python),
''' Javascript plug-ins: @0@'''.format(have_javascript), ''' Javascript plug-ins: @0@'''.format(have_javascript),
''' Lua plug-ins: @0@'''.format(have_lua), ''' Lua plug-ins: @0@'''.format(have_lua),
''' Vala plug-ins: @0@'''.format(have_vala),
''' TWAIN (Win32): @0@'''.format(platform_windows), ''' TWAIN (Win32): @0@'''.format(platform_windows),
''' Webpage: @0@'''.format(webkit.found()), ''' Webpage: @0@'''.format(webkit.found()),
''' WMF: @0@'''.format(wmf.found()), ''' WMF: @0@'''.format(wmf.found()),
......
...@@ -44,7 +44,6 @@ option('openexr', type: 'feature', value: 'auto', description: 'Openex ...@@ -44,7 +44,6 @@ option('openexr', type: 'feature', value: 'auto', description: 'Openex
option('png', type: 'feature', value: 'auto', description: 'PNG support') option('png', type: 'feature', value: 'auto', description: 'PNG support')
option('print', type: 'boolean', value: true, description: 'Print support') option('print', type: 'boolean', value: true, description: 'Print support')
option('tiff', type: 'feature', value: 'auto', description: 'TIFF support') option('tiff', type: 'feature', value: 'auto', description: 'TIFF support')
option('vala-plugins', type: 'feature', value: 'auto', description: 'Build VAPI and Vala plugins')
option('webkit', type: 'feature', value: 'auto', description: 'Help browser and webpage plugins') option('webkit', type: 'feature', value: 'auto', description: 'Help browser and webpage plugins')
option('webp', type: 'feature', value: 'auto', description: 'Webp support') option('webp', type: 'feature', value: 'auto', description: 'Webp support')
option('wmf', type: 'feature', value: 'auto', description: 'Wmf support') option('wmf', type: 'feature', value: 'auto', description: 'Wmf support')
...@@ -58,12 +57,8 @@ option('gtk-doc-app', type: 'boolean', value: false, description: 'Build ...@@ -58,12 +57,8 @@ option('gtk-doc-app', type: 'boolean', value: false, description: 'Build
option('linux-input', type: 'feature', value: 'auto', description: 'Linux input event controller module') option('linux-input', type: 'feature', value: 'auto', description: 'Linux input event controller module')
option('vec-icons', type: 'boolean', value: true, description: 'Use vector icons rather than raster ones') option('vec-icons', type: 'boolean', value: true, description: 'Use vector icons rather than raster ones')
option('javascript', type: 'combo', value:'error', description: 'Install Javascript plug-ins', option('vala-plugins', type: 'feature', value: 'auto', description: 'Build VAPI and Vala plugins')
choices: [ 'never', 'always', 'error' ],
) option('javascript', type: 'boolean', value: true, description: 'Install Javascript plug-ins')
option('lua', type: 'combo', value:'error', description: 'Install Lua plug-ins', option('lua', type: 'boolean', value: true, description: 'Install Lua plug-ins')
choices: [ 'never', 'always', 'error' ], option('python', type: 'boolean', value: true, description: 'Install Python 3 plug-ins')
)
option('python', type: 'combo', value:'error', description: 'Install Python 3 plug-ins',
choices: [ 'never', 'always', 'error' ],
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment