1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-12-22 20:53:24 +02:00

gnuplot-gfx: a graphical gnuplot that uses truecolor libvga graphics

This commit is contained in:
David Kühling 2011-01-06 17:17:15 +01:00
parent 437e156f07
commit 7336686dfa
9 changed files with 166 additions and 21 deletions

View File

@ -7,9 +7,26 @@
# License GPLv2 or later. NO WARRANTY.
#
# Todo:
#
# - After 21acf8eb423af24ca00835192239d50f2e4570a8 I once had proper plot
# display from Octave (but didn't came back to the console afterwards).
# Even after building again with mouse support, this isn't working any more.
# Why? Must be related to the 050-ggi-close.patch but that patch is doing
# close to nothing.
#
# - Somebody seems to mess with the console/stdin. Even when using
# GGI_FBDEV_OPTIONS=-noinput and setting GGI_NEWVT. Can be easily tested
# when launching from ssh.
#
# - When using GGI_NEWVT in Octave, it seems like somebody is injecting text
# or something into Octave's stdin or into the file handles Octave uses. It
# would abort with some strange error message noting that it doesn't know
# some corrupted command name (stuff like "setset"). Very frightening.
include $(TOPDIR)/rules.mk
PKG_NAME:=gnuplot-ggi
PKG_NAME:=gnuplot-gfx
PKG_ORIG_NAME=gnuplot
PKG_VERSION:=4.4.0
PKG_RELEASE:=3
@ -20,39 +37,39 @@ PKG_SOURCE_URL:=@SF/gnuplot
PKG_MD5SUM:=e708665bd512153ad5c35252fe499059
PKG_INSTALL=1
PKG_BUILD_DEPENDS:= gnuplot-ggi/host libtool/host
PKG_BUILD_DEPENDS:= gnuplot-gfx/host libtool/host
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/gnuplot-ggi/Default
define Package/gnuplot-gfx/Default
SECTION:=utils
CATEGORY:=Utilities
TITLE:=A portable command-line driven graphing utility
URL:=http://sourceforge.net/projects/gnuplot/
endef
define Package/gnuplot-ggi/Default/description
define Package/gnuplot-gfx/Default/description
Gnuplot is a portable command-line driven graphing utility for linux, OS/2,
MS Windows, OSX, VMS, and many other platforms. This version is compiled
to use LibGGI as default terminal, allowing gnuplot to draw directly to
the Linux framebuffer.
endef
define Package/gnuplot-ggi
$(call Package/gnuplot-ggi/Default)
DEPENDS:=+libncurses +uclibcxx +zlib +libpng +libfreetype +libgd +libintl +libiconv
define Package/gnuplot-gfx
$(call Package/gnuplot-gfx/Default)
DEPENDS:=+libncurses +uclibcxx +zlib +libpng +libfreetype +libgd +libintl +libiconv +svgalib
TITLE+=
endef
define Package/gnuplot-ggi-gih
$(call Package/gnuplot-ggi/Default)
DEPENDS:=+gnuplot-ggi
define Package/gnuplot-gfx-gih
$(call Package/gnuplot-gfx/Default)
DEPENDS:=+gnuplot-gfx
TITLE+=(integrated help)
endef
define Package/gnuplot-ggi-gih/description
$(call Package/gnuplot-ggi/Default/description)
define Package/gnuplot-gfx-gih/description
$(call Package/gnuplot-gfx/Default/description)
This package contains the documentation files needed for GNUplot\'s internal
help system.
endef
@ -93,16 +110,23 @@ CONFIGURE_ARGS += \
--without-tutorial \
--without-row-help \
--without-lisp-files \
--with-ggi \
--with-gihdir=/usr/share/gnuplot \
--disable-mouse
--without-ggi \
--with-linux-vga \
--with-gihdir=/usr/share/gnuplot
# Without mouse, gnuplot works in console mode where it closes the graphics
# device after keypress to get into text mode. This makes it impossible to
# use Octave which relies on proper suspend/resume behaviour with multiplot.
#--disable-mouse
CONFIGURE_VARS += \
CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++" \
CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
LIBS="-nodefaultlibs -luClibc++ -lpthread -lgcc"
TARGET_CPPFLAGS += -DDEFAULTTERM=\\\"ggi\\\"
TARGET_CPPFLAGS += -DDEFAULTTERM=\\\"linux\\\"
# todo: insto cppflags
TARGET_CFLAGS += \
@ -114,6 +138,9 @@ TARGET_LDFLAGS+= \
-L$(STAGING_DIR)/usr/lib/libintl/lib \
-L$(STAGING_DIR)/usr/lib/libiconv/lib
# todo: remove that when stable
MAKE_FLAGS += -j2
# cannot disable mouse for ggi: compilation fails. (todo: fix)
# --disable-mouse
@ -122,23 +149,23 @@ TARGET_LDFLAGS+= \
#TARGET_LDFLAGS += -Wl,-rpath-link -Wl,$(STAGING_DIR)/usr/lib
define Package/gnuplot-ggi/install
define Package/gnuplot-gfx/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnuplot $(1)/usr/bin/
endef
define Package/gnuplot-ggi-gih/install
define Package/gnuplot-gfx-gih/install
$(INSTALL_DIR) $(1)/usr/share/gnuplot/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnuplot/gnuplot.gih \
$(1)/usr/share/gnuplot/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,gnuplot-ggi))
$(eval $(call BuildPackage,gnuplot-ggi-gih))
$(eval $(call BuildPackage,gnuplot-gfx))
$(eval $(call BuildPackage,gnuplot-gfx-gih))
# The following comments configure the Emacs editor. Just ignore them.
# Local Variables:
# compile-command: "make -C ~/h/src/qi/openwrt-xburst package/gnuplot-ggi/compile -j2 V=99"
# compile-command: "make -C ~/h/src/qi/openwrt-xburst package/gnuplot-gfx/compile -j2 V=99"
# End:

View File

@ -0,0 +1,71 @@
Index: gnuplot-4.4.0/term/ggi.trm
===================================================================
--- gnuplot-4.4.0.orig/term/ggi.trm 2011-01-05 13:48:52.000000000 +0100
+++ gnuplot-4.4.0/term/ggi.trm 2011-01-05 21:52:25.000000000 +0100
@@ -230,6 +230,7 @@
static TBOOLEAN GGI_mode_changed = 1;
static char GGI_mode_spec[0xff] = "";
static int GGI_acceleration = 7; /* arbitrary */
+static TBOOLEAN GGI_initialized = 0;
enum GGI_id {
GGI_MODE,
@@ -275,6 +276,7 @@
/* Called bevore a graphic is displayed */
TERM_PUBLIC void GGI_graphics()
{
+ GGI_init();
#ifdef USE_MOUSE
int i, j;
int display_frame = ggiGetDisplayFrame(GGIvisual);
@@ -355,6 +357,12 @@
int success = 0;
ggi_mode mode;
+ if (GGI_initialized) {
+ return;
+ }
+ GGI_initialized = 1;
+ printf ("gii initializing\n");
+
#if 0
if (0 != giiInit()) {
ggiPanic("*** giiInit() failed *** \n");
@@ -554,6 +562,10 @@
TERM_PUBLIC void
GGI_close()
{
+ if (!GGI_initialized) {
+ return;
+ }
+
ggiFlush(GGIvisual);
/* DETACH EXTENSIONS */
#if HAVE_WMH_H
@@ -567,6 +579,8 @@
ggiClose(GGIvisual);
GGIvisual = (ggi_visual_t)0;
+ ggiExit();
+ GGI_initialized = 0;
/* EXIT EXTENSIONS */
#if HAVE_WMH_H
@@ -578,6 +592,8 @@
#ifdef ENABLE_XMI
xmiExit();
#endif
+
+ printf ("gii closed\n");
}
/* Called when terminal is terminated i.e.
@@ -614,6 +630,8 @@
GGI_resume()
{
/* do nothing */
+ /* why? this looks broken! */
+ GGI_init();
}
TERM_PUBLIC void

View File

@ -0,0 +1,15 @@
Index: gnuplot-4.4.0/term/linux.trm
===================================================================
--- gnuplot-4.4.0.orig/term/linux.trm 2011-01-06 16:19:41.000000000 +0100
+++ gnuplot-4.4.0/term/linux.trm 2011-01-06 16:20:00.000000000 +0100
@@ -120,7 +120,9 @@
char line[256];
FILE *pipe;
- LINUX_graphics_allowed = FALSE;
+ /* enabling this. No need to be paranoid on openwrt. popen() below won't
+ even work */
+ LINUX_graphics_allowed = TRUE;
if (geteuid() != 0)
return; /* if we aren't root, we cannot init graphics */

View File

@ -0,0 +1,19 @@
Index: gnuplot-4.4.0/term/linux.trm
===================================================================
--- gnuplot-4.4.0.orig/term/linux.trm 2011-01-06 16:42:27.000000000 +0100
+++ gnuplot-4.4.0/term/linux.trm 2011-01-06 17:14:41.000000000 +0100
@@ -94,8 +94,12 @@
#define _STRING_H_
#include <vga.h>
-static int linux_vmode = G1024x768x256; /* default mode */
-static int vgacolor[] = { 7, 8, 2, 3, 4, 5, 9, 14, 12, 15, 13, 10, 11, 1, 6 };
+static int linux_vmode = G320x240x16M32; /* default mode */
+/* static int vgacolor[] = { 7, 8, 2, 3, 4, 5, 9, 14, 12, 15, 13, 10, 11, 1, 6 }; */
+static int vgacolor[] = {
+ 0x808080, 0xc0c0c0, 0x008000, 0x008080, 0x800000, 0x800080,
+ 0x0000ff, 0xffff00, 0xff0000, 0xffffff, 0xff00ff, 0x00ff00,
+ 0x00ffff, 0x000080, 0x808000 };
static int graphics_on = FALSE;
static vga_modeinfo *modeinfo;
static int linux_startx, linux_starty, linux_lasty;

View File

@ -0,0 +1,13 @@
Index: gnuplot-4.4.0/src/term.c
===================================================================
--- gnuplot-4.4.0.orig/src/term.c 2011-01-06 17:10:50.000000000 +0100
+++ gnuplot-4.4.0/src/term.c 2011-01-06 17:13:37.000000000 +0100
@@ -1792,7 +1792,7 @@
LINUX_setup has failed, also if we are logged in by network */
#ifdef LINUXVGA
if (LINUX_graphics_allowed)
-#ifdef VGAGL
+#if defined(VGAGL) && defined (THREEDKIT)
term_name = "vgagl";
#else
term_name = "linux";