gobject-introspection: get python version from python build.sh

Hardcoding it in gobject-introspection's build.sh and meson.patch will
most definetly lead to us failing to update it somewhere when updating
or rebuilding the package.
This commit is contained in:
Henrik Grimler 2021-11-25 11:04:07 +01:00
parent 5837f3f445
commit 0dbab6fa85
2 changed files with 8 additions and 6 deletions

View File

@ -8,11 +8,13 @@ TERMUX_PKG_SRCURL=https://github.com/GNOME/gobject-introspection/archive/refs/ta
TERMUX_PKG_SHA256=13595a257df7d0b71b002ec115f1faafd3295c9516f307e2c57bd219d5cd8369
TERMUX_PKG_BUILD_DEPENDS="glib, python"
_PYTHON_VERSION=3.10
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-Dpython=python${_PYTHON_VERSION}"
termux_step_pre_configure() {
_PYTHON_VERSION=$(. $TERMUX_SCRIPTDIR/packages/python/build.sh; echo $_MAJOR_VERSION)
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-Dpython=python${_PYTHON_VERSION}"
echo "Applying meson.diff"
sed "s%@PYTHON_VERSION@%$_PYTHON_VERSION%g" \
$TERMUX_PKG_BUILDER_DIR/meson.diff | patch --silent -p1
CPPFLAGS+=" -I$TERMUX_PREFIX/include/python${_PYTHON_VERSION} -I$TERMUX_PREFIX/include/python${_PYTHON_VERSION}/cpython"
}

View File

@ -24,7 +24,7 @@ diff -uNr gobject-introspection/giscanner/meson.build gobject-introspection.mod/
- dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep,
- python_ext_dep],
+ dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep],
+ link_args: '-lpython3.10',
+ link_args: '-lpython@PYTHON_VERSION@',
install: true,
install_dir: giscannerdir,
)
@ -35,7 +35,7 @@ diff -uNr gobject-introspection/meson.build gobject-introspection.mod/meson.buil
meson_version: '>= 0.50.1',
default_options: [
'warning_level=1',
+ 'c_link_args=-lpython3.10',
+ 'c_link_args=-lpython@PYTHON_VERSION@',
'buildtype=debugoptimized',
],
)