summaryrefslogtreecommitdiff
path: root/x11/qt5-qtbase/Makefile
blob: 927010ba8996ee642d0706d9a764f57c31da4a38 (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
# $NetBSD: Makefile,v 1.64 2018/10/01 17:44:47 adam Exp $

DISTNAME=	qtbase-everywhere-src-${QTVERSION}
PKGNAME=	qt5-qtbase-${QTVERSION}
COMMENT=	C++ X GUI toolkit

.include "../../x11/qt5-qtbase/Makefile.common"

HAS_CONFIGURE=		yes
CONFIGURE_ARGS+=	-prefix "${QTPREFIX}"
CONFIGURE_ARGS+=	-opensource -confirm-license
CONFIGURE_ARGS+=	-sysconfdir "${PKG_SYSCONFDIR}/xdg"
CONFIGURE_ARGS+=	-accessibility
CONFIGURE_ARGS+=	-dbus-linked
CONFIGURE_ARGS+=	-icu
CONFIGURE_ARGS+=	-libproxy
CONFIGURE_ARGS+=	-openssl-linked
CONFIGURE_ARGS+=	-nomake examples
CONFIGURE_ARGS+=	-nomake tests
CONFIGURE_ARGS+=	-no-pch
CONFIGURE_ARGS+=	-no-sql-db2
CONFIGURE_ARGS+=	-no-sql-ibase
CONFIGURE_ARGS+=	-no-sql-mysql
CONFIGURE_ARGS+=	-no-sql-oci
CONFIGURE_ARGS+=	-no-sql-odbc
CONFIGURE_ARGS+=	-no-sql-psql
#CONFIGURE_ARGS+=	-no-sql-sqlite
CONFIGURE_ARGS+=	-no-sql-sqlite2
CONFIGURE_ARGS+=	-no-sql-tds
CONFIGURE_ARGS+=	-no-strip
CONFIGURE_ARGS+=	-no-use-gold-linker
CONFIGURE_ARGS+=	-pkg-config
CONFIGURE_ARGS+=	-release
CONFIGURE_ARGS+=	-shared
CONFIGURE_ARGS+=	-system-harfbuzz
CONFIGURE_ARGS+=	-system-libjpeg
CONFIGURE_ARGS+=	-system-libpng
CONFIGURE_ARGS+=	-system-pcre
CONFIGURE_ARGS+=	-system-sqlite
CONFIGURE_ARGS+=	-system-zlib
.if defined(MAKE_JOBS)
.  if !defined(MAKE_JOBS_SAFE) || empty(MAKE_JOBS_SAFE:M[nN][oO])
CONFIGURE_ENV+=		MAKEFLAGS=-j${MAKE_JOBS}
.  endif
.endif

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

.if ${OPSYS} != "Darwin"
CONFIGURE_ARGS+=	-fontconfig
QMAKE_CONF=		qmake.conf
.  if ${OPSYS} != "SunOS" && \
      (!empty(MACHINE_ARCH:Mi386) || !empty(MACHINE_ARCH:Mx86_64))
CONFIGURE_ARGS+=	-reduce-relocations
.  endif
.else
CONFIGURE_ARGS+=	-no-rpath	# avoid @rpath in dylibs
QMAKE_CONF=		qmake.conf.mac
.endif

PLIST_VARS+=		egl

.include "../../mk/compiler.mk"

.if ${OPSYS} == "SunOS"
.  if !empty(PKGSRC_COMPILER:Mgcc) || !empty(PKGSRC_COMPILER:Mclang)
.    if ${ABI:U} == "64"
CONFIGURE_ARGS+=	-platform solaris-g++-64
.    else
CONFIGURE_ARGS+=	-platform solaris-g++
.    endif
.  else
.    if ${ABI:U} == "64"
CONFIGURE_ARGS+=	-platform solaris-cc-64
.    else
CONFIGURE_ARGS+=	-platform solaris-cc
.    endif
.  endif
NETWORK_LIBS=		-lsocket -lnsl
.elif ${OPSYS} == "Interix"
CONFIGURE_ARGS+=	-platform interix-g++
CFLAGS+=		-I/usr/local/include/bind
LDFLAGS+=		-L/usr/local/lib/bind -lbind
BUILDLINK_PASSTHRU_DIRS+=/usr/local/include/bind /usr/local/lib/bind
SYS_LIBS=		-lbind -ldb -ldl
.elif ${OPSYS} == "DragonFly"
CONFIGURE_ARGS+=	-platform freebsd-g++
LDFLAGS+=		-lexecinfo
.elif ${OPSYS} == "Darwin"
CONFIGURE_ARGS+=	-platform macx-clang
CONFIGURE_ARGS+=	-no-framework
.  if exists(/usr/lib/libresolv.dylib)
LDFLAGS+=		-lresolv
.  endif
.elif ${OPSYS} == "Linux"
LDFLAGS+=		-ldl
.elif ${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD"
.  if exists(/usr/lib/libexecinfo.so)
LDFLAGS+=		-lexecinfo
.  endif
LDFLAGS.FreeBSD+=	-lutil
.endif

REPLACE_PERL+=		bin/fixqt4headers.pl
REPLACE_PERL+=		bin/syncqt.pl
REPLACE_PERL+=		mkspecs/features/data/unix/findclasslist.pl

PTHREAD_OPTS+=		require
UNLIMIT_RESOURCES=	datasize

BUILDLINK_PASSTHRU_DIRS+=	${QTPREFIX}

BUILD_TARGET=		sub-src
INSTALLATION_DIRS=	${QTPREFIX}/bin lib/pkgconfig
INSTALL_ENV+=		INSTALL_ROOT=${DESTDIR}

CHECK_INTERPRETER_SKIP+=qt5/examples/widgets/tools/echoplugin/echoplugin.pro
CHECK_INTERPRETER_SKIP+=qt5/examples/widgets/tools/echoplugin/plugin/plugin.pro
CHECK_INTERPRETER_SKIP+=qt5/examples/widgets/tools/plugandpaint/plugandpaint.pro
CHECK_INTERPRETER_SKIP+=qt5/examples/widgets/tools/plugandpaintplugins/basictools/basictools.pro
CHECK_INTERPRETER_SKIP+=qt5/examples/widgets/tools/plugandpaintplugins/extrafilters/extrafilters.pro
CHECK_INTERPRETER_SKIP+=qt5/examples/widgets/tools/styleplugin/plugin/plugin.pro
CHECK_INTERPRETER_SKIP+=qt5/mkspecs/features/data/mac/objc_namespace.sh
CHECK_INTERPRETER_SKIP+=qt5/mkspecs/features/uikit/device_destinations.sh
CHECK_INTERPRETER_SKIP+=qt5/mkspecs/features/uikit/devices.py
CHECK_INTERPRETER_SKIP+=qt5/mkspecs/macx-ios-clang/rename_main.sh

SUBST_CLASSES+=		opt
SUBST_STAGE.opt=	pre-configure
SUBST_MESSAGE.opt=	Removing some Qt5 default compiler flags.
SUBST_FILES.opt=	mkspecs/common/gcc-base.conf
SUBST_SED.opt=		-e 's,-O[s23],,'

SUBST_CLASSES.SunOS+=	vscript
SUBST_STAGE.vscript=	pre-configure
SUBST_FILES.vscript=	mkspecs/common/gcc-base-unix.conf
SUBST_SED.vscript=	-e '/QMAKE_LFLAGS_VERSION_SCRIPT/d'

SUBST_CLASSES+=		path
SUBST_STAGE.path=	pre-configure
SUBST_MESSAGE.path=	Add to default XDG path.
SUBST_FILES.path=	src/corelib/io/qstandardpaths_unix.cpp
SUBST_VARS.path=	LOCALBASE

BROKEN_FILES=		qt5/mkspecs/modules/qt_lib_bootstrap_private.pri
BROKEN_FILES1=		qt5/mkspecs/qmodule.pri

PC_FILES=		Qt5Concurrent.pc Qt5Core.pc Qt5DBus.pc \
			Qt5Gui.pc Qt5Network.pc Qt5OpenGL.pc \
			Qt5OpenGLExtensions.pc \
			Qt5PrintSupport.pc Qt5Sql.pc Qt5Test.pc \
			Qt5Widgets.pc Qt5Xml.pc

pre-configure:
	${SED}  -e 's:@LOCALBASE@:${LOCALBASE}:g' \
		-e 's:@X11BASE@:${X11BASE}:g' \
		-e 's:@CC@:${CC:Q}:g' \
		-e 's:@CXX@:${CXX:Q}:g' \
		-e 's:@LDFLAGS@:${LDFLAGS:Q}:g' \
		-e 's:@CFLAGS@:${CFLAGS:Q}:g' \
		-e 's:@CXXFLAGS@:${CXXFLAGS:Q}:g' \
		-e 's:@NETWORK_LIBS@:${NETWORK_LIBS:Q}:g' \
		-e 's:@SYS_LIBS@:${SYS_LIBS:Q}:g' \
		-e 's:@LEX@:${LEX}:g' \
		-e 's:@YACC@:${TOOLS_CMDLINE_YACC:Q}:g' \
		-e 's:@AR@:${AR:Q}:g' \
		-e 's:@MKDIR@:${MKDIR}:g' \
		-e 's:@LIBQT@:${LIBQT:Q}:g' \
		-e 's:@PTHREAD_LDFLAGS@:${PTHREAD_LDFLAGS:Q}:g' \
		-e 's:@PTHREAD_LIBS@:${PTHREAD_LIBS:Q}:g' \
		-e 's:@COMPILER_RPATH_FLAG@:${COMPILER_RPATH_FLAG}:g' \
		-e 's:@QMAKE_RANLIB@:${QMAKE_RANLIB:Q}:g' \
		${FILESDIR}/${QMAKE_CONF} > ${WRKSRC}/qmake.conf
		for dir in ${WRKSRC}/mkspecs/*; do \
			cp ${WRKSRC}/qmake.conf $${dir}; \
			rm -f $${dir}/*.orig; \
		done
	${RM} -f ${WRKSRC}/mkspecs/features/mac/default_pre.prf
	${RM} -f ${WRKSRC}/mkspecs/features/mac/default_post.prf

post-install:
.for i in ${PC_FILES}
	cd ${DESTDIR}${PREFIX}/lib/pkgconfig && \
	ln -f -s ${QTPREFIX}/lib/pkgconfig/${i} ${i}
.endfor
	cd ${WRKSRC} && env ${MAKE_ENV} ${INSTALL_ENV} \
		${MAKE_PROGRAM} install_mkspecs
# The pri file has WRKSRC in it.
	${SED} -e 's,${WRKSRC}/bin/qmake,${QTDIR}/bin/qmake,g' \
		${DESTDIR}${PREFIX}/${BROKEN_FILES} \
		> ${DESTDIR}${PREFIX}/${BROKEN_FILES}.1
	${MV} -f ${DESTDIR}${PREFIX}/${BROKEN_FILES}.1 \
		${DESTDIR}${PREFIX}/${BROKEN_FILES}
	${SED} -e 's,PKG_CONFIG_EXECUTABLE = .*,PKG_CONFIG_EXECUTABLE = ${TOOLS_PATH.pkg-config},' \
		${DESTDIR}${PREFIX}/${BROKEN_FILES1} \
		> ${DESTDIR}${PREFIX}/${BROKEN_FILES1}.1
	${MV} -f ${DESTDIR}${PREFIX}/${BROKEN_FILES1}.1 \
		${DESTDIR}${PREFIX}/${BROKEN_FILES1}

.include "../../converters/libiconv/buildlink3.mk"
.include "../../databases/sqlite3/buildlink3.mk"
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../devel/glib2/buildlink3.mk"
.include "../../devel/pcre2/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../fonts/harfbuzz/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
# Use lib/dbus-1.0/include/dbus/dbus-arch-deps.h from sysutils/dbus
USE_DBUS-ARCH-DEPS_H=	yes
.include "../../sysutils/dbus/buildlink3.mk"
.include "../../textproc/icu/buildlink3.mk"
.include "../../www/libproxy/buildlink3.mk"
.if ${OPSYS} != "Darwin"
.include "../../fonts/fontconfig/buildlink3.mk"
.include "../../graphics/glu/buildlink3.mk"
.  if !empty(MESALIB_SUPPORTS_EGL:Myes)
PLIST.egl=	yes
.  endif
.include "../../x11/libxcb/buildlink3.mk"
.include "../../x11/xcb-util/buildlink3.mk"
.include "../../x11/xcb-util-image/buildlink3.mk"
.include "../../x11/xcb-util-keysyms/buildlink3.mk"
.include "../../x11/xcb-util-renderutil/buildlink3.mk"
.include "../../x11/xcb-util-wm/buildlink3.mk"
.include "../../x11/libSM/buildlink3.mk"
.include "../../x11/libX11/buildlink3.mk"
.include "../../x11/libXext/buildlink3.mk"
.include "../../x11/libXcursor/buildlink3.mk"
.include "../../x11/libXft/buildlink3.mk"
.include "../../x11/libXi/buildlink3.mk"
.include "../../x11/libXmu/buildlink3.mk"
.include "../../x11/libXrandr/buildlink3.mk"
.include "../../x11/libXrender/buildlink3.mk"
.include "../../x11/libxkbcommon/buildlink3.mk"
.endif
.include "../../mk/jpeg.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"