aboutsummaryrefslogtreecommitdiffstats
path: root/x11-toolkits/swt31/Makefile
blob: 15d2ed8d4aefb58130a5e493ce9dd3ba525bcf29 (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
# New ports collection makefile for:    swt
# Date created:             2005-12-15
# Whom:                 past@ebs.gr
#
# $FreeBSD$
#

PORTNAME=   swt
PORTVERSION=    3.1
CATEGORIES= x11-toolkits devel java
MASTER_SITES=   ${MASTER_SITE_ECLIPSE}
MASTER_SITE_SUBDIR= R-${PORTVERSION}-200506271435

MAINTAINER= freebsd-eclipse@freebsd.org
COMMENT=    Standard Widget Toolkit for Java

SWT_VERSION=    3138
NO_WRKSUBDIR=   yes
# Someone with amd64 hardware must finish the amd64 support before it
# is enabled
ONLY_FOR_ARCHS= i386
USE_GMAKE=  yes
USE_ZIP=    yes
MAKEFILE=   make_freebsd.mak
INSTALLS_SHLIB= yes
PLIST_SUB=  BUILD=${SWT_VERSION}
PLIST_FILES=    %%JAVAJARDIR%%/swt.jar \
        lib/libswt-atk-gtk-%%BUILD%%.so \
        lib/libswt-awt-gtk-%%BUILD%%.so \
        lib/libswt-gtk-%%BUILD%%.so \
        lib/libswt-pi-gtk-%%BUILD%%.so

USE_JAVA=   yes
USE_REINPLACE=  yes
JAVA_VERSION=   1.4+
JAVA_OS=    native

.if !defined(WITHOUT_MOZILLA)
PLIST_FILES+=   lib/libswt-mozilla-gtk-%%BUILD%%.so
MAKE_MOZILLA=   make_mozilla
.if defined(WITH_MOZILLA) && ${WITH_MOZILLA} != "mozilla"
BROWSER=    ${WITH_MOZILLA}
BUILD_DEPENDS+= ${BROWSER}:${PORTSDIR}/www/${BROWSER}
.else
BUILD_DEPENDS+= mozilla:${PORTSDIR}/www/mozilla
BROWSER=    mozilla
.endif
.else
BROWSER=
MAKE_MOZILLA=
.endif

.if defined(WITHOUT_CAIRO)
MAKE_CAIRO=
.else
LIB_DEPENDS=    cairo.2:${PORTSDIR}/graphics/cairo
MAKE_CAIRO= make_cairo
PLIST_FILES+=   lib/libswt-cairo-gtk-%%BUILD%%.so
.endif

.if defined(WITHOUT_GNOMEVFS)
MAKE_GNOME=
USE_GNOME=  gtk20 pkgconfig
.else
MAKE_GNOME= make_gnome
USE_GNOME=  gtk20 gnomevfs2 libgnome libgnomeui pkgconfig
PLIST_FILES+=   lib/libswt-gnome-gtk-%%BUILD%%.so
.endif

.include <bsd.port.pre.mk>

.if (${ARCH} == "amd64")
DISTNAME=   swt-${PORTVERSION}-gtk-linux-x86_64
.else
DISTNAME=   swt-${PORTVERSION}-gtk-linux-x86
.endif

MAKE_ENV+=  BROWSER="${BROWSER}" \
        JAVA_HOME="${JAVA_HOME}" \
        MAKE_GNOME=${MAKE_GNOME} \
        MAKE_MOZILLA=${MAKE_MOZILLA} \
        MAKE_CAIRO=${MAKE_CAIRO} \
        MACHINE_ARCH=${MACHINE_ARCH}

post-extract:
    @(cd ${WRKSRC} && ${UNZIP_CMD} -qo "*.zip")
    @${CP} ${WRKSRC}/make_linux.mak ${WRKSRC}/make_freebsd.mak

post-patch:
    @${RM} ${WRKSRC}/lib*.so
.if (${ARCH} != "amd64")
    @${PATCH} ${PATCH_DIST_ARGS} \
      "cairo.c" \
      ${FILESDIR}/manualpatch-cairo \
      + "cairo.h" \
      + "cairo_custom.c" \
      + "cairo_stats.c" \
      + "cairo_stats.h" \
      + "cairo_structs.c" \
      + "cairo_structs.h"
.endif
    @${REINPLACE_CMD} -E \
        -e 's|%%CC%%|${CC}|' \
        -e 's|%%CXX%%|${CXX}|' \
        ${WRKSRC}/build.sh

do-build:
    @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SH} build.sh)

do-install:
    ${MKDIR} ${JAVAJARDIR}
    ${INSTALL_DATA} ${WRKSRC}/libswt-*.so ${PREFIX}/lib
    ${INSTALL_DATA} ${WRKSRC}/swt.jar ${JAVAJARDIR}/

.include <bsd.port.post.mk>