Nam Nguyen writes:

> I have attached a new port print/epstool. There is also an inline diff
> for math/octave to add print/epstool to RUN_DEPENDS.

ping. Please find the octave diff inline and new port print/epstool
attached.

>
> Motivation: In updating editors/TeXmacs I discovered that epstool was
> needed for the octave plugin to work with eps files.
>
> Here are two example octave sessions (without and with epstool)
> demonstrating creating eps files.
>
> source:
> https://stackoverflow.com/questions/20598761/how-to-save-plots-as-colorful-eps-in-octave
>
> without epstool:
>
> octave:1> clf();
> octave:2> surf(peaks);
> octave:3> print -depsc test.eps
> error: print: 'epstool' is required for specified output format, but
> binary is not available in PATH
> error: called from
>     print>epstool at line 893 column 7
>     __opengl_print__ at line 49 column 16
>     print at line 771 column 16
>
>
> with epstool:
>
> octave:1> clf();
> octave:2> surf(peaks);
> octave:3> print -depsc test.eps
> exit
>
> use ghostscript to view:
> $ gs test.eps
>
>
> As an aside, gnuplot is happy without epstool.
> see: https://sourceforge.net/p/gnuplot/discussion/5925/thread/b028261a/
>
> set terminal postscript eps
> set output "sinx.eps"
> plot sin(x)
>
> $ gs sinx.eps
>
>
> Some notes on epstool port itself:
> - gentoo notes dependency on ghostscript and reverse-dependency on
>   octave
>   see: https://packages.gentoo.org/packages/app-text/epstool/dependencies
> - combination of FIX_EXTRACT_PERMISSIONS, FIX_CLEANUP_PERMISSIONS,
>   FIX_CRLF_FILES and chmod is needed for patches to apply correctly
> - patch unixcom.mak to use ${CC}
> - patch ceps.c to address compiler warnings for strncat
>
> ./src/ceps.c:1525:30: warning: the value of the size argument in
> 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size]
>             strncat(platename, ".", sizeof(platename) - strlen(platename));
>                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./src/ceps.c:1525:30: note: change the argument to be the free space in
> the destination buffer minus the terminating null byte
>             strncat(platename, ".", sizeof(platename) - strlen(platename));
>                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>                                     sizeof(platename) - strlen(platename) - 1
>
>
> Comment:
> tool to create previews and fix bounding boxes in EPS files
>
> Description:
> Epstool is a utility to create or extract preview images in EPS files,
> fix bounding boxes and convert to bitmaps.
>
> Features:
>   - Add EPSI, DOS EPS or Mac PICT previews.
>   - Extract PostScript from DOS EPS files.
>   - Uses Ghostscript to create preview bitmaps.
>   - Create a TIFF, WMF, PICT or Interchange preview from part of a
>     bitmap created by Ghostscript.
>   - works under Win32, Win64, OS/2 and Unix.
>   - works on little-endian machines (Intel) or big endian (Sun Sparc,
>     Motorola) machines.
>
> Maintainer: The OpenBSD ports mailing-list <ports@openbsd.org>
>
> WWW: http://www.ghostgum.com.au/software/epstool.htm
>
> Feedback and tests are welcome. OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/math/octave/Makefile,v
retrieving revision 1.132
diff -u -p -u -p -r1.132 Makefile
--- Makefile    13 Nov 2022 19:13:38 -0000      1.132
+++ Makefile    28 Feb 2023 02:32:56 -0000
@@ -4,6 +4,7 @@ VERSION =       7.3.0
 DISTNAME =     octave-${VERSION}
 EXTRACT_SUFX = .tar.xz
 CATEGORIES =   math
+REVISION =     0
 
 SHARED_LIBS += octave          16.0
 SHARED_LIBS += octgui          10.0
@@ -33,6 +34,7 @@ BUILD_DEPENDS +=devel/desktop-file-utils
 
 RUN_DEPENDS =  devel/desktop-file-utils \
                archivers/gtar \
+               print/epstool \
                x11/gtk+3,-guic
 
 LIB_DEPENDS =  ${MODFORTRAN_LIB_DEPENDS} \

Attachment: epstool.tar.gz
Description: epstool

Reply via email to