Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes related to QT5_GENTOO_CONFIG, QT_FEATURE_* macros, qconfig_p.h header #261

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dev-qt/qtdbus/qtdbus-5.15.6.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ QT5_TARGET_SUBDIRS=(
)

QT5_GENTOO_CONFIG=(
:dbus
:dbus-linked:
::DBUS
:dbus:FEATURE_dbus
:dbus-linked:FEATURE_dbus_linked
)

QT5_GENTOO_PRIVATE_CONFIG=(
Expand Down
7 changes: 4 additions & 3 deletions dev-qt/qtgui/qtgui-5.15.6.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ QT5_TARGET_SUBDIRS=(
)

QT5_GENTOO_CONFIG=(
accessibility:accessibility-atspi-bridge
accessibility:accessibility-atspi-bridge:ACCESSIBILITY_ATSPI_BRIDGE
egl:egl:
eglfs:eglfs:
eglfs:eglfs_egldevice:
Expand All @@ -98,14 +98,15 @@ QT5_GENTOO_CONFIG=(
!:no-freetype:
gles2-only::OPENGL_ES
gles2-only:opengles2:OPENGL_ES_2
::FEATURE_gui
!:no-gui:
:system-harfbuzz:
!:no-harfbuzz:
jpeg:system-jpeg:IMAGEFORMAT_JPEG
!jpeg:no-jpeg:
libinput
libinput:libinput:LIBINPUT
libinput:xkbcommon:
:opengl
:opengl:OPENGL
png:png:
png:system-png:IMAGEFORMAT_PNG
!png:no-png:
Expand Down
2 changes: 1 addition & 1 deletion dev-qt/qtprintsupport/qtprintsupport-5.15.6.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ QT5_TARGET_SUBDIRS=(
)

QT5_GENTOO_CONFIG=(
cups
cups:cups:CUPS
)

src_configure() {
Expand Down
5 changes: 3 additions & 2 deletions dev-qt/qtwidgets/qtwidgets-5.15.6.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ QT5_TARGET_SUBDIRS=(
QT5_GENTOO_CONFIG=(
dbus:xdgdesktopportal:
gtk:gtk3:
::widgets
::WIDGETS
::FEATURE_widgets
!:no-widgets:
)

Expand All @@ -51,7 +52,7 @@ QT5_GENTOO_PRIVATE_CONFIG=(
src_configure() {
local myconf=(
-opengl $(usex gles2-only es2 desktop)
$(qt_use dbus)
$(usev dbus -dbus-linked)
$(qt_use gtk)
-gui
$(qt_use png libpng system)
Expand Down
42 changes: 25 additions & 17 deletions eclass/qt5-build.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,10 @@ qt5_base_configure() {
basedir=""
fi
cp src/corelib/global/qconfig.h "${basedir}"include/QtCore/ || die
if [[ ${PN} != qtcore ]]; then
mkdir "${basedir}"include/QtCore/private || die
cp src/corelib/global/qconfig_p.h "${basedir}"include/QtCore/private/ || die
fi

popd >/dev/null || die

Expand Down Expand Up @@ -790,27 +794,34 @@ qt5_qmake() {
# 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=
local x flag feature macro qconfig_add qconfig_remove qprivateconfig_add qprivateconfig_remove

> "${T}"/${PN}-qconfig.h
> "${T}"/${PN}-qconfig.pri
> "${T}"/${PN}-qmodule.pri

# generate qconfig_{add,remove} and ${PN}-qconfig.h
for x in "${QT5_GENTOO_CONFIG[@]}"; do
local flag=${x%%:*}
x=${x#${flag}:}
local feature=${x%%:*}
x=${x#${feature}:}
local macro=${x}
macro=$(tr 'a-z-' 'A-Z_' <<< "${macro}")
IFS=: read -r flag feature macro <<<"${x}"
Comment on lines -801 to +805
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break existing 5.15.5 ebuilds, right?


if [[ -z ${flag} ]] || { [[ ${flag} != '!' ]] && use ${flag}; }; then
[[ -n ${feature} ]] && qconfig_add+=" ${feature}"
[[ -n ${macro} ]] && echo "#define QT_${macro}" >> "${T}"/${PN}-qconfig.h
[[ -n ${feature} ]] && qconfig_add+="${qconfig_add:+ }${feature}"
if [[ -n ${macro} ]]; then
if [[ ${macro} == FEATURE_* ]]; then
echo "#define QT_${macro} 1" >> "${T}"/${PN}-qconfig.h
else
echo "#define QT_${macro}" >> "${T}"/${PN}-qconfig.h
fi
fi
else
[[ -n ${feature} ]] && qconfig_remove+=" ${feature}"
[[ -n ${macro} ]] && echo "#define QT_NO_${macro}" >> "${T}"/${PN}-qconfig.h
[[ -n ${feature} ]] && qconfig_remove+="${qconfig_remove:+ }${feature}"
if [[ -n ${macro} ]]; then
if [[ ${macro} == FEATURE_* ]]; then
echo "#define QT_${macro} -1" >> "${T}"/${PN}-qconfig.h
else
echo "#define QT_NO_${macro}" >> "${T}"/${PN}-qconfig.h
fi
fi
fi
done

Expand All @@ -830,15 +841,12 @@ qt5_install_module_config() {

# generate qprivateconfig
for x in "${QT5_GENTOO_PRIVATE_CONFIG[@]}"; do
local flag=${x%%:*}
x=${x#${flag}:}
local feature=${x%%:*}
x=${x#${feature}:}
IFS=: read -r flag feature <<<"${x}"

if [[ -z ${flag} ]] || { [[ ${flag} != '!' ]] && use ${flag}; }; then
[[ -n ${feature} ]] && qprivateconfig_add+=" ${feature}"
[[ -n ${feature} ]] && qprivateconfig_add+="${qprivateconfig_add:+ }${feature}"
else
[[ -n ${feature} ]] && qprivateconfig_remove+=" ${feature}"
[[ -n ${feature} ]] && qprivateconfig_remove+="${qprivateconfig_remove:+ }${feature}"
fi
done

Expand Down