summaryrefslogtreecommitdiff
path: root/devel/swt/Makefile
blob: 9b2c154b8a0f3038406d5717cc94f8fcbc4f5455 (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
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
# $NetBSD: Makefile,v 1.9 2011/01/13 13:37:28 wiz Exp $
#

SWTREL=		3.5.1
SWTVER=		3555
SWTDATE=	200909170800

PKGNAME=	swt-${SWTREL}.${SWTVER}
DISTNAME=	swt-${SWTREL}-gtk-linux-x86
PKGREVISION=	4
CATEGORIES=	devel
MASTER_SITES=	http://download.eclipse.org/eclipse/downloads/drops/R-${SWTREL}-${SWTDATE}/
EXTRACT_SUFX=	.zip

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.eclipse.org/
COMMENT=	Open source widget toolkit for Java
#LICENSE=	# TODO: (see mk/license.mk)

PKG_DESTDIR_SUPPORT=	user-destdir

WRKSRC=		${WRKDIR}
USE_TOOLS+=	gmake pkg-config
USE_LANGUAGES=	c c++
USE_JAVA2=	yes

BUILD_DEPENDS+=	apache-ant>=1.7.1:../../devel/apache-ant

BUILD_TARGETS=	all make_awt make_cairo make_xulrunner
BUILD_LIBS=	swt-atk-gtk swt-awt-gtk swt-cairo-gtk swt-glx-gtk \
		swt-gnome-gtk swt-gtk swt-pi-gtk swt-xulrunner-gtk

PLIST_SUBST+=	SWTVER=${SWTVER}

INSTALLATION_DIRS+=	share/java
INSTALLATION_DIRS+=	lib/jni

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "NetBSD" && ${LOWER_ARCH} == "x86_64"
MY_LOWER_ARCH=	amd64
.endif
MY_LOWER_ARCH?=	${LOWER_ARCH}

post-extract:
	cd ${WRKSRC} && jar -xf ${WRKSRC}/src.zip
	cp ${FILESDIR}/make_pkgsrc.mak ${WRKSRC}

do-build:
.for target in ${BUILD_TARGETS}
	cd ${WRKSRC} && ${GMAKE} \
	    JAVA_HOME=${PKG_JAVA_HOME} \
	    LOWER_OPSYS=${LOWER_OPSYS} \
	    LOWER_ARCH=${MY_LOWER_ARCH} \
	    -f make_pkgsrc.mak ${target}
.endfor
	${TEST} -d ${WRKSRC}/bin || mkdir ${WRKSRC}/bin
	cd ${WRKSRC} && find org/eclipse/swt -type f -name \*.java | \
	    xargs ${JAVA_BINPREFIX}-javac -source 1.4 -target 1.4 -d bin
	cd ${WRKSRC}/bin && ${JAVA_BINPREFIX}-jar -cf ${WRKSRC}/swt.jar .

do-install:
	${INSTALL_DATA} ${WRKSRC}/swt.jar \
	    ${DESTDIR}${PREFIX}/share/java/swt.jar
.for libname in ${BUILD_LIBS}
	${INSTALL_LIB} ${WRKSRC}/lib${libname}-${SWTVER}.so \
	    ${DESTDIR}${PREFIX}/lib/jni/lib${libname}-${SWTVER}.so
.endfor

.include "../../devel/atk/buildlink3.mk"
.include "../../devel/libgnome/buildlink3.mk"
.include "../../devel/libgnomeui/buildlink3.mk"
.include "../../devel/xulrunner/buildlink3.mk"
.include "../../graphics/MesaLib/buildlink3.mk"
.include "../../graphics/cairo/buildlink3.mk"
.include "../../sysutils/gnome-vfs/buildlink3.mk"
.include "../../x11/gtk2/buildlink3.mk"
BUILDLINK_DEPMETHOD.libXt+=	build
.include "../../x11/libXt/buildlink3.mk"
.include "../../x11/libXtst/buildlink3.mk"
.include "../../graphics/glu/buildlink3.mk"
.include "../../mk/java-vm.mk"
.include "../../mk/bsd.pkg.mk"