diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 41338 -> 41338 bytes | |||
-rw-r--r-- | eclass/kde4-meta.eclass | 2 | ||||
-rw-r--r-- | eclass/qt5-build.eclass | 131 |
3 files changed, 121 insertions, 12 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex 1690d69a4483..25ed9c41c13a 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass index 3df6fe39dbb5..88d9ef89ad15 100644 --- a/eclass/kde4-meta.eclass +++ b/eclass/kde4-meta.eclass @@ -1,6 +1,8 @@ # Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # +# @DEAD +# Removal on 2018-03-06. # @ECLASS: kde4-meta.eclass # @MAINTAINER: # kde@gentoo.org diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass index 82855656e040..939a048d3d42 100644 --- a/eclass/qt5-build.eclass +++ b/eclass/qt5-build.eclass @@ -42,6 +42,14 @@ esac # definitions, which are then merged together with all other Qt5 packages # installed on the system to obtain the global qconfig.{h,pri} files. +# @ECLASS-VARIABLE: QT5_GENTOO_PRIVATE_CONFIG +# @DEFAULT_UNSET +# @DESCRIPTION: +# Array of <useflag:feature> pairs that are evaluated in src_install +# to generate the per-package list of enabled QT.global_private features, +# which are then merged together with all other Qt5 packages installed on the +# system to obtain the global qmodule.pri file. + # @ECLASS-VARIABLE: VIRTUALX_REQUIRED # @DESCRIPTION: # For proper description see virtualx.eclass man page. @@ -319,7 +327,7 @@ qt5-build_src_install() { dosym qt5-"${CHOST}".conf /etc/xdg/qtchooser/qt5.conf fi - qt5_install_module_qconfigs + qt5_install_module_config prune_libtool_files } @@ -327,7 +335,7 @@ qt5-build_src_install() { # @DESCRIPTION: # Regenerate configuration after installation or upgrade/downgrade. qt5-build_pkg_postinst() { - qt5_regenerate_global_qconfigs + qt5_regenerate_global_configs } # @FUNCTION: qt5-build_pkg_postrm @@ -335,7 +343,7 @@ qt5-build_pkg_postinst() { # Regenerate configuration when a module is completely removed. qt5-build_pkg_postrm() { if [[ -z ${REPLACED_BY_VERSION} && ${PN} != qtcore ]]; then - qt5_regenerate_global_qconfigs + qt5_regenerate_global_configs fi } @@ -675,6 +683,9 @@ qt5_base_configure() { # do not build with -Werror -no-warnings-are-errors + # enable in respective modules to avoid poisoning QT.global_private.enabled_features + $([[ ${QT5_MINOR_VERSION} -ge 9 ]] && echo -no-gui -no-widgets) + # module-specific options "${myconf[@]}" ) @@ -762,15 +773,17 @@ qt5_qmake() { || die "qmake failed (${projectdir#${S}/})" } -# @FUNCTION: qt5_install_module_qconfigs +# @FUNCTION: qt5_install_module_config # @INTERNAL # @DESCRIPTION: -# Creates and installs gentoo-specific ${PN}-qconfig.{h,pri} files. -qt5_install_module_qconfigs() { - local x qconfig_add= qconfig_remove= +# Creates and installs gentoo-specific ${PN}-qconfig.{h,pri} and +# ${PN}-qmodule.pri files. +qt5_install_module_config() { + local x qconfig_add= qconfig_remove= qprivateconfig_add= qprivateconfig_remove= > "${T}"/${PN}-qconfig.h > "${T}"/${PN}-qconfig.pri + [[ ${QT5_MINOR_VERSION} -ge 9 ]] && > "${T}"/${PN}-qmodule.pri # generate qconfig_{add,remove} and ${PN}-qconfig.h for x in "${QT5_GENTOO_CONFIG[@]}"; do @@ -803,14 +816,46 @@ qt5_install_module_qconfigs() { insinto "${QT5_ARCHDATADIR#${EPREFIX}}"/mkspecs/gentoo doins "${T}"/${PN}-qconfig.pri ) + + if [[ ${QT5_MINOR_VERSION} -ge 9 ]]; then + # generate qprivateconfig + for x in "${QT5_GENTOO_PRIVATE_CONFIG[@]}"; do + local flag=${x%%:*} + x=${x#${flag}:} + local feature=${x%%:*} + x=${x#${feature}:} + + if [[ -z ${flag} ]] || { [[ ${flag} != '!' ]] && use ${flag}; }; then + [[ -n ${feature} ]] && qprivateconfig_add+=" ${feature}" + else + [[ -n ${feature} ]] && qprivateconfig_remove+=" ${feature}" + fi + done + + # generate and install ${PN}-qmodule.pri + [[ -n ${qprivateconfig_add} ]] && echo "QT.global_private.enabled_features = ${qprivateconfig_add}" >> "${T}"/${PN}-qmodule.pri + [[ -n ${qprivateconfig_remove} ]] && echo "QT.global_private.disabled_features = ${qprivateconfig_remove}" >> "${T}"/${PN}-qmodule.pri + [[ -s ${T}/${PN}-qmodule.pri ]] && ( + insinto "${QT5_ARCHDATADIR#${EPREFIX}}"/mkspecs/gentoo + doins "${T}"/${PN}-qmodule.pri + ) + fi + + # install also the original qconfig.pri + [[ ${PN} == qtcore && ${QT5_MINOR_VERSION} -ge 9 ]] && ( + insinto "${QT5_ARCHDATADIR#${EPREFIX}}"/mkspecs/gentoo + newins "${D}${QT5_ARCHDATADIR#${EPREFIX}}"/mkspecs/qconfig.pri qconfig-qtcore.pri + newins "${D}${QT5_ARCHDATADIR#${EPREFIX}}"/mkspecs/qmodule.pri qmodule-qtcore.pri + ) } -# @FUNCTION: qt5_regenerate_global_qconfigs +# @FUNCTION: qt5_regenerate_global_configs # @INTERNAL # @DESCRIPTION: -# Generates Gentoo-specific qconfig.{h,pri} according to the build configuration. +# Generates Gentoo-specific qconfig.{h,pri} and qmodule.pri according to the +# build configuration. # Don't call die here because dying in pkg_post{inst,rm} only makes things worse. -qt5_regenerate_global_qconfigs() { +qt5_regenerate_global_configs() { einfo "Regenerating gentoo-qconfig.h" find "${ROOT%/}${QT5_HEADERDIR}"/Gentoo \ @@ -824,10 +869,15 @@ qt5_regenerate_global_qconfigs() { einfo "Updating QT_CONFIG in qconfig.pri" local qconfig_pri=${ROOT%/}${QT5_ARCHDATADIR}/mkspecs/qconfig.pri + local qconfig_pri_orig=${ROOT%/}${QT5_ARCHDATADIR}/mkspecs/gentoo/qconfig-qtcore.pri if [[ -f ${qconfig_pri} ]]; then local x qconfig_add= qconfig_remove= - local qt_config=$(sed -n 's/^QT_CONFIG\s*+=\s*//p' "${qconfig_pri}") - local new_qt_config= + local qt_config new_qt_config= + if [[ -f ${qconfig_pri_orig} ]]; then + qt_config=$(sed -n 's/^QT_CONFIG\s*+=\s*//p' "${qconfig_pri_orig}") + else + qt_config=$(sed -n 's/^QT_CONFIG\s*+=\s*//p' "${qconfig_pri}") + fi # generate list of QT_CONFIG entries from the existing list, # appending QCONFIG_ADD and excluding QCONFIG_REMOVE @@ -849,4 +899,61 @@ qt5_regenerate_global_qconfigs() { else ewarn "${qconfig_pri} does not exist or is not a regular file" fi + + if [[ ${QT5_MINOR_VERSION} -ge 9 ]]; then + einfo "Updating QT.global_private in qmodule.pri" + + local qmodule_pri=${ROOT%/}${QT5_ARCHDATADIR}/mkspecs/qmodule.pri + local qmodule_pri_orig=${ROOT%/}${QT5_ARCHDATADIR}/mkspecs/gentoo/qmodule-qtcore.pri + if [[ -f ${qmodule_pri} && -f ${qmodule_pri_orig} ]]; then + local x + local qprivateconfig_enabled= qprivateconfig_disabled= + local qprivateconfig_orig_enabled= qprivateconfig_orig_disabled= + local new_qprivateconfig_enabled= new_qprivateconfig_disabled= + + # generate lists of QT.global_private.{dis,en}abled_features + qprivateconfig_orig_enabled="$(sed -n 's/^QT.global_private.enabled_features\s=\s*//p' "${qmodule_pri_orig}")" + qprivateconfig_orig_disabled="$(sed -n 's/^QT.global_private.disabled_features\s=\s*//p' "${qmodule_pri_orig}")" + eshopts_push -s nullglob + for x in "${ROOT%/}${QT5_ARCHDATADIR}"/mkspecs/gentoo/*-qmodule.pri; do + qprivateconfig_enabled+=" $(sed -n 's/^QT.global_private.enabled_features\s=\s*//p' "${x}")" + qprivateconfig_disabled+=" $(sed -n 's/^QT.global_private.disabled_features\s=\s*//p' "${x}")" + done + eshopts_pop + + # anything enabled is enabled, but anything disabled is + # only disabled if it isn't enabled somewhere else. + # this is because we need to forcibly disable some stuff + # in qtcore to support split qtbase. + new_qprivateconfig_enabled=${qprivateconfig_enabled} + for x in ${qprivateconfig_disabled}; do + if ! has "${x}" ${qprivateconfig_enabled}; then + new_qprivateconfig_disabled+=" ${x}" + fi + done + + # check all items from the original qtcore qmodule.pri, + # and add them to the appropriate list if not overriden + # elsewhere + for x in ${qprivateconfig_orig_enabled}; do + if ! has "${x}" ${new_qprivateconfig_enabled} ${new_qprivateconfig_disabled}; then + new_qprivateconfig_enabled+=" ${x}" + fi + done + for x in ${qprivateconfig_orig_disabled}; do + if ! has "${x}" ${new_qprivateconfig_enabled} ${new_qprivateconfig_disabled}; then + new_qprivateconfig_disabled+=" ${x}" + fi + done + + # now replace the existing QT.global_private.{dis,en}abled_features + # with the generated list + sed \ + -e "s/^QT.global_private.enabled_features\s*=.*/QT.global_private.enabled_features =${new_qprivateconfig_enabled}/" \ + -e "s/^QT.global_private.disabled_features\s*=.*/QT.global_private.disabled_features =${new_qprivateconfig_disabled}/" \ + -i "${qmodule_pri}" || eerror "Failed to sed QT.global_private.enabled_features in ${qmodule_pri}" + else + ewarn "${qmodule_pri} or ${qmodule_pri_orig} does not exist or is not a regular file" + fi + fi } |