Skip to content

Commit

Permalink
gnumeric: Bump to 1.12.53
Browse files Browse the repository at this point in the history
and include Python components (as a subpackage).
  • Loading branch information
xtkoba committed Oct 24, 2022
1 parent 860f985 commit 892c98a
Show file tree
Hide file tree
Showing 7 changed files with 765 additions and 4 deletions.
45 changes: 41 additions & 4 deletions x11-packages/gnumeric/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
20 changes: 20 additions & 0 deletions x11-packages/gnumeric/configure.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
669 changes: 669 additions & 0 deletions x11-packages/gnumeric/gir/1.12.53/Gnm-1.12.xml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions x11-packages/gnumeric/gnumeric-help.subpackage.sh
Original file line number Diff line number Diff line change
@@ -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)"
8 changes: 8 additions & 0 deletions x11-packages/gnumeric/gnumeric-python.subpackage.sh
Original file line number Diff line number Diff line change
@@ -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"
11 changes: 11 additions & 0 deletions x11-packages/gnumeric/introspection-Makefile.in.patch
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions x11-packages/gnumeric/plugins-python-loader-Makefile.in.diff
Original file line number Diff line number Diff line change
@@ -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@

0 comments on commit 892c98a

Please sign in to comment.