aboutsummaryrefslogtreecommitdiffstats
path: root/science/gdis/Makefile
blob: 19e86b2ec51793fad6b817b4ea70d9542fb66201 (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
87
88
89
# $FreeBSD$

PORTNAME=   gdis
PORTVERSION=    0.90
CATEGORIES= science
MASTER_SITES=   SF
EXTRACT_SUFX=   -src.tgz

MAINTAINER= ports@FreeBSD.org
COMMENT=    Display and manipulation of isolated molecules and periodic systems

LICENSE=    GPLv2 # (or later)

LIB_DEPENDS=    gtkglext-x11-1.0:${PORTSDIR}/x11-toolkits/gtkglext

OPTIONS_DEFINE= DOCS

USE_GL=     glu
USE_GNOME=  gtk20
USES=       gmake pkgconfig
MAKEFILE=   GNUmakefile

PORTDOCS=   CHANGELOG README TODO
PLIST_FILES=    bin/gdis %%DATADIR%%/gdis.elements %%DATADIR%%/gdis.library \
        %%DATADIR%%/gdis.manual share/pixmaps/gdis.xpm
PLIST_DIRS= %%DATADIR%%

DESKTOP_ENTRIES="GDIS" "Molecular modelling GUI" \
        "${PREFIX}/share/pixmaps/gdis.xpm" "${PORTNAME}" "" true

NO_STAGE=   yes
.include <bsd.port.options.mk>

post-patch:
    @${REINPLACE_CMD} -e \
        's|"\(gdis.elements\)|"../share/gdis/\1| ; \
         s|"\(gdis.library\)|"../share/gdis/\1|' ${WRKSRC}/gdis.h
    @${REINPLACE_CMD} -e \
        's|"\(gdis.manual\)|"../share/gdis/\1|' ${WRKSRC}/gui_help.c

do-configure:
    @${ECHO_CMD} -n \
        > ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} 'USE_GUI=YES' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} 'USE_GRISU=NO' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} 'include makefile.src' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} 'CFLAGS:=$$(CFLAGS) -DWITH_GUI' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} 'INCS=`pkg-config --cflags gtkglext-1.0`' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} 'LIBS=`pkg-config --libs gtkglext-1.0` -lgthread-2.0' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} 'OBJ=$$(SRC:.c=.o)' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} 'all: gdis' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} 'gdis: $$(OBJ)' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} '  $$(CC) $$(OBJ) $$(LDFLAGS) -o gdis $$(LIBS)' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} '.c.o:' \
        >> ${WRKSRC}/${MAKEFILE}
    @${ECHO_CMD} '  $$(CC) $$(CFLAGS) -c $$< $$(INCS)' \
        >> ${WRKSRC}/${MAKEFILE}
    @(cd ${WRKSRC} && ${SED} -e 's|logo_right_81|gdis|' \
        < logo_right.xpm > gdis.xpm)

do-install:
    (cd ${WRKSRC} && ${INSTALL_PROGRAM} gdis ${PREFIX}/bin)
    (cd ${WRKSRC} && ${INSTALL_DATA} gdis.xpm ${PREFIX}/share/pixmaps)
    @${MKDIR} ${DATADIR}
.for i in gdis.elements gdis.library gdis.manual
    (cd ${WRKSRC} && ${INSTALL_DATA} ${i} ${DATADIR})
.endfor
.if ${PORT_OPTIONS:MDOCS}
    @${MKDIR} ${DOCSDIR}
.for i in ${PORTDOCS}
    (cd ${WRKSRC} && ${INSTALL_DATA} ${i} ${DOCSDIR})
.endfor
.endif

.include <bsd.port.mk>