285.3. qt-creator-20.0.2
The Qt IDE for C++, QML and Python, with a clangd code model
| Version | 20.0.2, release 2 |
| Shelf | editors — Text editors, IDEs, notebooks and REPLs |
| Phase | 44_apps (Applications), 78 of 422 in build order |
| Licence | GPL-3.0-only WITH Qt-GPL-exception-1.0 |
| Homepage | https://www.qt.io/product/development-tools |
| Build time | 77.3 SBU |
| Installed size | 165.7 MiB in 2705 files |
| Recipe | ports/core/editors/qt-creator/kpkgbuild |
About
Qt Creator is the Qt project’s IDE for C++, QML and Python: an editor with a clangd code model, CMake and qmake project support, a debugger front end for gdb, the Clang-Tidy and Clazy runners, and a perf profiler. In KDOS its code model uses the clang port’s libraries at build time and its clangd at run time. The help viewer shows Qt documentation (.qch files) through the bundled litehtml renderer, so the port needs no QtWebEngine. No port installs any .qch file, as QDoc is not built in qt6-qttools, so Help mode and the Welcome page’s example list start empty.
Sources
qt-creator-20.0.2.tar.xz(38.3 MiB)
sha256f0505278792454d8fa1af029d05878b112773dc9d67503c8f9671cb67b07bfea
upstream: https://download.qt.io/official_releases/qtcreator/20.0/20.0.2/qt-creator-opensource-src-20.0.2.tar.xz
archive copy: sources-2/editors--qt-creator-20.0.2.tar.xz
Dependencies
Depends on: cmake, ninja, python3, llvm, clang, libarchive, yaml-cpp, elfutils, zstd, qt6-qtbase, qt6-qtdeclarative, qt6-qtsvg, qt6-qttools, qt6-qt5compat, qt6-qtserialport, qt6-qtshadertools, qt6-qtwayland, gdb, qt6-qtcharts, qt6-qthttpserver.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
no-execinfo.h.patch— no-execinfo.hno-malloc_trim.patch— no-malloc_trim
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install qt-creator'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/editors/qt-creator.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/editors/qt-creator
echo 'f0505278792454d8fa1af029d05878b112773dc9d67503c8f9671cb67b07bfea qt-creator-20.0.2.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/qt-creator
SRC=$SRC_ROOT/qt-creator-20.0.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf qt-creator-20.0.2.tar.xz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _series and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/no-execinfo.h.patch"
patch -p1 -i "$PORT_SRC/no-malloc_trim.patch"
cmake -S . -B build -G Ninja \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_WITH_PCH=OFF \
-DWITH_TESTS=OFF \
-DWITH_DOCS=OFF \
-DBUILD_QBS=OFF \
-DWITH_QMLDESIGNER=OFF \
-DBUILD_DESIGNSTUDIO=OFF \
-DQTC_USE_INTERNAL_TASKTREE=ON \
-DQTC_CLANG_BUILDMODE_MATCH=ON \
-DBUILD_EXECUTABLE_CMDBRIDGE=OFF \
-DBUILD_PLUGIN_CLANGFORMAT=OFF \
-DBUILD_PLUGIN_COPILOT=OFF \
-DBUILD_PLUGIN_COMPILEREXPLORER=OFF \
-DBUILD_PLUGIN_GITLAB=OFF \
-DBUILD_PLUGIN_AXIVION=OFF \
-DBUILD_PLUGIN_EXTENSIONMANAGER=OFF \
-DBUILD_PLUGIN_LEARNING=OFF \
-DBUILD_PLUGIN_UPDATEINFO=OFF \
-DBUILD_HELPVIEWERBACKEND_QTWEBENGINE=OFF \
-DHELPVIEWER_DEFAULT_BACKEND=litehtml \
-DCMAKE_REQUIRE_FIND_PACKAGE_Clang=ON \
-DCMAKE_REQUIRE_FIND_PACKAGE_LibArchive=ON \
-DCMAKE_REQUIRE_FIND_PACKAGE_yaml-cpp=ON \
-DCMAKE_REQUIRE_FIND_PACKAGE_elfutils=ON \
-DCMAKE_REQUIRE_FIND_PACKAGE_Zstd=ON \
-DCMAKE_DISABLE_FIND_PACKAGE_LibRustcDemangle=ON \
-DCMAKE_DISABLE_FIND_PACKAGE_LibDDemangle=ON
cmake --build build
DESTDIR=$PKG cmake --install build
test -x "$PKG/usr/bin/qtcreator"
ls "$PKG"/usr/lib/qtcreator/plugins/libClangCodeModel.so >/dev/null
cat > "$PKG/usr/share/applications/org.qt-project.qtcreator.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Qt Creator
GenericName=C++ and Qt IDE
Comment=Develop C++, QML and Python applications with Qt
TryExec=qtcreator
Exec=qtcreator %F
Icon=QtProject-qtcreator
Terminal=false
StartupWMClass=org.qt-project.qtcreator
Categories=Development;IDE;Qt;
Keywords=ide;c++;qt;qml;cmake;debugger;designer;qtcreator;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.qt-project.qtcreator.desktop"
test -e "$PKG"/usr/share/icons/hicolor/48x48/apps/QtProject-qtcreator.png
The switches, and why each is set:
-DBUILD_WITH_PCH=OFF— Compile without precompiled headers, which are on by default.-DWITH_TESTS=OFF,-DWITH_DOCS=OFF— No test plugins and no generated documentation; both are upstream’s defaults.-DBUILD_QBS=OFF— Do not build the Qbs build tool from the copy insrc/shared/qbs. It is upstream’s default; Qbs is a separate product.-DWITH_QMLDESIGNER=OFF— Leave out the QML Designer, the visual Qt Quick editor. Upstream turns it on by default whenever Qt is new enough, Qt Quick is present and the compiler is new enough.-DBUILD_DESIGNSTUDIO=OFF— No Qt Design Studio plugins, examples or settings. It is upstream’s default.-DQTC_USE_INTERNAL_TASKTREE=ON— Use Qt Creator’s own copy of the TaskTree library. Upstream chooses it whenever Qt has no TaskTree module, as the Qt ports here do not; naming it keeps the choice the same on every build.-DQTC_CLANG_BUILDMODE_MATCH=ON— Declare that the clang libraries match this build’s release mode.cmake/FindClang.cmaketests that only on Windows and elsewhere sets it on wheneverclangToolingis found; the one thing it gates is the ClangFormat plugin, which is off.-DBUILD_EXECUTABLE_CMDBRIDGE=OFF— Do not buildcmdbridge, the helper for fast container and remote device access. It is written in Go and built withgo buildonce for every remote platform and architecture.-DBUILD_PLUGIN_CLANGFORMAT=OFF— Leave out the ClangFormat plugin, which formats code with clang’slibclangFormatlinked into Qt Creator.-DBUILD_PLUGIN_COPILOT=OFF— This switch and-DBUILD_PLUGIN_COMPILEREXPLORER=OFF,-DBUILD_PLUGIN_GITLAB=OFF,-DBUILD_PLUGIN_AXIVION=OFF,-DBUILD_PLUGIN_EXTENSIONMANAGER=OFF,-DBUILD_PLUGIN_LEARNING=OFFand-DBUILD_PLUGIN_UPDATEINFO=OFFleave out the plugins that are front ends to online services: GitHub Copilot, Compiler Explorer, GitLab, the Axivion dashboard, the extension store, the Learning page and the update checker. Upstream builds every plugin whose own conditions are met unless itsBUILD_PLUGIN_<NAME>switch is off.-DBUILD_HELPVIEWERBACKEND_QTWEBENGINE=OFF— Do not build the QtWebEngine help viewer, which upstream builds by default; qt6-qtwebengine is not independs.-DHELPVIEWER_DEFAULT_BACKEND=litehtml— Show help pages with litehtml. It is upstream’s default.-DCMAKE_REQUIRE_FIND_PACKAGE_Clang=ON— This switch and theCMAKE_REQUIRE_FIND_PACKAGE_switches forLibArchive,yaml-cpp,elfutilsandZstdturn each of those optionalfind_packagecalls into a configure error when the package is missing. Without them a miss is quiet: libarchive and yaml-cpp fall back to the copies insrc/libs/3rdparty, the perf parser is left out with only a status line when elfutils is missing, and without zstd it reads no compressed perf data.-DCMAKE_DISABLE_FIND_PACKAGE_LibRustcDemangle=ON,-DCMAKE_DISABLE_FIND_PACKAGE_LibDDemangle=ON— The perf parser can demangle Rust and D symbols through these two libraries. Neither is a port, so neither is looked for.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/qt-creator, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf qt-creator-20.0.2-2.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/qt-creator, and runs the triggers its paths call for.
Contents
Installed programs: qtcreator, qtcreator.sh.
Installed directories: /usr/lib/qtcreator, /usr/libexec/qtcreator, /usr/share/licenses/qt-creator, /usr/share/qtcreator.
Notes
no-execinfo.h.patch and no-malloc_trim.patch are Alpine’s musl patches. musl has no execinfo.h, so the backtrace on a failed assertion is compiled out, and no malloc_trim, so the call that returns freed memory to the system a minute after a key or mouse press is removed.
Code Paster, a front end to paste services, stays built: the version-control plugin names it as a recommended plugin, and configure stops if its target is missing.
Upstream’s menu entry is replaced. The program sets its desktop file name, and so its Wayland app_id, to org.qt-project.qtcreator, which the entry gives as StartupWMClass. Other editors here claim the C and C++ source types too, so the entry claims no types and mimeapps.list chooses.