2022-06-16 17:23:12 +00:00
|
|
|
{ newScope
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchpatch2
|
2022-06-16 17:23:12 +00:00
|
|
|
, makeSetupHook
|
|
|
|
, makeWrapper
|
2023-04-12 12:48:02 +00:00
|
|
|
, gst_all_1
|
2022-11-21 17:40:18 +00:00
|
|
|
, libglvnd
|
2022-12-17 10:02:37 +00:00
|
|
|
, darwin
|
2022-06-16 17:23:12 +00:00
|
|
|
, buildPackages
|
2023-10-09 19:29:22 +00:00
|
|
|
, python3
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
# options
|
|
|
|
, developerBuild ? false
|
|
|
|
, debug ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
srcs = import ./srcs.nix {
|
|
|
|
inherit fetchurl;
|
|
|
|
mirror = "mirror://qt";
|
|
|
|
};
|
|
|
|
|
|
|
|
addPackages = self: with self;
|
|
|
|
let
|
2023-04-12 12:48:02 +00:00
|
|
|
callPackage = self.newScope ({
|
2023-10-09 19:29:22 +00:00
|
|
|
inherit qtModule srcs python3;
|
2023-04-12 12:48:02 +00:00
|
|
|
stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
|
|
|
|
});
|
2022-06-16 17:23:12 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
inherit callPackage srcs;
|
|
|
|
|
|
|
|
qtModule = callPackage ./qtModule.nix { };
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
qtbase = callPackage ./modules/qtbase.nix {
|
|
|
|
withGtk3 = true;
|
|
|
|
inherit (srcs.qtbase) src version;
|
2023-04-12 12:48:02 +00:00
|
|
|
inherit developerBuild;
|
2023-04-29 16:46:19 +00:00
|
|
|
inherit (darwin.apple_sdk_11_0.frameworks)
|
|
|
|
AGL AVFoundation AppKit Contacts CoreBluetooth EventKit GSS MetalKit;
|
2022-10-21 18:38:19 +00:00
|
|
|
patches = [
|
2023-04-29 16:46:19 +00:00
|
|
|
./patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch
|
|
|
|
./patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch
|
|
|
|
./patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch
|
|
|
|
./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
|
2023-07-15 17:15:38 +00:00
|
|
|
./patches/0007-qtbase-find-qt-tools-in-QTTOOLSPATH.patch
|
2023-10-09 19:29:22 +00:00
|
|
|
./patches/0008-qtbase-allow-translations-outside-prefix.patch
|
2023-08-22 20:05:09 +00:00
|
|
|
./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
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
2023-04-12 12:48:02 +00:00
|
|
|
env = callPackage ./qt-env.nix { };
|
2022-11-21 17:40:18 +00:00
|
|
|
full = env "qt-full-${qtbase.version}" ([
|
|
|
|
qt3d
|
|
|
|
qt5compat
|
|
|
|
qtcharts
|
|
|
|
qtconnectivity
|
2023-04-29 16:46:19 +00:00
|
|
|
qtdatavis3d
|
2022-11-21 17:40:18 +00:00
|
|
|
qtdeclarative
|
|
|
|
qtdoc
|
2023-04-29 16:46:19 +00:00
|
|
|
qtgrpc
|
|
|
|
qthttpserver
|
2022-11-21 17:40:18 +00:00
|
|
|
qtimageformats
|
2023-04-29 16:46:19 +00:00
|
|
|
qtlanguageserver
|
|
|
|
qtlocation
|
2022-11-21 17:40:18 +00:00
|
|
|
qtlottie
|
|
|
|
qtmultimedia
|
2023-04-29 16:46:19 +00:00
|
|
|
qtmqtt
|
2022-11-21 17:40:18 +00:00
|
|
|
qtnetworkauth
|
|
|
|
qtpositioning
|
|
|
|
qtsensors
|
|
|
|
qtserialbus
|
|
|
|
qtserialport
|
|
|
|
qtshadertools
|
2023-04-29 16:46:19 +00:00
|
|
|
qtspeech
|
2022-11-21 17:40:18 +00:00
|
|
|
qtquick3d
|
2023-04-29 16:46:19 +00:00
|
|
|
qtquick3dphysics
|
|
|
|
qtquickeffectmaker
|
|
|
|
qtquicktimeline
|
|
|
|
qtremoteobjects
|
2022-11-21 17:40:18 +00:00
|
|
|
qtsvg
|
|
|
|
qtscxml
|
|
|
|
qttools
|
|
|
|
qttranslations
|
|
|
|
qtvirtualkeyboard
|
|
|
|
qtwebchannel
|
|
|
|
qtwebengine
|
|
|
|
qtwebsockets
|
|
|
|
qtwebview
|
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [ qtwayland libglvnd ]);
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
qt3d = callPackage ./modules/qt3d.nix { };
|
|
|
|
qt5compat = callPackage ./modules/qt5compat.nix { };
|
|
|
|
qtcharts = callPackage ./modules/qtcharts.nix { };
|
2022-12-17 10:02:37 +00:00
|
|
|
qtconnectivity = callPackage ./modules/qtconnectivity.nix {
|
2023-04-29 16:46:19 +00:00
|
|
|
inherit (darwin.apple_sdk_11_0.frameworks) IOBluetooth PCSC;
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
2022-06-16 17:23:12 +00:00
|
|
|
qtdatavis3d = callPackage ./modules/qtdatavis3d.nix { };
|
|
|
|
qtdeclarative = callPackage ./modules/qtdeclarative.nix { };
|
|
|
|
qtdoc = callPackage ./modules/qtdoc.nix { };
|
2023-10-09 19:29:22 +00:00
|
|
|
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=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
2022-09-30 11:47:45 +00:00
|
|
|
qthttpserver = callPackage ./modules/qthttpserver.nix { };
|
2022-06-16 17:23:12 +00:00
|
|
|
qtimageformats = callPackage ./modules/qtimageformats.nix { };
|
|
|
|
qtlanguageserver = callPackage ./modules/qtlanguageserver.nix { };
|
2023-04-29 16:46:19 +00:00
|
|
|
qtlocation = callPackage ./modules/qtlocation.nix { };
|
2022-06-16 17:23:12 +00:00
|
|
|
qtlottie = callPackage ./modules/qtlottie.nix { };
|
|
|
|
qtmultimedia = callPackage ./modules/qtmultimedia.nix {
|
2023-04-12 12:48:02 +00:00
|
|
|
inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi;
|
2022-12-17 10:02:37 +00:00
|
|
|
inherit (darwin.apple_sdk_11_0.frameworks) VideoToolbox;
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
2023-04-29 16:46:19 +00:00
|
|
|
qtmqtt = callPackage ./modules/qtmqtt.nix { };
|
2022-06-16 17:23:12 +00:00
|
|
|
qtnetworkauth = callPackage ./modules/qtnetworkauth.nix { };
|
|
|
|
qtpositioning = callPackage ./modules/qtpositioning.nix { };
|
|
|
|
qtsensors = callPackage ./modules/qtsensors.nix { };
|
|
|
|
qtserialbus = callPackage ./modules/qtserialbus.nix { };
|
|
|
|
qtserialport = callPackage ./modules/qtserialport.nix { };
|
|
|
|
qtshadertools = callPackage ./modules/qtshadertools.nix { };
|
2022-12-17 10:02:37 +00:00
|
|
|
qtspeech = callPackage ./modules/qtspeech.nix {
|
|
|
|
inherit (darwin.apple_sdk_11_0.frameworks) Cocoa;
|
|
|
|
};
|
2022-06-16 17:23:12 +00:00
|
|
|
qtquick3d = callPackage ./modules/qtquick3d.nix { };
|
2022-09-30 11:47:45 +00:00
|
|
|
qtquick3dphysics = callPackage ./modules/qtquick3dphysics.nix { };
|
2023-04-29 16:46:19 +00:00
|
|
|
qtquickeffectmaker = callPackage ./modules/qtquickeffectmaker.nix { };
|
2022-06-16 17:23:12 +00:00
|
|
|
qtquicktimeline = callPackage ./modules/qtquicktimeline.nix { };
|
|
|
|
qtremoteobjects = callPackage ./modules/qtremoteobjects.nix { };
|
|
|
|
qtsvg = callPackage ./modules/qtsvg.nix { };
|
|
|
|
qtscxml = callPackage ./modules/qtscxml.nix { };
|
|
|
|
qttools = callPackage ./modules/qttools.nix { };
|
|
|
|
qttranslations = callPackage ./modules/qttranslations.nix { };
|
|
|
|
qtvirtualkeyboard = callPackage ./modules/qtvirtualkeyboard.nix { };
|
|
|
|
qtwayland = callPackage ./modules/qtwayland.nix { };
|
|
|
|
qtwebchannel = callPackage ./modules/qtwebchannel.nix { };
|
2023-04-29 16:46:19 +00:00
|
|
|
qtwebengine = callPackage ./modules/qtwebengine.nix {
|
|
|
|
inherit (darwin) bootstrap_cmds cctools xnu;
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit (darwin.apple_sdk_11_0) libpm libunwind llvmPackages_14;
|
2023-04-29 16:46:19 +00:00
|
|
|
inherit (darwin.apple_sdk_11_0.libs) sandbox;
|
|
|
|
inherit (darwin.apple_sdk_11_0.frameworks)
|
|
|
|
AGL AVFoundation Accelerate Cocoa CoreLocation CoreML ForceFeedback
|
|
|
|
GameController ImageCaptureCore LocalAuthentication
|
|
|
|
MediaAccessibility MediaPlayer MetalKit Network OpenDirectory Quartz
|
|
|
|
ReplayKit SecurityInterface Vision;
|
|
|
|
xcbuild = buildPackages.xcbuild.override {
|
|
|
|
productBuildVer = "20A2408";
|
|
|
|
};
|
|
|
|
};
|
2022-06-16 17:23:12 +00:00
|
|
|
qtwebsockets = callPackage ./modules/qtwebsockets.nix { };
|
2022-12-17 10:02:37 +00:00
|
|
|
qtwebview = callPackage ./modules/qtwebview.nix {
|
|
|
|
inherit (darwin.apple_sdk_11_0.frameworks) WebKit;
|
|
|
|
};
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
wrapQtAppsHook = makeSetupHook
|
|
|
|
{
|
|
|
|
name = "wrap-qt6-apps-hook";
|
2023-04-29 16:46:19 +00:00
|
|
|
propagatedBuildInputs = [ buildPackages.makeBinaryWrapper ];
|
2022-06-16 17:23:12 +00:00
|
|
|
} ./hooks/wrap-qt-apps-hook.sh;
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
qmake = makeSetupHook
|
|
|
|
{
|
|
|
|
name = "qmake6-hook";
|
|
|
|
propagatedBuildInputs = [ self.qtbase.dev ];
|
|
|
|
substitutions = {
|
|
|
|
inherit debug;
|
|
|
|
fix_qmake_libtool = ./hooks/fix-qmake-libtool.sh;
|
|
|
|
};
|
|
|
|
} ./hooks/qmake-hook.sh;
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
# TODO(@Artturin): convert to makeScopeWithSplicing'
|
2022-11-21 17:40:18 +00:00
|
|
|
# simple example of how to do that in 5568a4d25ca406809530420996d57e0876ca1a01
|
2023-10-09 19:29:22 +00:00
|
|
|
baseScope = lib.makeScope newScope addPackages;
|
|
|
|
|
|
|
|
bootstrapScope = baseScope.overrideScope'(final: prev: {
|
|
|
|
qtbase = prev.qtbase.override { qttranslations = null; };
|
|
|
|
qtdeclarative = null;
|
|
|
|
});
|
|
|
|
|
|
|
|
finalScope = baseScope.overrideScope'(final: prev: {
|
|
|
|
qttranslations = bootstrapScope.qttranslations;
|
|
|
|
});
|
|
|
|
in finalScope
|