summaryrefslogtreecommitdiffstats
path: root/openbsd/14.0.0/dependencies/tqt3/Makefile
blob: 885b0e96ec568f7c765de4a0990d4310b99f4d77 (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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
.include </usr/ports/x11/trinity/trinity.port.mk>

PKGNAME=		trinity-tqt3-${VERSION}
VERSION=		3.5.0${PREVERSION}
PREVERSION=		~pre221+117b166c

COMMENT=		C++ X11 GUI toolkit
CATEGORIES=		x11/trinity/dependencies
HOMEPAGE=		http://www.trinitydesktop.org/
MAINTAINER=		François Andriot <francois.andriot@free.fr>

MASTER_SITES=	http://nuc.vtf/tde/tde-tarballs/14.0.0/main/dependencies/
DISTNAME=		trinity-tqt3-${TDE_VERSION}${PREVERSION}
EXTRACT_SUFX=	.tar.gz

PREFIX=			${LOCALBASE}

SHARED_LIBS += tqtdesignercore      1.0
SHARED_LIBS += tqteditor            1.0
SHARED_LIBS += tqassistantclient    1.0
SHARED_LIBS += tqt-mt               35.0
SHARED_LIBS += tqui                 1.0

PROGRAMS3=designer findtr moc qt20fix qtrename140 uic
PROGRAMS=assistant linguist lrelease lupdate qm2ts qmake qtconfig 

# XXX be sure to update the yqt3.port.mk version after a qt bump.
QT_PLUGINS=		plugins-${LIBtqt-mt_VERSION:R}

FLAVORS=debug
FLAVOR?=

# GPL/QPL
PERMIT_PACKAGE_CDROM=	Yes

# For qsettings to write its setup
PORTHOME=	${WRKDIST}

LIB_DEPENDS=	graphics/png \
				graphics/libmng

WANTLIB=	GL GLU ICE SM X11>=10 Xcursor Xext Xft Xi Xinerama \
			Xmu png mng \
			Xrandr Xrender fontconfig freetype jpeg lcms m stdc++ z

BUILD_DEPENDS=	print/cups,-libs \
				devel/gmake


MULTI_PACKAGES+=-main -html -mysql -postgresql -sqlite2


# DEBUG flavor
.if ${FLAVOR:Mdebug}
CONFIGURE_ARGS+=-debug
PKGDEBUG=-debug
.else
PKGDEBUG=
.endif

.include <bsd.port.arch.mk>


# MAIN package
PKGNAME-main=		trinity-tqt3-mt-${VERSION}
REVISION-main= 		1
COMMENT-main=		C++ X11 GUI toolkit
WANTLIB-main=		${WANTLIB} pthread c


# MYSQL package
PKGNAME-mysql=		trinity-tqt3-mysql-${VERSION}
REVISION-mysql= 	1
COMMENT-mysql=		MySQL plugin for tqt3
.if ${BUILD_PACKAGES:M-mysql}
CONFIGURE_ARGS+= -I${LOCALBASE}/include/mysql -L${LOCALBASE}/lib/mysql -plugin-sql-mysql
.else
CONFIGURE_ARGS+=-no-sql-mysql
.endif
LIB_DEPENDS-mysql=	${LIB_DEPENDS} ${BUILD_PKGPATH} databases/mysql
WANTLIB-mysql=		${WANTLIB} mysqlclient tqt-mt


# POSTGRESQL package
PKGNAME-postgresql=	trinity-tqt3-postgresql-${VERSION}
REVISION-postgresql= 	1
COMMENT-postgresql=	PostgresSQL plugin for tqt3
.if ${BUILD_PACKAGES:M-postgresql}
BUILD_DEPENDS+=databases/postgresql,-server
CONFIGURE_ARGS+= -I${LOCALBASE}/include/postgresql \
	    -I${LOCALBASE}/include/postgresql/server \
	    -L${LOCALBASE}/lib \
	    -I${LOCALBASE}/include -plugin-sql-psql
.else
CONFIGURE_ARGS+=-no-sql-psql
.endif
LIB_DEPENDS-postgresql=	${LIB_DEPENDS} ${BUILD_PKGPATH} databases/postgresql
WANTLIB-postgresql=	${WANTLIB} pq


# SQLITE2 package
PKGNAME-sqlite2=	trinity-tqt3-sqlite2-${VERSION}
REVISION-sqlite2= 	1
COMMENT-sqlite2=	sqlite2 plugin for tqt3
.if ${BUILD_PACKAGES:M-sqlite2}
CONFIGURE_ARGS+= -plugin-sql-sqlite
.else
CONFIGURE_ARGS+=-no-sql-sqlite
.endif
LIB_DEPENDS-sqlite2=	${LIB_DEPENDS} ${BUILD_PKGPATH} databases/sqlite
WANTLIB-sqlite2=	${WANTLIB} sqlite


# HTML package
COMMENT-html=		off-line html documentation for tqt3
FULLPKGNAME-html=	trinity-tqt3-html-${VERSION}
FULLPKGPATH-html=	x11/trinity/tqt3,-html
REVISION-html= 		1
LIB_DEPENDS-html=
WANTLIB-html=
PKG_ARCH-html=		*


# for manpages in MESSAGE
SUBST_VARS= QT_PLUGINS

DOCS=	FAQ LICENSE.GPL2 LICENSE.GPL3 README README-QT.TXT \
	changes-3* \
	README.immodule changes.immodule

NO_TEST=	Yes

# Build options.
USE_GROFF =	Yes
MAKE_ENV=	QTDIR="${WRKDIST}" \
			PATH="${WRKDIST}/bin:${PATH}" \
			EXTRA_SAMPLES="${EXTRA_SAMPLES}" \
			SYS_CXX="${CXX}" \
			SYS_CXXFLAGS="${CXXFLAGS}" \
			LD_LIBRARY_PATH="${WRKDIST}/lib"

MAKE_FLAGS=	DESIGNER_SUBDIR=dummy \
		LIBtqt-mt_VERSION=$(LIBtqt-mt_VERSION) \
		LIBtqui_VERSION=$(LIBtqui_VERSION) \
		LIBtqteditor_VERSION=$(LIBtqteditor_VERSION) \
		LIBtqassistantclient_VERSION=$(LIBtqassistantclient_VERSION) \
		LIBtqtdesignercore_VERSION=$(LIBtqtdesignercore_VERSION)

GMAKE=	cd ${WRKDIST} && gmake ${MAKE_ENV} ${MAKE_FLAGS}

# Configuration step.
CONFIGURE_ENV=	QTDIR="${WRKSRC}" \
				PATH=${WRKDIST}/bin:${PATH}; \
				LD_LIBRARY_PATH="${WRKDIST}/lib"

post-patch:
	# fix variables in 'qmake.conf'
	gsed -i ${WRKDIST}/mkspecs/*/qmake.conf \
		-e "s|^QMAKE_INCDIR_QT.*|QMAKE_INCDIR_QT		= /usr/local/include/tqt3|" \
		-e "s|\$\(QTDIR\)|${LOCALBASE}|g" \
		-e "s|-lqt|-ltqt|g" \
		-e "s|^QMAKE_CFLAGS		=.*|QMAKE_CFLAGS		= ${CXXFLAGS}|" \
		-e "s|^QMAKE_INCDIR		=.*|QMAKE_INCDIR		= ${LOCALBASE}/include|" \
		-e "s|^QMAKE_LIBDIR		=.*|QMAKE_LIBDIR		= ${LOCALBASE}/lib|" \
		-e "s|^QMAKE_RPATH		= .*|QMAKE_RPATH		=|" \
		-e "s|^QMAKE_STRIP             =.*|QMAKE_STRIP             =|" \
		-e "s|^QMAKE_STRIPFLAGS_LIB 	+=.*|QMAKE_STRIPFLAGS_LIB 	+=|" \
		-e "s|^QMAKE_MOC		=.*|QMAKE_MOC		= ${LOCALBASE}/bin/tqmoc|" \
		-e "s|^QMAKE_UIC		=.*|QMAKE_UIC		= ${LOCALBASE}/bin/tquic|" \
		-e "s|^QMAKE_INCDIR_QT		=.*|QMAKE_INCDIR_QT		= ${LOCALBASE}/include/tqt3|" \
		-e "s|^QMAKE_LIBDIR_QT		=.*|QMAKE_LIBDIR_QT		= ${LOCALBASE}/lib|"
	gsed -i ${WRKDIST}/mkspecs/openbsd-g++/qmake.conf \
		-e "s|^QMAKE_LFLAGS_SONAME	=.*|QMAKE_LFLAGS_SONAME	=|" \
		-e "s|^CONFIG			+= qt warn_on release link_prl|CONFIG			+= qt warn_on release link_prl thread|"
	echo "QMAKE_OPENBSD_SHLIBS	= 1" >>"${WRKDIST}/mkspecs/openbsd-g++/qmake.conf"

do-configure:
	cd ${WRKDIST} && echo yes | ./configure \
		${CONFIGURE_ARGS} \
		-I${X11BASE}/include/freetype2 \
		-I${LOCALBASE}/include \
		-L${WRKSRC}/lib \
		-L${LOCALBASE}/lib \
		\
		-prefix			"${LOCALBASE}" \
		-headerdir		"${LOCALBASE}/include/tqt3" \
		-libdir			"${LOCALBASE}/lib" \
		-plugindir		"${LOCALBASE}/lib/tqt3/plugins" \
		-datadir		"${LOCALBASE}/share/tqt3" \
		-docdir			"${LOCALBASE}/share/doc/tqt3" \
		-translationdir	"${LOCALBASE}/share/tqt3/translations" \
		-sysconfdir		"/etc/tqt3" \
		\
		-thread \
		-shared \
		-fast \
		-no-exceptions \
		-platform openbsd-g++ \
		\
		-no-pch \
		-cups \
		-stl \
		-ipv6 \
		\
		-sm \
		-xshape				\
		-xinerama			\
		-xcursor			\
		-xrandr				\
		-xrender			\
		-xft				\
		-tablet				\
		-xkb				\
		\
		-system-zlib			\
		-system-libpng			\
		-system-libmng			\
		-system-libjpeg			\
		-no-nas-sound		\
		\
		-enable-opengl			\
		-dlopen-opengl			\
		\
		-qt-gif				\
		-qt-imgfmt-mng \
		-qt-imgfmt-png			\
		-qt-imgfmt-jpeg			\
		-plugin-imgfmt-mng		\
		\
		-no-sql-odbc		\
		-no-sql-ibase		\
		-no-sql-sqlite3		\
		\
		-lfontconfig			\
		-inputmethod			\
		-glibmainloop \
		-v


# Build step.
do-build:
	# proceed
	${GMAKE} sub-src sub-plugins sub-tools

	# build tqtconv2ui
	${GMAKE} -C tools/designer/tools/tqtconv2ui

	# build tqvfb
	${GMAKE} -C tools/tqvfb

	# fix .prl files
	gsed -i ${WRKDIST}/lib/*.prl -e "s|${WRKDIST}|${LOCALBASE}/share/tqt3|g"


# Installation step.
pre-install:
	# Clean up patch residual files
	find ${WRKDIST} -name "*.orig" | xargs rm -f

do-install:
	# Installs 'libtqt-mt.so.3' library
	${GMAKE} -C src INSTALL_ROOT=${WRKINST} install_target

	# Installs all the remaining
	${GMAKE} INSTALL_ROOT=${WRKINST} install
	${GMAKE} INSTALL_ROOT=${WRKINST} plugins-install

	install -m755 ${WRKDIST}/bin/tqtrename140 ${WRKINST}${LOCALBASE}/bin
	install -m755 ${WRKDIST}/bin/tqt20fix ${WRKINST}${LOCALBASE}/bin
	install -m755 ${WRKDIST}/bin/tqtfindtr ${WRKINST}${LOCALBASE}/bin

	# install tqtconv2ui
	install -m755 ${WRKDIST}/bin/tqtconv2ui ${WRKINST}${LOCALBASE}/bin/tqtconv2ui

	# install tqvfb
	install -m755 ${WRKDIST}/tools/tqvfb/tqvfb ${WRKINST}${LOCALBASE}/bin/tqvfb
	
.include <bsd.port.mk>