From b490986f7e294f20452bbe9b8301ae17ade73d0d Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Tue, 11 Feb 2020 16:06:25 +0200 Subject: [PATCH] new package: gnuplot-x Same as 'gnuplot' from termux-packages but with X11 support. Requested in https://github.com/termux/x11-packages/issues/90. --- x11-packages/gnuplot-x/Makefile.patch | 12 ++++++++++ x11-packages/gnuplot-x/build.sh | 28 ++++++++++++++++++++++ x11-packages/gnuplot-x/plot.c.patch | 11 +++++++++ x11-packages/gnuplot-x/src-command.c.patch | 13 ++++++++++ 4 files changed, 64 insertions(+) create mode 100644 x11-packages/gnuplot-x/Makefile.patch create mode 100644 x11-packages/gnuplot-x/build.sh create mode 100644 x11-packages/gnuplot-x/plot.c.patch create mode 100644 x11-packages/gnuplot-x/src-command.c.patch diff --git a/x11-packages/gnuplot-x/Makefile.patch b/x11-packages/gnuplot-x/Makefile.patch new file mode 100644 index 000000000..56694a51f --- /dev/null +++ b/x11-packages/gnuplot-x/Makefile.patch @@ -0,0 +1,12 @@ +diff -u -r ../gnuplot-5.2.0/Makefile.in ./Makefile.in +--- ../gnuplot-5.2.0/Makefile.in 2017-09-03 03:44:09.000000000 +0000 ++++ ./Makefile.in 2017-10-14 20:54:05.459305245 +0000 +@@ -344,7 +344,7 @@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = foreign +-SUBDIRS = config m4 term src docs man demo tutorial share ++SUBDIRS = config m4 term src man tutorial share + EXTRA_DIST = BUGS Copyright FAQ.pdf GNUmakefile INSTALL INSTALL.gnu \ + Makefile.maint PATCHLEVEL PGPKEYS README RELEASE_NOTES \ + VERSION configure.vms win diff --git a/x11-packages/gnuplot-x/build.sh b/x11-packages/gnuplot-x/build.sh new file mode 100644 index 000000000..373396546 --- /dev/null +++ b/x11-packages/gnuplot-x/build.sh @@ -0,0 +1,28 @@ +TERMUX_PKG_HOMEPAGE=http://gnuplot.info/ +TERMUX_PKG_DESCRIPTION="Command-line driven graphing utility" +TERMUX_PKG_LICENSE="BSD" +TERMUX_PKG_VERSION=5.2.8 +TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/gnuplot/gnuplot/${TERMUX_PKG_VERSION}/gnuplot-${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=60a6764ccf404a1668c140f11cc1f699290ab70daa1151bb58fed6139a28ac37 +TERMUX_PKG_DEPENDS="libandroid-support, libc++, libiconv, libx11, readline, pango, libgd, zlib" +TERMUX_PKG_CONFLICTS="gnuplot" +TERMUX_PKG_HOSTBUILD=true + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +--with-x +--with-lua=no +--with-bitmap-terminals +--with-texdir=$TERMUX_PREFIX/share/texmf +" + +termux_step_host_build() { + "$TERMUX_PKG_SRCDIR/configure" + make -C docs/ gnuplot.gih +} + +termux_step_post_make_install() { + mkdir -p $TERMUX_PREFIX/share/gnuplot/5.2/ + + cp $TERMUX_PKG_HOSTBUILD_DIR/docs/gnuplot.gih \ + $TERMUX_PREFIX/share/gnuplot/5.2/gnuplot.gih +} diff --git a/x11-packages/gnuplot-x/plot.c.patch b/x11-packages/gnuplot-x/plot.c.patch new file mode 100644 index 000000000..c99893208 --- /dev/null +++ b/x11-packages/gnuplot-x/plot.c.patch @@ -0,0 +1,11 @@ +--- ./src/plot.c.orig 2019-02-08 21:42:42.500914619 +0000 ++++ ./src/plot.c 2019-02-08 21:43:56.702190583 +0000 +@@ -281,7 +281,7 @@ + #endif + /* make sure that we really have revoked root access, this might happen if + gnuplot is compiled without vga support but is installed suid by mistake */ +-#ifdef __linux__ ++#if defined(__linux__) && !defined(__ANDROID__) + if (setuid(getuid()) != 0) { + fprintf(stderr,"gnuplot: refusing to run at elevated privilege\n"); + exit(EXIT_FAILURE); diff --git a/x11-packages/gnuplot-x/src-command.c.patch b/x11-packages/gnuplot-x/src-command.c.patch new file mode 100644 index 000000000..a0657eda2 --- /dev/null +++ b/x11-packages/gnuplot-x/src-command.c.patch @@ -0,0 +1,13 @@ +For WEXITSTATUS macro. + +diff -u -r ../gnuplot-5.2.0/src/command.c ./src/command.c +--- ../gnuplot-5.2.0/src/command.c 2017-08-30 18:48:26.000000000 +0000 ++++ ./src/command.c 2017-10-14 20:56:13.905856980 +0000 +@@ -138,6 +138,7 @@ + int vms_ktid; /* key table id, for translating keystrokes */ + #endif /* VMS */ + ++#include + + /* static prototypes */ + static void command __PROTO((void));