summaryrefslogtreecommitdiffstats
path: root/freebsd/dependencies/tqt3/Makefile
blob: 60f79623033291745c87c70e6e5850f7cdf0c499 (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
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
# -*-mode: makefile-*-
# Created by: slavek.banko@axis.cz
# $FreeBSD$
#

.include <../../trinity.port.mk>

PORTNAME=		tqt3
COMMENT=		Multiplatform C++ application framework
TDE_PREVERSION=		~pre6+77ba1370
MASTER_SITE_SUBDIR=	t/tqt-x11-free
DISTNAME=		tqt-x11-free_${TDE_VERSION}${TDE_PREVERSION:C/(~(pre|r|s)[0-9]*).*/\1/1}
DISTSRC=		${PORTNAME}-trinity-${TDE_VERSION}${TDE_PREVERSION}
PORTREVISION=		0
CATEGORIES=		x11-toolkits
DIST_SUBDIR=		TDE/dependencies
PREFIX=			${LOCALBASE}


# For TQt3 is used FreeBSD make
# Remove gmake from USES
USES=${USES/gmake//}

BUILD_DEPENDS+=	tqmake:${PORTSDIR}/x11/trinity/dependencies/tqmake

LIB_DEPENDS+=	libmng.so:${PORTSDIR}/graphics/libmng \
		libpng.so:${PORTSDIR}/graphics/png \
		libjpeg.so:${PORTSDIR}/graphics/jpeg-turbo \
		libglib-2.0.so:${PORTSDIR}/devel/glib20

USE_XORG=	xcursor xinerama sm inputproto xi
REINPLACE_ARGS=	-i ""
HAS_CONFIGURE=	yes
USE_LDCONFIG=	yes

.if defined(PACKAGE_BUILDING)
TMPDIR?=	/tmp
.endif

CONFIGURE_ARGS+=\
		-prefix ${PREFIX} \
		-sysconfdir ${PREFIX}/etc/tqt3 \
		-datadir ${DATADIR} \
		-headerdir ${PREFIX}/include/tqt3 \
		-docdir ${DATADIR}/doc \
		-plugindir ${PREFIX}/lib/tqt3/plugins \
		-translationdir ${DATADIR}/translations \
		\
		-thread \
		-shared \
		-fast \
		-no-g++-exceptions \
		\
		-no-nis \
		${CUPS} \
		-stl \
		-ipv6 \
		\
		-sm \
		-xshape \
		-xinerama \
		-xcursor \
		-tablet \
		-xkb \
		\
		-system-zlib \
		-system-libpng \
		-system-libmng \
		-system-libjpeg \
		\
		-qt-gif \
		-qt-imgfmt-png \
		-qt-imgfmt-jpeg \
		-qt-imgfmt-mng \
		\
		-I${LOCALBASE}/include/libpng15 \
		-DPNG_DEPSTRUCT= \
		\
		-verbose \
		-inputmethod \
		-glibmainloop \
		# End of CONFIGURE_OPTS

CONFIGURE_ENV?=	QTDIR=${WRKSRC} \
		PATH=${WRKSRC}/bin:$$PATH

MAKE_ENV?=	TMPDIR=${TMPDIR} \
		QTDIR=${WRKSRC} \
		PATH=${WRKSRC}/bin:$$PATH \
		LD_LIBRARY_PATH=${WRKSRC}/lib:$$LD_LIBRARY_PATH

ALL_TARGET=	sub-tools
EXTRACT_AFTER_ARGS+= \
	--exclude '${EXTRACT_BASE}mkspecs' \
	--exclude '${EXTRACT_BASE}qmake' \
	--exclude '${EXTRACT_BASE}include/jri*' \
	--exclude '${EXTRACT_BASE}include/np*' \
	--exclude '${EXTRACT_BASE}doc/html/qmake*'

OPTIONS_DEFINE=	CUPS NAS OPENGL XFT XRANDR XRENDER
OPTIONS_DEFAULT= CUPS NAS OPENGL XFT XRANDR XRENDER

EXTRACT_COOKIE=	${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g}
CONFIGURE_COOKIE=${WRKDIR}/.configure_done.${PORTNAME}.${PREFIX:S/\//_/g}
INSTALL_COOKIE=	${WRKDIR}/.install_done.${PORTNAME}.${PREFIX:S/\//_/g}
BUILD_COOKIE=	${WRKDIR}/.build_done.${PORTNAME}.${PREFIX:S/\//_/g}
PATCH_COOKIE=	${WRKDIR}/.patch_done.${PORTNAME}.${PREFIX:S/\//_/g}
PACKAGE_COOKIE=	${WRKDIR}/.package_done.${PORTNAME}.${PREFIX:S/\//_/g}

.include <bsd.port.pre.mk>

PREFIX_REAL!=	/bin/realpath ${PREFIX}

# Enable debug symbols
.if ${TDE_DEBUG}
CONFIGURE_ARGS+=-debug
.endif

# The previous TQt port versions installed tqmake and tqmake's specs under LOCALBASE
# The new trinity/dependencies/tqmake port installs them under LOCALBASE. We can use
# either one here, but we prefer the newer:
.for d in ${LOCALBASE} ${PREFIX}
.	if exists($d/share/tqt3/mkspecs/freebsd-g++/qplatformdefs.h)
QTBASE=$d
PLATFORM=${QTBASE}/share/tqt3/mkspecs/freebsd-g++
.	endif
.endfor

.if defined(PLATFORM)
CONFIGURE_ARGS+=-platform ${PLATFORM}
.else
CONFIGURE_ARGS+=-platform ${LOCALBASE}/share/tqt3/mkspecs/freebsd-g++
.endif

.if ${PORT_OPTIONS:MXRANDR}
LIB_DEPENDS+=	libXrandr.so:${PORTSDIR}/x11/libXrandr
.elif defined(WITHOUT_XRANDR)
CONFIGURE_ARGS+=-no-xrandr
.endif

.if ${PORT_OPTIONS:MXRENDER}
LIB_DEPENDS+=	libXrender.so:${PORTSDIR}/x11/libXrender
.elif defined(WITHOUT_XRENDER)
CONFIGURE_ARGS+=-no-xrender
.endif

.if ${PORT_OPTIONS:MXFT}
LIB_DEPENDS+=	libXft.so.2:${PORTSDIR}/x11-fonts/libXft
.elif defined(WITHOUT_XFT)
CONFIGURE_ARGS+=-no-xft
.endif

.if defined(WANT_QT_DEBUG)
CONFIGURE_ARGS+=-debug
.endif

.if ${PORT_OPTIONS:MOPENGL}
USE_GL=		glu
CONFIGURE_ARGS+=-dlopen-opengl
.else
CONFIGURE_ARGS+=-disable-opengl
.endif # WITHOUT_OPENGL

.if ${PORT_OPTIONS:MCUPS}
LIB_DEPENDS+=	libcups.so.2:${PORTSDIR}/print/cups
CUPS=	-cups -L${LOCALBASE}/lib -I${LOCALBASE}/include
.endif

.if ${PORT_OPTIONS:MNAS}
LIB_DEPENDS+=	libaudio.so:${PORTSDIR}/audio/nas
CONFIGURE_ARGS+=-system-nas-sound -no-pch
.else
CONFIGURE_ARGS+=-no-nas-sound -no-pch
.endif

.if exists(${LOCALBASE}/include/qt2/qapp.h)
BROKEN=	You have QT2 headers installed!  Installing this port
BROKEN+=will result in conflicts between QT3 and QT2!
.endif

post-patch:
.if defined(PLATFORM)
	@${REINPLACE_CMD} -e 's|$$outpath/bin/tqmake|${QTBASE}/bin/tqmake|g' \
		${WRKSRC}/configure
	@${REINPLACE_CMD} -e 's|$$OUTDIR/bin/tqmake|${QTBASE}/bin/tqmake|g' \
		${WRKSRC}/config.tests/unix/endian.test \
		${WRKSRC}/config.tests/unix/largefile.test \
		${WRKSRC}/config.tests/unix/ptrsize.test
.else
	@${REINPLACE_CMD} -e 's|$$outpath/bin/tqmake|${LOCALBASE}/bin/tqmake|g' \
		${WRKSRC}/configure
	@${REINPLACE_CMD} -e 's|$$OUTDIR/bin/tqmake|${LOCALBASE}/bin/tqmake|g' \
		${WRKSRC}/config.tests/unix/endian.test \
		${WRKSRC}/config.tests/unix/largefile.test \
		${WRKSRC}/config.tests/unix/ptrsize.test
.endif
	@${REINPLACE_CMD} -e 's|^	cd qmake.*||' ${WRKSRC}/Makefile
	@${REINPLACE_CMD} -e 's|^CFG_PRECOMPILE=no|CFG_PRECOMPILE=auto|g' \
		${WRKSRC}/configure

post-configure:
	@${REINPLACE_CMD} \
		-e 's|/lib/pkgconfig/|/libdata/pkgconfig/|g' \
		-e 's|^INCPATH.*=|INCPATH  = -I../include|g' \
			${WRKSRC}/src/Makefile
	@${REINPLACE_CMD} -e \
		's|^prefix=.*|prefix=${PREFIX}|g' ${WRKSRC}/lib/tqt-mt.pc

do-build:
	export ${MAKE_ENV} && \
	${MAKE} -C ${WRKSRC} sub-src sub-plugins sub-tools && \
	${MAKE} -C ${WRKSRC}/tools/tqvfb

post-build:
	@${RM} -f ${WRKSRC}/doc/html/qmake*

# Work around tqmake generated dependencies
pre-su-install:
	${MKDIR} ${STAGEDIR}${PREFIX}/lib ${STAGEDIR}${PREFIX}/bin
	${INSTALL_DATA} ${WRKSRC}/lib/*.prl ${STAGEDIR}${PREFIX}/lib
	${INSTALL_SCRIPT} ${WRKSRC}/bin/tqtfindtr ${STAGEDIR}${PREFIX}/bin
.for tool in maketqpf tqtmergetr msg2tqm tqvfb
	${INSTALL_PROGRAM} ${WRKSRC}/tools/${tool}/${tool} ${STAGEDIR}${PREFIX}/bin
.endfor
	${INSTALL_PROGRAM} ${WRKSRC}/tools/qembed/tqembed ${STAGEDIR}${PREFIX}/bin

do-install:
	# Installs 'libtqt-mt.so.3' library
	${MAKE} -C ${WRKSRC}/src INSTALL_ROOT=${STAGEDIR} install_target

	# Installs all the remaining
	export ${MAKE_ENV} && \
	${MAKE} -C ${WRKSRC} INSTALL_ROOT=${STAGEDIR} install && \
	${MAKE} -C ${WRKSRC} INSTALL_ROOT=${STAGEDIR} plugins-install

	install -m755 ${WRKSRC}/bin/tqtrename140 ${STAGEDIR}${PREFIX}/bin
	install -m755 ${WRKSRC}/bin/tqt20fix ${STAGEDIR}${PREFIX}/bin
	install -m755 ${WRKSRC}/bin/tqtfindtr ${STAGEDIR}${PREFIX}/bin

	# install tqtconv2ui
	install -m755 ${WRKSRC}/bin/tqtconv2ui ${STAGEDIR}${PREFIX}/bin/tqtconv2ui

	# install tqvfb
	install -m755 ${WRKSRC}/tools/tqvfb/tqvfb ${STAGEDIR}${PREFIX}/bin/tqvfb

post-install:
	# fix .prl files
	gsed -i ${STAGEDIR}${PREFIX}/lib/*.prl -e "s|${WRKSRC}|${PREFIX}/share/tqt3|g"

	# make links to QTDIR
	${MKDIR} ${STAGEDIR}${PREFIX}/share/tqt3/bin
	cd ${STAGEDIR}${PREFIX}/share/tqt3/bin && \
	${LN} -s ../../../bin/* ${STAGEDIR}${PREFIX}/share/tqt3/bin
	${MKDIR} ${STAGEDIR}${PREFIX}/share/tqt3/lib
	cd ${STAGEDIR}${PREFIX}/share/tqt3/lib && \
	${LN} -s ../../../lib/lib*.* ${STAGEDIR}${PREFIX}/share/tqt3/lib
	${LN} -s ../../include/tqt3 ${STAGEDIR}${PREFIX}/share/tqt3/include
	${LN} -s ../../lib/tqt3/plugins ${STAGEDIR}${PREFIX}/share/tqt3/plugins

	# display message about sql plugins
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>