Add dev-qt from an older version of the gentoo repo

Qt5 has been removed, we restore it since we still use it.
This commit is contained in:
2026-07-03 09:45:00 +02:00
parent 2247967dd3
commit 692df50613
319 changed files with 15302 additions and 0 deletions

View File

@ -0,0 +1,3 @@
DIST qt-creator-opensource-src-19.0.0.tar.xz 39935612 BLAKE2B 474d6b0d80f75462272a926440537a7e815f137e27fa02cfad17ab562820ea0eca94eb30a70e6345fe1fa66282722540b1b6a56113ca72a998eeabec1f1d4f02 SHA512 7214d1883c4ddfa2d5a52b74d75c649f926afe455f1dab30aed72d7abc21ceae677d137a196e13b61a2d798a6556f1c68d79fcd63e6ba1c847b817a2a5274d90
DIST qt-creator-opensource-src-19.0.1.tar.xz 39906824 BLAKE2B 3624bea2048cd384dbb453ae08f6809c2d93d19d17444d93540a2f8bd4ee1f447e7324c4a80db2dfb101dc04794dfbaafe27565b95ece0fabaee38d9cb61fb83 SHA512 9cce61ea678f5c98c5a7cecce28d74a2c22687b1fa26aeb61e475534effdaa6558fe59beef805f9c5ac77fd5c6f28bd7738b870e4801008e05c84ca0dac4a8ff
DIST qt-creator-opensource-src-19.0.2.tar.xz 39908940 BLAKE2B 2a20e5644ad1406292108654d71d3bacbc06fba12270ea657814537755d96c033fd1a4f7d64c284c1115cc4c7f3f1b3e4a61a3360d3a263dbfeacb27accd944e SHA512 c0663a848fa7da32e7a1b1b3198a963bf2cc8e1f620cec97ca80522799029bff5fee61dd40bbebb337efe9eb7a87c08e6eb41154c05e7890808faf5d6b1a38f8

View File

@ -0,0 +1,8 @@
malloc_trim() is unavailable with musl
--- a/src/plugins/coreplugin/icore.cpp
+++ b/src/plugins/coreplugin/icore.cpp
@@ -1276,3 +1276,3 @@
// glibc may not actually free memory in free().
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) && defined(__GLIBC__)
connect(&m_trimTimer, &QTimer::timeout, this, [] { malloc_trim(0); });

View File

@ -0,0 +1,26 @@
execinfo is unavailable with musl (unless opt to package+use libexecinfo)
--- a/src/libs/utils/qtcassert.cpp
+++ b/src/libs/utils/qtcassert.cpp
@@ -9,5 +9,5 @@
#include <QTime>
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && defined(__GLIBC__)
#include <stdio.h>
#include <signal.h>
@@ -30,5 +30,5 @@
if (maxdepth < 0 || maxdepth > ArraySize)
maxdepth = ArraySize;
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && defined(__GLIBC__)
void *bt[ArraySize] = {nullptr};
int size = backtrace(bt, maxdepth);
--- a/src/plugins/qmldesigner/libs/designercore/exceptions/exception.cpp
+++ b/src/plugins/qmldesigner/libs/designercore/exceptions/exception.cpp
@@ -4,5 +4,5 @@
#include "exception.h"
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) && defined(__GLIBC__)
#include <execinfo.h>
#include <cxxabi.h>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>qt@gentoo.org</email>
<name>Gentoo Qt Project</name>
</maintainer>
<use>
<flag name="clang">Build clang-based plugins for C/C++ development (code model, formatting, static analysis)</flag>
<flag name="designer">Enable designer for QtWidgets-based UIs</flag>
<flag name="help">Enable the integrated <pkg>dev-qt/qt-docs</pkg> viewer (also needed for examples)</flag>
<flag name="plugin-dev">Install the 'Devel' component needed to build external Qt Creator plugins</flag>
<flag name="qmldesigner">Build QmlDesigner and related plugins (Insight, StudioWelcome)</flag>
<flag name="serialterminal">Build the serial terminal plugin</flag>
<flag name="tracing">Build plugins for tracing requiring extra dependencies (AppStatisticsMonitor, CtfVisualizer, PerfProfiler, QmlProfiler)</flag>
<flag name="webengine">
Allow using <pkg>dev-qt/qtwebengine</pkg> for
better USE=help display, and for Design Viewer
Connector support with USE=qmldesigner
</flag>
</use>
<upstream>
<bugs-to>https://qt-project.atlassian.net/</bugs-to>
<doc>https://doc.qt.io/qtcreator/</doc>
<remote-id type="github">qt-creator/qt-creator</remote-id>
</upstream>
</pkgmetadata>

View File

@ -0,0 +1,281 @@
# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( {16..22} )
LLVM_OPTIONAL=1
PYTHON_COMPAT=( python3_{11..14} )
inherit cmake flag-o-matic llvm-r2 python-any-r1 readme.gentoo-r1 xdg
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI=(
"https://code.qt.io/qt-creator/qt-creator.git"
"https://github.com/qt-creator/qt-creator.git"
)
EGIT_SUBMODULES=(
perfparser
src/libs/qlitehtml
src/libs/qlitehtml/src/3rdparty/litehtml
)
else
QTC_PV=${PV/_/-}
QTC_P=${PN}-opensource-src-${QTC_PV}
[[ ${QTC_PV} == ${PV} ]] && QTC_REL=official || QTC_REL=development
SRC_URI="
https://download.qt.io/${QTC_REL}_releases/qtcreator/$(ver_cut 1-2)/${PV/_/-}/${QTC_P}.tar.xz
"
S=${WORKDIR}/${QTC_P}
KEYWORDS="amd64"
fi
DESCRIPTION="Lightweight IDE for C++/QML development centering around Qt"
HOMEPAGE="https://www.qt.io/product/development-tools"
LICENSE="GPL-3"
SLOT="0"
IUSE="
+clang designer doc +help keyring plugin-dev qmldesigner
serialterminal +svg test +tracing webengine
"
REQUIRED_USE="clang? ( ${LLVM_REQUIRED_USE} )"
RESTRICT="!test? ( test )"
QT_PV=6.7.3:6
# := is used where Qt's private APIs are used for safety
COMMON_DEPEND="
app-arch/libarchive:=
dev-cpp/yaml-cpp:=
>=dev-qt/qtbase-${QT_PV}=[concurrent,dbus,gui,network,ssl,widgets,xml]
>=dev-qt/qtdeclarative-${QT_PV}=
clang? (
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
')
)
designer? ( >=dev-qt/qttools-${QT_PV}[designer] )
help? (
>=dev-qt/qttools-${QT_PV}[assistant]
webengine? ( >=dev-qt/qtwebengine-${QT_PV} )
)
keyring? (
app-crypt/libsecret
dev-libs/glib:2
)
qmldesigner? (
>=dev-qt/qtquick3d-${QT_PV}=
>=dev-qt/qtsvg-${QT_PV}
>=dev-qt/qtwebsockets-${QT_PV}
webengine? ( >=dev-qt/qtwebengine-${QT_PV} )
)
serialterminal? ( >=dev-qt/qtserialport-${QT_PV} )
svg? ( >=dev-qt/qtsvg-${QT_PV} )
tracing? (
app-arch/zstd:=
dev-libs/elfutils
>=dev-qt/qtcharts-${QT_PV}
>=dev-qt/qtshadertools-${QT_PV}
)
"
# qtimageformats for .webp in examples, semi-optfeature but useful in general
RDEPEND="
${COMMON_DEPEND}
help? ( >=dev-qt/qtimageformats-${QT_PV} )
qmldesigner? ( >=dev-qt/qtquicktimeline-${QT_PV} )
"
DEPEND="${COMMON_DEPEND}"
BDEPEND="
${PYTHON_DEPS}
>=dev-qt/qttools-${QT_PV}[linguist]
doc? ( >=dev-qt/qttools-${QT_PV}[qdoc,qtattributionsscanner] )
"
PATCHES=(
"${FILESDIR}"/${PN}-16.0.0-musl-no-execinfo.patch
"${FILESDIR}"/${PN}-12.0.0-musl-no-malloc-trim.patch
)
src_prepare() {
cmake_src_prepare
# needed for finding docs at runtime in PF
sed -e "/_IDE_DOC_PATH/s/qtcreator/${PF}/" \
-i cmake/QtCreatorAPIInternal.cmake || die
# avoid building manual tests (aka not ran) for nothing (bug #950010)
sed -i '/add_subdirectory(manual)/d' tests/CMakeLists.txt || die
if use plugin-dev; then #928423
# cmake --install --component integrates poorly with the cmake
# eclass and the install targets are otherwise missing, so strip
# out EXCLUDE_FROM_ALL until figure out a better solution
find . \( -name CMakeLists.txt -o -name '*.cmake' \) -exec sed -i -zE \
's/COMPONENT[[:space:]]+Devel[[:space:]]+EXCLUDE_FROM_ALL//g' {} + || die
fi
}
src_configure() {
use clang && llvm_chost_setup
# -Werror=lto-type-mismatch issues, needs looking into
filter-lto
# temporary workaround for musl-1.2.4 (bug #903611), this ideally
# needs fixing in qtbase as *64 usage comes from its headers' macros
use elibc_musl && append-lfs-flags
local mycmakeargs=(
-DBUILD_DEVELOPER_DOCS=$(usex doc)
-DBUILD_DOCS_BY_DEFAULT=$(usex doc)
-DBUILD_WITH_PCH=no
-DWITH_DOCS=$(usex doc)
-DWITH_TESTS=$(usex test)
# sticking to bundled for now until it switches to KF6's
-DBUILD_LIBRARY_KSYNTAXHIGHLIGHTING=yes
# Much can be optional, but do not want to flood users (or maintainers)
# with too many flags. Not to mention that many plugins are merely
# wrappers around still optional tools (e.g. cvs) and any unwanted
# plugins can be disabled at runtime. So optional flags are limited
# to plugins with additional build-time dependencies.
-DBUILD_LIBRARY_TRACING=$(usex tracing) # qml+perfprofiler,ctfvisual
-DBUILD_EXECUTABLE_PERFPARSER=$(usex tracing)
-DBUILD_PLUGIN_APPSTATISTICSMONITOR=$(usex tracing)
-DBUILD_PLUGIN_CLANGCODEMODEL=$(usex clang)
-DBUILD_PLUGIN_CLANGFORMAT=$(usex clang)
-DBUILD_PLUGIN_CLANGTOOLS=$(usex clang)
-DCLANGTOOLING_LINK_CLANG_DYLIB=yes
-DBUILD_PLUGIN_DESIGNER=$(usex designer)
-DBUILD_PLUGIN_HELP=$(usex help)
-DBUILD_HELPVIEWERBACKEND_QTWEBENGINE=$(usex webengine)
# TODO?: unbundle litehtml, but support for latest releases
# tend to lag behind and bundled may work out better for now
-DBUILD_LIBRARY_QLITEHTML=$(usex help $(usex !webengine))
# help shouldn't use with the above, but qmldesigner is automagic
$(use help || use qmldesigner &&
cmake_use_find_package webengine Qt6WebEngineWidgets)
-DBUILD_PLUGIN_SERIALTERMINAL=$(usex serialterminal)
-DENABLE_SVG_SUPPORT=$(usex svg)
-DWITH_QMLDESIGNER=$(usex qmldesigner)
# cmdbridge-server is a hardly used maintenance burden (bug #967488)
-DBUILD_EXECUTABLE_CMDBRIDGE=no
# meant to be in sync with qtbase[journald], but think(?) not worth
# handling given qt-creator can use QT_FORCE_STDERR_LOGGING=1 nowadays
-Djournald=no
# not packaged, but allow using if found
#-DCMAKE_DISABLE_FIND_PACKAGE_LibDDemangle=yes
#-DCMAKE_DISABLE_FIND_PACKAGE_LibRustcDemangle=yes
# for bundled qtkeychain (no switch to unbundle right now)
# reminder: if ever unbundled/optional, qtbase[dbus] can be removed
-DLIBSECRET_SUPPORT=$(usex keyring)
)
cmake_src_configure
}
src_test() {
local -x QT_QPA_PLATFORM=offscreen
local CMAKE_SKIP_TESTS=(
# broke since 17.0.0 and hasn't really been looked into yet,
# does not seem to cause visible problems so skipping for now
tst_process
# skipping same tests+label as upstream's CI by default
# `grep ctest .github/workflows/build_cmake.yml`
tst_perfdata
)
cmake_src_test --label-exclude exclude_from_precheck
}
src_install() {
cmake_src_install
if use doc; then
dodoc -r "${BUILD_DIR}"/doc/html
dodoc "${BUILD_DIR}"/share/doc/${PF}/qtcreator{,-dev}.qch
docompress -x /usr/share/doc/${PF}/qtcreator{,-dev}.qch
fi
local DISABLE_AUTOFORMATTING=yes
local DOC_CONTENTS="\
Some plugins (if used) may need optional extra dependencies/USE.
This list provides associations with Gentoo's packages (if exists)
ordered as in Qt Creator's Help -> About Plugins (not exhaustive).
dev-qt/qt-docs:6 with USE=\"examples qch\" is notably recommended, or
else the example tab will be empty alongside missing documentation.
Build Systems:
- CMakeProjectManager (dev-build/cmake)
- MesonProjectManager (dev-build/meson)
- QbsProjectManager (dev-util/qbs)
C++:
- Beautifier (dev-util/astyle and/or dev-util/uncrustify)
- ClangCodeModel (USE=clang, dev-util/clazy to understand Qt semantics)
- ClangFormat (USE=clang)
Code Analyzer:
- ClangTools (USE=clang)
- Cppcheck (dev-util/cppcheck)
- CtfVisualizer (USE=tracing)
- PerfProfiler (USE=tracing)
- Valgrind (dev-debug/valgrind)
Core:
- Help (USE=help + dev-qt/qt-docs:6 with USE=\"examples qch\")
Device Support:
- Android (virtual/jdk, will also want the unpackaged Qt for Android)
Other Languages:
- Nim (dev-lang/nim)
- Python (dev-lang/python)
Qt Creator:
- Designer (USE=designer)
Qt Quick:
- Insight (USE=qmldesigner)
- QmlDesigner (USE=qmldesigner)
- QmlProfiler (USE=tracing)
Utilities:
- AppStatisticsMonitor (USE=tracing)
- Autotest (dev-cpp/catch, dev-cpp/gtest, or dev-libs/boost if used)
- Conan (dev-util/conan)
- Docker (app-containers/docker)
- Haskell (dev-lang/ghc)
- ScreenRecorder (media-video/ffmpeg)
- SerialTerminal (USE=serialterminal)
- SilverSearcher (sys-apps/the_silver_searcher)
- StudioWelcome (USE=qmldesigner)
Version Control:
- CVS (dev-vcs/cvs)
- Fossil (dev-vcs/fossil)
- Git (dev-vcs/git)
- Mercurial (dev-vcs/mercurial)
- Subversion (dev-vcs/subversion)"
readme.gentoo_create_doc
}
pkg_postinst() {
xdg_pkg_postinst
readme.gentoo_print_elog
}

View File

@ -0,0 +1,281 @@
# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( {16..22} )
LLVM_OPTIONAL=1
PYTHON_COMPAT=( python3_{11..14} )
inherit cmake flag-o-matic llvm-r2 python-any-r1 readme.gentoo-r1 xdg
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI=(
"https://code.qt.io/qt-creator/qt-creator.git"
"https://github.com/qt-creator/qt-creator.git"
)
EGIT_SUBMODULES=(
perfparser
src/libs/qlitehtml
src/libs/qlitehtml/src/3rdparty/litehtml
)
else
QTC_PV=${PV/_/-}
QTC_P=${PN}-opensource-src-${QTC_PV}
[[ ${QTC_PV} == ${PV} ]] && QTC_REL=official || QTC_REL=development
SRC_URI="
https://download.qt.io/${QTC_REL}_releases/qtcreator/$(ver_cut 1-2)/${PV/_/-}/${QTC_P}.tar.xz
"
S=${WORKDIR}/${QTC_P}
KEYWORDS="~amd64"
fi
DESCRIPTION="Lightweight IDE for C++/QML development centering around Qt"
HOMEPAGE="https://www.qt.io/product/development-tools"
LICENSE="GPL-3"
SLOT="0"
IUSE="
+clang designer doc +help keyring plugin-dev qmldesigner
serialterminal +svg test +tracing webengine
"
REQUIRED_USE="clang? ( ${LLVM_REQUIRED_USE} )"
RESTRICT="!test? ( test )"
QT_PV=6.7.3:6
# := is used where Qt's private APIs are used for safety
COMMON_DEPEND="
app-arch/libarchive:=
dev-cpp/yaml-cpp:=
>=dev-qt/qtbase-${QT_PV}=[concurrent,dbus,gui,network,ssl,widgets,xml]
>=dev-qt/qtdeclarative-${QT_PV}=
clang? (
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
')
)
designer? ( >=dev-qt/qttools-${QT_PV}[designer] )
help? (
>=dev-qt/qttools-${QT_PV}[assistant]
webengine? ( >=dev-qt/qtwebengine-${QT_PV} )
)
keyring? (
app-crypt/libsecret
dev-libs/glib:2
)
qmldesigner? (
>=dev-qt/qtquick3d-${QT_PV}=
>=dev-qt/qtsvg-${QT_PV}
>=dev-qt/qtwebsockets-${QT_PV}
webengine? ( >=dev-qt/qtwebengine-${QT_PV} )
)
serialterminal? ( >=dev-qt/qtserialport-${QT_PV} )
svg? ( >=dev-qt/qtsvg-${QT_PV} )
tracing? (
app-arch/zstd:=
dev-libs/elfutils
>=dev-qt/qtcharts-${QT_PV}
>=dev-qt/qtshadertools-${QT_PV}
)
"
# qtimageformats for .webp in examples, semi-optfeature but useful in general
RDEPEND="
${COMMON_DEPEND}
help? ( >=dev-qt/qtimageformats-${QT_PV} )
qmldesigner? ( >=dev-qt/qtquicktimeline-${QT_PV} )
"
DEPEND="${COMMON_DEPEND}"
BDEPEND="
${PYTHON_DEPS}
>=dev-qt/qttools-${QT_PV}[linguist]
doc? ( >=dev-qt/qttools-${QT_PV}[qdoc,qtattributionsscanner] )
"
PATCHES=(
"${FILESDIR}"/${PN}-16.0.0-musl-no-execinfo.patch
"${FILESDIR}"/${PN}-12.0.0-musl-no-malloc-trim.patch
)
src_prepare() {
cmake_src_prepare
# needed for finding docs at runtime in PF
sed -e "/_IDE_DOC_PATH/s/qtcreator/${PF}/" \
-i cmake/QtCreatorAPIInternal.cmake || die
# avoid building manual tests (aka not ran) for nothing (bug #950010)
sed -i '/add_subdirectory(manual)/d' tests/CMakeLists.txt || die
if use plugin-dev; then #928423
# cmake --install --component integrates poorly with the cmake
# eclass and the install targets are otherwise missing, so strip
# out EXCLUDE_FROM_ALL until figure out a better solution
find . \( -name CMakeLists.txt -o -name '*.cmake' \) -exec sed -i -zE \
's/COMPONENT[[:space:]]+Devel[[:space:]]+EXCLUDE_FROM_ALL//g' {} + || die
fi
}
src_configure() {
use clang && llvm_chost_setup
# -Werror=lto-type-mismatch issues, needs looking into
filter-lto
# temporary workaround for musl-1.2.4 (bug #903611), this ideally
# needs fixing in qtbase as *64 usage comes from its headers' macros
use elibc_musl && append-lfs-flags
local mycmakeargs=(
-DBUILD_DEVELOPER_DOCS=$(usex doc)
-DBUILD_DOCS_BY_DEFAULT=$(usex doc)
-DBUILD_WITH_PCH=no
-DWITH_DOCS=$(usex doc)
-DWITH_TESTS=$(usex test)
# sticking to bundled for now until it switches to KF6's
-DBUILD_LIBRARY_KSYNTAXHIGHLIGHTING=yes
# Much can be optional, but do not want to flood users (or maintainers)
# with too many flags. Not to mention that many plugins are merely
# wrappers around still optional tools (e.g. cvs) and any unwanted
# plugins can be disabled at runtime. So optional flags are limited
# to plugins with additional build-time dependencies.
-DBUILD_LIBRARY_TRACING=$(usex tracing) # qml+perfprofiler,ctfvisual
-DBUILD_EXECUTABLE_PERFPARSER=$(usex tracing)
-DBUILD_PLUGIN_APPSTATISTICSMONITOR=$(usex tracing)
-DBUILD_PLUGIN_CLANGCODEMODEL=$(usex clang)
-DBUILD_PLUGIN_CLANGFORMAT=$(usex clang)
-DBUILD_PLUGIN_CLANGTOOLS=$(usex clang)
-DCLANGTOOLING_LINK_CLANG_DYLIB=yes
-DBUILD_PLUGIN_DESIGNER=$(usex designer)
-DBUILD_PLUGIN_HELP=$(usex help)
-DBUILD_HELPVIEWERBACKEND_QTWEBENGINE=$(usex webengine)
# TODO?: unbundle litehtml, but support for latest releases
# tend to lag behind and bundled may work out better for now
-DBUILD_LIBRARY_QLITEHTML=$(usex help $(usex !webengine))
# help shouldn't use with the above, but qmldesigner is automagic
$(use help || use qmldesigner &&
cmake_use_find_package webengine Qt6WebEngineWidgets)
-DBUILD_PLUGIN_SERIALTERMINAL=$(usex serialterminal)
-DENABLE_SVG_SUPPORT=$(usex svg)
-DWITH_QMLDESIGNER=$(usex qmldesigner)
# cmdbridge-server is a hardly used maintenance burden (bug #967488)
-DBUILD_EXECUTABLE_CMDBRIDGE=no
# meant to be in sync with qtbase[journald], but think(?) not worth
# handling given qt-creator can use QT_FORCE_STDERR_LOGGING=1 nowadays
-Djournald=no
# not packaged, but allow using if found
#-DCMAKE_DISABLE_FIND_PACKAGE_LibDDemangle=yes
#-DCMAKE_DISABLE_FIND_PACKAGE_LibRustcDemangle=yes
# for bundled qtkeychain (no switch to unbundle right now)
# reminder: if ever unbundled/optional, qtbase[dbus] can be removed
-DLIBSECRET_SUPPORT=$(usex keyring)
)
cmake_src_configure
}
src_test() {
local -x QT_QPA_PLATFORM=offscreen
local CMAKE_SKIP_TESTS=(
# broke since 17.0.0 and hasn't really been looked into yet,
# does not seem to cause visible problems so skipping for now
tst_process
# skipping same tests+label as upstream's CI by default
# `grep ctest .github/workflows/build_cmake.yml`
tst_perfdata
)
cmake_src_test --label-exclude exclude_from_precheck
}
src_install() {
cmake_src_install
if use doc; then
dodoc -r "${BUILD_DIR}"/doc/html
dodoc "${BUILD_DIR}"/share/doc/${PF}/qtcreator{,-dev}.qch
docompress -x /usr/share/doc/${PF}/qtcreator{,-dev}.qch
fi
local DISABLE_AUTOFORMATTING=yes
local DOC_CONTENTS="\
Some plugins (if used) may need optional extra dependencies/USE.
This list provides associations with Gentoo's packages (if exists)
ordered as in Qt Creator's Help -> About Plugins (not exhaustive).
dev-qt/qt-docs:6 with USE=\"examples qch\" is notably recommended, or
else the example tab will be empty alongside missing documentation.
Build Systems:
- CMakeProjectManager (dev-build/cmake)
- MesonProjectManager (dev-build/meson)
- QbsProjectManager (dev-util/qbs)
C++:
- Beautifier (dev-util/astyle and/or dev-util/uncrustify)
- ClangCodeModel (USE=clang, dev-util/clazy to understand Qt semantics)
- ClangFormat (USE=clang)
Code Analyzer:
- ClangTools (USE=clang)
- Cppcheck (dev-util/cppcheck)
- CtfVisualizer (USE=tracing)
- PerfProfiler (USE=tracing)
- Valgrind (dev-debug/valgrind)
Core:
- Help (USE=help + dev-qt/qt-docs:6 with USE=\"examples qch\")
Device Support:
- Android (virtual/jdk, will also want the unpackaged Qt for Android)
Other Languages:
- Nim (dev-lang/nim)
- Python (dev-lang/python)
Qt Creator:
- Designer (USE=designer)
Qt Quick:
- Insight (USE=qmldesigner)
- QmlDesigner (USE=qmldesigner)
- QmlProfiler (USE=tracing)
Utilities:
- AppStatisticsMonitor (USE=tracing)
- Autotest (dev-cpp/catch, dev-cpp/gtest, or dev-libs/boost if used)
- Conan (dev-util/conan)
- Docker (app-containers/docker)
- Haskell (dev-lang/ghc)
- ScreenRecorder (media-video/ffmpeg)
- SerialTerminal (USE=serialterminal)
- SilverSearcher (sys-apps/the_silver_searcher)
- StudioWelcome (USE=qmldesigner)
Version Control:
- CVS (dev-vcs/cvs)
- Fossil (dev-vcs/fossil)
- Git (dev-vcs/git)
- Mercurial (dev-vcs/mercurial)
- Subversion (dev-vcs/subversion)"
readme.gentoo_create_doc
}
pkg_postinst() {
xdg_pkg_postinst
readme.gentoo_print_elog
}

View File

@ -0,0 +1,281 @@
# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( {16..22} )
LLVM_OPTIONAL=1
PYTHON_COMPAT=( python3_{11..14} )
inherit cmake flag-o-matic llvm-r2 python-any-r1 readme.gentoo-r1 xdg
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI=(
"https://code.qt.io/qt-creator/qt-creator.git"
"https://github.com/qt-creator/qt-creator.git"
)
EGIT_SUBMODULES=(
perfparser
src/libs/qlitehtml
src/libs/qlitehtml/src/3rdparty/litehtml
)
else
QTC_PV=${PV/_/-}
QTC_P=${PN}-opensource-src-${QTC_PV}
[[ ${QTC_PV} == ${PV} ]] && QTC_REL=official || QTC_REL=development
SRC_URI="
https://download.qt.io/${QTC_REL}_releases/qtcreator/$(ver_cut 1-2)/${PV/_/-}/${QTC_P}.tar.xz
"
S=${WORKDIR}/${QTC_P}
KEYWORDS="amd64"
fi
DESCRIPTION="Lightweight IDE for C++/QML development centering around Qt"
HOMEPAGE="https://www.qt.io/product/development-tools"
LICENSE="GPL-3"
SLOT="0"
IUSE="
+clang designer doc +help keyring plugin-dev qmldesigner
serialterminal +svg test +tracing webengine
"
REQUIRED_USE="clang? ( ${LLVM_REQUIRED_USE} )"
RESTRICT="!test? ( test )"
QT_PV=6.7.3:6
# := is used where Qt's private APIs are used for safety
COMMON_DEPEND="
app-arch/libarchive:=
dev-cpp/yaml-cpp:=
>=dev-qt/qtbase-${QT_PV}=[concurrent,dbus,gui,network,ssl,widgets,xml]
>=dev-qt/qtdeclarative-${QT_PV}=
clang? (
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
')
)
designer? ( >=dev-qt/qttools-${QT_PV}[designer] )
help? (
>=dev-qt/qttools-${QT_PV}[assistant]
webengine? ( >=dev-qt/qtwebengine-${QT_PV} )
)
keyring? (
app-crypt/libsecret
dev-libs/glib:2
)
qmldesigner? (
>=dev-qt/qtquick3d-${QT_PV}=
>=dev-qt/qtsvg-${QT_PV}
>=dev-qt/qtwebsockets-${QT_PV}
webengine? ( >=dev-qt/qtwebengine-${QT_PV} )
)
serialterminal? ( >=dev-qt/qtserialport-${QT_PV} )
svg? ( >=dev-qt/qtsvg-${QT_PV} )
tracing? (
app-arch/zstd:=
dev-libs/elfutils
>=dev-qt/qtcharts-${QT_PV}
>=dev-qt/qtshadertools-${QT_PV}
)
"
# qtimageformats for .webp in examples, semi-optfeature but useful in general
RDEPEND="
${COMMON_DEPEND}
help? ( >=dev-qt/qtimageformats-${QT_PV} )
qmldesigner? ( >=dev-qt/qtquicktimeline-${QT_PV} )
"
DEPEND="${COMMON_DEPEND}"
BDEPEND="
${PYTHON_DEPS}
>=dev-qt/qttools-${QT_PV}[linguist]
doc? ( >=dev-qt/qttools-${QT_PV}[qdoc,qtattributionsscanner] )
"
PATCHES=(
"${FILESDIR}"/${PN}-16.0.0-musl-no-execinfo.patch
"${FILESDIR}"/${PN}-12.0.0-musl-no-malloc-trim.patch
)
src_prepare() {
cmake_src_prepare
# needed for finding docs at runtime in PF
sed -e "/_IDE_DOC_PATH/s/qtcreator/${PF}/" \
-i cmake/QtCreatorAPIInternal.cmake || die
# avoid building manual tests (aka not ran) for nothing (bug #950010)
cmake_comment_add_subdirectory -f tests/CMakeLists.txt manual
if use plugin-dev; then #928423
# cmake --install --component integrates poorly with the cmake
# eclass and the install targets are otherwise missing, so strip
# out EXCLUDE_FROM_ALL until figure out a better solution
find . \( -name CMakeLists.txt -o -name '*.cmake' \) -exec sed -i -zE \
's/COMPONENT[[:space:]]+Devel[[:space:]]+EXCLUDE_FROM_ALL//g' {} + || die
fi
}
src_configure() {
use clang && llvm_chost_setup
# -Werror=lto-type-mismatch issues, needs looking into
filter-lto
# temporary workaround for musl-1.2.4 (bug #903611), this ideally
# needs fixing in qtbase as *64 usage comes from its headers' macros
use elibc_musl && append-lfs-flags
local mycmakeargs=(
-DBUILD_DEVELOPER_DOCS=$(usex doc)
-DBUILD_DOCS_BY_DEFAULT=$(usex doc)
-DBUILD_WITH_PCH=no
-DWITH_DOCS=$(usex doc)
-DWITH_TESTS=$(usex test)
# sticking to bundled for now until it switches to KF6's
-DBUILD_LIBRARY_KSYNTAXHIGHLIGHTING=yes
# Much can be optional, but do not want to flood users (or maintainers)
# with too many flags. Not to mention that many plugins are merely
# wrappers around still optional tools (e.g. cvs) and any unwanted
# plugins can be disabled at runtime. So optional flags are limited
# to plugins with additional build-time dependencies.
-DBUILD_LIBRARY_TRACING=$(usex tracing) # qml+perfprofiler,ctfvisual
-DBUILD_EXECUTABLE_PERFPARSER=$(usex tracing)
-DBUILD_PLUGIN_APPSTATISTICSMONITOR=$(usex tracing)
-DBUILD_PLUGIN_CLANGCODEMODEL=$(usex clang)
-DBUILD_PLUGIN_CLANGFORMAT=$(usex clang)
-DBUILD_PLUGIN_CLANGTOOLS=$(usex clang)
-DCLANGTOOLING_LINK_CLANG_DYLIB=yes
-DBUILD_PLUGIN_DESIGNER=$(usex designer)
-DBUILD_PLUGIN_HELP=$(usex help)
-DBUILD_HELPVIEWERBACKEND_QTWEBENGINE=$(usex webengine)
# TODO?: unbundle litehtml, but support for latest releases
# tend to lag behind and bundled may work out better for now
-DBUILD_LIBRARY_QLITEHTML=$(usex help $(usex !webengine))
# help shouldn't use with the above, but qmldesigner is automagic
$(use help || use qmldesigner &&
cmake_use_find_package webengine Qt6WebEngineWidgets)
-DBUILD_PLUGIN_SERIALTERMINAL=$(usex serialterminal)
-DENABLE_SVG_SUPPORT=$(usex svg)
-DWITH_QMLDESIGNER=$(usex qmldesigner)
# cmdbridge-server is a hardly used maintenance burden (bug #967488)
-DBUILD_EXECUTABLE_CMDBRIDGE=no
# meant to be in sync with qtbase[journald], but think(?) not worth
# handling given qt-creator can use QT_FORCE_STDERR_LOGGING=1 nowadays
-Djournald=no
# not packaged, but allow using if found
#-DCMAKE_DISABLE_FIND_PACKAGE_LibDDemangle=yes
#-DCMAKE_DISABLE_FIND_PACKAGE_LibRustcDemangle=yes
# for bundled qtkeychain (no switch to unbundle right now)
# reminder: if ever unbundled/optional, qtbase[dbus] can be removed
-DLIBSECRET_SUPPORT=$(usex keyring)
)
cmake_src_configure
}
src_test() {
local -x QT_QPA_PLATFORM=offscreen
local CMAKE_SKIP_TESTS=(
# broke since 17.0.0 and hasn't really been looked into yet,
# does not seem to cause visible problems so skipping for now
tst_process
# skipping same tests+label as upstream's CI by default
# `grep ctest .github/workflows/build_cmake.yml`
tst_perfdata
)
cmake_src_test --label-exclude exclude_from_precheck
}
src_install() {
cmake_src_install
if use doc; then
dodoc -r "${BUILD_DIR}"/doc/html
dodoc "${BUILD_DIR}"/share/doc/${PF}/qtcreator{,-dev}.qch
docompress -x /usr/share/doc/${PF}/qtcreator{,-dev}.qch
fi
local DISABLE_AUTOFORMATTING=yes
local DOC_CONTENTS="\
Some plugins (if used) may need optional extra dependencies/USE.
This list provides associations with Gentoo's packages (if exists)
ordered as in Qt Creator's Help -> About Plugins (not exhaustive).
dev-qt/qt-docs:6 with USE=\"examples qch\" is notably recommended, or
else the example tab will be empty alongside missing documentation.
Build Systems:
- CMakeProjectManager (dev-build/cmake)
- MesonProjectManager (dev-build/meson)
- QbsProjectManager (dev-util/qbs)
C++:
- Beautifier (dev-util/astyle and/or dev-util/uncrustify)
- ClangCodeModel (USE=clang, dev-util/clazy to understand Qt semantics)
- ClangFormat (USE=clang)
Code Analyzer:
- ClangTools (USE=clang)
- Cppcheck (dev-util/cppcheck)
- CtfVisualizer (USE=tracing)
- PerfProfiler (USE=tracing)
- Valgrind (dev-debug/valgrind)
Core:
- Help (USE=help + dev-qt/qt-docs:6 with USE=\"examples qch\")
Device Support:
- Android (virtual/jdk, will also want the unpackaged Qt for Android)
Other Languages:
- Nim (dev-lang/nim)
- Python (dev-lang/python)
Qt Creator:
- Designer (USE=designer)
Qt Quick:
- Insight (USE=qmldesigner)
- QmlDesigner (USE=qmldesigner)
- QmlProfiler (USE=tracing)
Utilities:
- AppStatisticsMonitor (USE=tracing)
- Autotest (dev-cpp/catch, dev-cpp/gtest, or dev-libs/boost if used)
- Conan (dev-util/conan)
- Docker (app-containers/docker)
- Haskell (dev-lang/ghc)
- ScreenRecorder (media-video/ffmpeg)
- SerialTerminal (USE=serialterminal)
- SilverSearcher (sys-apps/the_silver_searcher)
- StudioWelcome (USE=qmldesigner)
Version Control:
- CVS (dev-vcs/cvs)
- Fossil (dev-vcs/fossil)
- Git (dev-vcs/git)
- Mercurial (dev-vcs/mercurial)
- Subversion (dev-vcs/subversion)"
readme.gentoo_create_doc
}
pkg_postinst() {
xdg_pkg_postinst
readme.gentoo_print_elog
}

View File

@ -0,0 +1,278 @@
# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( {16..22} )
LLVM_OPTIONAL=1
PYTHON_COMPAT=( python3_{11..14} )
inherit cmake flag-o-matic llvm-r2 python-any-r1 readme.gentoo-r1 xdg
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI=(
"https://code.qt.io/qt-creator/qt-creator.git"
"https://github.com/qt-creator/qt-creator.git"
)
EGIT_SUBMODULES=(
perfparser
src/libs/qlitehtml
src/libs/qlitehtml/src/3rdparty/litehtml
)
else
QTC_PV=${PV/_/-}
QTC_P=${PN}-opensource-src-${QTC_PV}
[[ ${QTC_PV} == ${PV} ]] && QTC_REL=official || QTC_REL=development
SRC_URI="
https://download.qt.io/${QTC_REL}_releases/qtcreator/$(ver_cut 1-2)/${PV/_/-}/${QTC_P}.tar.xz
"
S=${WORKDIR}/${QTC_P}
KEYWORDS="~amd64"
fi
DESCRIPTION="Lightweight IDE for C++/QML development centering around Qt"
HOMEPAGE="https://www.qt.io/product/development-tools"
LICENSE="GPL-3"
SLOT="0"
IUSE="
+clang designer doc +help keyring plugin-dev qmldesigner
serialterminal +svg test +tracing webengine
"
REQUIRED_USE="clang? ( ${LLVM_REQUIRED_USE} )"
RESTRICT="!test? ( test )"
QT_PV=6.7.3:6
# := is used where Qt's private APIs are used for safety
COMMON_DEPEND="
app-arch/libarchive:=
dev-cpp/yaml-cpp:=
>=dev-qt/qtbase-${QT_PV}=[concurrent,dbus,gui,network,ssl,widgets,xml]
>=dev-qt/qtdeclarative-${QT_PV}=
clang? (
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
')
)
designer? ( >=dev-qt/qttools-${QT_PV}[designer] )
help? (
>=dev-qt/qttools-${QT_PV}[assistant]
webengine? ( >=dev-qt/qtwebengine-${QT_PV} )
)
keyring? (
app-crypt/libsecret
dev-libs/glib:2
)
qmldesigner? (
>=dev-qt/qtquick3d-${QT_PV}=
>=dev-qt/qtsvg-${QT_PV}
>=dev-qt/qtwebsockets-${QT_PV}
webengine? ( >=dev-qt/qtwebengine-${QT_PV} )
)
serialterminal? ( >=dev-qt/qtserialport-${QT_PV} )
svg? ( >=dev-qt/qtsvg-${QT_PV} )
tracing? (
app-arch/zstd:=
dev-libs/elfutils
>=dev-qt/qtcharts-${QT_PV}
>=dev-qt/qtshadertools-${QT_PV}
)
"
# qtimageformats for .webp in examples, semi-optfeature but useful in general
RDEPEND="
${COMMON_DEPEND}
help? ( >=dev-qt/qtimageformats-${QT_PV} )
qmldesigner? ( >=dev-qt/qtquicktimeline-${QT_PV} )
"
DEPEND="${COMMON_DEPEND}"
BDEPEND="
${PYTHON_DEPS}
>=dev-qt/qttools-${QT_PV}[linguist]
doc? ( >=dev-qt/qttools-${QT_PV}[qdoc,qtattributionsscanner] )
"
PATCHES=(
"${FILESDIR}"/${PN}-16.0.0-musl-no-execinfo.patch
"${FILESDIR}"/${PN}-12.0.0-musl-no-malloc-trim.patch
)
src_prepare() {
cmake_src_prepare
# needed for finding docs at runtime in PF
sed -e "/_IDE_DOC_PATH/s/qtcreator/${PF}/" \
-i cmake/QtCreatorAPIInternal.cmake || die
# avoid building manual tests (aka not ran) for nothing (bug #950010)
cmake_comment_add_subdirectory -f tests/CMakeLists.txt manual
if use plugin-dev; then #928423
# cmake --install --component integrates poorly with the cmake
# eclass and the install targets are otherwise missing, so strip
# out EXCLUDE_FROM_ALL until figure out a better solution
find . \( -name CMakeLists.txt -o -name '*.cmake' \) -exec sed -i -zE \
's/COMPONENT[[:space:]]+Devel[[:space:]]+EXCLUDE_FROM_ALL//g' {} + || die
fi
}
src_configure() {
use clang && llvm_chost_setup
# -Werror=lto-type-mismatch issues, needs looking into
filter-lto
# temporary workaround for musl-1.2.4 (bug #903611), this ideally
# needs fixing in qtbase as *64 usage comes from its headers' macros
use elibc_musl && append-lfs-flags
local mycmakeargs=(
-DBUILD_DEVELOPER_DOCS=$(usex doc)
-DBUILD_DOCS_BY_DEFAULT=$(usex doc)
-DBUILD_WITH_PCH=no
-DWITH_DOCS=$(usex doc)
-DWITH_TESTS=$(usex test)
# sticking to bundled for now until it switches to KF6's
-DBUILD_LIBRARY_KSYNTAXHIGHLIGHTING=yes
# Much can be optional, but do not want to flood users (or maintainers)
# with too many flags. Not to mention that many plugins are merely
# wrappers around still optional tools (e.g. cvs) and any unwanted
# plugins can be disabled at runtime. So optional flags are limited
# to plugins with additional build-time dependencies.
-DBUILD_LIBRARY_TRACING=$(usex tracing) # qml+perfprofiler,ctfvisual
-DBUILD_EXECUTABLE_PERFPARSER=$(usex tracing)
-DBUILD_PLUGIN_APPSTATISTICSMONITOR=$(usex tracing)
-DBUILD_PLUGIN_CLANGCODEMODEL=$(usex clang)
-DBUILD_PLUGIN_CLANGFORMAT=$(usex clang)
-DBUILD_PLUGIN_CLANGTOOLS=$(usex clang)
-DCLANGTOOLING_LINK_CLANG_DYLIB=yes
-DBUILD_PLUGIN_DESIGNER=$(usex designer)
-DBUILD_PLUGIN_HELP=$(usex help)
-DBUILD_HELPVIEWERBACKEND_QTWEBENGINE=$(usex webengine)
# TODO?: unbundle litehtml, but support for latest releases
# tend to lag behind and bundled may work out better for now
-DBUILD_LIBRARY_QLITEHTML=$(usex help $(usex !webengine))
# help shouldn't use with the above, but qmldesigner is automagic
$(use help || use qmldesigner &&
cmake_use_find_package webengine Qt6WebEngineWidgets)
-DBUILD_PLUGIN_SERIALTERMINAL=$(usex serialterminal)
-DENABLE_SVG_SUPPORT=$(usex svg)
-DWITH_QMLDESIGNER=$(usex qmldesigner)
# cmdbridge-server is a hardly used maintenance burden (bug #967488)
-DBUILD_EXECUTABLE_CMDBRIDGE=no
# meant to be in sync with qtbase[journald], but think(?) not worth
# handling given qt-creator can use QT_FORCE_STDERR_LOGGING=1 nowadays
-Djournald=no
# not packaged, but allow using if found
#-DCMAKE_DISABLE_FIND_PACKAGE_LibDDemangle=yes
#-DCMAKE_DISABLE_FIND_PACKAGE_LibRustcDemangle=yes
# for bundled qtkeychain (no switch to unbundle right now)
# reminder: if ever unbundled/optional, qtbase[dbus] can be removed
-DLIBSECRET_SUPPORT=$(usex keyring)
)
cmake_src_configure
}
src_test() {
local -x QT_QPA_PLATFORM=offscreen
local CMAKE_SKIP_TESTS=(
# skipping same tests+label as upstream's CI by default
# `grep ctest .github/workflows/build_cmake.yml`
tst_perfdata
)
cmake_src_test --label-exclude exclude_from_precheck
}
src_install() {
cmake_src_install
if use doc; then
dodoc -r "${BUILD_DIR}"/doc/html
dodoc "${BUILD_DIR}"/share/doc/${PF}/qtcreator{,-dev}.qch
docompress -x /usr/share/doc/${PF}/qtcreator{,-dev}.qch
fi
local DISABLE_AUTOFORMATTING=yes
local DOC_CONTENTS="\
Some plugins (if used) may need optional extra dependencies/USE.
This list provides associations with Gentoo's packages (if exists)
ordered as in Qt Creator's Help -> About Plugins (not exhaustive).
dev-qt/qt-docs:6 with USE=\"examples qch\" is notably recommended, or
else the example tab will be empty alongside missing documentation.
Build Systems:
- CMakeProjectManager (dev-build/cmake)
- MesonProjectManager (dev-build/meson)
- QbsProjectManager (dev-util/qbs)
C++:
- Beautifier (dev-util/astyle and/or dev-util/uncrustify)
- ClangCodeModel (USE=clang, dev-util/clazy to understand Qt semantics)
- ClangFormat (USE=clang)
Code Analyzer:
- ClangTools (USE=clang)
- Cppcheck (dev-util/cppcheck)
- CtfVisualizer (USE=tracing)
- PerfProfiler (USE=tracing)
- Valgrind (dev-debug/valgrind)
Core:
- Help (USE=help + dev-qt/qt-docs:6 with USE=\"examples qch\")
Device Support:
- Android (virtual/jdk, will also want the unpackaged Qt for Android)
Other Languages:
- Nim (dev-lang/nim)
- Python (dev-lang/python)
Qt Creator:
- Designer (USE=designer)
Qt Quick:
- Insight (USE=qmldesigner)
- QmlDesigner (USE=qmldesigner)
- QmlProfiler (USE=tracing)
Utilities:
- AppStatisticsMonitor (USE=tracing)
- Autotest (dev-cpp/catch, dev-cpp/gtest, or dev-libs/boost if used)
- Conan (dev-util/conan)
- Docker (app-containers/docker)
- Haskell (dev-lang/ghc)
- ScreenRecorder (media-video/ffmpeg)
- SerialTerminal (USE=serialterminal)
- SilverSearcher (sys-apps/the_silver_searcher)
- StudioWelcome (USE=qmldesigner)
Version Control:
- CVS (dev-vcs/cvs)
- Fossil (dev-vcs/fossil)
- Git (dev-vcs/git)
- Mercurial (dev-vcs/mercurial)
- Subversion (dev-vcs/subversion)"
readme.gentoo_create_doc
}
pkg_postinst() {
xdg_pkg_postinst
readme.gentoo_print_elog
}