# HG changeset patch
# User "lostbard" <john.donoghue@ieee.org>
# Date 1468592645 14400
# Node ID 54cb1c8721d12999906b10debb61877eb9e328b6
# Parent  4117faf769886269ee970ee90a629d2553709c51
gnuplot: update for 5.0.4

* src/gnuplot.mk: update version, checksum

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

diff -r 4117faf76988 -r 54cb1c8721d1 src/gnuplot-1-fixes.patch
--- a/src/gnuplot-1-fixes.patch	Fri Jul 08 10:24:12 2016 -0400
+++ b/src/gnuplot-1-fixes.patch	Fri Jul 15 10:24:05 2016 -0400
@@ -1,17 +1,7 @@
-diff -ur gnuplot-5.0.3.orig/config/config.mgw gnuplot-5.0.3/config/config.mgw
---- gnuplot-5.0.3.orig/config/config.mgw	2016-05-25 15:58:26.763608353 -0400
-+++ gnuplot-5.0.3/config/config.mgw	2016-05-27 08:00:58.093953296 -0400
-@@ -671,5 +671,5 @@
- #endif
- 
- /* gnuplot.gih is not used by wgnuplot */
--#define NO_GIH 1
-+/*#define NO_GIH 1*/
- #define HELPFILE "wgnuplot.chm"
-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-27 07:49:18.557940422 -0400
-@@ -91,14 +91,14 @@
+diff -ur gnuplot-5.0.4.orig/config/mingw/Makefile gnuplot-5.0.4/config/mingw/Makefile
+--- gnuplot-5.0.4.orig/config/mingw/Makefile	2016-07-15 09:55:04.799270340 -0400
++++ gnuplot-5.0.4/config/mingw/Makefile	2016-07-15 09:58:38.784664634 -0400
+@@ -119,14 +119,14 @@
  # Requires libcaca version 0.99.beta15 or newer. A post-beta18
  # svn version is recommended since it contains an improved
  # win32 backend.
@@ -28,27 +18,27 @@
  
  # Below you can adapt paths according to your software setup:
  
-@@ -140,8 +140,8 @@
+@@ -171,8 +171,8 @@
  # 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/"
+-HHWPATH = $(PROGRAMFILES32)/HTML\ Help\ Workshop/
 -HHC = $(HHWPATH)hhc
-+#HHWPATH = "$(PROGRAMFILES)/HTML Help Workshop/"
++#HHWPATH = $(PROGRAMFILES32)/HTML\ Help\ Workshop/
 +#HHC = $(HHWPATH)hhc
  
  # Choose which resource compiler you want to use (GNU windres or MS rc):
  GNU_RC = 1
-@@ -155,7 +155,7 @@
+@@ -186,7 +186,7 @@
  
  # Inno Setup Compiler
  # get it from: http://www.jrsoftware.org/isdl.php
--ISCC = "$(PROGRAMFILES)/Inno Setup 5/iscc"
-+#ISCC = "$(PROGRAMFILES)/Inno Setup 5/iscc"
+-ISCC = $(PROGRAMFILES32)/Inno\ Setup\ 5/iscc
++#ISCC = $(PROGRAMFILES32)/Inno\ Setup\ 5/iscc
  
  # Directory that might contain extra files to be shipped with the installer.
  # This should include dependencies like DLLs, but also fontconfig configuration files.
-@@ -445,7 +445,7 @@
+@@ -514,7 +514,7 @@
  FULLVERSION := $(MAINVERSION) patchlevel $(PATCHLEVEL)
  
  
@@ -57,7 +47,7 @@
  
  console: 
  	$(MAKE) TARGET=gnuplot.exe default
-@@ -487,8 +487,8 @@
+@@ -556,8 +556,8 @@
  	$(CC) -c $(CFLAGS) $(CFLAGSEXTRA) -MMD -MT '$*.$$(O)' -MF $*.d -o $@ $<
  
  LDLIBS = -lkernel32 -lgdi32 -lwinspool -lcomdlg32 -lcomctl32 -ladvapi32 -lshell32 -lmsimg32 -lgdiplus
@@ -65,22 +55,12 @@
 -LDFLAGS2 += -L$(HHWPATH)lib
 +#LDLIBS += -lhtmlhelp
 +#LDFLAGS2 += -L$(HHWPATH)lib
- 
- $(TARGET): $(VERSIONING) $(OBJS) $(WINOBJS) wgplt_res.$(O) Makefile
- 	$(LDX) $(LDFLAGS) $(LDFLAGS2) -o $@ $(OBJS) $(WINOBJS) wgplt_res.$(O) $(LDLIBS)\
-Only in gnuplot-5.0.3/config/mingw: .Makefile.swp
-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-27 07:55:44.467430876 -0400
-@@ -117,7 +117,7 @@
- #endif /* OS2_IPC */
- 
- 
--#ifndef _Windows
-+#ifndef IGNORE_Windows
- # include "help.h"
- #else
- # ifdef USE_OWN_WINSYSTEM_FUNCTION
+ ifdef MINGW64
+ LDFLAGS2 += -L.
+ endif
+diff -ur gnuplot-5.0.4.orig/src/command.c gnuplot-5.0.4/src/command.c
+--- gnuplot-5.0.4.orig/src/command.c	2016-07-15 09:55:04.793270217 -0400
++++ gnuplot-5.0.4/src/command.c	2016-07-15 10:19:33.241949090 -0400
 @@ -125,7 +125,7 @@
  # endif
  #endif /* _Windows */
@@ -90,9 +70,25 @@
  # include <windows.h>
  # ifdef __MSC__
  #  include <malloc.h>
-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-27 07:36:23.856997094 -0400
+@@ -2535,6 +2535,7 @@
+ void
+ help_command()
+ {
++#ifndef __MINGW32__
+     HWND parent;
+ 
+     c_token++;
+@@ -2570,6 +2571,7 @@
+         link.fIndexOnFail = TRUE;
+         HtmlHelp(parent, winhelpname, HH_KEYWORD_LOOKUP, (DWORD_PTR)&link);
+     }
++#endif
+ }
+ #else  /* !_Windows */
+ #ifndef VMS
+diff -ur gnuplot-5.0.4.orig/src/internal.c gnuplot-5.0.4/src/internal.c
+--- gnuplot-5.0.4.orig/src/internal.c	2016-07-15 09:55:04.787270093 -0400
++++ gnuplot-5.0.4/src/internal.c	2016-07-15 10:00:32.411998026 -0400
 @@ -47,7 +47,7 @@
  
  #include <math.h>
@@ -102,18 +98,18 @@
  /*
   * FIXME: This is almost certainly out of date on linux, since the matherr
   * mechanism has been replaced by math_error() and supposedly is only 
-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-27 07:51:03.707439227 -0400
+diff -ur gnuplot-5.0.4.orig/src/syscfg.h gnuplot-5.0.4/src/syscfg.h
+--- gnuplot-5.0.4.orig/src/syscfg.h	2016-07-15 09:55:04.796270278 -0400
++++ gnuplot-5.0.4/src/syscfg.h	2016-07-15 10:02:39.396605714 -0400
 @@ -341,11 +341,19 @@
  #endif
  
  #ifndef GP_EXCEPTION_NAME
 -# define GP_EXCEPTION_NAME exception
 +# if __MINGW32__
-+#  define GP_EXCEPTION_NAME exception
++#   define GP_EXCEPTION_NAME exception
 +#else
-+#  define GP_EXCEPTION_NAME exception
++#   define GP_EXCEPTION_NAME exception
 +#endif
  #endif
  
diff -r 4117faf76988 -r 54cb1c8721d1 src/gnuplot.mk
--- a/src/gnuplot.mk	Fri Jul 08 10:24:12 2016 -0400
+++ b/src/gnuplot.mk	Fri Jul 15 10:24:05 2016 -0400
@@ -3,11 +3,12 @@
 
 PKG             := gnuplot
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 5.0.3
-$(PKG)_CHECKSUM := 7ec8b4221ee5406f1beeac4f9db794acb501dc2b
+$(PKG)_VERSION  := 5.0.4
+$(PKG)_CHECKSUM := ff06f1dae6adab6f87338ee6efb70f70a53667ca
 $(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)
+#$(PKG)_URL      := http://sourceforge.net/projects/gnuplot/files/gnuplot/$($(PKG)_VERSION)/$($(PKG)_FILE)
+$(PKG)_URL      := http://sourceforge.net/projects/gnuplot/files/gnuplot/5.0 release candidates/$($(PKG)_FILE)
 $(PKG)_DEPS     :=
 
 ifeq ($(MXE_NATIVE_MINGW_BUILD),yes)
