qtcore-5.15.18.ebuild 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # Copyright 1999-2026 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. # Looking for Qt 6? It is packaged differently to Qt 5 with different
  5. # package names: https://wiki.gentoo.org/wiki/Project:Qt/Qt6_migration_notes
  6. if [[ ${PV} != *9999* ]]; then
  7. QT5_KDEPATCHSET_REV=1
  8. KEYWORDS="amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv x86"
  9. fi
  10. QT5_MODULE="qtbase"
  11. inherit linux-info flag-o-matic toolchain-funcs qt5-build
  12. DESCRIPTION="Cross-platform application development framework"
  13. SLOT=5/${QT5_PV}
  14. IUSE="icu old-kernel"
  15. DEPEND="
  16. dev-libs/double-conversion:=
  17. dev-libs/glib:2
  18. dev-libs/libpcre2[pcre16,unicode]
  19. virtual/zlib:=
  20. icu? ( dev-libs/icu:= )
  21. !icu? ( virtual/libiconv )
  22. "
  23. RDEPEND="${DEPEND}
  24. !<dev-qt/designer-${QT5_PV}:5
  25. !<dev-qt/qt3d-${QT5_PV}:5
  26. !<dev-qt/qtbluetooth-${QT5_PV}:5
  27. !<dev-qt/qtcharts-${QT5_PV}:5
  28. !<dev-qt/qtconcurrent-${QT5_PV}:5
  29. !<dev-qt/qtdatavis3d-${QT5_PV}:5
  30. !<dev-qt/qtdbus-${QT5_PV}:5
  31. !<dev-qt/qtdeclarative-${QT5_PV}:5
  32. !<dev-qt/qtgamepad-${QT5_PV}:5
  33. !<dev-qt/qtgraphicaleffects-${QT5_PV}:5
  34. !<dev-qt/qtgui-${QT5_PV}:5
  35. !<dev-qt/qthelp-${QT5_PV}:5
  36. !<dev-qt/qtimageformats-${QT5_PV}:5
  37. !<dev-qt/qtlocation-${QT5_PV}:5
  38. !<dev-qt/qtmultimedia-${QT5_PV}:5
  39. !<dev-qt/qtnetwork-${QT5_PV}:5
  40. !<dev-qt/qtnetworkauth-${QT5_PV}:5
  41. !<dev-qt/qtopengl-${QT5_PV}:5
  42. !<dev-qt/qtpositioning-${QT5_PV}:5
  43. !<dev-qt/qtprintsupport-${QT5_PV}:5
  44. !<dev-qt/qtquickcontrols-${QT5_PV}:5
  45. !<dev-qt/qtquickcontrols2-${QT5_PV}:5
  46. !<dev-qt/qtquicktimeline-${QT5_PV}:5
  47. !<dev-qt/qtscript-${QT5_PV}:5
  48. !<dev-qt/qtscxml-${QT5_PV}:5
  49. !<dev-qt/qtsensors-${QT5_PV}:5
  50. !<dev-qt/qtserialbus-${QT5_PV}:5
  51. !<dev-qt/qtserialport-${QT5_PV}:5
  52. !<dev-qt/qtspeech-${QT5_PV}:5
  53. !<dev-qt/qtsql-${QT5_PV}:5
  54. !<dev-qt/qtsvg-${QT5_PV}:5
  55. !<dev-qt/qttest-${QT5_PV}:5
  56. !<dev-qt/qtvirtualkeyboard-${QT5_PV}:5
  57. !<dev-qt/qtwayland-${QT5_PV}:5
  58. !<dev-qt/qtwebchannel-${QT5_PV}:5
  59. !<dev-qt/qtwebengine-${QT5_PV}:5
  60. !<dev-qt/qtwebsockets-${QT5_PV}:5
  61. !<dev-qt/qtwebview-${QT5_PV}:5
  62. !<dev-qt/qtwidgets-${QT5_PV}:5
  63. !<dev-qt/qtx11extras-${QT5_PV}:5
  64. !<dev-qt/qtxml-${QT5_PV}:5
  65. !<dev-qt/qtxmlpatterns-${QT5_PV}:5
  66. "
  67. QT5_TARGET_SUBDIRS=(
  68. src/tools/bootstrap
  69. src/tools/moc
  70. src/tools/rcc
  71. src/corelib
  72. src/tools/qlalr
  73. doc
  74. )
  75. QT5_GENTOO_PRIVATE_CONFIG=(
  76. !:network
  77. !:sql
  78. !:testlib
  79. !:xml
  80. )
  81. pkg_pretend() {
  82. use kernel_linux || return
  83. get_running_version
  84. if kernel_is -lt 4 11 && ! use old-kernel; then
  85. ewarn "The running kernel is older than 4.11. USE=old-kernel is needed for"
  86. ewarn "dev-qt/qtcore to function on this kernel properly. Bugs #669994, #672856"
  87. fi
  88. }
  89. src_prepare() {
  90. # don't add -O3 to CXXFLAGS, bug 549140
  91. sed -i -e '/CONFIG\s*+=/s/optimize_full//' src/corelib/corelib.pro || die
  92. # fix missing qt_version_tag symbol w/ LTO, bug 674382
  93. sed -i -e 's/^gcc:ltcg/gcc/' src/corelib/global/global.pri || die
  94. # Broken with FORTIFY_SOURCE=3
  95. #
  96. # Our toolchain sets F_S=2 by default w/ >= -O2, so we need
  97. # to unset F_S first, then explicitly set 2, to negate any default
  98. # and anything set by the user if they're choosing 3 (or if they've
  99. # modified GCC to set 3).
  100. #
  101. # Refs:
  102. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105078
  103. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105709
  104. # https://bugreports.qt.io/browse/QTBUG-103782
  105. # bug #847145
  106. if tc-enables-fortify-source ; then
  107. # We can't unconditionally do this b/c we fortify needs
  108. # some level of optimisation.
  109. filter-flags -D_FORTIFY_SOURCE=3
  110. # (Qt doesn't seem to respect CPPFLAGS?)
  111. append-flags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  112. fi
  113. qt5-build_src_prepare
  114. # workaround for a79a370c (...Annotate-QMutex-...patch) adding a header
  115. qt5_syncqt_version
  116. }
  117. src_configure() {
  118. local myconf=(
  119. $(qt_use icu)
  120. $(qt_use !icu iconv)
  121. )
  122. use old-kernel && myconf+=(
  123. -no-feature-renameat2 # needs Linux 3.16, bug 669994
  124. -no-feature-getentropy # needs Linux 3.17, bug 669994
  125. -no-feature-statx # needs Linux 4.11, bug 672856
  126. )
  127. qt5-build_src_configure
  128. }
  129. src_install() {
  130. qt5-build_src_install
  131. qt5_symlink_binary_to_path qmake 5
  132. local flags=(
  133. DBUS FREETYPE IMAGEFORMAT_JPEG IMAGEFORMAT_PNG
  134. OPENGL OPENSSL SSL WIDGETS
  135. )
  136. for flag in ${flags[@]}; do
  137. cat >> "${D}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die
  138. #if defined(QT_NO_${flag}) && defined(QT_${flag})
  139. # undef QT_NO_${flag}
  140. #elif !defined(QT_NO_${flag}) && !defined(QT_${flag})
  141. # define QT_NO_${flag}
  142. #endif
  143. _EOF_
  144. done
  145. }