aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qtopia/gnuplot/gnuplot-4.0.0/debian-separate-x11-package.patch
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-07-24 17:57:24 +0100
committerPaul Eggleton <paul.eggleton@linux.intel.com>2011-07-30 02:35:12 +0100
commite9b45ff67d32fdc27950a51135b6dabada8334e7 (patch)
treede99cd760c8292ee1dd334e23e1e5cc43e90dfbd /recipes-qtopia/gnuplot/gnuplot-4.0.0/debian-separate-x11-package.patch
downloadmeta-opie-e9b45ff67d32fdc27950a51135b6dabada8334e7.tar.gz
initial commit of meta-opie
Populate the repository with files from OpenEmbedded at revision 45edf621296daf150c72b876d720861235e5762e - no changes, only rearranged the directory structure to match the new oe-core style and added COPYING.MIT and README. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'recipes-qtopia/gnuplot/gnuplot-4.0.0/debian-separate-x11-package.patch')
-rw-r--r--recipes-qtopia/gnuplot/gnuplot-4.0.0/debian-separate-x11-package.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/recipes-qtopia/gnuplot/gnuplot-4.0.0/debian-separate-x11-package.patch b/recipes-qtopia/gnuplot/gnuplot-4.0.0/debian-separate-x11-package.patch
new file mode 100644
index 0000000..7afa0ee
--- /dev/null
+++ b/recipes-qtopia/gnuplot/gnuplot-4.0.0/debian-separate-x11-package.patch
@@ -0,0 +1,59 @@
+--- gnuplot-4.0.0.orig/src/term.c
++++ gnuplot-4.0.0/src/term.c
+@@ -1278,6 +1278,33 @@
+ return (t);
+ }
+
++#ifdef X11
++int
++x11driver_found()
++{
++ char *binname = "/gnuplot_x11";
++ char *fullname;
++ struct stat buf;
++
++ fullname = (char*)malloc(sizeof(X11_DRIVER_DIR) + sizeof(binname) + 1);
++ strcat(fullname, X11_DRIVER_DIR);
++ strcat(fullname, binname);
++
++ /* exists? */
++ if (stat(fullname, &buf)) {
++ free(fullname);
++ return 0;
++ }
++
++ free(fullname);
++ /* executable? */
++ if (buf.st_mode && S_IXOTH)
++ return 1;
++
++ return 0;
++}
++#endif
++
+ /*
+ * Routine to detect what terminal is being used (or do anything else
+ * that would be nice). One anticipated (or allowed for) side effect
+@@ -1356,12 +1383,18 @@
+ env_term = getenv("TERM"); /* try $TERM */
+ if (term_name == (char *) NULL
+ && env_term != (char *) NULL && strcmp(env_term, "xterm") == 0)
+- term_name = "x11";
++ term_name = "x11";
+ display = getenv("DISPLAY");
+ if (term_name == (char *) NULL && display != (char *) NULL)
+- term_name = "x11";
++ term_name = "x11";
+ if (X11_Display)
+- term_name = "x11";
++ term_name = "x11";
++ /* if x11 was selected check for driver */
++ if (term_name && (strcmp(term_name, "x11") == 0) && !x11driver_found() && isatty(fileno(stdin))) {
++ printf("*** X11 output driver not found, switching to dumb terminal!\n");
++ printf("*** If you want to use the X11 output, please install the ""gnuplot-x11"" package\n");
++ term_name = "dumb";
++ };
+ #endif /* x11 */
+
+ #ifdef AMIGA
+