aboutsummaryrefslogtreecommitdiff
path: root/graphics/grads/Makefile
blob: 7e4ba4a800f00e662a97d1954150cdc6ac4aa897 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# New ports collection makefile for:	GrADS
# Date created:		25 October 2002
# Whom:			Greg Lewis <glewis@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	grads
PORTVERSION=	1.9b4
PORTREVISION=	4
CATEGORIES=	graphics science math
MASTER_SITES=	ftp://grads.iges.org/grads/1.9/:src \
		ftp://grads.iges.org/grads/:other
DISTFILES=	${PORTNAME}-src-${PORTVERSION}${EXTRACT_SUFX}:src \
		example.tar.gz:other
EXTRACT_ONLY=	${PORTNAME}-src-${PORTVERSION}${EXTRACT_SUFX}

MAINTAINER=	glewis@FreeBSD.org
COMMENT=	The Grid Analysis and Display System

BUILD_DEPENDS=	${LOCALBASE}/lib/libudunits2.a:${PORTSDIR}/science/udunits \
		${LOCALBASE}/lib/libsx.a:${PORTSDIR}/x11/libsx
LIB_DEPENDS=	gd.4:${PORTSDIR}/graphics/gd \
		jpeg.11:${PORTSDIR}/graphics/jpeg \
		png.6:${PORTSDIR}/graphics/png

GNU_CONFIGURE=		yes
CONFIGURE_ENV+=		SUPPLIBS="${LOCALBASE}"
CONFIGURE_ARGS+=	--enable-dyn-supplibs \
			--with-readline \
			--with-printim \
			--with-gui \
			--with-x

OPTIONS=	HDF "Build hdf-support (only hdf OR netcdf is supported)" on \
		NETCDF "Build netcdf-support" off

.if !defined(NOPORTDATA)
PORTDATA=	*
.endif

.if !defined(NOPORTDOCS)
PORTDOCS=	*
.endif

.if !defined(NOPORTEXAMPLES)
PORTEXAMPLES=	*
.endif

.include <bsd.port.pre.mk>

.if defined(WITH_HDF)
LIB_DEPENDS+=		mfhdf.3:${PORTSDIR}/science/hdf
CONFIGURE_ARGS+=	--with-hdf
PLIST_SUB+=		NETCDF="@comment " HDF=""
.endif

.if defined(WITH_NETCDF)
LIB_DEPENDS+=		netcdf:${PORTSDIR}/science/netcdf4
CONFIGURE_ARGS+=	--with-nc
PLIST_SUB+=		NETCDF="" HDF="@comment "
.endif

post-extract:
	${MKDIR} "${WRKSRC}/examples"
	cd "${WRKSRC}/examples" && ${TAR} -xzf "${DISTDIR}/example.tar.gz"

post-configure:
	${REINPLACE_CMD} -e "s:%%DATADIR%%:${DATADIR}:" ${WRKSRC}/src/gx.h
	${REINPLACE_CMD} -e "s:ludunits:ludunits2:" ${WRKSRC}/src/Makefile

post-install:
.if !defined(NOPORTDATA)
	${MKDIR} "${DATADIR}"
	cd ${WRKSRC}/data && ${COPYTREE_SHARE} . "${DATADIR}"
.endif
.if !defined(NOPORTEXAMPLES)
	${MKDIR} "${EXAMPLESDIR}"
	cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . "${EXAMPLESDIR}"
.endif
.if !defined(NOPORTDOCS)
	${MKDIR} "${DOCSDIR}"
	cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . "${DOCSDIR}"
.endif

.include <bsd.port.post.mk>