From 9a7e9b077ef14cb67d64387caf5058b5af609dab Mon Sep 17 00:00:00 2001 From: rewine Date: Tue, 25 Jul 2023 20:20:02 +0800 Subject: [PATCH 1/3] qtcreator-qt5: remove --- .../0001-Fix-clang-libcpp-regexp.patch | 15 --- .../0002-Dont-remove-clang-header-paths.patch | 12 --- pkgs/development/tools/qtcreator/default.nix | 96 ------------------- pkgs/top-level/all-packages.nix | 4 - 4 files changed, 127 deletions(-) delete mode 100644 pkgs/development/tools/qtcreator/0001-Fix-clang-libcpp-regexp.patch delete mode 100644 pkgs/development/tools/qtcreator/0002-Dont-remove-clang-header-paths.patch delete mode 100644 pkgs/development/tools/qtcreator/default.nix diff --git a/pkgs/development/tools/qtcreator/0001-Fix-clang-libcpp-regexp.patch b/pkgs/development/tools/qtcreator/0001-Fix-clang-libcpp-regexp.patch deleted file mode 100644 index f0e8c3d2c5e1..000000000000 --- a/pkgs/development/tools/qtcreator/0001-Fix-clang-libcpp-regexp.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/plugins/cpptools/headerpathfilter.cpp b/src/plugins/cpptools/headerpathfilter.cpp -index b656f8e1..a830d3c3 100644 ---- a/src/plugins/cpptools/headerpathfilter.cpp -+++ b/src/plugins/cpptools/headerpathfilter.cpp -@@ -124,8 +124,8 @@ HeaderPaths::iterator resourceIterator(HeaderPaths &headerPaths) - { - // include/c++, include/g++, libc++\include and libc++abi\include - static const QString cppIncludes = R"((.*/include/.*(g\+\+|c\+\+).*))" -- R"(|(.*libc\+\+/include))" -- R"(|(.*libc\+\+abi/include))" -+ R"(|(.*libc\+\+.*\/include))" -+ R"(|(.*libc\+\+abi.*\/include))"; - R"(|(/usr/local/include))"; - static const QRegularExpression includeRegExp("\\A(" + cppIncludes + ")\\z"); - diff --git a/pkgs/development/tools/qtcreator/0002-Dont-remove-clang-header-paths.patch b/pkgs/development/tools/qtcreator/0002-Dont-remove-clang-header-paths.patch deleted file mode 100644 index b0427e94c7c7..000000000000 --- a/pkgs/development/tools/qtcreator/0002-Dont-remove-clang-header-paths.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/plugins/cpptools/headerpathfilter.cpp b/src/plugins/cpptools/headerpathfilter.cpp -index a830d3c3..80e2f933 100644 ---- a/src/plugins/cpptools/headerpathfilter.cpp -+++ b/src/plugins/cpptools/headerpathfilter.cpp -@@ -157,7 +157,6 @@ void removeClangSystemHeaderPaths(HeaderPaths &headerPaths) - - void HeaderPathFilter::tweakHeaderPaths() - { -- removeClangSystemHeaderPaths(builtInHeaderPaths); - removeGccInternalIncludePaths(); - - auto split = resourceIterator(builtInHeaderPaths); diff --git a/pkgs/development/tools/qtcreator/default.nix b/pkgs/development/tools/qtcreator/default.nix deleted file mode 100644 index 5072bb88f4b6..000000000000 --- a/pkgs/development/tools/qtcreator/default.nix +++ /dev/null @@ -1,96 +0,0 @@ -{ mkDerivation, lib, fetchurl, fetchgit, fetchpatch -, qtbase, qtquickcontrols, qtscript, qtdeclarative, qmake, llvmPackages_8, elfutils, perf -, withDocumentation ? false, withClangPlugins ? true -}: - -let - # Fetch clang from qt vendor, this contains submodules like this: - # clang<-clang-tools-extra<-clazy. - clang_qt_vendor = llvmPackages_8.clang-unwrapped.overrideAttrs (oldAttrs: { - # file RPATH_CHANGE could not write new RPATH - cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=ON" ]; - src = fetchgit { - url = "https://code.qt.io/clang/clang.git"; - rev = "c12b012bb7465299490cf93c2ae90499a5c417d5"; - sha256 = "0mgmnazgr19hnd03xcrv7d932j6dpz88nhhx008b0lv4bah9mqm0"; - }; - unpackPhase = ""; - }); -in - -mkDerivation rec { - pname = "qtcreator"; - version = "5.0.3"; - baseVersion = builtins.concatStringsSep "." (lib.take 2 (builtins.splitVersion version)); - - src = fetchurl { - url = "http://download.qt-project.org/official_releases/${pname}/${baseVersion}/${version}/qt-creator-opensource-src-${version}.tar.xz"; - sha256 = "1sz21ijzvhf5avblikffykbqa8zdq3sbg32g2dmyxv5w211v3lvz"; - }; - - buildInputs = [ qtbase qtscript qtquickcontrols qtdeclarative elfutils.dev ] ++ - lib.optionals withClangPlugins [ llvmPackages_8.libclang - clang_qt_vendor - llvmPackages_8.llvm ]; - - nativeBuildInputs = [ qmake ]; - - # 0001-Fix-clang-libcpp-regexp.patch is for fixing regexp that is used to - # find clang libc++ library include paths. By default it's not covering paths - # like libc++-version, which is default name for libc++ folder in nixos. - # ./0002-Dont-remove-clang-header-paths.patch is for forcing qtcreator to not - # remove system clang include paths. - patches = [ ./0001-Fix-clang-libcpp-regexp.patch - ./0002-Dont-remove-clang-header-paths.patch ]; - - doCheck = true; - - buildFlags = lib.optional withDocumentation "docs"; - - installFlags = [ "INSTALL_ROOT=$(out)" ] ++ lib.optional withDocumentation "install_docs"; - - qtWrapperArgs = [ "--set-default PERFPROFILER_PARSER_FILEPATH ${lib.getBin perf}/bin" ]; - - preConfigure = '' - substituteInPlace src/plugins/plugins.pro \ - --replace '$$[QT_INSTALL_QML]/QtQuick/Controls' '${qtquickcontrols}/${qtbase.qtQmlPrefix}/QtQuick/Controls' - substituteInPlace src/libs/libs.pro \ - --replace '$$[QT_INSTALL_QML]/QtQuick/Controls' '${qtquickcontrols}/${qtbase.qtQmlPrefix}/QtQuick/Controls' - '' + lib.optionalString withClangPlugins '' - # Fix paths for llvm/clang includes directories. - substituteInPlace src/shared/clang/clang_defines.pri \ - --replace '$$clean_path($${LLVM_LIBDIR}/clang/$${LLVM_VERSION}/include)' '${clang_qt_vendor}/lib/clang/8.0.0/include' \ - --replace '$$clean_path($${LLVM_BINDIR})' '${clang_qt_vendor}/bin' - - # Fix paths to libclang library. - substituteInPlace src/shared/clang/clang_installation.pri \ - --replace 'LIBCLANG_LIBS = -L$${LLVM_LIBDIR}' 'LIBCLANG_LIBS = -L${llvmPackages_8.libclang.lib}/lib' \ - --replace 'LIBCLANG_LIBS += $${CLANG_LIB}' 'LIBCLANG_LIBS += -lclang' \ - --replace 'LIBTOOLING_LIBS = -L$${LLVM_LIBDIR}' 'LIBTOOLING_LIBS = -L${clang_qt_vendor}/lib' \ - --replace 'LLVM_CXXFLAGS ~= s,-gsplit-dwarf,' '${lib.concatStringsSep "\n" ["LLVM_CXXFLAGS ~= s,-gsplit-dwarf," " LLVM_CXXFLAGS += -fno-rtti"]}' - ''; - - preBuild = lib.optionalString withDocumentation '' - ln -s ${lib.getLib qtbase}/$qtDocPrefix $NIX_QT5_TMP/share - ''; - - postInstall = '' - mkdir -p $out/share/applications - cp share/applications/org.qt-project.qtcreator.desktop $out/share/applications - substituteInPlace $out/share/applications/org.qt-project.qtcreator.desktop \ - --replace "Exec=qtcreator" "Exec=$out/bin/qtcreator" - ''; - - meta = { - description = "Cross-platform IDE tailored to the needs of Qt developers"; - longDescription = '' - Qt Creator is a cross-platform IDE (integrated development environment) - tailored to the needs of Qt developers. It includes features such as an - advanced code editor, a visual debugger and a GUI designer. - ''; - homepage = "https://wiki.qt.io/Category:Tools::QtCreator"; - license = "LGPL"; - maintainers = [ lib.maintainers.akaWolf ]; - platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2185766a0923..7339fc2eca66 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19607,10 +19607,6 @@ with pkgs; qc = callPackage ../development/tools/qc { }; - qtcreator = libsForQt5.callPackage ../development/tools/qtcreator { - inherit (linuxPackages) perf; - }; - qtcreator-qt6 = qt6Packages.callPackage ../development/tools/qtcreator/qt6.nix { inherit (linuxPackages) perf; stdenv = llvmPackages_14.stdenv; From dc061bb01c6e342ba4b1e477e2ef4b3668cd6933 Mon Sep 17 00:00:00 2001 From: rewine Date: Tue, 25 Jul 2023 20:21:25 +0800 Subject: [PATCH 2/3] qtcreator-qt6: rename to qtcreator --- pkgs/development/tools/qtcreator/{qt6.nix => default.nix} | 0 pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename pkgs/development/tools/qtcreator/{qt6.nix => default.nix} (100%) diff --git a/pkgs/development/tools/qtcreator/qt6.nix b/pkgs/development/tools/qtcreator/default.nix similarity index 100% rename from pkgs/development/tools/qtcreator/qt6.nix rename to pkgs/development/tools/qtcreator/default.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7339fc2eca66..41d9c57691e3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19607,7 +19607,7 @@ with pkgs; qc = callPackage ../development/tools/qc { }; - qtcreator-qt6 = qt6Packages.callPackage ../development/tools/qtcreator/qt6.nix { + qtcreator = qt6Packages.callPackage ../development/tools/qtcreator { inherit (linuxPackages) perf; stdenv = llvmPackages_14.stdenv; llvmPackages = llvmPackages_14; From 5153d9c6aea6efe1b1ed33ed75a25237dda627b4 Mon Sep 17 00:00:00 2001 From: rewine Date: Tue, 25 Jul 2023 20:31:11 +0800 Subject: [PATCH 3/3] aliases: add qtcreator-qt6 --- pkgs/top-level/aliases.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index a72d0ef65366..960ad593ca8a 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1449,6 +1449,7 @@ mapAliases ({ qca-qt5 = throw "'qca-qt5' has been renamed to/replaced by 'libsForQt5.qca-qt5'"; # Converted to throw 2022-02-22 qca2 = throw "qca2 has been removed, because it depended on qt4"; # Added 2022-05-26 qcsxcad = libsForQt5.qcsxcad; # Added 2020-11-05 + qtcreator-qt6 = throw "'qtcreator-qt6' has been renamed to/replaced by 'qtcreator', since qt5 version has been removed"; # Added 2023-07-25 qflipper = qFlipper; # Added 2022-02-11 qmk_firmware = throw "qmk_firmware has been removed because it was broken"; # Added 2021-04-02 qlandkartegt = throw "'qlandkartegt' has been removed from nixpkgs, as it was broken and unmaintained"; # Added 2023-04-17