Skip to content

Commit

Permalink
Merge pull request NixOS#260239 from NickCao/qt6
Browse files Browse the repository at this point in the history
qt6: 6.5.3 -> 6.6.0
  • Loading branch information
NickCao authored Oct 13, 2023
2 parents 7ba31c7 + 2de11a7 commit 9cbf22c
Show file tree
Hide file tree
Showing 30 changed files with 427 additions and 261 deletions.
10 changes: 10 additions & 0 deletions pkgs/applications/misc/copyq/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch2
, cmake
, ninja
, extra-cmake-modules
Expand All @@ -26,6 +27,15 @@ stdenv.mkDerivation rec {
hash = "sha256-aAmpFKIIFZLPWUaOcf4V1d/wVQ7xRcnXFsqFjROsabg=";
};

patches = [
# itemfakevim: fix build with qt 6.6.0
# https://github.com/hluk/CopyQ/pull/2508
(fetchpatch2 {
url = "https://github.com/hluk/CopyQ/commit/a20bfff0d78296b334ff8cabb047ab5d842b7311.patch";
hash = "sha256-F/6cQ8+O1Ttd4EFFxQas5ES6U+qxWdmYqUWRQLsVMa4=";
})
];

nativeBuildInputs = [
cmake
ninja
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ stdenv.mkDerivation rec {
url = "https://salsa.debian.org/debian/telegram-desktop/-/raw/09b363ed5a4fcd8ecc3282b9bfede5fbb83f97ef/debian/patches/Disable-register-custom-scheme.patch";
hash = "sha256-B8X5lnSpwwdp1HlvyXJWQPybEN+plOwimdV5gW6aY2Y=";
})
# lib_base: Add missing include for Qt 6.6
(fetchpatch {
url = "https://github.com/desktop-app/lib_base/commit/5ca91dbb811c84591780236abc31431e313faf39.patch";
stripLen = 1;
extraPrefix = "Telegram/lib_base/";
hash = "sha256-eZkyMnPaAmUFYXiCmPhLRTw2Xdx0lylY+UVOckCsiaA=";
})
];

postPatch = ''
Expand Down
11 changes: 11 additions & 0 deletions pkgs/applications/video/obs-studio/plugins/obs-tuna/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch2
, obs-studio
, cmake
, zlib
Expand All @@ -27,6 +28,16 @@ stdenv.mkDerivation (finalAttrs: {
fetchSubmodules = true;
};

patches = [
# fix build with qt 6.6.0
# treewide: replace deprecated qAsConst with std::as_const()
# https://github.com/univrsal/tuna/pull/176
(fetchpatch2 {
url = "https://github.com/univrsal/tuna/commit/0d570e771f8d8e6ae7c85bd2b86bbf59c264789e.patch";
hash = "sha256-A5idhMiM9funqhTm5XMIBqwy+FO1SaNPtgZjo+Vws6k=";
})
];

postInstall = ''
mkdir $out/lib $out/share
mv $out/obs-plugins/64bit $out/lib/obs-plugins
Expand Down
11 changes: 11 additions & 0 deletions pkgs/data/documentation/zeal/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch2
, cmake
, extra-cmake-modules
, pkg-config
Expand Down Expand Up @@ -30,6 +31,16 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-s1FaazHVtWE697BO0hIOgZVowdkq68R9x327ZnJRnlo=";
};

patches = [
# fix build with qt 6.6.0
# treewide: replace deprecated qAsConst with std::as_const()
# https://github.com/zealdocs/zeal/pull/1565
(fetchpatch2 {
url = "https://github.com/zealdocs/zeal/commit/d50a0115d58df2b222ede4c3a76b9686f4716465.patch";
hash = "sha256-Ub6RCZGpLSOjvK17Jrm+meZuZGXcC4kI3QYl5HbsLWU=";
})
];

postPatch = ''
substituteInPlace CMakeLists.txt \
--replace 'ZEAL_VERSION_SUFFIX "-dev"' 'ZEAL_VERSION_SUFFIX ""'
Expand Down
22 changes: 8 additions & 14 deletions pkgs/development/libraries/qt-6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ let
./patches/0004-qtbase-fix-locating-tzdir-on-NixOS.patch
./patches/0005-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch
./patches/0006-qtbase-qt-cmake-always-use-cmake-from-path.patch
./patches/0007-qtbase-find-qt-tools-in-QTTOOLSPATH.patch
./patches/0008-qtbase-allow-translations-outside-prefix.patch
./patches/0008-qtbase-find-qmlimportscanner-in-macdeployqt-via-environment.patch
./patches/0009-qtbase-check-in-the-QML-folder-of-this-library-does-actuall.patch
./patches/0010-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch
./patches/0007-qtbase-find-tools-in-PATH.patch
./patches/0008-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch
./patches/0009-qtbase-allow-translations-outside-prefix.patch
./patches/0010-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch
./patches/0011-qtbase-check-in-the-QML-folder-of-this-library-does-.patch
];
};
env = callPackage ./qt-env.nix { };
Expand All @@ -65,6 +65,7 @@ let
qtdatavis3d
qtdeclarative
qtdoc
qtgraphs
qtgrpc
qthttpserver
qtimageformats
Expand Down Expand Up @@ -105,15 +106,8 @@ let
qtdatavis3d = callPackage ./modules/qtdatavis3d.nix { };
qtdeclarative = callPackage ./modules/qtdeclarative.nix { };
qtdoc = callPackage ./modules/qtdoc.nix { };
qtgrpc = callPackage ./modules/qtgrpc.nix {
patches = [
(fetchpatch2 {
# fix compatibility with protobuf 23
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt6-grpc/-/raw/5cfb8728ca626af41d5dc2b1f642d026c011ec56/protobuf-23.patch";
hash = "sha256-msVQEAt0DewOnZIgymGijJEpIXbfmMUkdbIyJ0ZNuok=";
})
];
};
qtgraphs = callPackage ./modules/qtgraphs.nix { };
qtgrpc = callPackage ./modules/qtgrpc.nix { };
qthttpserver = callPackage ./modules/qthttpserver.nix { };
qtimageformats = callPackage ./modules/qtimageformats.nix { };
qtlanguageserver = callPackage ./modules/qtlanguageserver.nix { };
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/qt-6/fetch.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
WGET_ARGS=( https://download.qt.io/official_releases/qt/6.5/6.5.3/submodules/ -A '*.tar.xz' )
WGET_ARGS=( https://download.qt.io/official_releases/qt/6.6/6.6.0/submodules/ -A '*.tar.xz' )
16 changes: 16 additions & 0 deletions pkgs/development/libraries/qt-6/modules/qtgraphs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ qtModule
, qtbase
, qtdeclarative
, qtquick3d
, qtquicktimeline
}:

qtModule {
pname = "qtgraphs";
qtInputs = [
qtbase
qtdeclarative
qtquick3d
qtquicktimeline
];
}
2 changes: 0 additions & 2 deletions pkgs/development/libraries/qt-6/modules/qtgrpc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
, qtdeclarative
, protobuf
, grpc
, patches ? []
}:

qtModule {
pname = "qtgrpc";
qtInputs = [ qtbase qtdeclarative ];
buildInputs = [ protobuf grpc ];
inherit patches;
}
4 changes: 2 additions & 2 deletions pkgs/development/libraries/qt-6/modules/qtmqtt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

qtModule rec {
pname = "qtmqtt";
version = "6.5.3";
version = "6.6.0";
src = fetchFromGitHub {
owner = "qt";
repo = "qtmqtt";
rev = "v${version}";
hash = "sha256-F0rq72Cvnwy2cJmw3wUL9t8ZsnI61HBRMMWRwKdSEs8=";
hash = "sha256-rFi1w0Z4jLvHvhu0/VOIT0MWmKjy51jSK5M56qLs0gI=";
};
qtInputs = [ qtbase ];
}
10 changes: 10 additions & 0 deletions pkgs/development/libraries/qt-6/modules/qtsvg.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@
, libmng
, zlib
, pkg-config
, fetchpatch2
}:

qtModule {
pname = "qtsvg";
qtInputs = [ qtbase ];
buildInputs = [ libwebp jasper libmng zlib ];
nativeBuildInputs = [ pkg-config ];
patches = [
# Fix nullptr dereference with invalid SVG
# https://bugreports.qt.io/projects/QTBUG/issues/QTBUG-117944
(fetchpatch2 {
name = "QTBUG-117944.patch";
url = "https://code.qt.io/cgit/qt/qtsvg.git/patch/?id=edc8ca7f";
hash = "sha256-kBQYlQqPb0QkRhatQyaGdxE1Y5zHd6/ZEd5zn0gRVoM=";
})
];
}
7 changes: 7 additions & 0 deletions pkgs/development/libraries/qt-6/modules/qttools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ qtModule {
env.NIX_CFLAGS_COMPILE = toString [
"-DNIX_OUTPUT_OUT=\"${placeholder "out"}\""
];
postPatch = ''
substituteInPlace \
src/qdoc/catch/CMakeLists.txt \
src/qdoc/catch_generators/CMakeLists.txt \
src/qdoc/catch_conversions/CMakeLists.txt \
--replace ''\'''${CMAKE_INSTALL_INCLUDEDIR}' "$out/include"
'';
postInstall = ''
mkdir -p "$dev"
ln -s "$out/bin" "$dev/bin"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 69d9faa9e4420d3cb0d1466c1b95ceadb2cd75f3 Mon Sep 17 00:00:00 2001
From afbe4002948e60ee3b27cb9be9e549ae416373f8 Mon Sep 17 00:00:00 2001
From: Nick Cao <[email protected]>
Date: Thu, 13 Apr 2023 23:42:29 +0800
Subject: [PATCH 1/6] qtbase: qmake: always use libname instead of absolute
Subject: [PATCH 01/11] qtbase: qmake: always use libname instead of absolute
path in qmake files

In generated qmake files, absolute paths to qt libraries are embedded
Expand Down Expand Up @@ -46,5 +46,5 @@ index 3ffe354fd8d..441332d4582 100644
else()
list(APPEND out_list "${library_path}")
--
2.39.2
2.42.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 41e32c41f781261726722628122c924abb532575 Mon Sep 17 00:00:00 2001
From 8d3f5ee63ed29fe41927b904aa1e2b40f90c8ef4 Mon Sep 17 00:00:00 2001
From: Nick Cao <[email protected]>
Date: Fri, 14 Apr 2023 21:43:04 +0800
Subject: [PATCH 2/6] qtbase: qmake: fix mkspecs for darwin
Subject: [PATCH 02/11] qtbase: qmake: fix mkspecs for darwin

---
mkspecs/common/mac.conf | 2 +-
Expand All @@ -26,7 +26,7 @@ index 61bea952b22..9909dae7260 100644

QMAKE_LFLAGS_REL_RPATH =
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 4acf3b19d5c..aadfce875e2 100644
index f364716717c..3b40328304d 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -1,9 +1,5 @@
Expand All @@ -39,7 +39,7 @@ index 4acf3b19d5c..aadfce875e2 100644
contains(TEMPLATE, .*app) {
!macx-xcode:if(isEmpty(BUILDS)|build_pass) {
# Detect changes to the platform SDK
@@ -15,37 +11,6 @@ contains(TEMPLATE, .*app) {
@@ -15,269 +11,10 @@ contains(TEMPLATE, .*app) {

QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk)
}
Expand Down Expand Up @@ -77,9 +77,6 @@ index 4acf3b19d5c..aadfce875e2 100644
}

!no_objective_c:CONFIG += objective_c
@@ -73,234 +38,6 @@ qt {
}
}

-# Add the same default rpaths as Xcode does for new projects.
-# This is especially important for iOS/tvOS/watchOS where no other option is possible.
Expand Down Expand Up @@ -486,5 +483,5 @@ index df191eb13c4..e69de29bb2d 100644
-
-load(toolchain)
--
2.39.2
2.42.0

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From f52f3c2cb1703592eaeb43e80f585a24ce8402d7 Mon Sep 17 00:00:00 2001
From 8ce66fca339d9daf6bd132771c2ea582a461f31c Mon Sep 17 00:00:00 2001
From: Nick Cao <[email protected]>
Date: Fri, 14 Apr 2023 09:34:46 +0800
Subject: [PATCH 3/6] qtbase: qmake: fix includedir in generated pkg-config
Subject: [PATCH 03/11] qtbase: qmake: fix includedir in generated pkg-config

---
qmake/generators/makefile.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index cc985a878b4..4e3b383d812 100644
index 11d2f0ff7df..c78ed0d3485 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3403,8 +3403,7 @@ MakefileGenerator::writePkgConfigFile()
@@ -3412,8 +3412,7 @@ MakefileGenerator::writePkgConfigFile()
<< varGlue("QMAKE_PKGCONFIG_CFLAGS", "", " ", " ")
// << varGlue("DEFINES","-D"," -D"," ")
;
Expand All @@ -22,5 +22,5 @@ index cc985a878b4..4e3b383d812 100644
&& libDir != QLatin1String("/Library/Frameworks")) {
t << " -F${libdir}";
--
2.39.2
2.42.0

Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
From dd0dfc9cf87966f5d7493a943ec04c665be83cb6 Mon Sep 17 00:00:00 2001
From b1533ac42718835499ec633ffb3b1bed0d040719 Mon Sep 17 00:00:00 2001
From: Nick Cao <[email protected]>
Date: Fri, 14 Apr 2023 09:35:25 +0800
Subject: [PATCH 4/6] qtbase: fix locating tzdir on NixOS
Subject: [PATCH 04/11] qtbase: fix locating tzdir on NixOS

---
src/corelib/time/qtimezoneprivate_tz.cpp | 27 +++++++++++++++---------
1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
index 960a0944185..a5186acbd91 100644
index e702a5d6b43..2ac88c1cd10 100644
--- a/src/corelib/time/qtimezoneprivate_tz.cpp
+++ b/src/corelib/time/qtimezoneprivate_tz.cpp
@@ -51,7 +51,11 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
// Parse zone.tab table, assume lists all installed zones, if not will need to read directories
@@ -56,7 +56,11 @@ static bool isTzFile(const QString &name);
// zone1970.tab).
static QTzTimeZoneHash loadTzTimeZones()
{
- QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
Expand All @@ -24,7 +24,7 @@ index 960a0944185..a5186acbd91 100644
if (!QFile::exists(path))
path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");

@@ -730,18 +734,21 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
@@ -773,18 +777,21 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
if (!tzif.open(QIODevice::ReadOnly))
return ret;
} else {
Expand Down Expand Up @@ -56,5 +56,5 @@ index 960a0944185..a5186acbd91 100644
}
}
--
2.39.2
2.42.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 4e8c14f1af9c332826e0454f4fd63e541edbaf5c Mon Sep 17 00:00:00 2001
From 880fe5653a86d8091f3f577977f8af93552c48fd Mon Sep 17 00:00:00 2001
From: Nick Cao <[email protected]>
Date: Tue, 21 Mar 2023 15:48:49 +0800
Subject: [PATCH 5/6] qtbase: deal with a font face at index 0 as Regular for
Subject: [PATCH 05/11] qtbase: deal with a font face at index 0 as Regular for
Variable fonts

Reference: https://bugreports.qt.io/browse/QTBUG-111994
Expand All @@ -22,5 +22,5 @@ index 474644b871f..c7a117fd134 100644
FcObjectSetDestroy(os);
FcPatternDestroy(pattern);
--
2.39.2
2.42.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 61ae6e04388dd40e11c214d56f22f8f2007bf35f Mon Sep 17 00:00:00 2001
From 7f573f00fb850a08017d9f1e3c73b4d7efeb84f2 Mon Sep 17 00:00:00 2001
From: Nick Cao <[email protected]>
Date: Wed, 12 Apr 2023 10:13:50 +0800
Subject: [PATCH 6/6] qtbase: qt-cmake: always use cmake from path
Subject: [PATCH 06/11] qtbase: qt-cmake: always use cmake from path

The generated qt-cmake scripts embeds the absolute path of cmake used
during the build of qtbase, bloating the runtime closure of qtbase.
Expand All @@ -28,5 +28,5 @@ index f719257f602..571ffe788fa 100755
toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/qt.toolchain.cmake"

--
2.39.2
2.42.0

Loading

0 comments on commit 9cbf22c

Please sign in to comment.