# HG changeset patch
# User John Donoghue
# Date 1464211082 14400
#      Wed May 25 17:18:02 2016 -0400
# Node ID 05a46c977b8d4750aff046a2dd59148d9e11a5a6
# Parent  5e57f06cd77f5c0be9935dc0e9569f8dbe75329e
gnuplot: update to 5.0.3

* src/gnuplot.mk: update version, checksum

* src/gnuplot-1-fixes.patch: update patch

diff -r 5e57f06cd77f -r 05a46c977b8d src/gnuplot-1-fixes.patch
--- a/src/gnuplot-1-fixes.patch	Wed Oct 29 19:00:07 2014 +0000
+++ b/src/gnuplot-1-fixes.patch	Wed May 25 17:18:02 2016 -0400
@@ -1,142 +1,120 @@
- diff -ur gnuplot-4.6.7/config/mingw/Makefile gnuplot-4.6.7-commit/config/mingw/Makefile
---- gnuplot-4.6.7/config/mingw/Makefile	2014-06-13 01:56:55.000000000 +0900
-+++ gnuplot-4.6.7-commit/config/mingw/Makefile	2015-05-16 11:46:53.704000000 +0900
-@@ -27,7 +27,7 @@
+diff -ur gnuplot-5.0.3.orig/config/mingw/Makefile gnuplot-5.0.3/config/mingw/Makefile
+--- gnuplot-5.0.3.orig/config/mingw/Makefile	2016-05-25 15:58:26.763608353 -0400
++++ gnuplot-5.0.3/config/mingw/Makefile	2016-05-25 17:14:30.210884417 -0400
+@@ -91,14 +91,14 @@
+ # Requires libcaca version 0.99.beta15 or newer. A post-beta18
+ # svn version is recommended since it contains an improved
+ # win32 backend.
+-CACA=1
++#CACA=1
  
- # Use more modern HTML help instead of no longer supported Windows help system
- # Please update the HHWPATH below if necessary.
--HTML_HELP=1
-+#HTML_HELP=1
+ # Uncomment if you have libiconv
+ ICONV=1
  
- # GIF, PNG, JPEG device drivers
- # Requires gd library. There are two possibilities how to configure these
-@@ -127,29 +127,29 @@
- # -mpentiumpro means optimize for Pentium II and Pro processors
- #CFLAGS +=
+ # Uncomment if you have libcerf
+ # http://sourceforge.net/projects/libcerf/
+-CERF=1
++#CERF=1
  
--ifdef HTML_HELP
-+# ifdef HTML_HELP
+ # Below you can adapt paths according to your software setup:
  
- # To compile the .chm file you need the Microsoft HTML Help 1.4 SDK
- # It can be obtained here:
- # http://go.microsoft.com/fwlink/?LinkId=154968
- # We need to explicitly set the correct path here since we also need
- # adjust the include and library paths.
--HHWPATH = "$(PROGRAMFILES)/HTML Help Workshop/"
--HHC = $(HHWPATH)hhc
-+# HHWPATH = "$(PROGRAMFILES)/HTML Help Workshop/"
-+# HHC = $(HHWPATH)hhc
- 
--else
-+# else
- 
- # To compile the .hlp file you need hcw either out of Microsoft SDK or MS Help
- # Workshop. The latter can be obtained from either of
- # ftp://ftp.microsoft.com/softlib/mslfiles/hcwsetup.exe
- # http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=34D35502-4DE9-4676-952C-34CC7F64F098
- # Put the path to hcw here unless it is already in PATH:
--HCWPATH = "$(PROGRAMFILES)/Help\ Workshop/"
--HCW = $(HCWPATH)hcw
-+# HCWPATH = "$(PROGRAMFILES)/Help\ Workshop/"
-+# HCW = $(HCWPATH)hcw
- # Switches are for HCW 4.03:
--HCWFLAG =
-+# HCWFLAG =
- 
--endif
-+# endif
- 
- # Choose which resource compiler you want to use (GNU windres or MS rc):
- GNU_RC = 1
-@@ -382,8 +382,9 @@
+@@ -267,10 +267,14 @@
  endif
  
- ifdef ICONV
--	CFLAGS += -DHAVE_ICONV
--	TERMLIBS += -liconv
-+	CFLAGS += -DHAVE_ICONV $(ICONV_CFLAGS)
-+        LDFLAGS += $(ICONV_LDFLAGS)
-+	TERMLIBS += -liconv 
- endif
+ # Name of helpfiles:
+-HELPFILE = wgnuplot.chm
+-HELPFILEJA = wgnuplot-ja.chm
+-CFLAGS += -I$(HHWPATH)include
+-BUILDHELPFILE = $(D)windows/$(HELPFILE)
++ifdef HTML_HELP
++  HELPFILE = wgnuplot.chm
++  HELPFILEJA = wgnuplot-ja.chm
++  CFLAGS += -I$(HHWPATH)include
++  BUILDHELPFILE = $(D)windows/$(HELPFILE)
++#else
++  HELPFILE = wgnuplot.hlp
++endif
  
- ifdef GNU_RC
-@@ -401,7 +402,7 @@
-   RES2COFF = res2coff -i wgnuplot.res -o wgplt_res.$(O)
- endif
+ ifdef NEWGD
+   GD=1
+@@ -445,7 +449,7 @@
+ FULLVERSION := $(MAINVERSION) patchlevel $(PATCHLEVEL)
+ 
  
 -default: $(TARGET) $(MENUFILE) support
 +default: $(TARGET) $(MENUFILE) # support
  
- console:
- 	$(MAKE) TARGET=gnuplot.exe gnuplot.exe
-@@ -443,7 +444,7 @@
-   LDFLAGS2 += -L$(HHWPATH)lib
- endif
+ console: 
+ 	$(MAKE) TARGET=gnuplot.exe default
+@@ -487,8 +491,10 @@
+ 	$(CC) -c $(CFLAGS) $(CFLAGSEXTRA) -MMD -MT '$*.$$(O)' -MF $*.d -o $@ $<
  
--$(TARGET): $(OBJS) $(WINOBJS) wgplt_res.$(O) texticon.ico grpicon.ico
-+$(TARGET): $(OBJS) $(WINOBJS) wgplt_res.$(O) TEXTICON.ico GRPICON.ico
+ LDLIBS = -lkernel32 -lgdi32 -lwinspool -lcomdlg32 -lcomctl32 -ladvapi32 -lshell32 -lmsimg32 -lgdiplus
+-LDLIBS += -lhtmlhelp
+-LDFLAGS2 += -L$(HHWPATH)lib
++ifdef HTML_HELP
++  LDLIBS += -lhtmlhelp
++  LDFLAGS2 += -L$(HHWPATH)lib
++endif
+ 
+ $(TARGET): $(VERSIONING) $(OBJS) $(WINOBJS) wgplt_res.$(O) Makefile
  	$(LDX) $(LDFLAGS) $(LDFLAGS2) -o $@ $(OBJS) $(WINOBJS) wgplt_res.$(O) $(LDLIBS)\
- 	$(TERMLIBS) $(WX_LIBS) $(PANGOCAIRO_LIBS)
+diff -ur gnuplot-5.0.3.orig/src/command.c gnuplot-5.0.3/src/command.c
+--- gnuplot-5.0.3.orig/src/command.c	2016-05-25 15:58:26.693609393 -0400
++++ gnuplot-5.0.3/src/command.c	2016-05-25 17:11:27.591545425 -0400
+@@ -2541,9 +2541,9 @@
+     parent = GetDesktopWindow();
  
-@@ -458,7 +459,7 @@
+     /* open help file if necessary */
+-    help_window = HtmlHelp(parent, winhelpname, HH_GET_WIN_HANDLE, (DWORD_PTR)NULL);
++    help_window = WinHelp(parent, winhelpname, HH_GET_WIN_HANDLE, (DWORD_PTR)NULL);
+     if (help_window == NULL) {
+-        help_window = HtmlHelp(parent, winhelpname, HH_DISPLAY_TOPIC, (DWORD_PTR)NULL);
++        help_window = WinHelp(parent, winhelpname, HH_DISPLAY_TOPIC, (DWORD_PTR)NULL);
+         if (help_window == NULL) {
+             fprintf(stderr, "Error: Could not open help file \"%s\"\n", winhelpname);
+             return;
+@@ -2551,7 +2551,7 @@
+     }
+     if (END_OF_COMMAND) {
+         /* show table of contents */
+-        HtmlHelp(parent, winhelpname, HH_DISPLAY_TOC, (DWORD_PTR)NULL);
++        WinHelp(parent, winhelpname, HH_DISPLAY_TOC, (DWORD_PTR)NULL);
+     } else {
+         /* lookup topic in index */
+         HH_AKLINK link;
+@@ -2568,7 +2568,7 @@
+         link.pszMsgTitle =  NULL;
+         link.pszWindow =    NULL;
+         link.fIndexOnFail = TRUE;
+-        HtmlHelp(parent, winhelpname, HH_KEYWORD_LOOKUP, (DWORD_PTR)&link);
++        WinHelp(parent, winhelpname, HH_KEYWORD_LOOKUP, (DWORD_PTR)&link);
+     }
+ }
+ #else  /* !_Windows */
+diff -ur gnuplot-5.0.3.orig/src/internal.c gnuplot-5.0.3/src/internal.c
+--- gnuplot-5.0.3.orig/src/internal.c	2016-05-25 15:58:26.743608650 -0400
++++ gnuplot-5.0.3/src/internal.c	2016-05-25 16:08:29.549662758 -0400
+@@ -47,6 +47,7 @@
  
- # explicit rules
+ #include <math.h>
  
--wgplt_res.$(O): $(W)/wgnuplot.rc $(W)/wgnuplib.rc $(W)/wresourc.h texticon.ico grpicon.ico
-+wgplt_res.$(O): $(W)/wgnuplot.rc $(W)/wgnuplib.rc $(W)/wresourc.h TEXTICON.ico GRPICON.ico
- 	$(RC) $(RCFLAGS) $< $(RCOUT)
- 	$(RES2COFF)
++#ifndef __MINGW32__
+ #ifndef _WIN64
+ /*
+  * FIXME: This is almost certainly out of date on linux, since the matherr
+@@ -69,6 +70,7 @@
+     return (undefined = TRUE);	/* don't print error message */
+ }
+ #endif
++#endif
  
-@@ -494,13 +495,13 @@
- 	$(CC) -c $(CFLAGS) $(CXXFLAGS) $(PANGOCAIRO_CFLAGS) -MMD -MT '$*.$$(O)' -MF $*.d -o $@ $<
+ static enum DATA_TYPES sprintf_specifier __PROTO((const char *format));
  
- # extract icons from wgnuplot.rc
--texticon.ico: grpicon.ico
-+TEXTICON.ico: GRPICON.ico
- 
--grpicon.ico: geticon.exe $(W)/wgnuplot.rc
-+GRPICON.ico: geticon $(W)/wgnuplot.rc
- 	./geticon $(W)/wgnuplot.rc
- 
--geticon.exe: $(W)/geticon.c
--	$(LD) $(LDFLAGS) -o $@ $<
-+geticon: $(W)/geticon.c
-+	gcc -o $@ $<
- 
- ifdef HTML_HELP
- # convert gnuplot.doc to windows/wgnuplot.html
-@@ -703,7 +704,7 @@
- 	$(RM) config.h wgnuplot.map wgnuplot.res $(W)/gnuplot.rtf
- 	$(RM) *.$(O) *.po *.o *.co *.d
- 	$(RM) doc2*.exe $(W)/wgnuplib.res wgnuplib.map wgnuplot.lib
--	$(RM) $(M)bf_test.exe *.ico geticon.exe allterm.h allterm.c
-+	$(RM) $(M)bf_test.exe *.ico geticon allterm.h allterm.c
- 	$(RM) *.aux *.log *.dvi *.toc
- 	$(RM) gnuplot.tex gnuplot-figures.tex pdffigures.tex figure_*.pdf
- 	$(RM) titlepag.tex toc_entr.sty VERSION
-@@ -802,7 +803,7 @@
- 
- installer:
- 	$(MAKE) DESTDIR=./dist install
--	cp -p grpicon.ico ./dist/bin/
-+	cp -p GRPICON.ico ./dist/bin/
- 	cp -p $(TOP)/win/*.iss ./dist
- 	(cd ./dist; $(ISCC) gnuplot.iss)
- ifdef RELEASE
-
-diff -ur gnuplot-4.6.7/src/syscfg.h gnuplot-4.6.7-commit/src/syscfg.h
---- gnuplot-4.6.7/src/syscfg.h	2014-08-01 01:56:25.000000000 +0900
-+++ gnuplot-4.6.7-commit/src/syscfg.h	2015-05-16 15:27:58.612000000 +0900
-@@ -317,11 +317,19 @@
- #endif
- 
- #ifndef GP_EXCEPTION_NAME
--# define GP_EXCEPTION_NAME exception
-+# if __MINGW32__
-+#  define GP_EXCEPTION_NAME _exception
-+# else
-+#  define GP_EXCEPTION_NAME exception
-+# endif
+diff -ur gnuplot-5.0.3.orig/src/syscfg.h gnuplot-5.0.3/src/syscfg.h
+--- gnuplot-5.0.3.orig/src/syscfg.h	2016-05-25 15:58:26.698609318 -0400
++++ gnuplot-5.0.3/src/syscfg.h	2016-05-25 16:07:22.469658253 -0400
+@@ -345,7 +345,11 @@
  #endif
  
  #ifndef GP_MATHERR
@@ -149,38 +127,3 @@
  #endif
  
  #ifdef HAVE_STRUCT_EXCEPTION_IN_MATH_H
-
-diff -ur gnuplot-4.6.7/src/win/wgnuplot.rc gnuplot-4.6.7-commit/src/win/wgnuplot.rc
---- gnuplot-4.6.7/src/win/wgnuplot.rc	2014-07-08 03:18:41.000000000 +0900
-+++ gnuplot-4.6.7-commit/src/win/wgnuplot.rc	2015-05-16 11:24:48.912000000 +0900
-@@ -19,8 +19,8 @@
-    * rc -30 -k -dMSRC win\wgnuplot.rc wgnuplot.exe
-    */
- 
--GRPICON ICON "grpicon.ico"
--TEXTICON ICON  "texticon.ico"
-+GRPICON ICON "GRPICON.ico"
-+TEXTICON ICON  "TEXTICON.ico"
- 
- #else
- /* using Borland BRC.EXE */
-
-diff -ur internal.orig.c internal.mod.c
---- a/src/internal.c	2014-07-08 03:18:40.000000000 +0900
-+++ b/src/internal.c	2015-05-16 19:29:17.660000000 +0900
-@@ -58,6 +58,7 @@
- 
- static enum DATA_TYPES sprintf_specifier __PROTO((const char *format));
- 
-+#ifndef __MINGW32__
- #ifndef _WIN64
- int
- GP_MATHERR( STRUCT_EXCEPTION_P_X )
-@@ -65,6 +66,7 @@
-     return (undefined = TRUE);	/* don't print error message */
- }
- #endif
-+#endif
- 
- #define BAD_DEFAULT default: int_error(NO_CARET, "internal error : type neither INT or CMPLX"); return;
-
diff -r 5e57f06cd77f -r 05a46c977b8d src/gnuplot.mk
--- a/src/gnuplot.mk	Wed Oct 29 19:00:07 2014 +0000
+++ b/src/gnuplot.mk	Wed May 25 17:18:02 2016 -0400
@@ -3,8 +3,8 @@
 
 PKG             := gnuplot
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 4.6.7
-$(PKG)_CHECKSUM := 0f76465981f4643a5a5491333aeda4d56d890622
+$(PKG)_VERSION  := 5.0.3
+$(PKG)_CHECKSUM := 7ec8b4221ee5406f1beeac4f9db794acb501dc2b
 $(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
 $(PKG)_FILE     := gnuplot-$($(PKG)_VERSION).tar.gz
 $(PKG)_URL      := http://sourceforge.net/projects/gnuplot/files/gnuplot/$($(PKG)_VERSION)/$($(PKG)_FILE)
