summaryrefslogtreecommitdiff
path: root/science/xcrysden/Makefile
blob: fa220861fd4d2fb8f4b8da520cd2c174c742758d (plain)
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

PORTNAME=	xcrysden
DISTVERSION=	1.6.2
CATEGORIES=	science
MASTER_SITES=	http://www.xcrysden.org/download/

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Crystalline and molecular structure visualisation program

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

LIB_DEPENDS=	libfftw3.so:math/fftw3 \
		libgl2ps.so:print/gl2ps \
		libTogl2.0.so:graphics/togl
RUN_DEPENDS=	bwidget>0:x11-toolkits/bwidget \
		obabel:science/openbabel \
		convert:graphics/ImageMagick6 \
		ppmtompeg:graphics/netpbm \
		xwd:x11/xwd

USES=		fortran gl gmake localbase:ldflags tcl tk xorg
USE_GL=		gl glu
USE_XORG=	x11 xmu

CONFLICTS_INSTALL=	cgnslib-4.1.2,1	# bin/unitconv

MAKE_ARGS=	prefix=${STAGEDIR}${PREFIX}

CFLAGS+=	-fcommon # notified xcrysden ML on Sep 20, 2020

BINARY_ALIAS=	make=gmake gcc=cc gfortran=gfortran${GCC_DEFAULT}

OPTIONS_DEFINE=	EXAMPLES

PORTEXAMPLES=	*

post-patch:
	@${CP} ${FILESDIR}/Make.sys ${WRKSRC}
	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/Make.sys
	@${RM} -r ${WRKSRC}/external/src

post-install:
	# stagedir shouldn't be in executables
	@${REINPLACE_CMD} -i '' -e 's|${STAGEDIR}||' ${STAGEDIR}${PREFIX}/bin/*
	# remove bad symlinks
	@${RM} \
		${STAGEDIR}${PREFIX}/share/doc/xcrysden/examples/examples \
		${STAGEDIR}${PREFIX}/share/xcrysden/examples
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/xcrysden/*
	# move examples from the docs dir
	@${MV} ${STAGEDIR}${DOCSDIR}/examples ${STAGEDIR}${EXAMPLESDIR}

.include <bsd.port.mk>