Bump graphics/vips to version 8.3.3_1
[dports.git] / graphics / pgplot / Makefile
1 # Created by: jmz
2 # $FreeBSD$
3
4 PORTNAME=       pgplot
5 PORTVERSION=    5.2.2
6 PORTREVISION=   17
7 CATEGORIES=     graphics
8 MASTER_SITES=   ftp://ftp.astro.caltech.edu/pub/pgplot/
9 DISTNAME=       ${PORTNAME}${PORTVERSION:R}
10
11 MAINTAINER=     ports@FreeBSD.org
12 COMMENT=        C/FORTRAN library for drawing graphs on a variety of display devices
13
14 LIB_DEPENDS=    libpng.so:graphics/png
15
16 MAKE_JOBS_UNSAFE=       yes
17
18 USES=           fortran shebangfix
19 USE_LDCONFIG=   yes
20 USE_XORG=       x11 xproto xt
21
22 MAKE_ENV=       SSP_CFLAGS=
23 SHEBANG_FILES=  makehtml maketex
24 SUFFIXES=       flib clib bin
25 WRKSRC=         ${WRKDIR}/${PORTNAME}
26
27 OPTIONS_DEFINE= DOCS EXAMPLES
28
29 .include <bsd.port.options.mk>
30
31 .if ${ARCH:M*64*}
32 EXTRA_PATCHES +=        ${FILESDIR}/drivers_64bit_patch
33 .endif
34
35 PORTDATA=       grfont.dat
36
37 .if ${PORT_OPTIONS:MDOCS}
38 DOCS=   cpg/cpgplot.doc pgplot-routines.tex pgplot.doc pgplot.html \
39         readme.pgdisp rgb.txt
40 SUFFIXES+=      doc
41 PORTDOCS=       ${DOCS:C|.*/||}
42 USES+=          perl5
43 USE_PERL5=      build
44 .endif
45
46 .if ${PORT_OPTIONS:MEXAMPLES}
47 EXAMPLES=       Makefile.demo cpg/cpgdemo.c examples/pgdemo*.f
48 PORTEXAMPLES=   ${EXAMPLES:C|.*/||}
49 .endif
50
51 post-patch:
52         @${REINPLACE_CMD} -e 's|png_ptr->jmpbuf|png_jmpbuf(png_ptr)|' \
53                 ${WRKSRC}/drivers/pndriv.c
54         @${REINPLACE_CMD} -e 's|/usr/local/pgplot|${DATADIR}|g' \
55                 ${WRKSRC}/src/grgfil.f
56         @cd ${FILESDIR}; ${CP} Makefile* drivers.list grexec.f ${WRKSRC}
57         @${CP} ${WRKSRC}/src/*.inc ${WRKSRC}
58
59 do-build:
60 .for s in ${SUFFIXES}
61         @cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} \
62         Makefile.${s} ${_MAKE_JOBS} ${MAKE_ARGS}
63 .endfor
64
65 do-install:
66         @cd ${WRKSRC}; \
67         ${INSTALL_PROGRAM} pgxwin_server pgdisp ${STAGEDIR}${PREFIX}/bin; \
68         ${INSTALL_DATA} *.a ${STAGEDIR}${PREFIX}/lib; \
69         ${INSTALL_LIB} *.so.5* ${STAGEDIR}${PREFIX}/lib; \
70         ${INSTALL_DATA} cpgplot.h ${STAGEDIR}${PREFIX}/include
71 .for f in libcpgplot.so libpgplot.so
72         @${LN} -sf ${f}.5 ${STAGEDIR}${PREFIX}/lib/${f}
73 .endfor
74         @${MKDIR} ${STAGEDIR}${DATADIR}
75         @cd ${WRKSRC}; ${INSTALL_DATA} ${PORTDATA} ${STAGEDIR}${DATADIR}
76 .if ${PORT_OPTIONS:MDOCS}
77         @${MKDIR} ${STAGEDIR}${DOCSDIR}
78         @cd ${WRKSRC}; ${CP} pgdispd/aaaread.me readme.pgdisp; \
79         ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR}
80 .endif
81 .if ${PORT_OPTIONS:MEXAMPLES}
82         @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
83         @cd ${WRKSRC}; ${INSTALL_DATA} ${EXAMPLES} ${STAGEDIR}${EXAMPLESDIR}
84 .endif
85
86 .if defined(MAINTAINER_MODE) && !defined(BATCH)
87 DEMO?=  cpgdemo
88
89 check test: build
90         @cd ${WRKSRC}; ${CP} cpg/cpgdemo.c examples/pgdemo*.f ${WRKSRC}; \
91         ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} \
92         Makefile.demo ${_MAKE_JOBS} ${MAKE_ARGS}
93         @${SETENV} LD_LIBRARY_PATH="${LOCALBASE}/lib:${WRKSRC}" \
94         PGPLOT_DIR="${WRKSRC}" PGPLOT_DEV="/xwin" ${WRKSRC}/${DEMO}
95 .endif
96
97 .include <bsd.port.mk>