aboutsummaryrefslogtreecommitdiff
path: root/editors/libreoffice/Makefile
blob: 5b85c57d785737fff82991013feed366881efdbf (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# $FreeBSD$

.include "${.CURDIR}/Makefile.common"

PORTREVISION=	0

COMMENT=	Full integrated office productivity suite

BUILD_DEPENDS=	p5-Archive-Zip>=0:${PORTSDIR}/archivers/p5-Archive-Zip \
		zip:${PORTSDIR}/archivers/zip \
		${LOCALBASE}/lib/libboost_regex.a:${PORTSDIR}/devel/boost-libs \
		${LOCALBASE}/libdata/pkgconfig/cppunit.pc:${PORTSDIR}/devel/cppunit \
		dmake:${PORTSDIR}/devel/dmake \
		${LOCALBASE}/bin/gperf:${PORTSDIR}/devel/gperf \
		mdds>=0.9.0:${PORTSDIR}/devel/mdds \
		gpatch:${PORTSDIR}/devel/patch \
		ucpp:${PORTSDIR}/devel/ucpp \
		vigra-config:${PORTSDIR}/graphics/vigra \
		bash:${PORTSDIR}/shells/bash \
		gsed:${PORTSDIR}/textproc/gsed

LIB_DEPENDS=	libapr-1.so:${PORTSDIR}/devel/apr1 \
		libicutu.so:${PORTSDIR}/devel/icu \
		liblangtag.so:${PORTSDIR}/devel/liblangtag \
		liborcus-0.8.so:${PORTSDIR}/devel/liborcus07 \
		libcurl.so:${PORTSDIR}/ftp/curl \
		libcairo.so:${PORTSDIR}/graphics/cairo \
		libGLEW.so:${PORTSDIR}/graphics/glew \
		libgraphite2.so:${PORTSDIR}/graphics/graphite2 \
		libjpeg.so:${PORTSDIR}/graphics/jpeg \
		liblcms2.so:${PORTSDIR}/graphics/lcms2 \
		libcdr-0.1.so:${PORTSDIR}/graphics/libcdr01 \
		libetonyek-0.1.so:${PORTSDIR}/graphics/libetonyek01 \
		libfreehand-0.1.so:${PORTSDIR}/graphics/libfreehand \
		libwpg-0.3.so:${PORTSDIR}/graphics/libwpg03 \
		libpng15.so:${PORTSDIR}/graphics/png \
		libpoppler.so:${PORTSDIR}/graphics/poppler \
		liblpsolve55.so:${PORTSDIR}/math/lp_solve \
		libcmis-0.4.so:${PORTSDIR}/net/libcmis \
		libharfbuzz.so:${PORTSDIR}/print/harfbuzz \
		libmspub-0.1.so:${PORTSDIR}/print/libmspub01 \
		libnss3.so:${PORTSDIR}/security/nss \
		libclucene-core.so:${PORTSDIR}/textproc/clucene \
		libexpat.so:${PORTSDIR}/textproc/expat2 \
		libhunspell-1.3.so:${PORTSDIR}/textproc/hunspell \
		libhyphen.so:${PORTSDIR}/textproc/hyphen \
		libabw-0.1.so:${PORTSDIR}/textproc/libabw \
		libe-book-0.1.so:${PORTSDIR}/textproc/libe-book \
		libexttextcat-2.0.so:${PORTSDIR}/textproc/libexttextcat \
		libmwaw-0.3.so:${PORTSDIR}/textproc/libmwaw03 \
		libodfgen-0.1.so:${PORTSDIR}/textproc/libodfgen01 \
		librevenge-0.0.so:${PORTSDIR}/textproc/librevenge \
		libvisio-0.1.so:${PORTSDIR}/textproc/libvisio01 \
		libwpd-0.10.so:${PORTSDIR}/textproc/libwpd010 \
		libwps-0.3.so:${PORTSDIR}/textproc/libwps03 \
		libxml2.so:${PORTSDIR}/textproc/libxml2 \
		libxslt.so:${PORTSDIR}/textproc/libxslt \
		libmythes-1.2.so:${PORTSDIR}/textproc/mythes \
		librdf.so:${PORTSDIR}/textproc/redland \
		libserf-1.so:${PORTSDIR}/www/serf

RUN_DEPENDS=	${LOCALBASE}/lib/X11/fonts/Caladea/Caladea-Bold.ttf:${PORTSDIR}/x11-fonts/crosextrafonts-caladea-ttf \
		${LOCALBASE}/lib/X11/fonts/Carlito/Carlito-Bold.ttf:${PORTSDIR}/x11-fonts/crosextrafonts-carlito-ttf \
		${LOCALBASE}/lib/X11/fonts/dejavu/DejaVuSans.ttf:${PORTSDIR}/x11-fonts/dejavu \
		${LOCALBASE}/lib/X11/fonts/GentiumBasic/GenBasI.ttf:${PORTSDIR}/x11-fonts/gentium-basic \
		${LOCALBASE}/lib/X11/fonts/Liberation/LiberationMono-Bold.ttf:${PORTSDIR}/x11-fonts/liberation-fonts-ttf \
		${LOCALBASE}/lib/X11/fonts/LinLibertineG/LinLibertine_DR_G.ttf:${PORTSDIR}/x11-fonts/linuxlibertine-g

_MAKE_JOBS=	#

GNU_CONFIGURE=	yes
USE_AUTOTOOLS=	autoconf aclocal
USE_GL=		gl glu
USE_OPENLDAP=	yes
USE_PERL5=	build
USE_PYTHON=	yes
USE_QT4=	# empty but required
USE_XORG=	xaw xrandr
USES=		bison compiler:c++11-lang gmake perl5 pkgconfig shared-mime-info tar:xz
WANT_GNOME=	yes

DISTFILES+=	${PORTNAME}-${LOVERSION}${EXTRACT_SUFX}
DISTFILES+=	${PORTNAME}-help-${LOVERSION}${EXTRACT_SUFX}

EXTRACT_ONLY:=	${DISTFILES}

DISTFILES+=	1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz:src

DIST_SUBDIR=	libreoffice
WRKSRC=		${WRKDIR}/${PORTNAME}-${LOVERSION}

CONFIGURE_ENV=		DMAKE=${LOCALBASE}/bin/dmake \
			GNUTAR="${TAR}" \
			GPERF=${LOCALBASE}/bin/gperf \
			OPENSSL_CFLAGS="-I/usr/include" \
			OPENSSL_LIBS="-lcrypto -lssl" \
			PYTHON_CFLAGS="`${PYTHON_VERSION}-config --cflags`" \
			PYTHON_LIBS="`${PYTHON_VERSION}-config --libs`"

CONFIGURE_ARGS+=	--disable-dependency-tracking \
			--disable-fetch-external \
			--disable-online-update \
			--exec-prefix=${PREFIX} \
			--with-build-version="FreeBSD ports ${PKGVERSION}" \
			--with-external-tar=${DISTDIR}/${DIST_SUBDIR} \
			--with-gnu-patch=${LOCALBASE}/bin/gpatch \
			--with-os-version=${OSVERSION} \
			--with-parallelism=${MAKE_JOBS_NUMBER} \
			--with-vendor="FreeBSD ports"

CONFIGURE_ARGS+=	--disable-coinmp \
			--disable-epm \
			--disable-firebird-sdbc \
			--disable-gnome-vfs \
			--disable-gstreamer \
			--disable-kde \
			--disable-kdeab \
			--disable-mergelibs \
			--disable-packagekit \
			--enable-cairo-canvas \
			--enable-graphite \
			--enable-python=system \
			--with-alloc=system \
			--with-external-dict-dir=${LOCALBASE}/share/hunspell \
			--with-external-hyph-dir=${LOCALBASE}/share/hyphen \
			--with-external-thes-dir=${LOCALBASE}/share/mythes \
			--with-system-altlinuxhyph \
			--with-system-apr \
			--with-system-boost \
			--with-system-cairo \
			--with-system-clucene \
			--with-system-cppunit \
			--with-system-curl \
			--with-system-dicts \
			--with-system-expat \
			--with-system-glew \
			--with-system-graphite \
			--with-system-harfbuzz \
			--with-system-hunspell \
			--with-system-icu \
			--with-system-jpeg \
			--with-system-lcms2 \
			--with-system-libabw \
			--with-system-libcdr \
			--with-system-libcmis \
			--with-system-libebook \
			--with-system-libetonyek \
			--with-system-libexttextcat \
			--with-system-libfreehand \
			--with-system-liblangtag \
			--with-system-libmspub \
			--with-system-libmwaw \
			--with-system-libodfgen \
			--with-system-libpng \
			--with-system-librevenge \
			--with-system-libvisio \
			--with-system-libwpd \
			--with-system-libwpg \
			--with-system-libwps \
			--with-system-libxml \
			--with-system-lpsolve \
			--with-system-mdds \
			--with-system-mesa-headers \
			--with-system-mythes \
			--with-system-neon \
			--with-system-nss \
			--with-system-openldap \
			--with-system-openssl \
			--with-system-orcus \
			--with-system-poppler \
			--with-system-postgresql \
			--with-system-redland \
			--with-system-serf \
			--with-system-ucpp \
			--with-system-vigra \
			--with-system-zlib \
			--without-fonts \
			--without-myspell-dicts \
			--without-system-npapi-headers

#XXX add: --with-system-libeot or --with-system-libatomic_ops

OPTIONS_DEFINE=	CUPS DEBUG GNOME GTK2 GTK3 JAVA KDE4 MMEDIA PGSQL SDK \
		SYSTRAY TEST VERBOSE WEBDAV
OPTIONS_DEFAULT=CUPS GTK2

JAVA_DESC=	Add java support (XML Filters, macros)
MMEDIA_DESC=	Enable multimedia backend for impress
PGSQL_DESC=	Build with PostgreSQL-SDBC driver
SDK_DESC=	Build with SDK
SYSTRAY_DESC=	Enable systemtray quickstarter
TEST_DESC=	Run all regression tests
VERBOSE_DESC=	Increase build verbosity
WEBDAV_DESC=	Enable webdav protocol

CUPS_LIB_DEPENDS=	libcups.so:${PORTSDIR}/print/cups-client
CUPS_CONFIGURE_ENABLE=	cups

DEBUG_CONFIGURE_ON=	--enable-crashdump --enable-dbgutil --enable-debug
DEBUG_CONFIGURE_OFF=	--enable-release-build

GNOME_LIB_DEPENDS=	libdbus-glib-1.so:${PORTSDIR}/devel/dbus-glib
GNOME_USE=	GNOME=gconf2
GNOME_CONFIGURE_ENABLE=	dbus gconf gio lockdown

GTK3_USE=		GNOME=gtk30
GTK3_CONFIGURE_ENABLE=	gtk3

JAVA_CATEGORIES=	java
JAVA_DISTFILES=	048751f3271906db5126ab76870444c4-commons-codec-1.9-src.zip:src \
		17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip:src \
		2c9b0f83ed5890af02c0df1c1776f39b-commons-httpclient-3.1-src.tar.gz:src \
		3404ab6b1792ae5f16bbd603bd1e1d03-libformula-1.1.7.zip:src \
		35c94d2df8893241173de1d16b6034c0-swingExSrc.zip:src \
		39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip:src \
		3bdf40c0d199af31923e900d082ca2dd-libfonts-1.1.6.zip:src \
		798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip:src \
		8ab049135b2d15313da5d9f0656894a1-commons-lang3-3.3.1-src.tar.gz:src \
		8ce2fcd72becf06c41f7201d15373ed9-librepository-1.1.6.zip:src \
		97b2d4dba862397f446b217e2b623e71-libloader-1.1.6.zip:src \
		a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip:src \
		ace6ab49184e329db254e454a010f56d-libxml-1.1.7.zip:src \
		ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip:src \
		d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip:src \
		db60e4fde8dd6d6807523deb71ee34dc-liblayout-0.2.10.zip:src \
		e8e197d628436490886d17cffa108fe3-commons-logging-1.1.3-src.tar.gz:src \
		ea570af93c284aa9e5621cd563f54f4d-bsh-2.0b1-src.tar.gz:src \
		eeb2c7ddf0d302fba4bfc6e97eac9624-libbase-1.1.6.zip:src \
		f94d9870737518e3b597f9265f4e9803-libserializer-1.1.6.zip:src
JAVA_BUILD_DEPENDS=	ant:${PORTSDIR}/devel/apache-ant \
			${JAVAJARDIR}/junit.jar:${PORTSDIR}/java/junit
# XXX jni.h from GNU classpath causes ABI conflicts.
JAVA_CONFLICTS_BUILD=	classpath-[0-9]*
JAVA_CONFIGURE_ON=	--enable-ext-wiki-publisher \
			--enable-report-builder \
			--with-ant-home=${LOCALBASE}/share/java/apache-ant \
			--with-jdk-home="${JAVA_HOME}" \
			--with-junit=${JAVAJARDIR}/junit.jar
JAVA_CONFIGURE_OFF=	--without-java
# LibreOffice works only with Java 6 -- which may not be the default
# if you specify the JAVA_VENDOR variable
JAVA_BUILD=	yes
JAVA_VERSION=	1.6
JAVA_USE=	JAVA=yes

KDE4_USE=	KDE4=kdelibs QT4=moc_build QT4=qmake_build
KDE4_CONFIGURE_ENABLE=	kde4
KDE4_CONFIGURE_ENV=	KDE4DIR="${KDE4_PREFIX}" \
			QT4DIR="${QT_PREFIX}" \
			QT4INC="${QT_INCDIR}" \
			QT4LIB="${QT_LIBDIR}"

MMEDIA_USE=	GSTREAMER=yes
MMEDIA_CONFIGURE_ENABLE=	gstreamer-0-10

PGSQL_USES=	pgsql:9.0+
PGSQL_CONFIGURE_ENABLE=	postgresql-sdbc
PGSQL_CONFIGURE_WITH=	gssapi krb5

SDK_DISTFILES=	185d60944ea767075d27247c3162b3bc-unowinreg.dll:ext
SDK_BUILD_DEPENDS=	doxygen:${PORTSDIR}/devel/doxygen
SDK_CONFIGURE_ENABLE=	odk
SDK_CONFIGURE_ON=	--with-doxygen=${LOCALBASE}/bin/doxygen
SDK_CONFIGURE_OFF=	--without-doxygen

SYSTRAY_CONFIGURE_ENABLE=	systray

TEST_CONFIGURE_ENABLE=	cve-tests

WEBDAV_LIB_DEPENDS=	libneon.so:${PORTSDIR}/www/neon29
WEBDAV_CONFIGURE_ENABLE=	neon

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDEBUG}
IGNORE=			is broken with DEBUG option
.endif

.if ${PORT_OPTIONS:MDEBUG} || ${PORT_OPTIONS:MVERBOSE}
CONFIGURE_ARGS+=	--enable-verbose
.endif

.if ${PORT_OPTIONS:MGNOME} || ${PORT_OPTIONS:MGTK2}
USE_GNOME+=	gtk20
CONFIGURE_ARGS+=	--enable-gtk
.else
CONFIGURE_ARGS+=	--disable-gtk
.endif

.if ${PORT_OPTIONS:MGNOME} || ${PORT_OPTIONS:MGTK2} || ${PORT_OPTIONS:MGTK3}
USES+=		desktop-file-utils
INSTALLS_ICONS=	yes
.endif

.if empty(PORT_OPTIONS:MTEST)
EXTRA_PATCHES+=		${FILESDIR}/disable-cppunittester
.endif

.include <bsd.port.pre.mk>

.if ${COMPILER_FEATURES:Mlibc++}
EXTRA_PATCHES+=	${FILESDIR}/extra-libc++:-p1
EXTRA_PATCHES+=	${FILESDIR}/extra-libc++.i386:-p0
.endif

.if ${COMPILER_FEATURES:Mlibstdc++} && ${CHOSEN_COMPILER_TYPE} == clang
DISTFILES+=	bae83fa5dc7f081768daace6e199adc3-glm-0.9.4.6-libreoffice.zip:src
# XXX fdo#84008 (fixed in 4.3.3)
CONFIGURE_ARGS+=	--disable-collada \
			--disable-gltf
.else
DISTFILES+=	4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2:src \
		OpenCOLLADA-master-6509aa13af.tar.bz2:src
BUILD_DEPENDS+=		${LOCALBASE}/include/glm/glm.hpp:${PORTSDIR}/math/glm
LIB_DEPENDS+=	libgltf-0.0.so:${PORTSDIR}/graphics/libgltf
EXTRA_PATCHES+=	${FILESDIR}/extra-collada
CONFIGURE_ARGS+=	--enable-collada \
			--enable-gltf \
			--with-system-glm \
			--with-system-libgltf
.endif

.if ${OSVERSION} < 900506
CONFIGURE_ARGS+=	--with-linker-hash-style=sysv
.endif

.if ${OSVERSION} < 1000033
BUILD_DEPENDS+=	${LOCALBASE}/bin/flex:${PORTSDIR}/textproc/flex
CONFIGURE_ENV+=	FLEX=${LOCALBASE}/bin/flex
.endif

ACLOCAL_ARGS=	-I "${WRKSRC}/m4"
CPPFLAGS=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib

MAKE_ENV+=	ENVCFLAGS="${CFLAGS}" ENVCFLAGSCXX="${CXXFLAGS}"
MAKE_ENV+=	ENVLINKFLAGS="${LDFLAGS}"
MAKE_ENV+=	GNUSED=${LOCALBASE}/bin/gsed
MAKE_ENV+=	LANG=C LC_ALL=C

pre-configure:
	@${TOUCH} ${WRKSRC}/autogen.lastrun

post-configure:
	@${TOUCH} ${WRKSRC}/src.downloaded

do-install:
	@cd ${WRKSRC} && ${MAKE_CMD} ${MAKE_ARGS} distro-pack-install
	@${RM} -f ${PLISTD} ${PLISTF}
	@cd ${STAGEDIR}${PREFIX} && ${FIND} -d lib/libreoffice -type d \
	    -empty -exec ${ECHO_CMD} "@dir {}" \; >> ${PLISTD}
	@cd ${STAGEDIR}${PREFIX} && ${FIND} -H -s bin etc lib man \
	    \( -type f -o -type l \) -print >> ${PLISTF}
.for subdir in application-registry applications icons mime mime-info mimelnk
	@cd ${STAGEDIR}${PREFIX} && ${FIND} -H -s share/${subdir} \
	    \( -type f -o -type l \) -print >> ${PLISTF}
.endfor
.if ${PORT_OPTIONS:MSDK}
.for subdir in include share share/doc share/idl
	@cd ${STAGEDIR}${PREFIX} && ${FIND} -H -s ${subdir}/libreoffice \
	    \( -type f -o -type l \) -print >> ${PLISTF}
.endfor
.endif
	@${SORT} -u ${PLISTF} >> ${TMPPLIST}
	@${SORT} -u ${PLISTD} >> ${TMPPLIST}

.include <bsd.port.post.mk>