Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtbase/, eclass/
Date: Tue, 02 Aug 2022 21:51:32
Message-Id: 1659476986.96837e4d39ffa0a8da392fa0039b80c72e56c234.sam@gentoo
1 commit: 96837e4d39ffa0a8da392fa0039b80c72e56c234
2 Author: Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 25 22:40:57 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 2 21:49:46 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96837e4d
7
8 dev-qt/qtbase: new package
9
10 Version 6.3.1 qtbase in non-split form.
11
12 Bug: https://bugs.gentoo.org/838970
13 Package-Manager: Portage-3.0.30, Repoman-3.0.3
14 Signed-off-by: Jimi Huotari <chiitoo <AT> gentoo.org>
15 Signed-off-by: Sam James <sam <AT> gentoo.org>
16
17 dev-qt/qtbase/Manifest | 1 +
18 dev-qt/qtbase/metadata.xml | 38 ++++++++
19 dev-qt/qtbase/qtbase-6.3.1.ebuild | 178 ++++++++++++++++++++++++++++++++++++++
20 eclass/qt6-build.eclass | 161 ++++++++++++++++++++++++++++++++++
21 4 files changed, 378 insertions(+)
22
23 diff --git a/dev-qt/qtbase/Manifest b/dev-qt/qtbase/Manifest
24 new file mode 100644
25 index 000000000000..7501b9d04ca4
26 --- /dev/null
27 +++ b/dev-qt/qtbase/Manifest
28 @@ -0,0 +1 @@
29 +DIST qtbase-everywhere-src-6.3.1.tar.xz 47118260 BLAKE2B b8b819330011033275d9532219bf09cce3ef1e7d8e50945b1cdeceddf3742c1ee4a1bba9d4340f1f6b48fd59659920c3652abf21bbd8b4bbed0c635a3caafb0c SHA512 5c4304dc1f5fa80201b61c9c8dbf4c3449506a243ea1f87e336dc3641a37b9d40c2aa4a93190cc69ddde0f349c74e327c35de5f46de888ddfd49616903e8a7b5
30
31 diff --git a/dev-qt/qtbase/metadata.xml b/dev-qt/qtbase/metadata.xml
32 new file mode 100644
33 index 000000000000..809758b7ae0e
34 --- /dev/null
35 +++ b/dev-qt/qtbase/metadata.xml
36 @@ -0,0 +1,38 @@
37 +<?xml version="1.0" encoding="UTF-8"?>
38 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
39 +<pkgmetadata>
40 + <maintainer type="project">
41 + <email>qt@g.o</email>
42 + <name>Gentoo Qt Project</name>
43 + </maintainer>
44 + <use>
45 + <flag name="brotli">Enable support for Brotli decompression</flag>
46 + <flag name="concurrent">Build Qt6Concurrent module</flag>
47 + <flag name="dbus">Build Qt6DBus module</flag>
48 + <flag name="egl">Enable EGL integration</flag>
49 + <flag name="eglfs">Build the EGL Full Screen/Single Surface platform plugin</flag>
50 + <flag name="evdev">Enable support for input devices via evdev</flag>
51 + <flag name="gssapi">Enable support for GSSAPI (<pkg>virtual/krb5</pkg>)</flag>
52 + <flag name="gtk">Build the GTK platform theme plugin</flag>
53 + <flag name="gui">Build Qt6Gui module</flag>
54 + <flag name="libinput">Enable support for input devices via <pkg>dev-libs/libinput</pkg></flag>
55 + <flag name="libproxy">Use <pkg>net-libs/libproxy</pkg> for automatic HTTP/SOCKS proxy configuration</flag>
56 + <flag name="network">Build Qt6Network module</flag>
57 + <flag name="sql">Build Qt6Sql module</flag>
58 + <flag name="systemd">Enable native journald logging support</flag>
59 + <flag name="tslib">Enable support for touchscreen devices via <pkg>x11-libs/tslib</pkg></flag>
60 + <flag name="tuio">Build plugin to receive touch events over the TUIO protocol</flag>
61 + <flag name="vulkan">Enable support for Vulkan</flag>
62 + <flag name="widgets">Build Qt6Widgets module</flag>
63 + <flag name="X">Build the XCB platform plugin and enable X11 integration</flag>
64 + </use>
65 + <upstream>
66 + <bugs-to>https://bugreports.qt.io/</bugs-to>
67 + <doc>https://doc.qt.io/</doc>
68 + </upstream>
69 + <slots>
70 + <subslots>
71 + Must only be used by packages that are known to use private parts of the Qt API.
72 + </subslots>
73 + </slots>
74 +</pkgmetadata>
75
76 diff --git a/dev-qt/qtbase/qtbase-6.3.1.ebuild b/dev-qt/qtbase/qtbase-6.3.1.ebuild
77 new file mode 100644
78 index 000000000000..36931e0ea933
79 --- /dev/null
80 +++ b/dev-qt/qtbase/qtbase-6.3.1.ebuild
81 @@ -0,0 +1,178 @@
82 +# Copyright 2021-2022 Gentoo Authors
83 +# Distributed under the terms of the GNU General Public License v2
84 +
85 +EAPI=8
86 +
87 +inherit qt6-build
88 +
89 +DESCRIPTION="Cross-platform application development framework"
90 +
91 +if [[ ${QT6_BUILD_TYPE} == release ]]; then
92 + KEYWORDS="~amd64"
93 +fi
94 +
95 +# Qt Modules
96 +# TODO: Restore/patch xml flag support (seems fixed in 6.9999).
97 +IUSE="+concurrent +dbus +gui +network +sql opengl +widgets zstd"
98 +REQUIRED_USE="
99 + opengl? ( gui )
100 + widgets? ( gui )
101 + X? ( || ( evdev libinput ) )
102 +"
103 +
104 +QTGUI_IUSE="accessibility egl eglfs evdev gles2-only +jpeg +libinput tslib tuio vulkan +X"
105 +QTNETWORK_IUSE="brotli gssapi libproxy sctp +ssl vnc"
106 +QTSQL_IUSE="freetds mysql oci8 odbc postgres +sqlite"
107 +IUSE+=" ${QTGUI_IUSE} ${QTNETWORK_IUSE} ${QTSQL_IUSE} cups gtk icu systemd +udev"
108 +# QtPrintSupport = QtGui + QtWidgets enabled.
109 +# ibus = xkbcommon + dbus, and xkbcommon needs either libinput or X
110 +REQUIRED_USE+="
111 + $(printf '%s? ( gui ) ' ${QTGUI_IUSE//+/})
112 + $(printf '%s? ( network ) ' ${QTNETWORK_IUSE//+/})
113 + $(printf '%s? ( sql ) ' ${QTSQL_IUSE//+/})
114 + accessibility? ( dbus X )
115 + cups? ( gui widgets )
116 + eglfs? ( egl )
117 + gtk? ( widgets )
118 + gui? ( || ( eglfs X ) || ( libinput X ) )
119 + libinput? ( udev )
120 + sql? ( || ( freetds mysql oci8 odbc postgres sqlite ) )
121 + vnc? ( gui )
122 + X? ( gles2-only? ( egl ) )
123 +"
124 +
125 +# TODO:
126 +# qtimageformats: mng not done yet, qtimageformats.git upstream commit 9443239c
127 +# qtnetwork: connman, networkmanager
128 +DEPEND="
129 + app-crypt/libb2
130 + dev-libs/double-conversion:=
131 + dev-libs/glib:2
132 + dev-libs/libpcre2:=[pcre16,unicode]
133 + dev-util/gtk-update-icon-cache
134 + media-libs/fontconfig
135 + >=media-libs/freetype-2.6.1:2
136 + >=media-libs/harfbuzz-1.6.0:=
137 + media-libs/tiff:0
138 + >=sys-apps/dbus-1.4.20
139 + sys-libs/zlib:=
140 + brotli? ( app-arch/brotli:= )
141 + evdev? ( sys-libs/mtdev )
142 + freetds? ( dev-db/freetds )
143 + gles2-only? ( media-libs/libglvnd )
144 + !gles2-only? ( media-libs/libglvnd[X] )
145 + gssapi? ( virtual/krb5 )
146 + gtk? (
147 + x11-libs/gtk+:3
148 + x11-libs/libX11
149 + x11-libs/pango
150 + )
151 + gui? ( media-libs/libpng:0= )
152 + icu? ( dev-libs/icu:= )
153 + !icu? ( virtual/libiconv )
154 + jpeg? ( media-libs/libjpeg-turbo:= )
155 + libinput? (
156 + dev-libs/libinput:=
157 + >=x11-libs/libxkbcommon-0.5.0
158 + )
159 + libproxy? ( net-libs/libproxy )
160 + mysql? ( dev-db/mysql-connector-c:= )
161 + oci8? ( dev-db/oracle-instantclient:=[sdk] )
162 + odbc? ( dev-db/unixODBC )
163 + postgres? ( dev-db/postgresql:* )
164 + sctp? ( kernel_linux? ( net-misc/lksctp-tools ) )
165 + sqlite? ( dev-db/sqlite:3 )
166 + ssl? ( dev-libs/openssl:= )
167 + systemd? ( sys-apps/systemd:= )
168 + tslib? ( >=x11-libs/tslib-1.21 )
169 + udev? ( virtual/libudev:= )
170 + vulkan? ( dev-util/vulkan-headers )
171 + X? (
172 + x11-libs/libdrm
173 + x11-libs/libICE
174 + x11-libs/libSM
175 + x11-libs/libX11
176 + >=x11-libs/libxcb-1.12:=[xkb]
177 + >=x11-libs/libxkbcommon-0.5.0[X]
178 + x11-libs/xcb-util-image
179 + x11-libs/xcb-util-keysyms
180 + x11-libs/xcb-util-renderutil
181 + x11-libs/xcb-util-wm
182 + )
183 + zstd? ( app-arch/zstd:= )
184 +"
185 +RDEPEND="${DEPEND}"
186 +
187 +src_configure() {
188 + local mycmakeargs=(
189 + -DINSTALL_BINDIR=${QT6_BINDIR}
190 + -DINSTALL_INCLUDEDIR=${QT6_HEADERDIR}
191 + -DINSTALL_LIBDIR=${QT6_LIBDIR}
192 + -DINSTALL_ARCHDATADIR=${QT6_ARCHDATADIR}
193 + -DINSTALL_PLUGINSDIR=${QT6_PLUGINDIR}
194 + -DINSTALL_LIBEXECDIR=${QT6_LIBEXECDIR}
195 + -DINSTALL_QMLDIR=${QT6_QMLDIR}
196 + -DINSTALL_DATADIR=${QT6_DATADIR}
197 + -DINSTALL_DOCDIR=${QT6_DOCDIR}
198 + -DINSTALL_TRANSLATIONSDIR=${QT6_TRANSLATIONDIR}
199 + -DINSTALL_SYSCONFDIR=${QT6_SYSCONFDIR}
200 + -DINSTALL_MKSPECSDIR=${QT6_ARCHDATADIR}/mkspecs
201 + -DINSTALL_EXAMPLESDIR=${QT6_EXAMPLESDIR}
202 + -DQT_FEATURE_androiddeployqt=OFF
203 + $(qt_feature concurrent)
204 + $(qt_feature dbus)
205 + $(qt_feature gui)
206 + $(qt_feature gui testlib)
207 + $(qt_feature icu)
208 + $(qt_feature network)
209 + $(qt_feature sql)
210 + $(qt_feature systemd journald)
211 + $(qt_feature udev libudev)
212 + $(qt_feature zstd)
213 + )
214 + use gui && mycmakeargs+=(
215 + $(qt_feature accessibility accessibility_atspi_bridge)
216 + $(qt_feature egl)
217 + $(qt_feature eglfs eglfs_egldevice)
218 + $(qt_feature eglfs eglfs_gbm)
219 + $(qt_feature evdev)
220 + $(qt_feature evdev mtdev)
221 + -DQT_FEATURE_gif=ON
222 + $(qt_feature jpeg)
223 + $(qt_feature opengl)
224 + $(qt_feature gles2-only opengles2)
225 + $(qt_feature libinput)
226 + $(qt_feature tslib)
227 + $(qt_feature tuio tuiotouch)
228 + $(qt_feature vulkan)
229 + $(qt_feature widgets)
230 + $(qt_feature X xcb)
231 + $(qt_feature X xcb_xlib)
232 + )
233 + use widgets && mycmakeargs+=(
234 + $(qt_feature cups)
235 + $(qt_feature gtk gtk3)
236 + )
237 + if use libinput || use X; then
238 + mycmakeargs+=( -DQT_FEATURE_xkbcommon=ON )
239 + fi
240 + use network && mycmakeargs+=(
241 + $(qt_feature brotli)
242 + $(qt_feature gssapi)
243 + $(qt_feature libproxy)
244 + $(qt_feature sctp)
245 + $(qt_feature ssl openssl)
246 + $(qt_feature vnc)
247 + )
248 + use sql && mycmakeargs+=(
249 + $(qt_feature freetds sql_tds)
250 + $(qt_feature mysql sql_mysql)
251 + $(qt_feature oci8 sql_oci)
252 + $(qt_feature odbc sql_odbc)
253 + $(qt_feature postgres sql_psql)
254 + $(qt_feature sqlite sql_sqlite)
255 + $(qt_feature sqlite system_sqlite)
256 + )
257 +
258 + qt6-build_src_configure
259 +}
260
261 diff --git a/eclass/qt6-build.eclass b/eclass/qt6-build.eclass
262 new file mode 100644
263 index 000000000000..139fb03e17f4
264 --- /dev/null
265 +++ b/eclass/qt6-build.eclass
266 @@ -0,0 +1,161 @@
267 +# Copyright 2021-2022 Gentoo Authors
268 +# Distributed under the terms of the GNU General Public License v2
269 +
270 +# @ECLASS: qt6-build.eclass
271 +# @MAINTAINER:
272 +# qt@g.o
273 +# @SUPPORTED_EAPIS: 8
274 +# @BLURB: Eclass for Qt6 split ebuilds.
275 +# @DESCRIPTION:
276 +# This eclass contains various functions that are used when building Qt6.
277 +# Requires EAPI 8.
278 +
279 +if [[ ${CATEGORY} != dev-qt ]]; then
280 + die "qt6-build.eclass is only to be used for building Qt 6"
281 +fi
282 +
283 +case ${EAPI} in
284 + 8) : ;;
285 + *) die "qt6-build.eclass: unsupported EAPI=${EAPI:-0}" ;;
286 +esac
287 +
288 +# @ECLASS-VARIABLE: QT6_MODULE
289 +# @PRE_INHERIT
290 +# @DESCRIPTION:
291 +# The upstream name of the module this package belongs to. Used for
292 +# SRC_URI and EGIT_REPO_URI. Must be set before inheriting the eclass.
293 +: ${QT6_MODULE:=${PN}}
294 +
295 +# @ECLASS-VARIABLE: VIRTUALX_REQUIRED
296 +# @DESCRIPTION:
297 +# For proper description see virtualx.eclass man page.
298 +# Here we redefine default value to be manual, if your package needs virtualx
299 +# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
300 +: ${VIRTUALX_REQUIRED:=manual}
301 +
302 +inherit cmake virtualx
303 +
304 +HOMEPAGE="https://www.qt.io/"
305 +LICENSE="|| ( GPL-2 GPL-3 LGPL-3 ) FDL-1.3"
306 +SLOT=6/$(ver_cut 1-2)
307 +
308 +QT6_MINOR_VERSION=$(ver_cut 2)
309 +readonly QT6_MINOR_VERSION
310 +
311 +case ${PV} in
312 + 6.9999)
313 + # git dev branch
314 + QT6_BUILD_TYPE="live"
315 + EGIT_BRANCH="dev"
316 + ;;
317 + 6.?.9999|6.??.9999)
318 + # git stable branch
319 + QT6_BUILD_TYPE="live"
320 + EGIT_BRANCH=${PV%.9999}
321 + ;;
322 + *_alpha*|*_beta*|*_rc*)
323 + # development release
324 + QT6_BUILD_TYPE="release"
325 + MY_P=${QT6_MODULE}-everywhere-src-${PV/_/-}
326 + SRC_URI="https://download.qt.io/development_releases/qt/${PV%.*}/${PV/_/-}/submodules/${MY_P}.tar.xz"
327 + S=${WORKDIR}/${MY_P}
328 + ;;
329 + *)
330 + # official stable release
331 + QT6_BUILD_TYPE="release"
332 + MY_P=${QT6_MODULE}-everywhere-src-${PV}
333 + SRC_URI="https://download.qt.io/official_releases/qt/${PV%.*}/${PV}/submodules/${MY_P}.tar.xz"
334 + S=${WORKDIR}/${MY_P}
335 + ;;
336 +esac
337 +readonly QT6_BUILD_TYPE
338 +
339 +EGIT_REPO_URI=(
340 + "https://code.qt.io/qt/${QT6_MODULE}.git"
341 + "https://github.com/qt/${QT6_MODULE}.git"
342 +)
343 +[[ ${QT6_BUILD_TYPE} == live ]] && inherit git-r3
344 +
345 +# @ECLASS-VARIABLE: QT6_BUILD_DIR
346 +# @OUTPUT_VARIABLE
347 +# @DESCRIPTION:
348 +# Build directory for out-of-source builds.
349 +: ${QT6_BUILD_DIR:=${S}_build}
350 +
351 +IUSE="debug test"
352 +
353 +if [[ ${QT6_BUILD_TYPE} == release ]]; then
354 + RESTRICT="test" # bug 457182
355 +else
356 + RESTRICT="!test? ( test )"
357 +fi
358 +
359 +BDEPEND="
360 + dev-lang/perl
361 + virtual/pkgconfig
362 +"
363 +# TODO: Tests have not been split from qtbase.
364 +#if [[ ${PN} != qttest ]]; then
365 +# DEPEND+=" test? ( ~dev-qt/qttest-${PV} )"
366 +#fi
367 +
368 +EXPORT_FUNCTIONS src_prepare src_configure
369 +
370 +###### Phase functions ######
371 +
372 +# @FUNCTION: qt6-build_src_prepare
373 +# @DESCRIPTION:
374 +# Prepares the environment and patches the sources if necessary.
375 +qt6-build_src_prepare() {
376 + qt6_prepare_env
377 +
378 + cmake_src_prepare
379 +}
380 +
381 +# @FUNCTION: qt6-build_src_configure
382 +# @DESCRIPTION:
383 +# Configures sources.
384 +qt6-build_src_configure() {
385 + cmake_src_configure
386 +}
387 +
388 +###### Public helpers ######
389 +
390 +# @FUNCTION: qt_feature
391 +# @USAGE: <flag> [feature]
392 +# @DESCRIPTION:
393 +# <flag> is the name of a flag in IUSE.
394 +qt_feature() {
395 + [[ $# -ge 1 ]] || die "${FUNCNAME}() requires at least one argument"
396 + echo "-DQT_FEATURE_${2:-$1}=$(usex $1 ON OFF)"
397 +}
398 +
399 +###### Internal functions ######
400 +
401 +# @FUNCTION: qt6_prepare_env
402 +# @INTERNAL
403 +# @DESCRIPTION:
404 +# Prepares the environment for building Qt.
405 +qt6_prepare_env() {
406 + # setup installation directories
407 + # note: keep paths in sync with qmake-utils.eclass
408 + QT6_PREFIX=${EPREFIX}/usr
409 + QT6_HEADERDIR=${QT6_PREFIX}/include/qt6
410 + QT6_LIBDIR=${QT6_PREFIX}/$(get_libdir)
411 + QT6_ARCHDATADIR=${QT6_PREFIX}/$(get_libdir)/qt6
412 + QT6_BINDIR=${QT6_ARCHDATADIR}/bin
413 + QT6_PLUGINDIR=${QT6_ARCHDATADIR}/plugins
414 + QT6_LIBEXECDIR=${QT6_ARCHDATADIR}/libexec
415 + QT6_IMPORTDIR=${QT6_ARCHDATADIR}/imports
416 + QT6_QMLDIR=${QT6_ARCHDATADIR}/qml
417 + QT6_DATADIR=${QT6_PREFIX}/share/qt6
418 + QT6_DOCDIR=${QT6_PREFIX}/share/qt6-doc
419 + QT6_TRANSLATIONDIR=${QT6_DATADIR}/translations
420 + QT6_EXAMPLESDIR=${QT6_DATADIR}/examples
421 + QT6_TESTSDIR=${QT6_DATADIR}/tests
422 + QT6_SYSCONFDIR=${EPREFIX}/etc/xdg
423 + readonly QT6_PREFIX QT6_HEADERDIR QT6_LIBDIR QT6_ARCHDATADIR \
424 + QT6_BINDIR QT6_PLUGINDIR QT6_LIBEXECDIR QT6_IMPORTDIR \
425 + QT6_QMLDIR QT6_DATADIR QT6_DOCDIR QT6_TRANSLATIONDIR \
426 + QT6_EXAMPLESDIR QT6_TESTSDIR QT6_SYSCONFDIR
427 +}