Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gobject-introspection: Fix Python extension issue #8046

Merged
merged 5 commits into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions packages/gobject-introspection/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,30 @@ TERMUX_PKG_HOMEPAGE=https://gi.readthedocs.io/
TERMUX_PKG_DESCRIPTION="Uniform machine readable API"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=1.68.0
TERMUX_PKG_REVISION=3
TERMUX_PKG_REVISION=4
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_SRCURL=https://github.com/GNOME/gobject-introspection/archive/refs/tags/$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=13595a257df7d0b71b002ec115f1faafd3295c9516f307e2c57bd219d5cd8369
TERMUX_PKG_BUILD_DEPENDS="glib, python"

termux_step_pre_configure() {
CPPFLAGS+=" -I$TERMUX_PREFIX/include/python3.10 -I$TERMUX_PREFIX/include/python3.10/cpython"
_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"
}

termux_step_post_make_install() {
soabi=cpython-${_PYTHON_VERSION//.}

cd $TERMUX_PREFIX/lib/gobject-introspection/giscanner
m=_giscanner
for s in $m.$soabi-*.so; do
if [ -f $s ]; then
mv $s $m.$soabi.so
fi
done
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -uNr gobject-introspection/giscanner/meson.build gobject-introspection.mod/giscanner/meson.build
--- gobject-introspection/giscanner/meson.build 2021-06-03 13:43:38.060569823 +0000
+++ gobject-introspection.mod/giscanner/meson.build 2021-06-03 13:55:08.705053742 +0000
@@ -98,24 +98,11 @@
@@ -98,24 +98,12 @@
dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep],
)

Expand All @@ -24,6 +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: '-lpython@PYTHON_VERSION@',
install: true,
install_dir: giscannerdir,
)
Expand All @@ -34,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',
],
)
Expand Down