summaryrefslogtreecommitdiff
path: root/eclass/qt5-build.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/qt5-build.eclass')
-rw-r--r--eclass/qt5-build.eclass140
1 files changed, 62 insertions, 78 deletions
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index bc5928d33140..2765fc46081f 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -6,7 +6,7 @@
# qt@gentoo.org
# @AUTHOR:
# Davide Pesavento <pesa@gentoo.org>
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: Eclass for Qt5 split ebuilds.
# @DESCRIPTION:
# This eclass contains various functions that are used when building Qt5.
@@ -16,10 +16,20 @@ if [[ ${CATEGORY} != dev-qt ]]; then
fi
case ${EAPI} in
- 7) ;;
+ 7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
+# @ECLASS-VARIABLE: QT5_BUILD_TYPE
+# @DESCRIPTION:
+# Default value is "release".
+# If PV matches "*9999*", this is automatically set to "live".
+QT5_BUILD_TYPE=release
+if [[ ${PV} == *9999* ]]; then
+ QT5_BUILD_TYPE=live
+fi
+readonly QT5_BUILD_TYPE
+
# @ECLASS-VARIABLE: QT5_MODULE
# @PRE_INHERIT
# @DESCRIPTION:
@@ -27,6 +37,13 @@ esac
# SRC_URI and EGIT_REPO_URI. Must be set before inheriting the eclass.
: ${QT5_MODULE:=${PN}}
+# @ECLASS-VARIABLE: _QT5_P
+# @INTERNAL
+# @DESCRIPTION:
+# The upstream package name of the module this package belongs to.
+# Used for SRC_URI and S.
+_QT5_P=${QT5_MODULE}-everywhere-src-${PV}
+
# @ECLASS-VARIABLE: QT5_TARGET_SUBDIRS
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -59,41 +76,17 @@ esac
inherit estack flag-o-matic toolchain-funcs virtualx
-HOMEPAGE="https://www.qt.io/"
-LICENSE="|| ( GPL-2 GPL-3 LGPL-3 ) FDL-1.3"
-SLOT=5/$(ver_cut 1-2)
-
-QT5_MINOR_VERSION=$(ver_cut 2)
-readonly QT5_MINOR_VERSION
-
-case ${PV} in
- 5.??.9999)
- # git stable branch
- QT5_BUILD_TYPE="live"
- EGIT_BRANCH=${PV%.9999}
- ;;
- *_alpha*|*_beta*|*_rc*)
- # development release
- QT5_BUILD_TYPE="release"
- MY_P=${QT5_MODULE}-everywhere-src-${PV/_/-}
- SRC_URI="https://download.qt.io/development_releases/qt/${PV%.*}/${PV/_/-}/submodules/${MY_P}.tar.xz"
- S=${WORKDIR}/${MY_P}
- ;;
- *)
+if [[ ${PN} != qtwebengine ]]; then
+ if [[ ${QT5_BUILD_TYPE} == live ]] || [[ -n ${KDE_ORG_COMMIT} ]]; then
+ # KDE Qt5PatchCollection
+ inherit kde.org
+ else
# official stable release
- QT5_BUILD_TYPE="release"
- MY_P=${QT5_MODULE}-everywhere-src-${PV}
- SRC_URI="https://download.qt.io/official_releases/qt/${PV%.*}/${PV}/submodules/${MY_P}.tar.xz"
- S=${WORKDIR}/${MY_P}
- ;;
-esac
-readonly QT5_BUILD_TYPE
-
-EGIT_REPO_URI=(
- "https://code.qt.io/qt/${QT5_MODULE}.git"
- "https://github.com/qt/${QT5_MODULE}.git"
-)
-[[ ${QT5_BUILD_TYPE} == live ]] && inherit git-r3
+ HOMEPAGE="https://www.qt.io/"
+ SRC_URI="https://download.qt.io/official_releases/qt/${PV%.*}/${PV}/submodules/${_QT5_P}.tar.xz"
+ S=${WORKDIR}/${_QT5_P}
+ fi
+fi
# @ECLASS-VARIABLE: QT5_BUILD_DIR
# @OUTPUT_VARIABLE
@@ -101,6 +94,8 @@ EGIT_REPO_URI=(
# Build directory for out-of-source builds.
: ${QT5_BUILD_DIR:=${S}_build}
+LICENSE="|| ( GPL-2 GPL-3 LGPL-3 ) FDL-1.3"
+SLOT=5/$(ver_cut 1-2)
IUSE="debug test"
if [[ ${QT5_BUILD_TYPE} == release ]]; then
@@ -119,30 +114,7 @@ fi
###### Phase functions ######
-EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install src_test pkg_postinst pkg_postrm
-
-# @FUNCTION: qt5-build_src_unpack
-# @DESCRIPTION:
-# Unpacks the sources.
-qt5-build_src_unpack() {
- # bug 307861
- if [[ ${PN} == qtwebengine ]]; then
- eshopts_push -s extglob
- if is-flagq '-g?(gdb)?([1-9])'; then
- ewarn
- ewarn "You have enabled debug info (probably have -g or -ggdb in your CFLAGS/CXXFLAGS)."
- ewarn "You may experience really long compilation times and/or increased memory usage."
- ewarn "If compilation fails, please try removing -g/-ggdb before reporting a bug."
- ewarn
- fi
- eshopts_pop
- fi
-
- case ${QT5_BUILD_TYPE} in
- live) git-r3_src_unpack ;&
- release) default ;;
- esac
-}
+EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test pkg_postinst pkg_postrm
# @FUNCTION: qt5-build_src_prepare
# @DESCRIPTION:
@@ -150,6 +122,15 @@ qt5-build_src_unpack() {
qt5-build_src_prepare() {
qt5_prepare_env
+ if [[ -n ${KDE_ORG_COMMIT} ]]; then
+ # Upstream bumped version in 5.15 branch after 5.15.2 release but their
+ # 5.15.3 release is closed and this will never be more than a Qt 5.15.2
+ # with patches on top.
+ einfo "Preparing KDE Qt5PatchCollection snapshot at ${KDE_ORG_COMMIT}"
+ sed -e "/^MODULE_VERSION/s/5\.15\.3/5\.15\.2/" -i .qmake.conf || die
+ mkdir -p .git || die # need to fake a git repository for configure
+ fi
+
if [[ ${QT5_MODULE} == qtbase ]]; then
qt5_symlink_tools_to_build_dir
@@ -258,22 +239,23 @@ qt5-build_src_install() {
"${D}${QT5_HEADERDIR}"/QtCore/qconfig.h \
|| die "sed failed (qconfig.h)"
- # install qtchooser configuration file
- cat > "${T}/qt5-${CHOST}.conf" <<-_EOF_ || die
- ${QT5_BINDIR}
- ${QT5_LIBDIR}
- _EOF_
-
- (
- insinto /etc/xdg/qtchooser
- doins "${T}/qt5-${CHOST}.conf"
- )
-
- # convenience symlinks
- dosym qt5-"${CHOST}".conf /etc/xdg/qtchooser/5.conf
- dosym qt5-"${CHOST}".conf /etc/xdg/qtchooser/qt5.conf
- # TODO bug 522646: write an eselect module to manage default.conf
- dosym qt5.conf /etc/xdg/qtchooser/default.conf
+ if ver_test -lt 5.15.2-r10; then
+ # install qtchooser configuration file
+ cat > "${T}/qt5-${CHOST}.conf" <<-_EOF_ || die
+ ${QT5_BINDIR}
+ ${QT5_LIBDIR}
+ _EOF_
+
+ (
+ insinto /etc/xdg/qtchooser
+ doins "${T}/qt5-${CHOST}.conf"
+ )
+
+ # convenience symlinks
+ dosym qt5-"${CHOST}".conf /etc/xdg/qtchooser/5.conf
+ dosym qt5-"${CHOST}".conf /etc/xdg/qtchooser/qt5.conf
+ dosym qt5.conf /etc/xdg/qtchooser/default.conf
+ fi
fi
qt5_install_module_config
@@ -647,9 +629,11 @@ qt5_base_configure() {
# a forwarding header is no longer created since 5.8, causing the system
# config to always be used. bug 599636
- # ${S}/include does not exist in live sources
+ # ${S}/include does not exist in live sources or kde.org snapshots
local basedir="${S}/"
- [[ ${QT5_BUILD_TYPE} == live ]] && basedir=""
+ if [[ ${QT5_BUILD_TYPE} == live ]] || [[ -n ${KDE_ORG_COMMIT} ]]; then
+ basedir=""
+ fi
cp src/corelib/global/qconfig.h "${basedir}"include/QtCore/ || die
popd >/dev/null || die