aboutsummaryrefslogtreecommitdiffstats
path: root/x11-toolkits/gnocl/Makefile
blob: 1ae8f7dac6c889e597ddd07d08e6fbf6b667f659 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# New ports collection makefile for:    gnocl
# Date created:         15 August 2003
# Whom:                 Stephane Legrand <stephane@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   gnocl
PORTVERSION=    0.9.91
PORTREVISION=   4
CATEGORIES= x11-toolkits devel
MASTER_SITES=   SF/gnocl

MAINTAINER= gahr@FreeBSD.org
COMMENT=    GTK+ and Gnome extension for Tcl

USE_GMAKE=  yes
USE_BZIP2=  yes
USE_GNOME=  gtk20
USE_TCL=    84
USE_LDCONFIG=   yes

BUILD_WRKSRC=   ${WRKSRC}/src
CFLAGS+=    -I${LOCALBASE}/include/tcl8.4

.include <bsd.port.pre.mk>

.if ${ARCH} == "sparc64" || ${ARCH} == "ia64"
BROKEN=     Does not compile on sparc64 or ia64
.endif

.if ${ARCH} == amd64
CFLAGS+=    -fPIC
.endif

GNOCL_CANVAS_FILE="lib/libgnoclCanvas.so.1"
GNOCL_GCONF_FILE="lib/libgnoclGconf.so.1"
GNOCL_GNOME_FILE="lib/libgnoclGnome.so.1"
GNOCL_VFS_FILE="lib/libgnoclVFS.so.1"

.if defined(WITHOUT_CANVAS)
GNOCL_CANVAS_FILE=  "@comment "
.else
USE_GNOME+= libgnomecanvas
.endif

.if defined(WITHOUT_GCONF)
GNOCL_GCONF_FILE=   "@comment "
.else
USE_GNOME+= gconf2
.endif

.if defined(WITHOUT_GNOME)
GNOCL_GNOME_FILE=   "@comment "
.else
USE_GNOME+= libgnomeui gnomepanel
.endif

.if defined(WITHOUT_GNOMEVFS2)
GNOCL_VFS_FILE=     "@comment "
.else
USE_GNOME+= gnomevfs2
.endif

PLIST_SUB+= GNOCL_CANVAS_FILE=${GNOCL_CANVAS_FILE}
PLIST_SUB+= GNOCL_GCONF_FILE=${GNOCL_GCONF_FILE}
PLIST_SUB+= GNOCL_GNOME_FILE=${GNOCL_GNOME_FILE}
PLIST_SUB+= GNOCL_VFS_FILE=${GNOCL_VFS_FILE}

post-patch:
.if defined(WITHOUT_CANVAS)
    ${REINPLACE_CMD} -e 's=^USE_CANVAS=#USE_CANVAS=' ${BUILD_WRKSRC}/Makefile
.endif
.if defined(WITHOUT_GCONF)
    ${REINPLACE_CMD} -e 's=^USE_GCONF=#USE_GCONF=' ${BUILD_WRKSRC}/Makefile
.endif
.if defined(WITHOUT_GNOME)
    ${REINPLACE_CMD} -e 's=^USE_GNOME=#USE_GNOME=' ${BUILD_WRKSRC}/Makefile
.endif
.if defined(WITHOUT_GNOMEVFS2)
    ${REINPLACE_CMD} -e 's=^USE_VFS=#USE_VFS=' ${BUILD_WRKSRC}/Makefile
.endif
    ${FIND} ${WRKSRC}/demos -name "*.tcl" | ${XARGS} \
        ${REINPLACE_CMD} -i "" -e 's|tclsh|${TCLSH}|g; \
        s|package require Gnocl|load ${PREFIX}/lib/libgnocl.so.1; package require Gnocl|g; \
        s|package require GnoclCanvas|load ${PREFIX}/lib/libgnoclCanvas.so.1; package require GnoclCanvas|g; \
        s|package require GnoclGconf|load ${PREFIX}/lib/libgnoclGconf.so.1; package require GnoclGconf|g; \
        s|package require GnoclGnome|load ${PREFIX}/lib/libgnoclGnome.so.1; package require GnoclGnome|g; \
        s|package require GnoclVFS|load ${PREFIX}/lib/libgnoclVFS.so.1; package require GnoclVFS|g'

do-install:
    ${INSTALL_DATA} ${BUILD_WRKSRC}/gnocl.so ${PREFIX}/lib/libgnocl.so.1
    if ${TEST} -f ${BUILD_WRKSRC}/gnoclCanvas.so; then \
        ${INSTALL_DATA} ${BUILD_WRKSRC}/gnoclCanvas.so ${PREFIX}/lib/libgnoclCanvas.so.1; \
    fi; \
    if ${TEST} -f ${BUILD_WRKSRC}/gnoclGconf.so; then \
        ${INSTALL_DATA} ${BUILD_WRKSRC}/gnoclGconf.so ${PREFIX}/lib/libgnoclGconf.so.1; \
    fi; \
    if ${TEST} -f ${BUILD_WRKSRC}/gnoclGnome.so; then \
        ${INSTALL_DATA} ${BUILD_WRKSRC}/gnoclGnome.so ${PREFIX}/lib/libgnoclGnome.so.1; \
    fi; \
    if ${TEST} -f ${BUILD_WRKSRC}/gnoclVFS.so; then \
        ${INSTALL_DATA} ${BUILD_WRKSRC}/gnoclVFS.so ${PREFIX}/lib/libgnoclVFS.so.1; \
    fi; \

post-install:
.if !defined(NOPORTDOCS)
    ${INSTALL} -d ${DOCSDIR}
    (cd ${WRKSRC}/doc && ${COPYTREE_SHARE} \* ${DOCSDIR})
.endif
.if !defined(NOPORTEXAMPLES)
    ${INSTALL} -d ${EXAMPLESDIR}
    (cd ${WRKSRC}/demos && ${COPYTREE_SHARE} \* ${EXAMPLESDIR})
.endif

.include <bsd.port.post.mk>