From 892c98aa6872fc616aacc764ba8a794fc051bbff Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Mon, 24 Oct 2022 08:24:58 +0900 Subject: [PATCH] gnumeric: Bump to 1.12.53 and include Python components (as a subpackage). --- x11-packages/gnumeric/build.sh | 45 +- x11-packages/gnumeric/configure.patch | 20 + .../gnumeric/gir/1.12.53/Gnm-1.12.xml | 669 ++++++++++++++++++ .../gnumeric/gnumeric-help.subpackage.sh | 5 + .../gnumeric/gnumeric-python.subpackage.sh | 8 + .../gnumeric/introspection-Makefile.in.patch | 11 + .../plugins-python-loader-Makefile.in.diff | 11 + 7 files changed, 765 insertions(+), 4 deletions(-) create mode 100644 x11-packages/gnumeric/gir/1.12.53/Gnm-1.12.xml create mode 100644 x11-packages/gnumeric/gnumeric-help.subpackage.sh create mode 100644 x11-packages/gnumeric/gnumeric-python.subpackage.sh create mode 100644 x11-packages/gnumeric/introspection-Makefile.in.patch create mode 100644 x11-packages/gnumeric/plugins-python-loader-Makefile.in.diff diff --git a/x11-packages/gnumeric/build.sh b/x11-packages/gnumeric/build.sh index 66374583409197..ccdb8f88f71e5e 100644 --- a/x11-packages/gnumeric/build.sh +++ b/x11-packages/gnumeric/build.sh @@ -3,27 +3,64 @@ TERMUX_PKG_DESCRIPTION="The GNOME spreadsheet" TERMUX_PKG_LICENSE="GPL-2.0, GPL-3.0" TERMUX_PKG_MAINTAINER="@termux" _MAJOR_VERSION=1.12 -TERMUX_PKG_VERSION=${_MAJOR_VERSION}.52 +TERMUX_PKG_VERSION=${_MAJOR_VERSION}.53 TERMUX_PKG_SRCURL=https://download.gnome.org/sources/gnumeric/${_MAJOR_VERSION}/gnumeric-${TERMUX_PKG_VERSION}.tar.xz -TERMUX_PKG_SHA256=73cf73049a22a1d828506275b2c9378ec37c5ff37b68bb1f2f494f0d6400823b +TERMUX_PKG_SHA256=5568e4c8dceabb9028f1361d1045522f95f0a71daa59e973cbdd2d39badd4f02 TERMUX_PKG_DEPENDS="glib, goffice, gtk3, libcairo, libgsf, libxml2, pango, zlib" +TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner" +TERMUX_PKG_RECOMMENDS="gnumeric-help" +TERMUX_PKG_SUGGESTS="glpk" +TERMUX_PKG_DISABLE_GIR=false TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ---enable-introspection=no +PYTHON=python +--enable-introspection=yes --without-gda --without-psiconv --without-paradox --without-long-double --without-perl ---without-python +" +TERMUX_PKG_RM_AFTER_INSTALL=" +lib/locale +share/glib-2.0/schemas/gschemas.compiled " termux_step_pre_configure() { + termux_setup_gir + + _PYTHON_VERSION=$(. $TERMUX_SCRIPTDIR/packages/python/build.sh; echo $_MAJOR_VERSION) + termux_setup_python_crossenv + pushd $TERMUX_PYTHON_CROSSENV_SRCDIR + _CROSSENV_PREFIX=$TERMUX_PKG_BUILDDIR/python-crossenv-prefix + python${_PYTHON_VERSION} -m crossenv \ + $TERMUX_PREFIX/bin/python${_PYTHON_VERSION} \ + ${_CROSSENV_PREFIX} + popd + . ${_CROSSENV_PREFIX}/bin/activate + + echo "Applying plugins-python-loader-Makefile.in.diff" + sed "s|@PYTHON_VERSION@|${_PYTHON_VERSION}|g" \ + $TERMUX_PKG_BUILDER_DIR/plugins-python-loader-Makefile.in.diff \ + | patch --silent -p1 + + export PYTHON_GIOVERRIDESDIR=$TERMUX_PREFIX/lib/python${_PYTHON_VERSION}/site-packages/gi/overrides + CPPFLAGS+=" -D__USE_GNU" } termux_step_post_configure() { + touch ./src/g-ir-scanner + local ver=$(awk '/^PACKAGE_VERSION =/ { print $3 }' Makefile) local so=$TERMUX_PREFIX/lib/libspreadsheet.so rm -f ${so} echo "INPUT(-lspreadsheet-${ver})" > ${so} + + # Workaround for https://github.com/android/ndk/issues/201 + local plugins_libs="-L$TERMUX_PKG_BUILDDIR/src/.libs -lspreadsheet" + plugins_libs+=" $($PKG_CONFIG libgoffice-0.10 --libs)" + plugins_libs+=" $($PKG_CONFIG libgsf-1 --libs)" + plugins_libs+=" $($PKG_CONFIG gtk+-3.0 --libs)" + find plugins -name Makefile | xargs -n 1 \ + sed -i 's|^LIBS = |\0'"${plugins_libs}"' |g' } diff --git a/x11-packages/gnumeric/configure.patch b/x11-packages/gnumeric/configure.patch index e944a5e051c5d7..0bf883c55ad911 100644 --- a/x11-packages/gnumeric/configure.patch +++ b/x11-packages/gnumeric/configure.patch @@ -18,3 +18,23 @@ -Wdefault-bitfield-sign -Wdo-while -Wparen-string \ -Wptr-subtraction-blows -Wreturn-void -Wtypesign \ -Wstrict-prototypes -Wno-error=format-nonliteral " +@@ -18611,7 +18611,6 @@ + have_python=no + have_python_gi=no + introspection_py_msg=no +-PYTHON_GIOVERRIDESDIR= + if test "x$PYTHON" != x; then + + printf "%s\n" "#define PYTHON_INTERPRETER \"$PYTHON\"" >>confdefs.h +@@ -18620,10 +18619,9 @@ + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python module gi" >&5 + printf %s "checking for python module gi... " >&6; } +- if $PYTHON -c 'import gi' 2>/dev/null; then ++ if true; then + have_python_gi=yes + introspection_py_msg="Yes." +- PYTHON_GIOVERRIDESDIR=`$PYTHON -c 'import gi; import os.path; print(os.path.dirname(gi.__file__)+"/overrides")'` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_python_gi" >&5 + printf "%s\n" "$have_python_gi" >&6; } diff --git a/x11-packages/gnumeric/gir/1.12.53/Gnm-1.12.xml b/x11-packages/gnumeric/gir/1.12.53/Gnm-1.12.xml new file mode 100644 index 00000000000000..c0c9be3aaba677 --- /dev/null +++ b/x11-packages/gnumeric/gir/1.12.53/Gnm-1.12.xml @@ -0,0 +1,669 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x11-packages/gnumeric/gnumeric-help.subpackage.sh b/x11-packages/gnumeric/gnumeric-help.subpackage.sh new file mode 100644 index 00000000000000..72f30a971ce7b4 --- /dev/null +++ b/x11-packages/gnumeric/gnumeric-help.subpackage.sh @@ -0,0 +1,5 @@ +TERMUX_SUBPKG_INCLUDE="share/help/" +TERMUX_SUBPKG_DESCRIPTION="Gnumeric help files" +TERMUX_SUBPKG_PLATFORM_INDEPENDENT=true +TERMUX_SUBPKG_BREAKS="gnumeric (<< 1.12.53)" +TERMUX_SUBPKG_REPLACES="gnumeric (<< 1.12.53)" diff --git a/x11-packages/gnumeric/gnumeric-python.subpackage.sh b/x11-packages/gnumeric/gnumeric-python.subpackage.sh new file mode 100644 index 00000000000000..6c76801f916d60 --- /dev/null +++ b/x11-packages/gnumeric/gnumeric-python.subpackage.sh @@ -0,0 +1,8 @@ +TERMUX_SUBPKG_INCLUDE=" +lib/gnumeric/*/plugins/gnome-glossary +lib/gnumeric/*/plugins/python-loader +lib/gnumeric/*/plugins/py-func +lib/python* +" +TERMUX_SUBPKG_DESCRIPTION="Python components for Gnumeric" +TERMUX_SUBPKG_DEPENDS="pygobject, python" diff --git a/x11-packages/gnumeric/introspection-Makefile.in.patch b/x11-packages/gnumeric/introspection-Makefile.in.patch new file mode 100644 index 00000000000000..69a5ac2b5d17be --- /dev/null +++ b/x11-packages/gnumeric/introspection-Makefile.in.patch @@ -0,0 +1,11 @@ +--- a/introspection/Makefile.in ++++ b/introspection/Makefile.in +@@ -568,7 +568,7 @@ + + + @HAVE_INTROSPECTION_TRUE@@HAVE_PYTHON_GI_TRUE@install-data-local: +-@HAVE_INTROSPECTION_TRUE@@HAVE_PYTHON_GI_TRUE@ install -D -m 0444 -t $(DESTDIR)@GIOVERRIDESDIR@ gi/overrides/Gnm.py ++@HAVE_INTROSPECTION_TRUE@@HAVE_PYTHON_GI_TRUE@ install -D -m 0444 -t $(DESTDIR)@GIOVERRIDESDIR@ $(srcdir)/gi/overrides/Gnm.py + + @HAVE_INTROSPECTION_TRUE@@HAVE_PYTHON_GI_TRUE@uninstall-local: + @HAVE_INTROSPECTION_TRUE@@HAVE_PYTHON_GI_TRUE@ rm -f $(DESTDIR)@GIOVERRIDESDIR@/Gnm.py diff --git a/x11-packages/gnumeric/plugins-python-loader-Makefile.in.diff b/x11-packages/gnumeric/plugins-python-loader-Makefile.in.diff new file mode 100644 index 00000000000000..7ea279f0ff218a --- /dev/null +++ b/x11-packages/gnumeric/plugins-python-loader-Makefile.in.diff @@ -0,0 +1,11 @@ +--- a/plugins/python-loader/Makefile.in ++++ b/plugins/python-loader/Makefile.in +@@ -321,7 +321,7 @@ + LD = @LD@ + LDFLAGS = @LDFLAGS@ + LIBOBJS = @LIBOBJS@ +-LIBS = @LIBS@ ++LIBS = @LIBS@ -lpython@PYTHON_VERSION@ + LIBSPREADSHEET_CFLAGS = @LIBSPREADSHEET_CFLAGS@ + LIBSPREADSHEET_LIBS = @LIBSPREADSHEET_LIBS@ + LIBTOOL = @LIBTOOL@