diff --git a/packages/gobject-introspection/build.sh b/packages/gobject-introspection/build.sh new file mode 100644 index 000000000..e7a624a2e --- /dev/null +++ b/packages/gobject-introspection/build.sh @@ -0,0 +1,12 @@ +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_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.9 -I$TERMUX_PREFIX/include/python3.9/cpython" +} diff --git a/packages/gobject-introspection/meson.patch b/packages/gobject-introspection/meson.patch new file mode 100644 index 000000000..1b24a9efd --- /dev/null +++ b/packages/gobject-introspection/meson.patch @@ -0,0 +1,71 @@ +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 @@ + dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep], + ) + +-# https://github.com/mesonbuild/meson/issues/4117 +-if host_machine.system() == 'windows' +- python_ext_dep = python.dependency() +-else +- python_ext_dep = python.dependency().partial_dependency(compile_args: true) +-endif +- +-if not python_ext_dep.found() +- # For example if Python is 32bit but we require a 64bit variant +- error('Python installation not useable') +-endif +- + giscanner_pymod = python.extension_module('_giscanner', ['giscannermodule.c'], + link_with: giscanner_lib, + c_args: gi_hidden_visibility_cflags + custom_c_args, + include_directories : configinc, +- dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep, +- python_ext_dep], ++ dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep], + install: true, + install_dir: giscannerdir, + ) +diff -uNr gobject-introspection/meson.build gobject-introspection.mod/meson.build +--- gobject-introspection/meson.build 2021-06-03 13:43:38.062569940 +0000 ++++ gobject-introspection.mod/meson.build 2021-06-03 13:57:59.063038610 +0000 +@@ -3,6 +3,7 @@ + meson_version: '>= 0.50.1', + default_options: [ + 'warning_level=1', ++ 'c_link_args=-lpython3.9', + 'buildtype=debugoptimized', + ], + ) +@@ -157,9 +158,6 @@ + libffi_dep = dependency('libffi', + fallback : ['libffi', 'ffi_dep']) + +-# python headers +-cc.check_header('Python.h', dependencies: [python.dependency()], required: true) +- + # cairo + cairo_option = get_option('cairo') + if cc.get_id() == 'msvc' +diff -uNr gobject-introspection/meson_options.txt gobject-introspection.mod/meson_options.txt +--- gobject-introspection/meson_options.txt 2021-06-03 13:43:38.062569940 +0000 ++++ gobject-introspection.mod/meson_options.txt 2021-06-03 13:59:44.285204579 +0000 +@@ -26,7 +26,7 @@ + description: 'Intermediate prefix for gir installation under ${prefix}' + ) + +-option('gi_cross_use_prebuilt_gi', type: 'boolean', value : false, ++option('gi_cross_use_prebuilt_gi', type: 'boolean', value : true, + description: 'Use gobject introspection tools installed in the build system (useful when cross-compiling)' + ) + +@@ -38,7 +38,7 @@ + description: 'Use a ldd wrapper instead of system ldd command in giscanner (useful when cross-compiling)' + ) + +-option('build_introspection_data', type: 'boolean', value : true, ++option('build_introspection_data', type: 'boolean', value : false, + description: 'Build introspection data (.gir and .typelib files) in addition to library and tools' + ) +