meson: update submodule only if it doesn’t exist

Some build servers don’t have git installed, which makes the tarball
build fail when trying to update the libgd submodule. This commit adds a
check for the existence of the root meson.build of libgd before running
git.

https://bugzilla.gnome.org/show_bug.cgi?id=779603
This commit is contained in:
Ernestas Kulik 2017-03-05 21:49:17 +02:00
parent f80af5094c
commit dc57c21448
2 changed files with 10 additions and 2 deletions

8
check_libgd.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
if [ ! -f "${MESON_SOURCE_ROOT}/libgd/meson.build" ]
then
git \
--git-dir="${MESON_SOURCE_ROOT}/.git" \
submodule update --init libgd
fi

View file

@ -102,8 +102,8 @@ nautilus_include_dirs = include_directories ('.')
subdir ('eel')
subdir ('libnautilus-extension')
message ('Updating libgd submodule…')
run_command ('git', '--git-dir="$MESON_SOURCE_ROOT/.git"', 'submodule', 'update', '--init', 'libgd')
message ('Checking for libgd…')
run_command ('check_libgd.sh')
libgd_options = ['static=true',
'with-gtk-hacks=true',