diff --git a/mingw-w64-gnuplot/01-gnuplot.patch b/mingw-w64-gnuplot/01-gnuplot.patch index 777357ca70..3d932930c6 100644 --- a/mingw-w64-gnuplot/01-gnuplot.patch +++ b/mingw-w64-gnuplot/01-gnuplot.patch @@ -109,6 +109,15 @@ diff -Naur gnuplot-5.2.0.orig/config/mingw/Makefile gnuplot-5.2.0/config/mingw/M diff -Naur gnuplot-5.2.0.orig/src/command.c gnuplot-5.2.0/src/command.c --- gnuplot-5.2.0.orig/src/command.c 2017-08-30 20:48:26.000000000 +0200 +++ gnuplot-5.2.0/src/command.c 2017-09-10 18:33:08.422397000 +0200 +@@ -117,7 +117,7 @@ + #endif /* OS2_IPC */ + + +-#ifndef _Windows ++#if !defined( _Windows) || defined(__MINGW32__) + # include "help.h" + #endif /* _Windows */ + @@ -129,7 +129,7 @@ # else # include @@ -139,3 +148,199 @@ diff -Naur gnuplot-5.2.0.orig/src/win/winmain.c gnuplot-5.2.0/src/win/winmain.c #include #include #include +@@ -371,7 +371,8 @@ + else + lang = GetLanguageCode(); + +- filename = (LPTSTR) malloc((_tcslen(szModuleName) + _tcslen(name) + _tcslen(lang) + _tcslen(ext) + 1) * sizeof(TCHAR)); ++ //filename = (LPTSTR) malloc((_tcslen(szModuleName) + _tcslen(name) + _tcslen(lang) + _tcslen(ext) + 1) * sizeof(TCHAR)); ++ filename = (LPTSTR) malloc(1024 * sizeof(TCHAR)); + if (filename) { + _tcscpy(filename, szModuleName); + _tcscat(filename, name); +--- gnuplot-5.2.0.orig/src/term.c 2017-07-09 01:49:45.000000000 +0200 ++++ gnuplot-5.2.0/src/term.c 2017-09-22 06:30:56.438408900 +0200 +@@ -1582,7 +1582,7 @@ + + #if defined(WXWIDGETS) && defined(_WIN32) + if (term_name == (char *) NULL) +- term_name = "wxt"; ++ term_name = "win"; + #endif + + #ifdef QTTERM +--- gnuplot-5.2.0.orig/src/makefile.am.orig 2016-01-10 01:22:18.000000000 +0100 ++++ gnuplot-5.2.0/src/makefile.am 2017-09-22 00:25:36.299247900 +0200 +@@ -91,6 +91,26 @@ + # Hercules and original pc graphics driver code + # corgraph.asm header.mac hrcgraph.asm pcgraph.asm lineproc.mac + ++# MINGW specific build section ++if BUILD_MINGW ++ ++AM_CPPFLAGS += -DHAVE_GDIPLUS -DHAVE_DWRITE -DHAVE_D2D -DWIN32 ++AM_CPPFLAGS += -O2 -pipe -DUNICODE -D_UNICODE -Wno-unused-function ++AM_CPPFLAGS += -D_Windows -DHAVE_CONFIG_H ++AM_CPPFLAGS += -D__USE_MINGW_ANSI_STDIO=1 ++AM_CPPFLAGS += -DUSE_MOUSE=1 -DWIN_IPC ++ ++ ++AM_LDFLAGS = ++ ++gnuplot_SOURCES += win/winmain.c win/wgnuplib.c win/wgraph.c win/wprinter.c \ ++win/wpause.c win/wgdiplus.cpp win/wd2d.cpp win/wtext.h plot.h\ ++gpexecute.c ++ ++gnuplot_CPPFLAGS = $(AM_CPPFLAGS) -DPIPES -DWGP_CONSOLE ++gnuplot_LDADD += -lkernel32 -lgdi32 -lwinspool -lcomdlg32 -lcomctl32 -ladvapi32 -lshell32 -lmsimg32 -lgdiplus -lshlwapi -ld2d1 -ldwrite -lole32 ++gnuplot_LDFLAGS = $(AM_LDFLAGS) -mconsole ++ + if BUILD_WXWIDGETS + gnuplot_SOURCES += wxterminal/wxt_gui.cpp + endif +@@ -101,6 +121,43 @@ + + if BUILD_BITMAP + gnuplot_SOURCES += bitmap.c ++ ++#wgnuplot section ++bin_PROGRAMS += wgnuplot ++ ++menudir = $(prefix)/bin ++menu_DATA = win/wgnuplot.mnu ++dist_doc_DATA = ../FAQ.pdf ../README ../RELEASE_NOTES ../Copyright ../NEWS ../ChangeLog ../BUGS ++ ++wgnuplot_SOURCES = $(gnuplot_SOURCES) ++wgnuplot_SOURCES += win/wtext.c win/screenbuf.c win/wmenu.c win/wredirect.cpp ++wgnuplot_CPPFLAGS = $(AM_CPPFLAGS) -DPIPES ++wgnuplot_LDADD = $(gnuplot_LDADD) wgplt_res.$(O) ++wgnuplot_LDFLAGS = $(AM_LDFLAGS) -mwindows --enable-auto-import ++ ++ ++#wgnuplot_pipes section ++bin_PROGRAMS += wgnuplot_pipes ++ ++wgnuplot_pipes_SOURCES = $(gnuplot_SOURCES) ++wgnuplot_pipes_SOURCES += win/wtext.c win/screenbuf.c win/wmenu.c win/wredirect.cpp ++wgnuplot_pipes_CPPFLAGS = $(AM_CPPFLAGS) -DPIPES ++wgnuplot_pipes_LDADD = $(gnuplot_LDADD) wgplt_res.$(O) ++wgnuplot_pipes_LDFLAGS = $(AM_LDFLAGS) -mconsole ++ ++RCFLAGS = --include-dir=$(srcdir)/win \ ++ --define __WIN32__ --define __WIN95__ \ ++ --define __GNUWIN32__ --use-temp-file ++RCOUT = wgplt_res.$(O) ++RES2COFF = echo wgplt_res.$(O) ++ ++wgplt_res.$(O): win/wgnuplot.rc win/wgnuplib.rc win/wresourc.h win/texticon.ico win/grpicon.ico win/wgnuplot.exe.manifest win/wgnuplot.exe.manifest64 ++ echo Making RESOURCE FILE ++ windres $(RCFLAGS) $< wgplt_res.$(O) ++ echo wgplt_res.$(O) ++ ++endif ++ + endif + + DISTCLEANFILES = timestamp.h +--- gnuplot-5.2.0.orig/makefile.am 2017-06-05 00:03:34.000000000 +0200 ++++ gnuplot-5.2.0/makefile.am 2017-09-22 06:53:00.751133800 +0200 +@@ -7,6 +7,8 @@ + Makefile.maint PATCHLEVEL PGPKEYS README RELEASE_NOTES \ + VERSION configure.vms win + ++dist_doc_DATA = FAQ.pdf README RELEASE_NOTES Copyright NEWS ChangeLog BUGS ++ + DISTCLEANFILES = stamp-h + + ACLOCAL_AMFLAGS = -I m4 +--- gnuplot-5.2.0.orig/docs/makefile.am.orig 2017-07-06 01:01:27.000000000 +0200 ++++ gnuplot-5.2.0/docs/makefile.am 2017-09-22 07:01:56.461836100 +0200 +@@ -50,6 +50,12 @@ + + AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/term + ++if BUILD_MINGW ++AM_CPPFLAGS += -DWINDOWS_NO_GUI ++dist_doc_DATA = gnuplot.pdf ++endif ++ ++ + T = $(top_srcdir)/term/ + CORETERM = $(T)ai.trm $(T)aquaterm.trm $(T)be.trm $(T)caca.trm \ + $(T)cairo.trm $(T)canvas.trm $(T)cgm.trm $(T)context.trm \ +@@ -124,7 +130,8 @@ + done >$@ + + # for debugging +-alldoc: check dvi gih hlp html info ipf nroff pdf ps rnh rtf htb ++#alldoc: check dvi gih hlp html info ipf nroff pdf ps rnh rtf htb ++alldoc: gih + + ### [tn]roff documentation + troff: gnuplot.ms $(srcdir)/titlepag.ms +@@ -223,6 +230,7 @@ + + doc2tex_SOURCES = doc2tex.c termdoc.c + doc2tex_CPPFLAGS = -DALL_TERM_DOC $(AM_CPPFLAGS) ++doc2tex_CFLAGS= -DWINDOWS_NO_GUI + + dvi: gnuplot.dvi + gnuplot.dvi: gnuplot.tex $(srcdir)/titlepag.tex $(srcdir)/toc_entr.sty +@@ -339,6 +347,7 @@ + $(AM_V_GEN) ./doc2ipf$(EXEEXT) $(srcdir)/gnuplot.doc gnuplot.ipf + + doc2ipf_SOURCES = doc2ipf.c termdoc.c xref.c ++doc2ipf_CFLAGS= -DWINDOWS_NO_GUI + + ### Rich Text Format + rtf: gnuplot.rtf +@@ -366,6 +375,8 @@ + fi + + checkdoc_SOURCES = checkdoc.c termdoc.c gnuplot.doc ++checkdoc_CFLAGS= -DWINDOWS_NO_GUI ++ + + clean-local: + $(AM_V_at)for f in figure*.pdf $(LUA_HELP); do \ +--- gnuplot-5.2.0.orig/configure.ac.orig 2017-09-03 05:43:58.000000000 +0200 ++++ gnuplot-5.2.0/configure.ac 2017-09-20 15:41:50.308502400 +0200 +@@ -36,6 +36,8 @@ + AC_C_STRINGIZE + AC_PROG_LN_S + ++AC_CANONICAL_HOST ++ + if test "${build}" != "${host}" + then + CC=${CC-${host_alias-gcc}} +@@ -49,6 +51,8 @@ + CC_FOR_BUILD="${CC}" + AC_PROG_CC + ++ build_mingw=no ++ + # We must set the default linker to the linker used by gcc for the correct + # operation of libtool. If LD is not defined and we are using gcc, try to + # set the LD default to the ld used by gcc. +@@ -58,7 +62,10 @@ + then + case $build in + *-*-mingw*) +- gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; ++ gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ++ AC_MSG_NOTICE([MINGW environment detected, executing MINGW type build]) ++ #AC_CONFIG_LINKS([src/config.h:config/config.mgw]) ++ build_mingw=yes ;; + *) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; + esac +@@ -1087,6 +1094,8 @@ + + AM_CONDITIONAL(BUILD_GPCAIRO, test "${build_gpcairo}" = yes) + ++AM_CONDITIONAL(BUILD_MINGW, test "${build_mingw}" = yes) ++ + dnl Enable subsystem to generate statistical summary of file contents + AC_ARG_ENABLE(stats,dnl + [ --disable-stats Omit calculation of statistical summary of data], diff --git a/mingw-w64-gnuplot/PKGBUILD b/mingw-w64-gnuplot/PKGBUILD index a28d496d54..15a3111f2a 100644 --- a/mingw-w64-gnuplot/PKGBUILD +++ b/mingw-w64-gnuplot/PKGBUILD @@ -4,68 +4,50 @@ _realname=gnuplot pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=5.2.0 -pkgrel=2 +pkgrel=3 pkgdesc="Plotting package which outputs to X11, PostScript, PNG, GIF, and others (mingw-w64)" arch=('any') url='http://www.gnuplot.info/' license=('custom') -depends=("${MINGW_PACKAGE_PREFIX}-cairo" - "${MINGW_PACKAGE_PREFIX}-gnutls" - "${MINGW_PACKAGE_PREFIX}-libcerf" +depends=("${MINGW_PACKAGE_PREFIX}-readline" "${MINGW_PACKAGE_PREFIX}-libgd" - "${MINGW_PACKAGE_PREFIX}-lua" + "${MINGW_PACKAGE_PREFIX}-cairo" "${MINGW_PACKAGE_PREFIX}-pango" - "${MINGW_PACKAGE_PREFIX}-readline" - "${MINGW_PACKAGE_PREFIX}-wxWidgets") -makedepends=("texinfo" "dos2unix") + "${MINGW_PACKAGE_PREFIX}-wxWidgets" + "${MINGW_PACKAGE_PREFIX}-libcaca" + "${MINGW_PACKAGE_PREFIX}-libcerf" + "${MINGW_PACKAGE_PREFIX}-gnutls") options=('strip' 'staticlibs') source=("https://downloads.sourceforge.net/sourceforge/${_realname}/${_realname}-${pkgver}.tar.gz" "01-gnuplot.patch" ) sha256sums=('7dfe6425a1a6b9349b1fb42dae46b2e52833b13e807a78a613024d6a99541e43' - '502743f65c2bea57f474192076c315717fcba1aa29fe2ebffff552a6c0be522c') + 'c045d625cacc9988401c4423d84eb09e36a06b671bb75506273b9cf4a4f8957d') prepare() { cd "${srcdir}"/${_realname}-${pkgver} patch -p1 -i ${srcdir}/01-gnuplot.patch + autoreconf -fi } build() { - [[ -d build-${MINGW_CHOST} ]] && rm -rf build-${MINGW_CHOST} - cp -rf "${srcdir}"/${_realname}-${pkgver} "${srcdir}"/build-${MINGW_CHOST} - cd "${srcdir}"/build-${MINGW_CHOST} + cd "${srcdir}"/${_realname}-${pkgver} + [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH} + mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH} - ./configure \ + ../${_realname}-${pkgver}/configure \ --prefix=${MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ - --target=${MINGW_CHOST} + --target=${MINGW_CHOST} \ + --without-lua \ + --with-caca \ + --with-bitmap-terminals - # Do not build docs - cd config/mingw - make console windows pipes + make } - package() { - cd "${srcdir}"/build-${MINGW_CHOST}/config/mingw + cd "${srcdir}"/build-${CARCH} make install DESTDIR="${pkgdir}" - - cd "${pkgdir}" - mkdir -p "${pkgdir}${MINGW_PREFIX}/bin" - mkdir -p "${pkgdir}${MINGW_PREFIX}/share/${_realname}" - mkdir -p "${pkgdir}${MINGW_PREFIX}/share/${_realname}/demo" - mkdir -p "${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}" - - mv ${pkgdir}/bin/* ${pkgdir}${MINGW_PREFIX}/bin/ - mv ${pkgdir}/share/* ${pkgdir}${MINGW_PREFIX}/share/${_realname}/ - mv ${pkgdir}/demo/* ${pkgdir}${MINGW_PREFIX}/share/${_realname}/demo/ - mv ${pkgdir}/docs/* ${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}/ - - rm -rf "${pkgdir}/bin" - rm -rf "${pkgdir}/share" - rm -rf "${pkgdir}/demo" - rm -rf "${pkgdir}/docs" - - for i in $(find . -maxdepth 1 -type f); do mv ${i} ${pkgdir}${MINGW_PREFIX}/share/${_realname}/; done }