ci: copy qt 5.15.8 package

This commit is contained in:
Anton Iakimov 2024-01-19 13:30:40 +01:00
parent e98f076f45
commit ce449003cc
No known key found for this signature in database
78 changed files with 4465 additions and 0 deletions

1
.gitignore vendored
View File

@ -71,6 +71,7 @@ build/
# https://github.com/github/gitignore/blob/master/C%2B%2B.gitignore
# Prerequisites
*.d
!qtbase.patch.d
# Compiled Object files
*.slo

View File

@ -0,0 +1,232 @@
/*
# Updates
Run `./fetch.sh` to update package sources from Git.
Check for any minor version changes.
*/
{ makeScopeWithSplicing, generateSplicesForMkScope
, lib, stdenv, fetchurl, fetchgit, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper
, bison, cups ? null, harfbuzz, libGL, perl, python3
, gstreamer, gst-plugins-base, gtk3, dconf
, darwin
, buildPackages
# options
, developerBuild ? false
, decryptSslTraffic ? false
, debug ? false
, config
}:
let
srcs = import ./srcs.nix { inherit lib fetchgit fetchFromGitHub; };
qtCompatVersion = srcs.qtbase.version;
patches = {
qtbase = lib.optionals stdenv.isDarwin [
./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
# Patch framework detection to support X.framework/X.tbd,
# extending the current support for X.framework/X.
./qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
./qtbase.patch.d/0014-aarch64-darwin.patch
] ++ [
./qtbase.patch.d/0003-qtbase-mkspecs.patch
./qtbase.patch.d/0004-qtbase-replace-libdir.patch
./qtbase.patch.d/0005-qtbase-cmake.patch
./qtbase.patch.d/0006-qtbase-gtk3.patch
./qtbase.patch.d/0007-qtbase-xcursor.patch
./qtbase.patch.d/0008-qtbase-tzdir.patch
./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
./qtbase.patch.d/0010-qtbase-assert.patch
./qtbase.patch.d/0011-fix-header_module.patch
];
qtdeclarative = [
./qtdeclarative.patch
# prevent headaches from stale qmlcache data
./qtdeclarative-default-disable-qmlcache.patch
];
qtscript = [ ./qtscript.patch ];
qtserialport = [ ./qtserialport.patch ];
qtwebengine = [
(fetchpatch {
url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a6f16c6daea3b5a1f7bc9f175d1645922c131563/qt5/qt5-webengine-python3.patch";
hash = "sha256-rUSDwTucXVP3Obdck7LRTeKZ+JYQSNhQ7+W31uHZ9yM=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/Homebrew/formula-patches/7ae178a617d1e0eceb742557e63721af949bd28a/qt5/qt5-webengine-chromium-python3.patch";
stripLen = 1;
extraPrefix = "src/3rdparty/";
hash = "sha256-MZGYeMdGzwypfKoSUaa56K3inbcGRx7he/+AFyk5ekA=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/Homebrew/formula-patches/7ae178a617d1e0eceb742557e63721af949bd28a/qt5/qt5-webengine-gcc12.patch";
stripLen = 1;
extraPrefix = "src/3rdparty/";
hash = "sha256-s4GsGMJTBNWw2gTJuIEP3tqT82AmTsR2mbj59m2p6rM=";
})
] ++ lib.optionals stdenv.isDarwin [
./qtwebengine-darwin-no-platform-check.patch
./qtwebengine-mac-dont-set-dsymutil-path.patch
./qtwebengine-darwin-checks.patch
];
qtwebkit = [
(fetchpatch {
name = "qtwebkit-bison-3.7-build.patch";
url = "https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31.patch";
sha256 = "0h8ymfnwgkjkwaankr3iifiscsvngqpwb91yygndx344qdiw9y0n";
})
(fetchpatch {
name = "qtwebkit-glib-2.68.patch";
url = "https://github.com/qtwebkit/qtwebkit/pull/1058/commits/5b698ba3faffd4e198a45be9fe74f53307395e4b.patch";
sha256 = "0a3xv0h4lv8wggckgy8cg8xnpkg7n9h45312pdjdnnwy87xvzss0";
})
(fetchpatch {
name = "qtwebkit-darwin-handle.patch";
url = "https://github.com/qtwebkit/qtwebkit/commit/5c272a21e621a66862821d3ae680f27edcc64c19.patch";
sha256 = "9hjqLyABz372QDgoq7nXXXQ/3OXBGcYN1/92ekcC3WE=";
})
./qtwebkit.patch
./qtwebkit-icu68.patch
] ++ lib.optionals stdenv.isDarwin [
./qtwebkit-darwin-no-readline.patch
./qtwebkit-darwin-no-qos-classes.patch
];
qttools = [ ./qttools.patch ];
};
addPackages = self: with self;
let
qtModule =
import ../qtModule.nix
{
inherit perl;
inherit lib;
# Use a variant of mkDerivation that does not include wrapQtApplications
# to avoid cyclic dependencies between Qt modules.
mkDerivation =
import ../mkDerivation.nix
{ inherit lib; inherit debug; wrapQtAppsHook = null; }
stdenv.mkDerivation;
}
{ inherit self srcs patches; };
callPackage = self.newScope { inherit qtCompatVersion qtModule srcs stdenv; };
in {
inherit callPackage qtCompatVersion qtModule srcs;
mkDerivationWith =
import ../mkDerivation.nix
{ inherit lib; inherit debug; inherit (self) wrapQtAppsHook; };
mkDerivation = mkDerivationWith stdenv.mkDerivation;
qtbase = callPackage ../modules/qtbase.nix {
inherit (srcs.qtbase) src version;
patches = patches.qtbase;
inherit bison cups harfbuzz libGL;
withGtk3 = !stdenv.isDarwin; inherit dconf gtk3;
inherit developerBuild decryptSslTraffic;
inherit (darwin.apple_sdk_11_0.frameworks) AGL AppKit ApplicationServices AVFoundation Carbon Cocoa CoreAudio CoreBluetooth
CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit;
libobjc = darwin.apple_sdk_11_0.objc4;
xcbuild = darwin.apple_sdk_11_0.xcodebuild;
};
qt3d = callPackage ../modules/qt3d.nix {};
qtcharts = callPackage ../modules/qtcharts.nix {};
qtconnectivity = callPackage ../modules/qtconnectivity.nix {};
qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
qtdoc = callPackage ../modules/qtdoc.nix {};
qtgamepad = callPackage ../modules/qtgamepad.nix {
inherit (darwin.apple_sdk_11_0.frameworks) GameController;
};
qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
qtimageformats = callPackage ../modules/qtimageformats.nix {};
qtlocation = callPackage ../modules/qtlocation.nix {};
qtlottie = callPackage ../modules/qtlottie.nix {};
qtmacextras = callPackage ../modules/qtmacextras.nix {};
qtmultimedia = callPackage ../modules/qtmultimedia.nix {
inherit gstreamer gst-plugins-base;
};
qtnetworkauth = callPackage ../modules/qtnetworkauth.nix {};
qtquick1 = null;
qtquickcontrols = callPackage ../modules/qtquickcontrols.nix {};
qtquickcontrols2 = callPackage ../modules/qtquickcontrols2.nix {};
qtscript = callPackage ../modules/qtscript.nix {};
qtsensors = callPackage ../modules/qtsensors.nix {};
qtserialbus = callPackage ../modules/qtserialbus.nix {};
qtserialport = callPackage ../modules/qtserialport.nix {};
qtspeech = callPackage ../modules/qtspeech.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 {};
qtwebengine = callPackage ../modules/qtwebengine.nix {
inherit (srcs.qtwebengine) version;
python = python3;
postPatch = ''
# update catapult for python3 compatibility
rm -r src/3rdparty/chromium/third_party/catapult
cp -r ${srcs.catapult} src/3rdparty/chromium/third_party/catapult
'';
inherit (darwin) cctools xnu;
inherit (darwin.apple_sdk_11_0) libpm libunwind;
inherit (darwin.apple_sdk_11_0.libs) sandbox;
inherit (darwin.apple_sdk_11_0.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication
MediaPlayer MediaAccessibility SecurityInterface Vision CoreML;
libobjc = darwin.apple_sdk_11_0.objc4;
};
qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
qtwebkit = callPackage ../modules/qtwebkit.nix {
inherit (darwin) ICU;
inherit (darwin.apple_sdk_11_0.frameworks) OpenGL;
};
qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
qtwebview = callPackage ../modules/qtwebview.nix {
inherit (darwin.apple_sdk_11_0.frameworks) CoreFoundation WebKit;
};
qtx11extras = callPackage ../modules/qtx11extras.nix {};
qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
env = callPackage ../qt-env.nix {};
full = env "qt-full-${qtbase.version}" ([
qt3d qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2
qtscript qtsensors qtserialport qtsvg qttools qttranslations
qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
qtwebview qtx11extras qtxmlpatterns qtlottie
] ++ lib.optional (!stdenv.isDarwin) qtwayland
++ lib.optional (stdenv.isDarwin) qtmacextras);
qmake = makeSetupHook {
name = "qmake-hook";
propagatedBuildInputs = [ self.qtbase.dev ];
substitutions = {
inherit debug;
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
};
} ../hooks/qmake-hook.sh;
wrapQtAppsHook = makeSetupHook {
name = "wrap-qt5-apps-hook";
propagatedBuildInputs = [ self.qtbase.dev buildPackages.makeWrapper ]
++ lib.optional stdenv.isLinux self.qtwayland.dev;
} ../hooks/wrap-qt-apps-hook.sh;
} // lib.optionalAttrs config.allowAliases {
# remove before 23.11
overrideScope' = lib.warn "qt5 now uses makeScopeWithSplicing which does not have \"overrideScope'\", use \"overrideScope\"." self.overrideScope;
};
in makeScopeWithSplicing (generateSplicesForMkScope "qt5") (_: {}) (_: {}) addPackages

17
nix/pkgs/qt-5/5.15/fetch.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-prefetch-scripts jq
set -eox pipefail
here="$(dirname "${BASH_SOURCE[0]}")"
modules="${here}/modules"
srcs="${here}/srcs-generated.json"
while read -r module; do
if [[ -z "$module" ]]; then continue; fi
url="https://invent.kde.org/qt/qt/${module}.git"
nix-prefetch-git --url $url --rev refs/heads/kde/5.15 --fetch-submodules \
| jq "{key: \"${module}\", value: {url,rev,sha256}}"
done < "$modules" | jq -s 'from_entries' > "${srcs}.tmp"
mv "${srcs}.tmp" "$srcs"

View File

@ -0,0 +1,41 @@
qt3d
qtactiveqt
qtandroidextras
qtbase
qtcharts
qtconnectivity
qtdatavis3d
qtdeclarative
qtdoc
qtgamepad
qtgraphicaleffects
qtimageformats
qtlocation
qtlottie
qtmacextras
qtmultimedia
qtnetworkauth
qtpurchasing
qtquick3d
qtquickcontrols
qtquickcontrols2
qtquicktimeline
qtremoteobjects
qtscript
qtscxml
qtsensors
qtserialbus
qtserialport
qtspeech
qtsvg
qttools
qttranslations
qtvirtualkeyboard
qtwayland
qtwebchannel
qtwebglplugin
qtwebsockets
qtwebview
qtwinextras
qtx11extras
qtxmlpatterns

View File

@ -0,0 +1,485 @@
From 5ec1d1009d9943f20e82ffc087deabb31d447e75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
Date: Fri, 3 Apr 2020 21:07:58 +0200
Subject: [PATCH 01/11] qtbase-mkspecs-mac
---
mkspecs/common/mac.conf | 2 +-
mkspecs/features/mac/default_post.prf | 206 --------------------------
mkspecs/features/mac/default_pre.prf | 58 --------
mkspecs/features/mac/sdk.mk | 25 ----
mkspecs/features/mac/sdk.prf | 61 --------
5 files changed, 1 insertion(+), 351 deletions(-)
delete mode 100644 mkspecs/features/mac/sdk.mk
delete mode 100644 mkspecs/features/mac/sdk.prf
diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
index 61bea952b2..9909dae726 100644
--- a/mkspecs/common/mac.conf
+++ b/mkspecs/common/mac.conf
@@ -23,7 +23,7 @@ QMAKE_INCDIR_OPENGL = \
QMAKE_FIX_RPATH = install_name_tool -id
-QMAKE_LFLAGS_RPATH = -Wl,-rpath,
+QMAKE_LFLAGS_RPATH =
QMAKE_LFLAGS_GCSECTIONS = -Wl,-dead_strip
QMAKE_LFLAGS_REL_RPATH =
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index abc6d82ade..59b94fe5b6 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -1,9 +1,5 @@
load(default_post)
-# Recompute SDK version in case the user set it explicitly
-sdk_version = $$QMAKE_MAC_SDK_VERSION
-QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
-
contains(TEMPLATE, .*app) {
!macx-xcode:if(isEmpty(BUILDS)|build_pass) {
# Detect changes to the platform SDK
@@ -16,36 +12,6 @@ contains(TEMPLATE, .*app) {
QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk)
}
- # Detect incompatible SDK versions
-
- isEmpty(QT_MAC_SDK_VERSION_MIN): \
- QT_MAC_SDK_VERSION_MIN = $$QT_MAC_SDK_VERSION
-
- !versionAtLeast(QMAKE_MAC_SDK_VERSION, $$QT_MAC_SDK_VERSION_MIN): \
- warning("Qt requires at least version $$QT_MAC_SDK_VERSION_MIN of the platform SDK," \
- "you're building against version $${QMAKE_MAC_SDK_VERSION}. Please upgrade.")
-
- !isEmpty(QT_MAC_SDK_VERSION_MAX) {
- # For Qt developers only
- !isEmpty($$list($$(QT_MAC_SDK_NO_VERSION_CHECK))): \
- CONFIG += sdk_no_version_check
-
- QMAKE_MAC_SDK_MAJOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\\d+)(\\.\\d+)(\\.\\d+)?", \\1)
-
- !sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_VERSION, $$QT_MAC_SDK_VERSION_MAX) {
- warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_MAX"\
- "of the platform SDK, you're using $${QMAKE_MAC_SDK_MAJOR_VERSION}.")
- warning("This is an unsupported configuration. You may experience build issues," \
- "and by using")
- warning("the $$QMAKE_MAC_SDK_VERSION SDK you are opting in to new features" \
- "that Qt has not been prepared for.")
-
- warning("Please downgrade the SDK you use to build your app to version" \
- "$$QT_MAC_SDK_VERSION_MAX, or configure")
- warning("with CONFIG+=sdk_no_version_check when running qmake" \
- "to silence this warning.")
- }
- }
}
!no_objective_c:CONFIG += objective_c
@@ -73,230 +39,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.
-!no_default_rpath {
- uikit: QMAKE_RPATHDIR += @executable_path/Frameworks
- else: QMAKE_RPATHDIR += @executable_path/../Frameworks
- equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks
-}
-
-# Don't pass -headerpad_max_install_names when using Bitcode.
-# In that case the linker emits a warning stating that the flag is ignored when
-# used with bitcode, for reasons that cannot be determined (rdar://problem/20748962).
-# Using this flag is also unnecessary in practice on UIKit platforms since they
-# are sandboxed, and only UIKit platforms support bitcode to begin with.
-!bitcode: QMAKE_LFLAGS += $$QMAKE_LFLAGS_HEADERPAD
-
-app_extension_api_only {
- QMAKE_CFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
- QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
- QMAKE_CXXFLAGS_PRECOMPILE += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
- QMAKE_LFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
-}
-
-macos {
- !isEmpty(QMAKE_APPLE_DEVICE_ARCHS) {
- # If the user has requested a specific set of architectures,
- # build all of those by default, but limited to only those.
- CONFIG -= only_active_arch
- } else {
- # Otherwise allow building all of the architectures available
- # in Qt, but only build the active arch (unless the user has
- # manually overridden this via CONFIG -= only_active_arch).
- QMAKE_APPLE_DEVICE_ARCHS = $$QT_ARCHS
- }
-}
-
-macx-xcode {
- qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO
- !isEmpty(QMAKE_PKGINFO_TYPEINFO): \
- qmake_pkginfo_typeinfo.value = $$QMAKE_PKGINFO_TYPEINFO
- else: \
- qmake_pkginfo_typeinfo.value = "????"
- QMAKE_MAC_XCODE_SETTINGS += qmake_pkginfo_typeinfo
-
- bundle_version = $$VERSION
- isEmpty(bundle_version): bundle_version = 1.0.0
-
- l = $$split(bundle_version, '.') 0 0 # make sure there are at least three
- VER_MAJ = $$member(l, 0, 0)
- VER_MIN = $$member(l, 1, 1)
- VER_PAT = $$member(l, 2, 2)
- unset(l)
-
- qmake_full_version.name = QMAKE_FULL_VERSION
- qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
- QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
-
- qmake_short_version.name = QMAKE_SHORT_VERSION
- qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
- QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
-
- !isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
- debug_information_format.name = DEBUG_INFORMATION_FORMAT
- debug_information_format.value = $$QMAKE_XCODE_DEBUG_INFORMATION_FORMAT
- debug_information_format.build = debug
- QMAKE_MAC_XCODE_SETTINGS += debug_information_format
- }
-
- QMAKE_XCODE_ARCHS =
-
- arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
- arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS
- QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
- QMAKE_MAC_XCODE_SETTINGS += arch_device
-
- simulator {
- arch_simulator.name = "ARCHS[sdk=$${simulator.sdk}*]"
- arch_simulator.value = $$QMAKE_APPLE_SIMULATOR_ARCHS
- QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_SIMULATOR_ARCHS
- QMAKE_MAC_XCODE_SETTINGS += arch_simulator
- }
-
- only_active_arch.name = ONLY_ACTIVE_ARCH
- only_active_arch.value = YES
- only_active_arch.build = debug
- QMAKE_MAC_XCODE_SETTINGS += only_active_arch
-} else {
- device|!simulator: VALID_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS
- simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
- VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS
-
- single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
-
- macos {
- only_active_arch: DEFAULT_ARCHS = $$system("uname -m")
- else: DEFAULT_ARCHS = $$VALID_ARCHS
- }
-
- ARCHS = $(filter $(EXPORT_VALID_ARCHS), \
- $(if $(ARCHS), $(ARCHS), \
- $(if $(EXPORT_DEFAULT_ARCHS), $(EXPORT_DEFAULT_ARCHS), \
- $(EXPORT_VALID_ARCHS))))
- ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ARCHS), $(EXPORT_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
-
- QMAKE_EXTRA_VARIABLES += VALID_ARCHS DEFAULT_ARCHS ARCHS ARCH_ARGS
-
- arch_flags = $(EXPORT_ARCH_ARGS)
-
- QMAKE_CFLAGS += $$arch_flags
- QMAKE_CXXFLAGS += $$arch_flags
- QMAKE_LFLAGS += $$arch_flags
-
- QMAKE_PCH_ARCHS = $$VALID_ARCHS
-
- macos: deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
- ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
- tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
- watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
-
- # If we're doing a simulator and device build, device and simulator
- # architectures use different paths and flags for the sysroot and
- # deployment target switch, so we must multiplex them across multiple
- # architectures using -Xarch. Otherwise we fall back to the simple path.
- # This is not strictly necessary, but results in cleaner command lines
- # and makes it easier for people to override EXPORT_VALID_ARCHS to limit
- # individual rules to a different set of architecture(s) from the overall
- # build (such as machtest in QtCore).
- simulator:device {
- QMAKE_XARCH_CFLAGS =
- QMAKE_XARCH_LFLAGS =
- QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS
-
- for (arch, VALID_ARCHS) {
- contains(VALID_SIMULATOR_ARCHS, $$arch) {
- sdk = $$simulator.sdk
- version_identifier = $$simulator.deployment_identifier
- } else {
- sdk = $$device.sdk
- version_identifier = $$device.deployment_identifier
- }
-
- version_min_flags = \
- -Xarch_$${arch} \
- -m$${version_identifier}-version-min=$$deployment_target
- QMAKE_XARCH_CFLAGS_$${arch} = $$version_min_flags \
- -Xarch_$${arch} \
- -isysroot$$xcodeSDKInfo(Path, $$sdk)
- QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
- -Xarch_$${arch} \
- -isysroot$$xcodeSDKInfo(Path, $$sdk)
-
- QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
- QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS_$${arch})
-
- QMAKE_EXTRA_VARIABLES += \
- QMAKE_XARCH_CFLAGS_$${arch} \
- QMAKE_XARCH_LFLAGS_$${arch}
- }
-
- QMAKE_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
- QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
- QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
- } else {
- simulator {
- version_identifier = $$simulator.deployment_identifier
- sysroot_path = $$xcodeSDKInfo(Path, $$simulator.sdk)
- } else {
- version_identifier = $$device.deployment_identifier
- sysroot_path = $$xcodeSDKInfo(Path, $$device.sdk)
- }
- version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
- QMAKE_CFLAGS += -isysroot $$sysroot_path $$version_min_flag
- QMAKE_CXXFLAGS += -isysroot $$sysroot_path $$version_min_flag
- QMAKE_LFLAGS += -isysroot $$sysroot_path $$version_min_flag
- }
-
- # Enable precompiled headers for multiple architectures
- QMAKE_CFLAGS_USE_PRECOMPILE =
- for (arch, VALID_ARCHS) {
- icc_pch_style: \
- use_flag = "-pch-use "
- else: \
- use_flag = -include
-
- # Only use Xarch with multi-arch, as the option confuses ccache
- count(VALID_ARCHS, 1, greaterThan): \
- QMAKE_CFLAGS_USE_PRECOMPILE += \
- -Xarch_$${arch}
-
- QMAKE_CFLAGS_USE_PRECOMPILE += \
- $${use_flag}${QMAKE_PCH_OUTPUT_$${arch}}
- }
- icc_pch_style {
- QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE -include ${QMAKE_PCH_INPUT}
- QMAKE_CFLAGS_USE_PRECOMPILE =
- } else {
- QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
- QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
- QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
- }
-
- QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT}
-}
-
-!equals(sdk_version, $$QMAKE_MAC_SDK_VERSION) {
- # Explicit SDK version has been set, respect that
- QMAKE_LFLAGS += -Wl,-sdk_version -Wl,$$sdk_version
-}
-
-cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
-!isEmpty(QMAKE_XCODE_VERSION): \
- cache(QMAKE_XCODE_VERSION, stash)
-
-QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
-
-xcode_product_bundle_identifier_setting.name = PRODUCT_BUNDLE_IDENTIFIER
-xcode_product_bundle_identifier_setting.value = $$QMAKE_TARGET_BUNDLE_PREFIX
-isEmpty(xcode_product_bundle_identifier_setting.value): \
- xcode_product_bundle_identifier_setting.value = "com.yourcompany"
-xcode_product_bundle_target = $$QMAKE_BUNDLE
-isEmpty(xcode_product_bundle_target): \
- xcode_product_bundle_target = ${PRODUCT_NAME:rfc1034identifier}
-xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identifier_setting.value}.$${xcode_product_bundle_target}"
-QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
-
!macx-xcode {
generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode \"$(EXPORT__PRO_FILE_)\" $$QMAKE_ARGS
generate_xcode_project.target = xcodeproj
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index 2c91ba6679..a6ab233825 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -21,61 +21,3 @@ macos {
}
load(default_pre)
-
-isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
- # Get path of Xcode's Developer directory
- QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
- isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
- error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
-
- # Make sure Xcode path is valid
- !exists($$QMAKE_XCODE_DEVELOPER_PATH): \
- error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
-}
-
-isEmpty(QMAKE_XCODEBUILD_PATH): \
- QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")
-
-!isEmpty(QMAKE_XCODEBUILD_PATH) {
- # Make sure Xcode is set up properly
- !system("/usr/bin/xcrun xcodebuild -license check 2>/dev/null"): \
- error("Xcode not set up properly. You need to confirm the license agreement by running 'sudo xcrun xcodebuild -license accept'.")
-
- isEmpty(QMAKE_XCODE_VERSION) {
- # Extract Xcode version using xcodebuild
- xcode_version = $$system("/usr/bin/xcrun xcodebuild -version")
- QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
- isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
- unset(xcode_version)
- }
-}
-
-isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
- QMAKE_XCODE_PREFERENCES_FILE = $$(HOME)/Library/Preferences/com.apple.dt.Xcode.plist
- exists($$QMAKE_XCODE_PREFERENCES_FILE): \
- QMAKE_TARGET_BUNDLE_PREFIX = $$system("/usr/libexec/PlistBuddy -c 'print IDETemplateOptions:bundleIdentifierPrefix' $$QMAKE_XCODE_PREFERENCES_FILE 2>/dev/null")
-
- !isEmpty(_QMAKE_CACHE_):!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \
- cache(QMAKE_TARGET_BUNDLE_PREFIX)
-}
-
-QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon
-
-# Make the default debug info format for static debug builds
-# DWARF instead of DWARF with dSYM. This cuts down build times
-# for application debug builds significantly, as Xcode doesn't
-# have to pull out all the DWARF info from the Qt static libs
-# and put it into a dSYM file. We don't need that dSYM file in
-# the first place, since the information is available in the
-# object files inside the archives (static libraries).
-macx-xcode:qtConfig(static): \
- QMAKE_XCODE_DEBUG_INFORMATION_FORMAT = dwarf
-
-# This variable is used by the xcode_dynamic_library_suffix
-# feature, which allows Xcode to choose the Qt libraries to link to
-# at build time, depending on the current Xcode SDK and configuration.
-QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
-
-xcode_copy_phase_strip_setting.name = COPY_PHASE_STRIP
-xcode_copy_phase_strip_setting.value = NO
-QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting
diff --git a/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk
--- a/mkspecs/features/mac/sdk.mk
+++ b/mkspecs/features/mac/sdk.mk
@@ -1,27 +0,0 @@
-
-ifeq ($(QT_MAC_SDK_NO_VERSION_CHECK),)
- CHECK_SDK_COMMAND = /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version 2>/dev/null
- CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) $(CHECK_SDK_COMMAND))
- ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION))
- # We don't want to complain about out of date SDK unless the target needs to be remade.
- # This covers use-cases such as running 'make check' after moving the build to a
- # computer without Xcode or with a different Xcode version.
- TARGET_UP_TO_DATE := $(shell QT_MAC_SDK_NO_VERSION_CHECK=1 $(MAKE) --question $(QMAKE_TARGET) && echo 1 || echo 0)
- ifeq ($(TARGET_UP_TO_DATE),0)
- ifneq ($(findstring missing DEVELOPER_DIR path,$(CURRENT_MAC_SDK_VERSION)),)
- $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) is no longer valid.)
- else ifneq ($(findstring SDK "$(EXPORT_QMAKE_MAC_SDK)" cannot be located,$(CURRENT_MAC_SDK_VERSION)),)
- $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) no longer contains the $(EXPORT_QMAKE_MAC_SDK_VERSION) platform SDK.)
- else ifneq ($(CURRENT_MAC_SDK_VERSION),)
- $(info The $(EXPORT_QMAKE_MAC_SDK) platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).)
- else
- $(info Unknown error resolving current platform SDK version.)
- endif
- $(info This requires a fresh build of your project. Please wipe the build directory)
- ifneq ($(EXPORT__QMAKE_STASH_),)
- $(info including the qmake cache in $(EXPORT__QMAKE_STASH_))
- endif
- $(error ^)
- endif
- endif
-endif
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
deleted file mode 100644
index 3a9c2778bb..0000000000
--- a/mkspecs/features/mac/sdk.prf
+++ /dev/null
@@ -1,61 +0,0 @@
-
-isEmpty(QMAKE_MAC_SDK): \
- error("QMAKE_MAC_SDK must be set when using CONFIG += sdk.")
-
-contains(QMAKE_MAC_SDK, .*/.*): \
- error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)")
-
-defineReplace(xcodeSDKInfo) {
- info = $$1
- equals(info, "Path"): \
- infoarg = --show-sdk-path
- equals(info, "PlatformPath"): \
- infoarg = --show-sdk-platform-path
- equals(info, "SDKVersion"): \
- infoarg = --show-sdk-version
- sdk = $$2
- isEmpty(sdk): \
- sdk = $$QMAKE_MAC_SDK
-
- isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) {
- QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$infoarg 2>/dev/null")
- # --show-sdk-platform-path won't work for Command Line Tools; this is fine
- # only used by the XCTest backend to testlib
- isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(infoarg, "--show-sdk-platform-path")): \
- error("Could not resolve SDK $$info for \'$$sdk\' using $$infoarg")
- cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info})
- }
-
- return($$eval(QMAKE_MAC_SDK.$${sdk}.$${info}))
-}
-
-QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path)
-QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath)
-QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
-
-isEmpty(QMAKE_EXPORT_INCDIR_OPENGL) {
- QMAKE_EXPORT_INCDIR_OPENGL = $$QMAKE_INCDIR_OPENGL
- sysrootified =
- for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
- QMAKE_INCDIR_OPENGL = $$sysrootified
-}
-
-QMAKESPEC_NAME = $$basename(QMAKESPEC)
-
-# Resolve SDK version of various tools
-for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_ACTOOL QMAKE_LINK_C QMAKE_LINK_C_SHLIB)) {
- tool_variable = QMAKE_MAC_SDK.$${QMAKESPEC_NAME}.$${QMAKE_MAC_SDK}.$${tool}
- !isEmpty($$tool_variable) {
- $$tool = $$eval($$tool_variable)
- next()
- }
-
- value = $$eval($$tool)
- isEmpty(value): next()
-
- sysrooted = $$system("/usr/bin/xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
- isEmpty(sysrooted): next()
-
- $$tool = $$sysrooted $$member(value, 1, -1)
- cache($$tool_variable, set stash, $$tool)
-}
diff --git a/mkspecs/features/mac/toolchain.prf b/mkspecs/features/mac/toolchain.prf
deleted file mode 100644
index df191eb13c..0000000000
--- a/mkspecs/features/mac/toolchain.prf
+++ /dev/null
@@ -1,5 +0,0 @@
-# Ensure that we process sdk.prf first, as it will update QMAKE_CXX,
-# which the default path determination uses.
-sdk: load(sdk)
-
-load(toolchain)

View File

@ -0,0 +1,490 @@
From 03a5a7eab673d18d00c9b5eb8c7d5b790079e8ff Mon Sep 17 00:00:00 2001
From: OPNA2608 <christoph.neidahl@gmail.com>
Date: Mon, 12 Apr 2021 20:20:46 +0200
Subject: [PATCH 03/11] qtbase-mkspecs
---
mkspecs/features/create_cmake.prf | 51 +++---------
.../data/cmake/Qt5BasicConfig.cmake.in | 80 +------------------
mkspecs/features/qml_module.prf | 2 +-
mkspecs/features/qml_plugin.prf | 2 +-
mkspecs/features/qt_app.prf | 2 +-
mkspecs/features/qt_build_paths.prf | 4 +-
mkspecs/features/qt_docs.prf | 10 +--
mkspecs/features/qt_example_installs.prf | 2 +-
mkspecs/features/qt_functions.prf | 27 ++++---
mkspecs/features/qt_installs.prf | 22 ++---
mkspecs/features/qt_plugin.prf | 2 +-
11 files changed, 52 insertions(+), 152 deletions(-)
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index 24ed125f12..f0666a1986 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -21,7 +21,7 @@ load(cmake_functions)
# at cmake time whether package has been found via a symlink, and correct
# that to an absolute path. This is only done for installations to
# the /usr or / prefix.
-CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$[QT_INSTALL_LIBS])
+CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$NIX_OUTPUT_OUT/lib/)
contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND = $$CMAKE_INSTALL_LIBS_DIR
CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake
@@ -77,45 +77,20 @@ split_incpath {
$$cmake_extra_source_includes.output
}
-CMAKE_INCLUDE_DIR = $$cmakeRelativePath($$[QT_INSTALL_HEADERS], $$[QT_INSTALL_PREFIX])
-contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") {
- CMAKE_INCLUDE_DIR = $$[QT_INSTALL_HEADERS]/
- CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
-}
+CMAKE_INCLUDE_DIR = $$NIX_OUTPUT_DEV/include/
+CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
-CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
-contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
- CMAKE_LIB_DIR = $$[QT_INSTALL_LIBS]/
- CMAKE_LIB_DIR_IS_ABSOLUTE = True
-} else {
- CMAKE_RELATIVE_INSTALL_LIBS_DIR = $$cmakeRelativePath($$[QT_INSTALL_PREFIX], $$[QT_INSTALL_LIBS])
- # We need to go up another two levels because the CMake files are
- # installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
- CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}../../"
-}
+CMAKE_BIN_DIR = $$NIX_OUTPUT_BIN/bin/
+CMAKE_BIN_DIR_IS_ABSOLUTE = True
-CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
-contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
- CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
- CMAKE_BIN_DIR_IS_ABSOLUTE = True
-}
+CMAKE_LIB_DIR = $$NIX_OUTPUT_OUT/lib/
+CMAKE_LIB_DIR_IS_ABSOLUTE = True
-CMAKE_PLUGIN_DIR = $$cmakeRelativePath($$[QT_INSTALL_PLUGINS], $$[QT_INSTALL_PREFIX])
-contains(CMAKE_PLUGIN_DIR, "^\\.\\./.*") {
- CMAKE_PLUGIN_DIR = $$[QT_INSTALL_PLUGINS]/
- CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
-}
+CMAKE_PLUGIN_DIR = $$NIX_OUTPUT_PLUGIN/
+CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
-win32:!static:!staticlib {
- CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX])
- contains(CMAKE_DLL_DIR, "^\\.\\./.*") {
- CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/
- CMAKE_DLL_DIR_IS_ABSOLUTE = True
- }
-} else {
- CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
- CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
-}
+CMAKE_DLL_DIR = $$NIX_OUTPUT_OUT/lib/
+CMAKE_DLL_DIR_IS_ABSOLUTE = True
static|staticlib:CMAKE_STATIC_TYPE = true
@@ -258,7 +233,7 @@ contains(CONFIG, plugin) {
cmake_qt5_plugin_file.files = $$cmake_target_file.output
static|staticlib: cmake_qt5_plugin_file.files += $$cmake_qt5_plugin_import_file.output
- cmake_qt5_plugin_file.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
+ cmake_qt5_plugin_file.path = $$NIX_OUTPUT_OUT/lib/cmake/Qt5$${CMAKE_MODULE_NAME}
INSTALLS += cmake_qt5_plugin_file
return()
@@ -400,7 +375,7 @@ exists($$cmake_macros_file.input) {
cmake_qt5_module_files.files += $$cmake_macros_file.output
}
-cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
+cmake_qt5_module_files.path = $$NIX_OUTPUT_OUT/lib/cmake/Qt5$${CMAKE_MODULE_NAME}
# We are generating cmake files. Most developers of Qt are not aware of cmake,
# so we require automatic tests to be available. The only module which should
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index db18dbece6..8246f37931 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -2,30 +2,6 @@ if (CMAKE_VERSION VERSION_LESS 3.1.0)
message(FATAL_ERROR \"Qt 5 $${CMAKE_MODULE_NAME} module requires at least CMake version 3.1.0\")
endif()
-!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
-!!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
-set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
-!!ELSE
-get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)
-# Use original install prefix when loaded through a
-# cross-prefix symbolic link such as /lib -> /usr/lib.
-get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH)
-get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5$${CMAKE_MODULE_NAME}\" REALPATH)
-if(_realCurr STREQUAL _realOrig)
- get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR/$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}\" ABSOLUTE)
-else()
- get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
-endif()
-unset(_realOrig)
-unset(_realCurr)
-unset(_IMPORT_PREFIX)
-!!ENDIF
-!!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
-get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
-!!ELSE
-set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
-!!ENDIF
-
!!IF !equals(TEMPLATE, aux)
# For backwards compatibility only. Use Qt5$${CMAKE_MODULE_NAME}_VERSION instead.
set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.VERSION)")
@@ -145,11 +121,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
IsDebugAndRelease)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
-!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-!!ELSE
set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
set(_deps
${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}
@@ -209,11 +181,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
!!ENDIF
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
-!!ELSE
set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
-!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
@@ -229,24 +197,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!IF !no_module_headers
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework\"
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Headers\"
+ \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework\"
+ \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Headers\"
)
!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
- )
-!!ELSE
- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
-!!ENDIF
-!!ELSE
-!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
- set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
-!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
+ \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, .,0, 0)/Headers/$$VERSION/\"
+ \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, .,0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
)
!!ELSE
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
@@ -262,7 +219,6 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
!!ENDIF
!!ENDIF
-!!ENDIF
!!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS)
include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL)
!!ENDIF
@@ -491,25 +447,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
!!IF isEmpty(CMAKE_DEBUG_TYPE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
-!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
-!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
_populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" $${CMAKE_DEBUG_AND_RELEASE})
!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
if (EXISTS
-!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
-!!ELSE
\"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
-!!ENDIF
AND EXISTS
-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
-!!ELSE
\"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
-!!ENDIF
_populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
endif()
@@ -528,25 +472,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
!!IF isEmpty(CMAKE_RELEASE_TYPE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
-!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
-!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
_populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" $${CMAKE_DEBUG_AND_RELEASE})
!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
if (EXISTS
-!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
-!!ELSE
\"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
-!!ENDIF
AND EXISTS
-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
-!!ELSE
\"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
-!!ENDIF
_populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
endif()
@@ -573,11 +505,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
IsDebugAndRelease)
set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
-!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
-!!ELSE
set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
-!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
set_target_properties(Qt5::${Plugin} PROPERTIES
\"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf
index 3d6cd9b3db..ca8b0b2701 100644
--- a/mkspecs/features/qml_module.prf
+++ b/mkspecs/features/qml_module.prf
@@ -51,7 +51,7 @@ builtin_resources {
# Install rules
qmldir.base = $$qmldir_path
qmldir.files = $$qmldir_file
-qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
+qmldir.path = $$NIX_OUTPUT_QML/$$TARGETPATH
qmlfiles.base = $$_PRO_FILE_PWD_
qmlfiles.files = $$fq_aux_qml_files
diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
index 1b67435787..24a1f78c17 100644
--- a/mkspecs/features/qml_plugin.prf
+++ b/mkspecs/features/qml_plugin.prf
@@ -50,7 +50,7 @@ load(qt_build_paths)
DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
-target.path = $$[QT_INSTALL_QML]/$$TARGETPATH
+target.path = $$NIX_OUTPUT_QML/$$TARGETPATH
INSTALLS += target
# Some final setup
diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
index 8354f30eea..62028fef8e 100644
--- a/mkspecs/features/qt_app.prf
+++ b/mkspecs/features/qt_app.prf
@@ -30,7 +30,7 @@ host_build:force_bootstrap {
target.path = $$[QT_HOST_BINS]
} else {
!build_pass:qtConfig(debug_and_release): CONFIG += release
- target.path = $$[QT_INSTALL_BINS]
+ target.path = $$NIX_OUTPUT_BIN/bin
CONFIG += relative_qt_rpath # Qt's tools and apps should be relocatable
}
INSTALLS += target
diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf
index 3bb3823a8e..655b7b7db8 100644
--- a/mkspecs/features/qt_build_paths.prf
+++ b/mkspecs/features/qt_build_paths.prf
@@ -24,6 +24,6 @@ exists($$MODULE_BASE_INDIR/.git): \
!force_independent {
# If the module is not built independently, everything ends up in qtbase.
# This is the case in non-prefix builds, except for selected modules.
- MODULE_BASE_OUTDIR = $$[QT_HOST_PREFIX]
- MODULE_QMAKE_OUTDIR = $$[QT_HOST_PREFIX]
+ MODULE_BASE_OUTDIR = $$NIX_OUTPUT_OUT
+ MODULE_QMAKE_OUTDIR = $$NIX_OUTPUT_OUT
}
diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
index 095bf15dac..4cc977bea5 100644
--- a/mkspecs/features/qt_docs.prf
+++ b/mkspecs/features/qt_docs.prf
@@ -65,7 +65,7 @@ QMAKE_DOCS_OUTPUTDIR = $$QMAKE_DOCS_BASE_OUTDIR/$$QMAKE_DOCS_TARGETDIR
QDOC += -outputdir $$shell_quote($$QMAKE_DOCS_OUTPUTDIR)
!build_online_docs: \
- QDOC += -installdir $$shell_quote($$[QT_INSTALL_DOCS])
+ QDOC += -installdir $$shell_quote($$NIX_OUTPUT_DOC)
PREP_DOC_INDEXES =
DOC_INDEXES =
!isEmpty(QTREPOS) {
@@ -84,8 +84,8 @@ DOC_INDEXES =
DOC_INDEXES += -indexdir $$shell_quote($$qrep/doc)
} else {
prepare_docs: \
- PREP_DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
- DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
+ PREP_DOC_INDEXES += -indexdir $$shell_quote($$NIX_OUTPUT_DOC)
+ DOC_INDEXES += -indexdir $$shell_quote($$NIX_OUTPUT_DOC)
}
qtattributionsscanner.target = qtattributionsscanner
@@ -108,12 +108,12 @@ prepare_docs {
qch_docs.commands = $$QHELPGENERATOR $$shell_quote($$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp) -o $$shell_quote($$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch)
inst_html_docs.files = $$QMAKE_DOCS_OUTPUTDIR
- inst_html_docs.path = $$[QT_INSTALL_DOCS]
+ inst_html_docs.path = $$NIX_OUTPUT_DOC
inst_html_docs.CONFIG += no_check_exist directory no_default_install no_build
INSTALLS += inst_html_docs
inst_qch_docs.files = $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
- inst_qch_docs.path = $$[QT_INSTALL_DOCS]
+ inst_qch_docs.path = $$NIX_OUTPUT_DOC
inst_qch_docs.CONFIG += no_check_exist no_default_install no_build
INSTALLS += inst_qch_docs
diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf
index 15b373ba40..5c373fe1d5 100644
--- a/mkspecs/features/qt_example_installs.prf
+++ b/mkspecs/features/qt_example_installs.prf
@@ -91,7 +91,7 @@ sourcefiles += \
$$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
$$DBUS_ADAPTORS $$DBUS_INTERFACES
addInstallFiles(sources.files, $$sourcefiles)
-sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
+sources.path = $$NIX_OUTPUT_DEV/share/examples/$$probase
INSTALLS += sources
check_examples {
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 7777e615bd..b0c6880a74 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -87,19 +87,22 @@ defineTest(qtHaveModule) {
defineTest(qtPrepareTool) {
cmd = $$eval(QT_TOOL.$${2}.binary)
isEmpty(cmd) {
- cmd = $$[QT_HOST_BINS]/$$2
- exists($${cmd}.pl) {
- $${1}_EXE = $${cmd}.pl
- cmd = perl -w $$system_path($${cmd}.pl)
- } else: contains(QMAKE_HOST.os, Windows) {
- $${1}_EXE = $${cmd}.exe
- cmd = $$system_path($${cmd}.exe)
- } else:contains(QMAKE_HOST.os, Darwin) {
- BUNDLENAME = $${cmd}.app/Contents/MacOS/$$2
- exists($$BUNDLENAME) {
- cmd = $$BUNDLENAME
+ cmd = $$system("command -v $${2}")
+ isEmpty(cmd) {
+ cmd = $$system("command -v $${2}.pl")
+ !isEmpty(cmd) {
+ $${1}_EXE = $$cmd
+ cmd = perl -w $$system_path($${cmd})
+ } else: contains(QMAKE_HOST.os, Windows) {
+ cmd = $$system("command -v $${2}.exe")
+ $${1}_EXE = $$cmd
+ } else: contains(QMAKE_HOST.os, Darwin) {
+ cmd = $$system("command -v $${2}.app")
+ !isEmpty(cmd) {
+ cmd = $${cmd}/Contents/MacOS/$${2}
+ $${1}_EXE = $$cmd
+ }
}
- $${1}_EXE = $$cmd
} else {
$${1}_EXE = $$cmd
}
diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf
index 1ebca17366..a8f958eae8 100644
--- a/mkspecs/features/qt_installs.prf
+++ b/mkspecs/features/qt_installs.prf
@@ -12,16 +12,10 @@
#library
!qt_no_install_library {
win32 {
- host_build: \
- dlltarget.path = $$[QT_HOST_BINS]
- else: \
- dlltarget.path = $$[QT_INSTALL_BINS]
+ dlltarget.path = $$NIX_OUTPUT_BIN/bin
INSTALLS += dlltarget
}
- host_build: \
- target.path = $$[QT_HOST_LIBS]
- else: \
- target.path = $$[QT_INSTALL_LIBS]
+ target.path = $$NIX_OUTPUT_OUT/lib
!static: target.CONFIG = no_dll
INSTALLS += target
}
@@ -29,35 +23,35 @@
#headers
qt_install_headers {
gen_headers.files = $$SYNCQT.GENERATED_HEADER_FILES
- gen_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME
+ gen_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME
INSTALLS += gen_headers
targ_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.INJECTED_HEADER_FILES
- targ_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME
+ targ_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME
INSTALLS += targ_headers
private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.INJECTED_PRIVATE_HEADER_FILES
- private_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/private
+ private_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/private
generated_privates: \
private_headers.CONFIG += no_check_exist
INSTALLS += private_headers
qpa_headers.files = $$SYNCQT.QPA_HEADER_FILES
- qpa_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/qpa
+ qpa_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/qpa
INSTALLS += qpa_headers
}
#module
qt_install_module {
!isEmpty(MODULE_PRI) {
- pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
+ pritarget.path = $$NIX_OUTPUT_DEV/mkspecs/modules
pritarget.files = $$MODULE_PRI
INSTALLS += pritarget
} else: isEmpty(MODULE_PRIVATE_PRI) {
warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects.")
}
!isEmpty(MODULE_PRIVATE_PRI) {
- privpritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
+ privpritarget.path = $$NIX_OUTPUT_DEV/mkspecs/modules
privpritarget.files = $$MODULE_PRIVATE_PRI
INSTALLS += privpritarget
}
diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
index 573d717eea..024c624cb6 100644
--- a/mkspecs/features/qt_plugin.prf
+++ b/mkspecs/features/qt_plugin.prf
@@ -88,7 +88,7 @@ CONFIG(static, static|shared)|prefix_build {
}
}
-target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
+target.path = $$NIX_OUTPUT_PLUGIN/$$PLUGIN_TYPE
INSTALLS += target
qt_libinfix_plugins: TARGET = $$TARGET$$QT_LIBINFIX
--
2.29.3

View File

@ -0,0 +1,68 @@
From 30d3906ff5e8671e9c97c5336c6c549656c0e293 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
Date: Sat, 4 Apr 2020 00:27:41 +0200
Subject: [PATCH 04/11] qtbase-replace-libdir
---
mkspecs/features/qt_common.prf | 20 ++------------------
mkspecs/features/qt_module.prf | 5 +----
2 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index 8df94aa4ee..414029f31c 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -31,32 +31,16 @@ contains(TEMPLATE, .*lib)|contains(TEMPLATE, aux) {
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
else: \
rplbase = $$MODULE_BASE_OUTDIR
- host_build {
- qqt_libdir = \$\$\$\$[QT_HOST_LIBS]
- qt_libdir = $$[QT_HOST_LIBS]
- } else {
- qqt_libdir = \$\$\$\$[QT_INSTALL_LIBS]
- qt_libdir = $$[QT_INSTALL_LIBS]
- }
+ qt_libdir = $$NIX_OUTPUT_OUT/lib
contains(QMAKE_DEFAULT_LIBDIRS, $$qt_libdir) {
- lib_replace0.match = $$rplbase/lib/
- lib_replace0.replace = $$qqt_libdir/
- lib_replace0.CONFIG = path
- QMAKE_PRL_INSTALL_REPLACE += lib_replace0
lib_replace.match = "[^ ']*$$rplbase/lib"
lib_replace.replace =
} else {
lib_replace.match = $$rplbase/lib
- lib_replace.replace = $$qqt_libdir
+ lib_replace.replace = $$qt_libdir
}
lib_replace.CONFIG = path
QMAKE_PRL_INSTALL_REPLACE += lib_replace
- !equals(qt_libdir, $$rplbase/lib) {
- qtlibdir_replace.match = $$qt_libdir
- qtlibdir_replace.replace = $$qqt_libdir
- qtlibdir_replace.CONFIG = path
- QMAKE_PRL_INSTALL_REPLACE += qtlibdir_replace
- }
}
contains(TEMPLATE, .*lib)|darwin {
if(!host_build|!cross_compile):qtConfig(reduce_exports): CONFIG += hide_symbols
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 828a9621b9..b9e5d35026 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -305,10 +305,7 @@ load(qt_targets)
}
!lib_bundle:unix {
CONFIG += create_libtool
- host_build: \
- QMAKE_LIBTOOL_LIBDIR = $$[QT_HOST_LIBS]
- else: \
- QMAKE_LIBTOOL_LIBDIR = "=$$[QT_INSTALL_LIBS/raw]"
+ QMAKE_LIBTOOL_LIBDIR = $$NIX_OUTPUT_OUT/lib
!isEmpty(lib_replace0.match) {
ltlib_replace0.match = $$lib_replace0.match
ltlib_replace0.replace = $$QMAKE_LIBTOOL_LIBDIR/
--
2.25.4

View File

@ -0,0 +1,194 @@
From 7871fbcefc7596a458cec005edafd9d4962baea3 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@mailbox.org>
Date: Tue, 17 Sep 2019 05:34:28 -0500
Subject: [PATCH 05/11] qtbase-cmake
---
mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 2 +-
mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in | 4 ++--
src/corelib/Qt5CoreConfigExtras.cmake.in | 10 +++++-----
src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in | 2 +-
.../Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in | 2 +-
src/dbus/Qt5DBusConfigExtras.cmake.in | 12 ++----------
src/gui/Qt5GuiConfigExtras.cmake.in | 6 +++---
src/widgets/Qt5WidgetsConfigExtras.cmake.in | 2 +-
8 files changed, 16 insertions(+), 24 deletions(-)
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index b6c3ab8609..edb6a89316 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -513,7 +513,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
IsDebugAndRelease)
set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
- set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
+ set(imported_location \"${PLUGIN_LOCATION}\")
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
set_target_properties(Qt5::${Plugin} PROPERTIES
\"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
diff --git a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
index b550a52c60..dbd3243885 100644
--- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
@@ -53,10 +53,10 @@ set_property(TARGET Qt5::$$CMAKE_PLUGIN_NAME PROPERTY INTERFACE_SOURCES
!!ENDIF
!!IF !isEmpty(CMAKE_RELEASE_TYPE)
-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF
list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 4c1c3a612b..bb8ab08143 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -6,7 +6,7 @@ if (NOT TARGET Qt5::qmake)
add_executable(Qt5::qmake IMPORTED)
!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
+ set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
!!ELSE
set(imported_location \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
!!ENDIF
@@ -21,7 +21,7 @@ if (NOT TARGET Qt5::moc)
add_executable(Qt5::moc IMPORTED)
!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
+ set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
!!ELSE
set(imported_location \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
!!ENDIF
@@ -38,7 +38,7 @@ if (NOT TARGET Qt5::rcc)
add_executable(Qt5::rcc IMPORTED)
!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
+ set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
!!ELSE
set(imported_location \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
!!ENDIF
@@ -121,7 +121,7 @@ if (NOT TARGET Qt5::WinMain)
!!IF !isEmpty(CMAKE_RELEASE_TYPE)
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
+ set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
!!ELSE
set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
!!ENDIF
@@ -135,7 +135,7 @@ if (NOT TARGET Qt5::WinMain)
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
+ set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
!!ELSE
set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
!!ENDIF
diff --git a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
index c357237d0e..6f0c75de3c 100644
--- a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
@@ -1,6 +1,6 @@
!!IF isEmpty(CMAKE_HOST_DATA_DIR_IS_ABSOLUTE)
-set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
+set(_qt5_corelib_extra_includes \"$$NIX_OUTPUT_DEV/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
!!ELSE
set(_qt5_corelib_extra_includes \"$${CMAKE_HOST_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
!!ENDIF
diff --git a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
index 706304cf34..546420f6ad 100644
--- a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
@@ -1,6 +1,6 @@
!!IF isEmpty(CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE)
-set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
+set(_qt5_corelib_extra_includes \"$$NIX_OUTPUT_DEV/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
!!ELSE
set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
!!ENDIF
diff --git a/src/dbus/Qt5DBusConfigExtras.cmake.in b/src/dbus/Qt5DBusConfigExtras.cmake.in
index a814678f7b..b13b964ec8 100644
--- a/src/dbus/Qt5DBusConfigExtras.cmake.in
+++ b/src/dbus/Qt5DBusConfigExtras.cmake.in
@@ -2,11 +2,7 @@
if (NOT TARGET Qt5::qdbuscpp2xml)
add_executable(Qt5::qdbuscpp2xml IMPORTED)
-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
-!!ELSE
- set(imported_location \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
-!!ENDIF
+ set(imported_location \"$$NIX_OUTPUT_DEV/bin/qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
_qt5_DBus_check_file_exists(${imported_location})
set_target_properties(Qt5::qdbuscpp2xml PROPERTIES
@@ -17,11 +13,7 @@ endif()
if (NOT TARGET Qt5::qdbusxml2cpp)
add_executable(Qt5::qdbusxml2cpp IMPORTED)
-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
-!!ELSE
- set(imported_location \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
-!!ENDIF
+ set(imported_location \"$$NIX_OUTPUT_DEV/bin/qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
_qt5_DBus_check_file_exists(${imported_location})
set_target_properties(Qt5::qdbusxml2cpp PROPERTIES
diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
index 84dbbfebd4..8ad0720c5c 100644
--- a/src/gui/Qt5GuiConfigExtras.cmake.in
+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
@@ -2,7 +2,7 @@
!!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
-set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\")
+set(Qt5Gui_EGL_INCLUDE_DIRS \"$$NIX_OUTPUT_DEV/$$CMAKE_INCLUDE_DIR/QtANGLE\")
!!ELSE
set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\")
!!ENDIF
@@ -17,13 +17,13 @@ macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATIO
set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+ set(imported_location \"$$NIX_OUTPUT_OUT/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
!!ELSE
set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
!!ENDIF
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+ set(imported_implib \"$$NIX_OUTPUT_OUT/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
!!ELSE
set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
!!ENDIF
diff --git a/src/widgets/Qt5WidgetsConfigExtras.cmake.in b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
index 83d8004a08..ca0b8e4bfb 100644
--- a/src/widgets/Qt5WidgetsConfigExtras.cmake.in
+++ b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::uic)
add_executable(Qt5::uic IMPORTED)
!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
+ set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
!!ELSE
set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
!!ENDIF
--
2.25.4

View File

@ -0,0 +1,48 @@
From 7a9f4f875053aed8ab387161eea623bf8325cfa8 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@mailbox.org>
Date: Tue, 17 Sep 2019 05:35:33 -0500
Subject: [PATCH 06/11] qtbase-gtk3
---
src/plugins/platformthemes/gtk3/main.cpp | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/plugins/platformthemes/gtk3/main.cpp b/src/plugins/platformthemes/gtk3/main.cpp
index 860fc3a26e..8cd4663d49 100644
--- a/src/plugins/platformthemes/gtk3/main.cpp
+++ b/src/plugins/platformthemes/gtk3/main.cpp
@@ -39,6 +39,7 @@
#include <qpa/qplatformthemeplugin.h>
#include "qgtk3theme.h"
+#include <QFile>
QT_BEGIN_NAMESPACE
@@ -54,8 +55,22 @@ public:
QPlatformTheme *QGtk3ThemePlugin::create(const QString &key, const QStringList &params)
{
Q_UNUSED(params);
- if (!key.compare(QLatin1String(QGtk3Theme::name), Qt::CaseInsensitive))
+ if (!key.compare(QLatin1String(QGtk3Theme::name), Qt::CaseInsensitive)) {
+
+#ifdef NIXPKGS_QGTK3_XDG_DATA_DIRS
+ QStringList XDG_DATA_DIRS = QFile::decodeName(qgetenv("XDG_DATA_DIRS")).split(':');
+ XDG_DATA_DIRS << QLatin1String(NIXPKGS_QGTK3_XDG_DATA_DIRS);
+ qputenv("XDG_DATA_DIRS", QFile::encodeName(XDG_DATA_DIRS.join(':')));
+#endif
+
+#ifdef NIXPKGS_QGTK3_GIO_EXTRA_MODULES
+ QStringList GIO_EXTRA_MODULES = QFile::decodeName(qgetenv("GIO_EXTRA_MODULES")).split(':');
+ GIO_EXTRA_MODULES << QLatin1String(NIXPKGS_QGTK3_GIO_EXTRA_MODULES);
+ qputenv("GIO_EXTRA_MODULES", QFile::encodeName(GIO_EXTRA_MODULES.join(':')));
+#endif
+
return new QGtk3Theme;
+ }
return nullptr;
}
--
2.25.4

View File

@ -0,0 +1,29 @@
From 707098eada20ba074e642a73248de74407bc261c Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@mailbox.org>
Date: Tue, 17 Sep 2019 05:35:58 -0500
Subject: [PATCH 07/11] qtbase-xcursor
---
src/plugins/platforms/xcb/qxcbcursor.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index 42c7a52bd4..ba670ddb44 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -317,10 +317,10 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
static bool function_ptrs_not_initialized = true;
if (function_ptrs_not_initialized) {
- QLibrary xcursorLib(QLatin1String("Xcursor"), 1);
+ QLibrary xcursorLib(QLatin1String(NIXPKGS_LIBXCURSOR), 1);
bool xcursorFound = xcursorLib.load();
if (!xcursorFound) { // try without the version number
- xcursorLib.setFileName(QLatin1String("Xcursor"));
+ xcursorLib.setFileName(QLatin1String(NIXPKGS_LIBXCURSOR));
xcursorFound = xcursorLib.load();
}
if (xcursorFound) {
--
2.25.4

View File

@ -0,0 +1,64 @@
From da003b582ee8823b29b1ff5c0aca8e06e7741b94 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@mailbox.org>
Date: Tue, 17 Sep 2019 05:36:25 -0500
Subject: [PATCH 08/11] qtbase-tzdir
---
src/corelib/time/qtimezoneprivate_tz.cpp | 31 +++++++++++++++---------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
index 01f9a6cce0..910338205a 100644
--- a/src/corelib/time/qtimezoneprivate_tz.cpp
+++ b/src/corelib/time/qtimezoneprivate_tz.cpp
@@ -77,7 +77,11 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
// Parse zone.tab table, assume lists all installed zones, if not will need to read directories
static QTzTimeZoneHash loadTzTimeZones()
{
- QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
+ // Try TZDIR first, in case we're running on NixOS.
+ QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab");
+ // Fallback to traditional paths in case we are not on NixOS.
+ if (!QFile::exists(path))
+ path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
if (!QFile::exists(path))
path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
@@ -672,20 +676,23 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
if (!tzif.open(QIODevice::ReadOnly))
return ret;
} else {
- // Open named tz, try modern path first, if fails try legacy path
- tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
+ // Try TZDIR first, in case we're running on NixOS
+ tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId));
if (!tzif.open(QIODevice::ReadOnly)) {
- tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
+ tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
if (!tzif.open(QIODevice::ReadOnly)) {
- // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
- const QByteArray zoneInfo = ianaId.split(',').at(0);
- const char *begin = zoneInfo.constBegin();
- if (PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset()
- && (begin == zoneInfo.constEnd()
- || PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset())) {
- ret.m_posixRule = ianaId;
+ tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
+ if (!tzif.open(QIODevice::ReadOnly)) {
+ // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
+ const QByteArray zoneInfo = ianaId.split(',').at(0);
+ const char *begin = zoneInfo.constBegin();
+ if (PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset()
+ && (begin == zoneInfo.constEnd()
+ || PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset())) {
+ ret.m_posixRule = ianaId;
+ }
+ return ret;
}
- return ret;
}
}
}
--
2.25.4

View File

@ -0,0 +1,33 @@
From 9fc6efaf774a8716932c98c0b0ea6408ed2614c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
Date: Sun, 10 May 2020 12:47:28 +0200
Subject: [PATCH 09/11] qtbase-qtpluginpath
---
src/corelib/kernel/qcoreapplication.cpp | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 5fdcc9b914..1a126ef359 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2691,6 +2691,16 @@ QStringList QCoreApplication::libraryPathsLocked()
QStringList *app_libpaths = new QStringList;
coreappdata()->app_libpaths.reset(app_libpaths);
+ // Add library paths derived from PATH
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
+ const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
+ for (const QString &path: paths) {
+ if (!path.isEmpty()) {
+ app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
+ }
+ }
+
+
auto setPathsFromEnv = [&](QString libPathEnv) {
if (!libPathEnv.isEmpty()) {
QStringList paths = libPathEnv.split(QDir::listSeparator(), Qt::SkipEmptyParts);
--
2.25.4

View File

@ -0,0 +1,32 @@
From 015845b3c320d02691f28373097d1e6dbbac79f7 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@mailbox.org>
Date: Tue, 17 Sep 2019 05:37:04 -0500
Subject: [PATCH 10/11] qtbase-assert
---
src/testlib/qtestassert.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/testlib/qtestassert.h b/src/testlib/qtestassert.h
index 6498ea84ef..d821ced7fc 100644
--- a/src/testlib/qtestassert.h
+++ b/src/testlib/qtestassert.h
@@ -44,10 +44,13 @@
QT_BEGIN_NAMESPACE
-
+#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
+#define QTEST_ASSERT(cond) do { } while ((false) && (cond))
+#define QTEST_ASSERT_X(cond, where, what) do { } while ((false) && (cond))
+#else
#define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (false)
-
#define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (false)
+#endif
QT_END_NAMESPACE
--
2.25.4

View File

@ -0,0 +1,22 @@
From 2bce8511877db1db532e1437e7140b1d55633f86 Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Mon, 30 Sep 2019 20:15:40 -0500
Subject: [PATCH 11/11] fix header_module
---
mkspecs/features/qt_module.prf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 0b2a30d159..37271e09d9 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -84,7 +84,7 @@ header_module {
qt_no_install_library
# Allow creation of .prl, .la and .pc files.
- target.path = $$[QT_INSTALL_LIBS]
+ target.path = $$NIX_OUTPUT_OUT/lib
target.CONFIG += dummy_install
INSTALLS += target
} else {

View File

@ -0,0 +1,15 @@
diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
index 84dbbfebd4..615bfed124 100644
--- a/src/gui/Qt5GuiConfigExtras.cmake.in
+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
@@ -119,6 +119,10 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
endif()
+ set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}.tbd")
+ if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
+ set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
+ endif()
!!ENDIF
if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
# The above find_library call doesn\'t work for finding

View File

@ -0,0 +1,275 @@
From abc52460201bc5c7603505bb187138b0c59291aa Mon Sep 17 00:00:00 2001
From: Mushroom <mushroom@watchingyour.tv>
Date: Sun, 20 Dec 2020 00:11:41 +0000
Subject: [PATCH] [QtBase] Split macOS platforms by architecture
Currently macOS only has one platform, which forces the default arch to
x86_64. This patch splits the platforms by architecture, and defaults to
the same as the host.
This stops M1-based macs from compiling x64 binaries by default,
instead making them compile native binaries.
[ChangeLog][QtBase][Platform Specific Changes][OS X] Split macOS
platforms so it doesn't default to the x64 architecture every time
Change-Id: I34891b107bb24f68371df1c8f087eb0ad5b5dd95
---
configure | 9 +++-
.../clang-macx-desktop.conf} | 8 ++--
mkspecs/common/macx.conf | 1 -
.../Info.plist.app | 0
.../Info.plist.dSYM.in | 0
.../Info.plist.disable_highdpi | 0
.../Info.plist.lib | 0
mkspecs/macx-clang-arm64/qmake.conf | 7 ++++
.../qplatformdefs.h | 0
mkspecs/macx-clang-x64/Info.plist.app | 24 +++++++++++
mkspecs/macx-clang-x64/Info.plist.dSYM.in | 18 ++++++++
.../macx-clang-x64/Info.plist.disable_highdpi | 8 ++++
mkspecs/macx-clang-x64/Info.plist.lib | 20 +++++++++
mkspecs/macx-clang-x64/qmake.conf | 7 ++++
mkspecs/macx-clang-x64/qplatformdefs.h | 41 +++++++++++++++++++
15 files changed, 137 insertions(+), 6 deletions(-)
rename mkspecs/{macx-clang/qmake.conf => common/clang-macx-desktop.conf} (83%)
rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.app (100%)
rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.dSYM.in (100%)
rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.disable_highdpi (100%)
rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.lib (100%)
create mode 100644 mkspecs/macx-clang-arm64/qmake.conf
rename mkspecs/{macx-clang => macx-clang-arm64}/qplatformdefs.h (100%)
create mode 100644 mkspecs/macx-clang-x64/Info.plist.app
create mode 100644 mkspecs/macx-clang-x64/Info.plist.dSYM.in
create mode 100644 mkspecs/macx-clang-x64/Info.plist.disable_highdpi
create mode 100644 mkspecs/macx-clang-x64/Info.plist.lib
create mode 100644 mkspecs/macx-clang-x64/qmake.conf
create mode 100644 mkspecs/macx-clang-x64/qplatformdefs.h
diff --git a/configure b/configure
index b6c9b462f24..a86f2ceaa5b 100755
--- a/configure
+++ b/configure
@@ -556,7 +556,14 @@ PLATFORM_NOTES=
if [ -z "$PLATFORM" ]; then
case "$UNAME_SYSTEM:$UNAME_RELEASE" in
Darwin:*)
- PLATFORM=macx-clang
+ case "$UNAME_MACHINE" in
+ arm64)
+ PLATFORM=macx-clang-arm64
+ ;;
+ *)
+ PLATFORM=macx-clang-x64
+ ;;
+ esac
;;
AIX:*)
#PLATFORM=aix-g++
diff --git a/mkspecs/macx-clang/qmake.conf b/mkspecs/common/clang-macx-desktop.conf
similarity index 83%
rename from mkspecs/macx-clang/qmake.conf
rename to mkspecs/common/clang-macx-desktop.conf
index 0cf1f31b60d..042319a2aa3 100644
--- a/mkspecs/macx-clang/qmake.conf
+++ b/mkspecs/common/clang-macx-desktop.conf
@@ -24,9 +24,9 @@ QMAKE_LIBS_X11 = -lX11 -lXext -lm
QMAKE_LIBDIR_X11 = /opt/X11/lib
QMAKE_INCDIR_X11 = /opt/X11/include
-include(../common/macx.conf)
-include(../common/gcc-base-mac.conf)
-include(../common/clang.conf)
-include(../common/clang-mac.conf)
+include(macx.conf)
+include(gcc-base-mac.conf)
+include(clang.conf)
+include(clang-mac.conf)
load(qt_config)
diff --git a/mkspecs/macx-clang/Info.plist.app b/mkspecs/macx-clang-arm64/Info.plist.app
similarity index 100%
rename from mkspecs/macx-clang/Info.plist.app
rename to mkspecs/macx-clang-arm64/Info.plist.app
diff --git a/mkspecs/macx-clang/Info.plist.dSYM.in b/mkspecs/macx-clang-arm64/Info.plist.dSYM.in
similarity index 100%
rename from mkspecs/macx-clang/Info.plist.dSYM.in
rename to mkspecs/macx-clang-arm64/Info.plist.dSYM.in
diff --git a/mkspecs/macx-clang/Info.plist.disable_highdpi b/mkspecs/macx-clang-arm64/Info.plist.disable_highdpi
similarity index 100%
rename from mkspecs/macx-clang/Info.plist.disable_highdpi
rename to mkspecs/macx-clang-arm64/Info.plist.disable_highdpi
diff --git a/mkspecs/macx-clang/Info.plist.lib b/mkspecs/macx-clang-arm64/Info.plist.lib
similarity index 100%
rename from mkspecs/macx-clang/Info.plist.lib
rename to mkspecs/macx-clang-arm64/Info.plist.lib
diff --git a/mkspecs/macx-clang-arm64/qmake.conf b/mkspecs/macx-clang-arm64/qmake.conf
new file mode 100644
index 00000000000..0cc2361e696
--- /dev/null
+++ b/mkspecs/macx-clang-arm64/qmake.conf
@@ -0,0 +1,7 @@
+#
+# qmake configuration for Clang on OS X (arm64)
+#
+
+QMAKE_APPLE_DEVICE_ARCHS=arm64
+
+include(../common/clang-macx-desktop.conf)
diff --git a/mkspecs/macx-clang/qplatformdefs.h b/mkspecs/macx-clang-arm64/qplatformdefs.h
similarity index 100%
rename from mkspecs/macx-clang/qplatformdefs.h
rename to mkspecs/macx-clang-arm64/qplatformdefs.h
diff --git a/mkspecs/macx-clang-x64/Info.plist.app b/mkspecs/macx-clang-x64/Info.plist.app
new file mode 100644
index 00000000000..fa592af0897
--- /dev/null
+++ b/mkspecs/macx-clang-x64/Info.plist.app
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>${QMAKE_PKGINFO_TYPEINFO}</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>NOTE</key>
+ <string>This file was generated by Qt/QMake.</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+</dict>
+</plist>
diff --git a/mkspecs/macx-clang-x64/Info.plist.dSYM.in b/mkspecs/macx-clang-x64/Info.plist.dSYM.in
new file mode 100644
index 00000000000..a8c8d0d4fb5
--- /dev/null
+++ b/mkspecs/macx-clang-x64/Info.plist.dSYM.in
@@ -0,0 +1,18 @@
+<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+ <dict>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.$${BUNDLEIDENTIFIER}</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+!!IF !isEmpty(VERSION)
+ <key>CFBundleShortVersionString</key>
+ <string>$${VER_MAJ}.$${VER_MIN}</string>
+ <key>CFBundleVersion</key>
+ <string>$${VER_MAJ}.$${VER_MIN}.$${VER_PAT}</string>
+!!ENDIF
+ </dict>
+</plist>
diff --git a/mkspecs/macx-clang-x64/Info.plist.disable_highdpi b/mkspecs/macx-clang-x64/Info.plist.disable_highdpi
new file mode 100644
index 00000000000..a9b89888ad4
--- /dev/null
+++ b/mkspecs/macx-clang-x64/Info.plist.disable_highdpi
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>NSHighResolutionCapable</key>
+ <string>NO</string>
+</dict>
+</plist>
diff --git a/mkspecs/macx-clang-x64/Info.plist.lib b/mkspecs/macx-clang-x64/Info.plist.lib
new file mode 100644
index 00000000000..34752ec40d9
--- /dev/null
+++ b/mkspecs/macx-clang-x64/Info.plist.lib
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${QMAKE_SHORT_VERSION}</string>
+ <key>CFBundleSignature</key>
+ <string>${QMAKE_PKGINFO_TYPEINFO}</string>
+ <key>CFBundleVersion</key>
+ <string>${QMAKE_FULL_VERSION}</string>
+ <key>NOTE</key>
+ <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
+</dict>
+</plist>
diff --git a/mkspecs/macx-clang-x64/qmake.conf b/mkspecs/macx-clang-x64/qmake.conf
new file mode 100644
index 00000000000..1ac373b53b4
--- /dev/null
+++ b/mkspecs/macx-clang-x64/qmake.conf
@@ -0,0 +1,7 @@
+#
+# qmake configuration for Clang on OS X (arm64)
+#
+
+QMAKE_APPLE_DEVICE_ARCHS=x86_64
+
+include(../common/clang-macx-desktop.conf)
diff --git a/mkspecs/macx-clang-x64/qplatformdefs.h b/mkspecs/macx-clang-x64/qplatformdefs.h
new file mode 100644
index 00000000000..063491dd900
--- /dev/null
+++ b/mkspecs/macx-clang-x64/qplatformdefs.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the qmake spec of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../common/mac/qplatformdefs.h"
+

View File

@ -0,0 +1,13 @@
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 1d66e75..827567a 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -727,7 +727,7 @@ bool QQmlTypeLoader::Blob::isDebugging() const
bool QQmlTypeLoader::Blob::diskCacheEnabled() const
{
- return (!disableDiskCache() && !isDebugging()) || forceDiskCache();
+ return forceDiskCache();
}
bool QQmlTypeLoader::Blob::qmldirDataAvailable(const QQmlRefPointer<QQmlQmldirData> &data, QList<QQmlError> *errors)

View File

@ -0,0 +1,114 @@
diff --git a/src/particles/particles.pro b/src/particles/particles.pro
index aaaa83419a..58aee00036 100644
--- a/src/particles/particles.pro
+++ b/src/particles/particles.pro
@@ -20,6 +20,6 @@ QMLTYPES_FILENAME = plugins.qmltypes
QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Particles.2
QML_IMPORT_NAME = QtQuick.Particles
IMPORT_VERSION = 2.$$QT_MINOR_VERSION
-CONFIG += qmltypes install_qmltypes install_metatypes
+CONFIG += qmltypes install_qmltypes
load(qt_module)
diff --git a/src/qml/qml.pro b/src/qml/qml.pro
index e39a8319b6..90c0331278 100644
--- a/src/qml/qml.pro
+++ b/src/qml/qml.pro
@@ -72,6 +72,6 @@ QMLTYPES_FILENAME = plugins.qmltypes
QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQml
QML_IMPORT_NAME = QtQml
IMPORT_VERSION = 2.$$QT_MINOR_VERSION
-CONFIG += qmltypes install_qmltypes install_metatypes
+CONFIG += qmltypes install_qmltypes
load(qt_module)
diff --git a/src/qmlmodels/qmlmodels.pro b/src/qmlmodels/qmlmodels.pro
index 4ac093556d..112e2c2be0 100644
--- a/src/qmlmodels/qmlmodels.pro
+++ b/src/qmlmodels/qmlmodels.pro
@@ -68,6 +68,6 @@ QMLTYPES_FILENAME = plugins.qmltypes
QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQml/Models.2
QML_IMPORT_NAME = QtQml.Models
IMPORT_VERSION = 2.$$QT_MINOR_VERSION
-CONFIG += qmltypes install_qmltypes install_metatypes
+CONFIG += qmltypes install_qmltypes
load(qt_module)
diff --git a/src/qmltest/qmltest.pro b/src/qmltest/qmltest.pro
index c2e8068fc6..79dba368f7 100644
--- a/src/qmltest/qmltest.pro
+++ b/src/qmltest/qmltest.pro
@@ -34,7 +34,7 @@ QMLTYPES_FILENAME = plugins.qmltypes
QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/Qt/test/qtestroot
QML_IMPORT_NAME = Qt.test.qtestroot
QML_IMPORT_VERSION = 1.0
-CONFIG += qmltypes install_qmltypes install_metatypes
+CONFIG += qmltypes install_qmltypes
# Install qmldir
qmldir.files = $$PWD/qmldir
diff --git a/src/qmlworkerscript/qmlworkerscript.pro b/src/qmlworkerscript/qmlworkerscript.pro
index 84466062e1..79885455cc 100644
--- a/src/qmlworkerscript/qmlworkerscript.pro
+++ b/src/qmlworkerscript/qmlworkerscript.pro
@@ -23,6 +23,6 @@ QMLTYPES_FILENAME = plugins.qmltypes
QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQml/WorkerScript.2
QML_IMPORT_NAME = QtQml.WorkerScript
IMPORT_VERSION = 2.$$QT_MINOR_VERSION
-CONFIG += qmltypes install_qmltypes install_metatypes
+CONFIG += qmltypes install_qmltypes
load(qt_module)
diff --git a/src/quick/quick.pro b/src/quick/quick.pro
index f2d49cf939..c401b04c4e 100644
--- a/src/quick/quick.pro
+++ b/src/quick/quick.pro
@@ -52,4 +52,4 @@ QMLTYPES_FILENAME = plugins.qmltypes
QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick.2
QML_IMPORT_NAME = QtQuick
IMPORT_VERSION = 2.$$QT_MINOR_VERSION
-CONFIG += qmltypes install_qmltypes install_metatypes
+CONFIG += qmltypes install_qmltypes
diff --git a/src/quickshapes/quickshapes.pro b/src/quickshapes/quickshapes.pro
index 4dbd3e5e46..0c6b186fc8 100644
--- a/src/quickshapes/quickshapes.pro
+++ b/src/quickshapes/quickshapes.pro
@@ -36,4 +36,4 @@ QMLTYPES_FILENAME = plugins.qmltypes
QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Shapes
QML_IMPORT_NAME = QtQuick.Shapes
IMPORT_VERSION = 1.$$QT_MINOR_VERSION
-CONFIG += qmltypes install_qmltypes install_metatypes
+CONFIG += qmltypes install_qmltypes
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 005db4248..685c5b1b2 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1760,6 +1760,15 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
addImportPath(installImportsPath);
+ // Add import paths derived from PATH
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
+ const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
+ for (const QString &path: paths) {
+ if (!path.isEmpty()) {
+ addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir));
+ }
+ }
+
// env import paths
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
const QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH");
diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
index 537eaf62ea..e21de58f64 100644
--- a/tools/qmlcachegen/qmlcache.prf
+++ b/tools/qmlcachegen/qmlcache.prf
@@ -26,7 +26,7 @@ defineReplace(qmlCacheOutputFileName) {
}
qmlcacheinst.base = $$QMLCACHE_DESTDIR
-qmlcacheinst.path = $$[QT_INSTALL_QML]/$$TARGETPATH
+qmlcacheinst.path = $$NIX_OUTPUT_QML/$$TARGETPATH
qmlcacheinst.CONFIG = no_check_exist
qmlcachegen.input = CACHEGEN_FILES

View File

@ -0,0 +1,13 @@
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
index 1f6d25e..087c3fb 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
@@ -81,7 +81,7 @@
#include <pthread.h>
#elif PLATFORM(GTK)
#include <wtf/gtk/GOwnPtr.h>
-typedef struct _GMutex GMutex;
+typedef union _GMutex GMutex;
typedef struct _GCond GCond;
#endif

View File

@ -0,0 +1,22 @@
diff --git a/src/serialport/qtudev_p.h b/src/serialport/qtudev_p.h
index af2dab2..8e17f64 100644
--- a/src/serialport/qtudev_p.h
+++ b/src/serialport/qtudev_p.h
@@ -111,9 +111,17 @@ inline QFunctionPointer resolveSymbol(QLibrary *udevLibrary, const char *symbolN
inline bool resolveSymbols(QLibrary *udevLibrary)
{
if (!udevLibrary->isLoaded()) {
+#ifdef NIXPKGS_LIBUDEV
+ udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 1);
+#else
udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 1);
+#endif
if (!udevLibrary->load()) {
+#ifdef NIXPKGS_LIBUDEV
+ udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 0);
+#else
udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 0);
+#endif
if (!udevLibrary->load()) {
qWarning("Failed to load the library: %s, supported version(s): %i and %i", qPrintable(udevLibrary->fileName()), 1, 0);
return false;

View File

@ -0,0 +1,15 @@
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -1241,6 +1241,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
if (!QFile(qmlImportScannerPath).exists())
qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
+#ifdef NIXPKGS_QMLIMPORTSCANNER
+ // Fallback: Nixpkgs hardcoded path
+ if (!QFile(qmlImportScannerPath).exists())
+ qmlImportScannerPath = NIXPKGS_QMLIMPORTSCANNER;
+#endif
+
// Verify that we found a qmlimportscanner binary
if (!QFile(qmlImportScannerPath).exists()) {
LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;

View File

@ -0,0 +1,29 @@
diff --git a/configure.pri b/configure.pri
index e072961f0..ac0861c01 100644
--- a/configure.pri
+++ b/configure.pri
@@ -442,24 +442,6 @@ defineTest(qtwebengine_isWindowsPlatformSupported) {
}
defineTest(qtwebengine_isMacOsPlatformSupported) {
- !qtwebengine_isMinXcodeVersion(10, 0, 0) {
- qtwebengine_platformError("requires at least version 10.0.0, but using Xcode version $${QMAKE_XCODE_VERSION}.")
- return(false)
- }
- !clang|intel_icc {
- qtwebengine_platformError("requires Clang.")
- return(false)
- }
- # We require macOS 10.13 (darwin version 17.0.0) or newer.
- darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0)
- lessThan(darwin_major_version, 17) {
- qtwebengine_platformError("requires macOS version 10.13 or newer.")
- return(false)
- }
- !qtwebengine_isMinOSXSDKVersion(10, 13): {
- qtwebengine_platformError("requires a macOS SDK version of 10.13 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
- return(false)
- }
return(true)
}

View File

@ -0,0 +1,12 @@
diff a/src/buildtools/config/mac_osx.pri b/src/buildtools/config/mac_osx.pri
--- a/src/buildtools/config/mac_osx.pri
+++ b/src/buildtools/config/mac_osx.pri
@@ -5,8 +5,6 @@ load(functions)
# otherwise query for it.
QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion)
isEmpty(QMAKE_MAC_SDK_VERSION) {
- QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null")
- isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
}
# chromium/build/mac/find_sdk.py expects the SDK version (mac_sdk_min) in Major.Minor format.

View File

@ -0,0 +1,12 @@
diff a/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn b/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn
--- a/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn
+++ b/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn
@@ -184,8 +184,6 @@ template("mac_toolchain") {
# If dSYMs are enabled, this flag will be added to the link tools.
if (_enable_dsyms) {
dsym_switch = " -Wcrl,dsym,{{root_out_dir}} "
- dsym_switch += "-Wcrl,dsymutilpath," +
- "${prefix}dsymutil" + " "
dsym_output_dir =
"{{root_out_dir}}/{{target_output_name}}{{output_extension}}.dSYM"

View File

@ -0,0 +1,11 @@
diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
--- a/Source/cmake/OptionsQt.cmake
+++ b/Source/cmake/OptionsQt.cmake
@@ -683,7 +683,6 @@ if (WIN32 AND COMPILER_IS_GCC_OR_CLANG)
endif ()
if (APPLE)
- SET_AND_EXPOSE_TO_BUILD(HAVE_QOS_CLASSES 1)
endif ()
if (ENABLE_MATHML)

View File

@ -0,0 +1,30 @@
diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt
--- a/Source/JavaScriptCore/shell/CMakeLists.txt
+++ b/Source/JavaScriptCore/shell/CMakeLists.txt
@@ -9,7 +9,6 @@ set(JSC_LIBRARIES
)
if (WTF_OS_MAC_OS_X)
- list(APPEND JSC_LIBRARIES edit)
endif ()
if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -563,7 +563,6 @@
#if PLATFORM(IOS)
#define HAVE_NETWORK_EXTENSION 1
-#define HAVE_READLINE 1
#if USE(APPLE_INTERNAL_SDK)
#define USE_CFNETWORK 1
#endif
@@ -650,7 +649,6 @@
#define HAVE_MADV_DONTNEED 1
#define HAVE_MERGESORT 1
#define HAVE_PTHREAD_SETNAME_NP 1
-#define HAVE_READLINE 1
#define HAVE_SYS_TIMEB_H 1
#if !PLATFORM(GTK) && !PLATFORM(QT)

View File

@ -0,0 +1,170 @@
Regressed by https://github.com/unicode-org/icu/commit/c3fe7e09d844
In file included from Source/WebCore/platform/text/TextAllInOne.cpp:31:
Source/WebCore/platform/text/TextCodecICU.cpp:311:42: error: use of undeclared identifier 'TRUE'
ucnv_setFallback(m_converterICU, TRUE);
^
In file included from Source/WebCore/platform/text/TextAllInOne.cpp:40:
In file included from Source/WebCore/platform/text/icu/UTextProvider.cpp:27:
Source/WebCore/platform/text/icu/UTextProvider.h:83:28: error: use of undeclared identifier 'TRUE'
isAccessible = TRUE;
^
Source/WebCore/platform/text/icu/UTextProvider.h:88:28: error: use of undeclared identifier 'FALSE'
isAccessible = FALSE;
^
Source/WebCore/platform/text/icu/UTextProvider.h:97:28: error: use of undeclared identifier 'TRUE'
isAccessible = TRUE;
^
Source/WebCore/platform/text/icu/UTextProvider.h:102:28: error: use of undeclared identifier 'FALSE'
isAccessible = FALSE;
^
In file included from Source/WebCore/platform/text/TextAllInOne.cpp:41:
Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:103:20: error: use of undeclared identifier 'TRUE'
return TRUE;
^
Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:108:20: error: use of undeclared identifier 'FALSE'
return FALSE;
^
Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:114:20: error: use of undeclared identifier 'TRUE'
return TRUE;
^
Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:119:20: error: use of undeclared identifier 'FALSE'
return FALSE;
^
Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:147:12: error: use of undeclared identifier 'TRUE'
return TRUE;
^
Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:339:16: error: use of undeclared identifier 'FALSE'
return FALSE;
^
Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:359:12: error: use of undeclared identifier 'TRUE'
return TRUE;
^
In file included from Source/WebCore/platform/text/TextAllInOne.cpp:42:
Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp:128:16: error: use of undeclared identifier 'FALSE'
return FALSE;
^
Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp:148:12: error: use of undeclared identifier 'TRUE'
return TRUE;
^
--- a/Source/WebCore/platform/text/TextCodecICU.cpp
+++ b/Source/WebCore/platform/text/TextCodecICU.cpp
@@ -308,7 +308,7 @@ void TextCodecICU::createICUConverter() const
m_converterICU = ucnv_open(m_canonicalConverterName, &err);
ASSERT(U_SUCCESS(err));
if (m_converterICU)
- ucnv_setFallback(m_converterICU, TRUE);
+ ucnv_setFallback(m_converterICU, true);
}
int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& err)
--- a/Source/WebCore/platform/text/icu/UTextProvider.h
+++ b/Source/WebCore/platform/text/icu/UTextProvider.h
@@ -80,12 +80,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text
// Ensure chunk offset is well formed if computed offset exceeds int32_t range.
ASSERT(offset < std::numeric_limits<int32_t>::max());
text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
- isAccessible = TRUE;
+ isAccessible = true;
return true;
}
if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
text->chunkOffset = text->chunkLength;
- isAccessible = FALSE;
+ isAccessible = false;
return true;
}
} else {
@@ -94,12 +94,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text
// Ensure chunk offset is well formed if computed offset exceeds int32_t range.
ASSERT(offset < std::numeric_limits<int32_t>::max());
text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
- isAccessible = TRUE;
+ isAccessible = true;
return true;
}
if (nativeIndex <= 0 && !text->chunkNativeStart) {
text->chunkOffset = 0;
- isAccessible = FALSE;
+ isAccessible = false;
return true;
}
}
--- a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
+++ b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
@@ -100,23 +100,23 @@ static UBool uTextLatin1Access(UText* uText, int64_t i
if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) {
// Already inside the buffer. Set the new offset.
uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
- return TRUE;
+ return true;
}
if (index >= length && uText->chunkNativeLimit == length) {
// Off the end of the buffer, but we can't get it.
uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
- return FALSE;
+ return false;
}
} else {
if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) {
// Already inside the buffer. Set the new offset.
uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
- return TRUE;
+ return true;
}
if (!index && !uText->chunkNativeStart) {
// Already at the beginning; can't go any farther.
uText->chunkOffset = 0;
- return FALSE;
+ return false;
}
}
@@ -144,7 +144,7 @@ static UBool uTextLatin1Access(UText* uText, int64_t i
uText->nativeIndexingLimit = uText->chunkLength;
- return TRUE;
+ return true;
}
static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
@@ -336,7 +336,7 @@ static int64_t uTextLatin1ContextAwareNativeLength(UTe
static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
{
if (!text->context)
- return FALSE;
+ return false;
int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
UBool isAccessible;
if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
@@ -356,7 +356,7 @@ static UBool uTextLatin1ContextAwareAccess(UText* text
ASSERT(newContext == UTextProviderContext::PriorContext);
textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
}
- return TRUE;
+ return true;
}
static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
--- a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
+++ b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
@@ -125,7 +125,7 @@ static inline int64_t uTextUTF16ContextAwareNativeLeng
static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
{
if (!text->context)
- return FALSE;
+ return false;
int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
UBool isAccessible;
if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
@@ -145,7 +145,7 @@ static UBool uTextUTF16ContextAwareAccess(UText* text,
ASSERT(newContext == UTextProviderContext::PriorContext);
textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
}
- return TRUE;
+ return true;
}
static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)

View File

@ -0,0 +1,12 @@
diff --git a/Source/WebKit2/PlatformQt.cmake b/Source/WebKit2/PlatformQt.cmake
--- a/Source/WebKit2/PlatformQt.cmake
+++ b/Source/WebKit2/PlatformQt.cmake
@@ -261,6 +261,7 @@
list(APPEND WebKit2_SYSTEM_INCLUDE_DIRECTORIES
${GLIB_INCLUDE_DIRS}
${GSTREAMER_INCLUDE_DIRS}
+ ${GSTREAMER_PBUTILS_INCLUDE_DIRS}
${Qt5Quick_INCLUDE_DIRS}
${Qt5Quick_PRIVATE_INCLUDE_DIRS}
${SQLITE_INCLUDE_DIR}

View File

@ -0,0 +1,207 @@
{
"qt3d": {
"url": "https://invent.kde.org/qt/qt/qt3d.git",
"rev": "c3c7e6ebc29cce466d954f72f340a257d76b5ec2",
"sha256": "13ixg0gx7sp90k0db2xn7r2rj1w3zw3vs84pav0v8fwfvph9ki98"
},
"qtactiveqt": {
"url": "https://invent.kde.org/qt/qt/qtactiveqt.git",
"rev": "2334cafc110c4e63bec3a5c7abdcd67e5e5ee754",
"sha256": "0p7pydqsrws5x9l74y37ldffd3yz4riyizl8669x6y6hj6177yd3"
},
"qtandroidextras": {
"url": "https://invent.kde.org/qt/qt/qtandroidextras.git",
"rev": "7ede0a6c555518a3fecba8930d5e4d9c58875d0d",
"sha256": "0nvdrbqm469iikkvzwjni3zb7dxwpy3x161m9yly4irklixhxkzh"
},
"qtbase": {
"url": "https://invent.kde.org/qt/qt/qtbase.git",
"rev": "6c09620dc84900c31a2d307a8640dbc15b1fcfdd",
"sha256": "0nr8xlfdrgjr6rrd5f99p8vzlxx6n8xch5l2z95pb2lx4w4pz26q"
},
"qtcharts": {
"url": "https://invent.kde.org/qt/qt/qtcharts.git",
"rev": "e30be213e483f2d6f3c40af0cbdc11a8e92e2026",
"sha256": "0vn1xh40lxa6vi87vr6qpskli2vh47mxi3d5srhf8rark0m51lf4"
},
"qtconnectivity": {
"url": "https://invent.kde.org/qt/qt/qtconnectivity.git",
"rev": "2d241e0b79971917845a6ed448e838ef273d73d7",
"sha256": "15zk9q1n9yfg4nkr0rs7agsvzim8nlrqzm1h4h9r0iwr91g9vqp5"
},
"qtdatavis3d": {
"url": "https://invent.kde.org/qt/qt/qtdatavis3d.git",
"rev": "9f0f50ebef04d5ac5ed0ee2a3a71e7748fce3005",
"sha256": "151650nqq29m99cbf7ac02vxzw4ivm4spr4kd2ss3gwhfxby3zgj"
},
"qtdeclarative": {
"url": "https://invent.kde.org/qt/qt/qtdeclarative.git",
"rev": "05c3f4921d81fb1b0eb497515c24ae56221d1e0a",
"sha256": "0101bbpnrj4rp51dcnn2gjcq7vw55g4c8y4lmg2nd5g69whmkl1c"
},
"qtdoc": {
"url": "https://invent.kde.org/qt/qt/qtdoc.git",
"rev": "79d6ef693b6241db4a86a90943c02180c4944214",
"sha256": "0ldskh9dd8qwa96nz1q5sbb8r2jdfcxvq589dyw87m3gpb8v16qq"
},
"qtgamepad": {
"url": "https://invent.kde.org/qt/qt/qtgamepad.git",
"rev": "ad63dc64f4bdafb503f7015d04e8849cef5d99b4",
"sha256": "06ag3cmg56f4z9pc3ix9lddz5ydx48pf438xc2l1z3x4wxbkfbsy"
},
"qtgraphicaleffects": {
"url": "https://invent.kde.org/qt/qt/qtgraphicaleffects.git",
"rev": "4119e4e6dc94447d773a01c1d6e4de0fefb9235a",
"sha256": "0sdywxrbjzz9qmrywd54hqqssv59b9mlvra16hjxfd0di50brab2"
},
"qtimageformats": {
"url": "https://invent.kde.org/qt/qt/qtimageformats.git",
"rev": "dbc9c396199ef78e820b40ddb8a4e76c0a86d48c",
"sha256": "18dhnvkv9hialjfcm80g9y38fsxfcfk4fgrrsm3hy2yda6a6g1c6"
},
"qtlocation": {
"url": "https://invent.kde.org/qt/qt/qtlocation.git",
"rev": "435f931a7e42172e12ceba8f0d9da06ba4ec0bee",
"sha256": "1p7hz09jv8whlv0m39cnjz3yc6pjzyxkc8zinl6f0qmrska6m4gp"
},
"qtlottie": {
"url": "https://invent.kde.org/qt/qt/qtlottie.git",
"rev": "56f94cb8e2da9801ada7aa06f86ccf807f5a4ed8",
"sha256": "1pyshl395qmf84h5lyw3rgn3gmz98sm1dq003jvr74w9i746hszf"
},
"qtmacextras": {
"url": "https://invent.kde.org/qt/qt/qtmacextras.git",
"rev": "bc397be87f9b02e8279cfe2fc9b893c9f95219b9",
"sha256": "1dr8a7sv00dmk1hc6kzs93rhvjk2wkxx0mxl7riafdzxzyajcl7n"
},
"qtmultimedia": {
"url": "https://invent.kde.org/qt/qt/qtmultimedia.git",
"rev": "32557dbe01ba66005b8e28b38033eeee9819a4c6",
"sha256": "09mds5v3b3jq34r40hqg2a39q16p4q648wda7cqgm2yp249j06g8"
},
"qtnetworkauth": {
"url": "https://invent.kde.org/qt/qt/qtnetworkauth.git",
"rev": "f082a4c84c54e888b8d023ba68b7085551403425",
"sha256": "03sd0a58b8z340in4avk6lqqa9qzkzkaxnk2yn1a270sxrsq6y0l"
},
"qtpurchasing": {
"url": "https://invent.kde.org/qt/qt/qtpurchasing.git",
"rev": "9dfea35b04dcb52d02d7a2883df88d89ba9999ef",
"sha256": "0swliqwzz3b297z7y6sr79ijgv3914s2g9ymq77plxglfdrnm74j"
},
"qtquick3d": {
"url": "https://invent.kde.org/qt/qt/qtquick3d.git",
"rev": "47defc8b33b7bdf1dbf289b65b301fba2def9b1c",
"sha256": "0kfwkxln3yz0c5rd1kfjmw0y2drwm1gg2s7f52kajfvg4274ha9c"
},
"qtquickcontrols": {
"url": "https://invent.kde.org/qt/qt/qtquickcontrols.git",
"rev": "18977875d16e22ad68a1dc2d7ee0a9c9f873c941",
"sha256": "0n3930zzvp4s6m715rvx1bjh2s2fg7cadjs2hq6bc8k9mwlqibk1"
},
"qtquickcontrols2": {
"url": "https://invent.kde.org/qt/qt/qtquickcontrols2.git",
"rev": "56ce8233382a091a8476c831edd416b5f704ae4f",
"sha256": "1h68s2fdgn1pbf5hsk6c8v4icz8c4cpbxv8iirz22yhlzabc3hdm"
},
"qtquicktimeline": {
"url": "https://invent.kde.org/qt/qt/qtquicktimeline.git",
"rev": "4cd0142a30bfa5eef47c720ac24dd73e12764806",
"sha256": "13vhlgxq8ap796p3y9c3kj645p0370bqjwm5hkz13pazm15sbc9z"
},
"qtremoteobjects": {
"url": "https://invent.kde.org/qt/qt/qtremoteobjects.git",
"rev": "929c7ad0676f084b9ecc469cd47a307596923cb3",
"sha256": "0l94k9fdzk96j40gab2l5n4lmadzaqhvbg8s3m5f3v4im00xa2x9"
},
"qtscript": {
"url": "https://invent.kde.org/qt/qt/qtscript.git",
"rev": "4d8e4bd20b7100b0b7192547b19c3c239aaf7034",
"sha256": "1pvihbjjmczby4934lir3h3kq0rqcvxnbw2vdkl9lhkds3lm0qhf"
},
"qtscxml": {
"url": "https://invent.kde.org/qt/qt/qtscxml.git",
"rev": "0c93f94a44e2dce7eed9d17d4976b0c1e14be7bb",
"sha256": "1vvzvin23ws6njhyg93s2dlkxb9p50mkipc611lsx7971gv1wih0"
},
"qtsensors": {
"url": "https://invent.kde.org/qt/qt/qtsensors.git",
"rev": "6add85fa1a234a7e1943ba175c6fc799ccbae48e",
"sha256": "1k02x3wzczwg7cqh6hav31akdsz9kk8s0vryd3q7zfrhqy9m88sh"
},
"qtserialbus": {
"url": "https://invent.kde.org/qt/qt/qtserialbus.git",
"rev": "ced5c7223d037aece1e7f37d4314f388252de025",
"sha256": "009ajdry6lvf9pifzm2zl0w5zhkmrrxm53mjf9s76jqrsi6yqk30"
},
"qtserialport": {
"url": "https://invent.kde.org/qt/qt/qtserialport.git",
"rev": "e2851096dc6f6a7cfa635d69ea950b382e3658ab",
"sha256": "071g8d9i3wi8rqqy4lxpp3z25a55pd2xwsy3r8v0a6s6y5g5lcpf"
},
"qtspeech": {
"url": "https://invent.kde.org/qt/qt/qtspeech.git",
"rev": "255845e2b2e605363762be25932d92fc10d32749",
"sha256": "0apyk2z9r7i54sh0zgbs8vfncc4jrcrzzvi3q14d105pkhrschp9"
},
"qtsvg": {
"url": "https://invent.kde.org/qt/qt/qtsvg.git",
"rev": "a7a0f2491334e8cb4ef5731f5eb741f3f7b9af76",
"sha256": "13zpzvwqv61dsd74s92nf46rhaw2rw3hl8m6d313wjlaaqi95ln6"
},
"qttools": {
"url": "https://invent.kde.org/qt/qt/qttools.git",
"rev": "090e526e713d01eac34c64e4a09ad961c612febf",
"sha256": "1zrxv9wdnqayn5hhblwyqyrdn8mj7x2ks2f4qsr2w3cdidcjjz7y"
},
"qttranslations": {
"url": "https://invent.kde.org/qt/qt/qttranslations.git",
"rev": "af8cd030fed6a47cc1e8727e7ee5445e037bf712",
"sha256": "14fx3r9s3p16rhv9fyrwnv6bn24nvh5xnjwcw1mb04c44ddb9r86"
},
"qtvirtualkeyboard": {
"url": "https://invent.kde.org/qt/qt/qtvirtualkeyboard.git",
"rev": "5f66c9571303170f07954f73b09cad4cee1ce5d0",
"sha256": "0jzl7a2zr83nd9sskmz9fk2w2spn3v821j0l7kcp2hxydgyhk8v3"
},
"qtwayland": {
"url": "https://invent.kde.org/qt/qt/qtwayland.git",
"rev": "df41e7e3e1f0e5495c5c8c52f1c9bb5a32b0da27",
"sha256": "0f292axj0ivgwgx97zc8x744243i7lgqcxbkjxham6md81m1xbwj"
},
"qtwebchannel": {
"url": "https://invent.kde.org/qt/qt/qtwebchannel.git",
"rev": "f8949655ccfacc2d34cfb0af23c540db84a2b9e5",
"sha256": "1303hghvk6avshb7imnkv24qv1ij5d3nbljba20l6v6dsr7zg7ba"
},
"qtwebglplugin": {
"url": "https://invent.kde.org/qt/qt/qtwebglplugin.git",
"rev": "655be6c5406f8ba42acaca363fc55d78a6198733",
"sha256": "08biydqk1lhjzvrgl3zhbrrgnjcy611pmh9scyw42avdvj2qzpc2"
},
"qtwebsockets": {
"url": "https://invent.kde.org/qt/qt/qtwebsockets.git",
"rev": "90f3590c3c49a0820462af9a778dd13d8df42244",
"sha256": "1dxc3imh8455vy3pggrzjflb2v5382q9ha2fwplybxawld9wdw45"
},
"qtwebview": {
"url": "https://invent.kde.org/qt/qt/qtwebview.git",
"rev": "dfd86e07019488954cddcf2ba314df3cd0c01c0c",
"sha256": "1crph9sdmxxs0787il86j2dv6k3qylmy8a83hfzczcjcx3pwcf7a"
},
"qtwinextras": {
"url": "https://invent.kde.org/qt/qt/qtwinextras.git",
"rev": "48318520a4031167c4c0ad559e1a11b2f4c053d6",
"sha256": "04smnp9pl3szizdp05dz7qmdgg8sk57d3r40sdy7v9zwi4lwaqi4"
},
"qtx11extras": {
"url": "https://invent.kde.org/qt/qt/qtx11extras.git",
"rev": "e44c85e8643f2724109993a7b9eaf0dff3530fec",
"sha256": "1vs1013zxw54xfmkpid99p5f38hlqds172vija7xjyjaww7j7y3b"
},
"qtxmlpatterns": {
"url": "https://invent.kde.org/qt/qt/qtxmlpatterns.git",
"rev": "3199d91de3f38e5ece3d36bcefe2c33b2c014f3f",
"sha256": "1l6babh2cjqwaqk12cqpkkl2qy909b1fd84p0ab19raw419ncawz"
}
}

View File

@ -0,0 +1,76 @@
{ lib, fetchgit, fetchFromGitHub }:
let
version = "5.15.8";
overrides = {};
mk = name: args:
let
override = overrides.${name} or {};
in
{
version = override.version or version;
src = override.src or
fetchgit {
inherit (args) url rev sha256;
fetchLFS = false;
fetchSubmodules = true;
deepClone = false;
leaveDotGit = false;
};
};
in
lib.mapAttrs mk (lib.importJSON ./srcs-generated.json)
// {
# qtwebkit does not have an official release tarball on the qt mirror and is
# mostly maintained by the community.
qtwebkit = rec {
src = fetchFromGitHub {
owner = "qt";
repo = "qtwebkit";
rev = "v${version}";
sha256 = "0x8rng96h19xirn7qkz3lydal6v4vn00bcl0s3brz36dfs0z8wpg";
};
version = "5.212.0-alpha4";
};
catapult = fetchgit {
url = "https://chromium.googlesource.com/catapult";
rev = "5eedfe23148a234211ba477f76fc2ea2e8529189";
hash = "sha256-LPfBCEB5tJOljXpptsNk0sHGtJf/wIRL7fccN79Nh6o=";
};
qtwebengine =
let
branchName = "5.15.12";
rev = "v${branchName}-lts";
in
{
version = branchName;
src = fetchgit {
url = "https://github.com/qt/qtwebengine.git";
sha256 = "sha256-8EQqSvxw9rqf+64CIbcCb1VXhNx1GNC8eDIgLyYDyvk=";
inherit rev branchName;
fetchSubmodules = true;
leaveDotGit = true;
name = "qtwebengine-${lib.substring 0 8 rev}.tar.gz";
postFetch = ''
# remove submodule .git directory
rm -rf "$out/src/3rdparty/.git"
# compress to not exceed the 2GB output limit
# try to make a deterministic tarball
tar -I 'gzip -n' \
--sort=name \
--mtime=1970-01-01 \
--owner=root --group=root \
--numeric-owner --mode=go=rX,u+rw,a-s \
--transform='s@^@source/@' \
-cf temp -C "$out" .
rm -r "$out"
mv temp "$out"
'';
};
};
}

81
nix/pkgs/qt-5/README.md Normal file
View File

@ -0,0 +1,81 @@
# Qt 5 Maintainer's Notes
## Minor Updates
Let `$major` be the major version number, e.g. `5.9`.
1. Change the version number in the `$major/fetch.sh`.
2. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/$major`
from the top of the Nixpkgs tree.
See below if it is necessary to update any patches.
## Major Updates
Let `$major` be the new major version number, e.g. `5.10`.
1. Copy the subdirectory from the previous major version to `$major`.
2. Change the version number in `$major/fetch.sh`.
3. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/$major`
from the top of the Nixpkgs tree.
4. Add a top-level attribute in `pkgs/top-level/all-packages.nix` for the new
major version.
5. Change the `qt5` top-level attribute to point to the new major version.
6. If the previous major version is _not_ a long-term support release,
remove it from Nixpkgs.
See below if it is necessary to update any patches.
## Patches
Nixpkgs maintains several patches for Qt which cannot be submitted upstream. To
facilitate maintenance, a fork of the upstream repository is created for each patched module:
- [qtbase](https://github.com/ttuegel/qtbase)
- [qtwebkit](https://github.com/ttuegel/qtwebkit)
- [qttools](https://github.com/ttuegel/qttools)
- [qtscript](https://github.com/ttuegel/qtscript)
- [qtserialport](https://github.com/ttuegel/qtserialport)
- [qtdeclarative](https://github.com/ttuegel/qtdeclarative)
- [qtwebengine](https://github.com/ttuegel/qtwebengine)
In each repository, the patches are contained in a branch named `nixpkgs/$major`
for each major version. Please make a pull request to add or update any patch
which will be maintained in Nixpkgs.
The forked repository for each module is used to create a single patch in
Nixpkgs. To recreate the patch for module `$module` (e.g. `qtbase`) at version
`$version` (e.g. `5.9.1`) in the branch `$major` (e.g. `5.9`),
1. Clone the fork for `$module` from the list above.
2. Checkout the active branch, `git checkout nixpkgs/$major`.
3. Compare the patched branch to the release tag,
`git diff v$version > $module.patch`.
4. Copy `$module.patch` into the Nixpkgs tree.
### Minor Version Updates
To update module `$module` to version `$version` from an older version in the
same branch `$major`,
1. Clone the fork for `$module` from the list above.
2. Checkout the active branch, `git checkout nixpkgs/$major`.
3. Merge the new version into the active branch,
`git merge --no-ff v$version`.
4. Fix any conflicts.
5. Open a pull request for the changes.
6. Follow the instructions above to recreate the module patch in Nixpkgs.
### Major Version Updates
To update module `$module` from `$oldversion` in branch `$oldmajor` to version
`$version` in branch `$major`,
1. Clone the fork for `$module` from the list above.
2. Checkout a new branch for the new major version,
`git checkout -b nixpkgs/$major nixpkgs/$oldmajor`.
3. Rebase the patches from `$oldversion` onto the new branch,
`git rebase v$oldversion --onto v$version`.
4. Fix any conflicts.
5. Open a pull request for the changes.
6. Follow the instructions above to recreate the module patch in Nixpkgs.

View File

@ -0,0 +1,25 @@
# Fix libtool libraries generated by qmake.
# qmake started inserting filenames of shared objects instead of the appropriate
# linker flags. fixQmakeLibtool searches for broken libtool libraries and
# replaces the filenames with the linker flags that should have been there.
fixQmakeLibtool() {
if [ -d "$1" ]; then
find "$1" -name '*.la' | while read la; do
set +e
framework_libs=$(grep '^dependency_libs' "$la" | grep -Eo -- '-framework +\w+' | tr '\n' ' ')
set -e
sed -i "$la" \
-e '/^dependency_libs/ s,\(/[^ ]\+\)/lib\([^/ ]\+\)\.so,-L\1 -l\2,g' \
-e '/^dependency_libs/ s,-framework \+\w\+,,g'
if [ ! -z "$framework_libs" ]; then
if grep '^inherited_linker_flags=' $la >/dev/null; then
sed -i "$la" -e "s/^\(inherited_linker_flags='[^']*\)/\1 $framework_libs/"
else
echo "inherited_linker_flags='$framework_libs'" >> "$la"
fi
fi
done
fi
}
fixupOutputHooks+=('fixQmakeLibtool $prefix')

View File

@ -0,0 +1,64 @@
# fixQtBuiltinPaths
#
# Usage: fixQtBuiltinPaths _dir_ _pattern_
#
# Fix Qt builtin paths in files matching _pattern_ under _dir_.
#
fixQtBuiltinPaths() {
local dir="$1"
local pattern="$2"
local bin="${!outputBin}"
local dev="${!outputDev}"
local doc="${!outputDoc}"
local lib="${!outputLib}"
if [ -d "$dir" ]; then
find "$dir" -name "$pattern" | while read pr_; do
if grep -q '\$\$\[QT_' "${pr_:?}"; then
echo "fixQtBuiltinPaths: Fixing Qt builtin paths in \`${pr_:?}'..."
sed -i "${pr_:?}" \
-e "s|\\\$\\\$\\[QT_HOST_BINS[^]]*\\]|"'$$'"NIX_OUTPUT_DEV/bin|g" \
-e "s|\\\$\\\$\\[QT_HOST_DATA[^]]*\\]/mkspecs|$dev/mkspecs|g" \
-e "s|\\\$\\\$\\[QT_HOST_PREFIX[^]]*\\]|"'$$'"NIX_OUTPUT_DEV|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_ARCHDATA[^]]*\\]|$lib|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_BINS[^]]*\\]|$bin/bin|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_CONFIGURATION[^]]*\\]|$bin|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_DATA[^]]*\\]|$lib|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_DOCS[^]]*\\]|$doc/share/doc|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_EXAMPLES[^]]*\\]|$doc/examples|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_HEADERS[^]]*\\]|$dev/include|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_LIBS[^]]*\\]|$lib/lib|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_LIBEXECS[^]]*\\]|$lib/libexec|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_PLUGINS[^]]*\\]|$bin/$qtPluginPrefix|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_PREFIX[^]]*\\]|"'$$'"NIX_OUTPUT_LIB|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_TESTS[^]]*\\]|$dev/tests|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_TRANSLATIONS[^]]*\\]|$lib/translations|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_QML[^]]*\\]|$bin/$qtQmlPrefix|g"
fi
done
elif [ -e "$dir" ]; then
if grep -q '\$\$\[QT_' "${dir:?}"; then
echo "fixQtBuiltinPaths: Fixing Qt builtin paths in \`${dir:?}'..."
sed -i "${dir:?}" \
-e "s|\\\$\\\$\\[QT_HOST_BINS[^]]*\\]|"'$$'"NIX_OUTPUT_DEV/bin|g" \
-e "s|\\\$\\\$\\[QT_HOST_DATA[^]]*\\]/mkspecs|$dev/mkspecs|g" \
-e "s|\\\$\\\$\\[QT_HOST_PREFIX[^]]*\\]|"'$$'"NIX_OUTPUT_DEV|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_ARCHDATA[^]]*\\]|$lib|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_BINS[^]]*\\]|$bin/bin|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_CONFIGURATION[^]]*\\]|$bin|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_DATA[^]]*\\]|$lib|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_DOCS[^]]*\\]|$doc/share/doc|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_EXAMPLES[^]]*\\]|$doc/examples|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_HEADERS[^]]*\\]|$dev/include|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_LIBS[^]]*\\]|$lib/lib|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_LIBEXECS[^]]*\\]|$lib/libexec|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_PLUGINS[^]]*\\]|$bin/$qtPluginPrefix|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_PREFIX[^]]*\\]|"'$$'"NIX_OUTPUT_LIB|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_TESTS[^]]*\\]|$dev/tests|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_TRANSLATIONS[^]]*\\]|$lib/translations|g" \
-e "s|\\\$\\\$\\[QT_INSTALL_QML[^]]*\\]|$bin/$qtQmlPrefix|g"
fi
else
echo "fixQtBuiltinPaths: Warning: \`$dir' does not exist"
fi
}

View File

@ -0,0 +1,36 @@
# fixQtModulePaths
#
# Usage: fixQtModulePaths _dir_
#
# Find Qt module definitions in directory _dir_ and patch the module paths.
#
fixQtModulePaths () {
local dir="$1"
local bin="${!outputBin}"
local dev="${!outputDev}"
local lib="${!outputLib}"
if [ -d "$dir" ]; then
find "$dir" -name 'qt_*.pri' | while read pr; do
if grep -q '\$\$QT_MODULE_' "${pr:?}"; then
echo "fixQtModulePaths: Fixing module paths in \`${pr:?}'..."
sed -i "${pr:?}" \
-e "s|\\\$\\\$QT_MODULE_LIB_BASE|$lib/lib|g" \
-e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$lib/lib|g" \
-e "s|\\\$\\\$QT_MODULE_INCLUDE_BASE|$dev/include|g" \
-e "s|\\\$\\\$QT_MODULE_BIN_BASE|$dev/bin|g"
fi
done
elif [ -e "$dir" ]; then
echo "fixQtModulePaths: Warning: \`$dir' is not a directory"
else
echo "fixQtModulePaths: Warning: \`$dir' does not exist"
fi
if [ "z$bin" != "z$dev" ]; then
if [ -d "$bin/bin" ]; then
mkdir -p "$dev/bin"
lndir -silent "$bin/bin" "$dev/bin"
fi
fi
}

View File

@ -0,0 +1,34 @@
updateToolPath() {
local tool="$1"
local target="$2"
local original="${!outputBin}/$tool"
local actual="${!outputDev}/$tool"
if grep -q "$original" "$target"; then
echo "updateToolPath: Updating \`$original' in \`$target\'..."
sed -i "$target" -e "s|$original|$actual|"
fi
}
moveQtDevTools() {
if [ -n "$devTools" ]; then
for tool in $devTools; do
moveToOutput "$tool" "${!outputDev}"
done
if [ -d "${!outputDev}/mkspecs" ]; then
find "${!outputDev}/mkspecs" -name '*.pr?' | while read pr_; do
for tool in $devTools; do
updateToolPath "$tool" "$pr_"
done
done
fi
if [ -d "${!outputDev}/lib/cmake" ]; then
find "${!outputDev}/lib/cmake" -name '*.cmake' | while read cmake; do
for tool in $devTools; do
updateToolPath "$tool" "$cmake"
done
done
fi
fi
}

View File

@ -0,0 +1,54 @@
. @fix_qmake_libtool@
qmakeFlags=( ${qmakeFlags-} )
qmakePrePhase() {
qmakeFlags_orig=( "${qmakeFlags[@]}" )
# These flags must be added _before_ the flags specified in the derivation.
qmakeFlags=( \
"PREFIX=$out" \
"NIX_OUTPUT_OUT=$out" \
"NIX_OUTPUT_DEV=${!outputDev}" \
"NIX_OUTPUT_BIN=${!outputBin}" \
"NIX_OUTPUT_DOC=${!outputDev}/${qtDocPrefix:?}" \
"NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?}" \
"NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?}" \
)
if [ -n "@debug@" ]; then
qmakeFlags+=( "CONFIG+=debug" )
else
qmakeFlags+=( "CONFIG+=release" )
fi
# do the stripping ourselves (needed for separateDebugInfo)
qmakeFlags+=( "CONFIG+=nostrip" )
qmakeFlags+=( "${qmakeFlags_orig[@]}" )
}
prePhases+=" qmakePrePhase"
qmakeConfigurePhase() {
runHook preConfigure
echo "QMAKEPATH=$QMAKEPATH"
echo qmake "${qmakeFlags[@]}"
qmake "${qmakeFlags[@]}"
if ! [[ -v enableParallelBuilding ]]; then
enableParallelBuilding=1
echo "qmake: enabled parallel building"
fi
if ! [[ -v enableParallelInstalling ]]; then
enableParallelInstalling=1
echo "qmake: enabled parallel installing"
fi
runHook postConfigure
}
if [ -z "${dontUseQmakeConfigure-}" -a -z "${configurePhase-}" ]; then
configurePhase=qmakeConfigurePhase
fi

View File

@ -0,0 +1,112 @@
if [[ -n "${__nix_qtbase-}" ]]; then
# Throw an error if a different version of Qt was already set up.
if [[ "$__nix_qtbase" != "@dev@" ]]; then
echo >&2 "Error: detected mismatched Qt dependencies:"
echo >&2 " @dev@"
echo >&2 " $__nix_qtbase"
exit 1
fi
else # Only set up Qt once.
__nix_qtbase="@dev@"
qtPluginPrefix=@qtPluginPrefix@
qtQmlPrefix=@qtQmlPrefix@
qtDocPrefix=@qtDocPrefix@
. @fix_qt_builtin_paths@
. @fix_qt_module_paths@
# Disable debug symbols if qtbase was built without debugging.
# This stops -dev paths from leaking into other outputs.
if [ -z "@debug@" ]; then
NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE-}${NIX_CFLAGS_COMPILE:+ }-DQT_NO_DEBUG"
fi
# Integration with CMake:
# Set the CMake build type corresponding to how qtbase was built.
if [ -n "@debug@" ]; then
cmakeBuildType="Debug"
else
cmakeBuildType="Release"
fi
providesQtRuntime() {
[ -d "$1/$qtPluginPrefix" ] || [ -d "$1/$qtQmlPrefix" ]
}
# Build tools are often confused if QMAKE is unset.
QMAKE=@dev@/bin/qmake
export QMAKE
QMAKEPATH=
export QMAKEPATH
QMAKEMODULES=
export QMAKEMODULES
declare -Ag qmakePathSeen=()
qmakePathHook() {
# Skip this path if we have seen it before.
# MUST use 'if' because 'qmakePathSeen[$]' may be unset.
if [ -n "${qmakePathSeen[$1]-}" ]; then return; fi
qmakePathSeen[$1]=1
if [ -d "$1/mkspecs" ]
then
QMAKEMODULES="${QMAKEMODULES}${QMAKEMODULES:+:}/mkspecs"
QMAKEPATH="${QMAKEPATH}${QMAKEPATH:+:}$1"
fi
}
envBuildHostHooks+=(qmakePathHook)
# Propagate any runtime dependency of the building package.
# Each dependency is propagated to the user environment and as a build
# input so that it will be re-propagated to the user environment by any
# package depending on the building package. (This is necessary in case
# the building package does not provide runtime dependencies itself and so
# would not be propagated to the user environment.)
declare -Ag qtEnvHostTargetSeen=()
qtEnvHostTargetHook() {
# Skip this path if we have seen it before.
# MUST use 'if' because 'qmakePathSeen[$]' may be unset.
if [ -n "${qtEnvHostTargetSeen[$1]-}" ]; then return; fi
qtEnvHostTargetSeen[$1]=1
if providesQtRuntime "$1" && [ "z${!outputBin}" != "z${!outputDev}" ]
then
propagatedBuildInputs+=" $1"
fi
}
envHostTargetHooks+=(qtEnvHostTargetHook)
postPatchMkspecs() {
# Prevent this hook from running multiple times
dontPatchMkspecs=1
local bin="${!outputBin}"
local dev="${!outputDev}"
local doc="${!outputDoc}"
local lib="${!outputLib}"
moveToOutput "mkspecs" "$dev"
if [ -d "$dev/mkspecs/modules" ]; then
fixQtModulePaths "$dev/mkspecs/modules"
fi
if [ -d "$dev/mkspecs" ]; then
fixQtBuiltinPaths "$dev/mkspecs" '*.pr?'
fi
}
if [ -z "${dontPatchMkspecs-}" ]; then
postPhases="${postPhases-}${postPhases:+ }postPatchMkspecs"
fi
qtPreHook() {
# Check that wrapQtAppsHook is used, or it is explicitly disabled.
if [[ -z "$__nix_wrapQtAppsHook" && -z "$dontWrapQtApps" ]]; then
echo >&2 "Error: wrapQtAppsHook is not used, and dontWrapQtApps is not set."
exit 1
fi
}
prePhases+=" qtPreHook"
fi

View File

@ -0,0 +1 @@
qmakeFlags+=( "QMAKE_LRELEASE=@dev@/bin/lrelease" )

View File

@ -0,0 +1,107 @@
if [[ -z "${__nix_wrapQtAppsHook-}" ]]; then
__nix_wrapQtAppsHook=1 # Don't run this hook more than once.
# Inherit arguments given in mkDerivation
qtWrapperArgs=( ${qtWrapperArgs-} )
qtHostPathSeen=()
qtUnseenHostPath() {
for pkg in "${qtHostPathSeen[@]}"
do
if [ "${pkg:?}" == "$1" ]
then
return 1
fi
done
qtHostPathSeen+=("$1")
return 0
}
qtHostPathHook() {
qtUnseenHostPath "$1" || return 0
local pluginDir="$1/${qtPluginPrefix:?}"
if [ -d "$pluginDir" ]
then
qtWrapperArgs+=(--prefix QT_PLUGIN_PATH : "$pluginDir")
fi
local qmlDir="$1/${qtQmlPrefix:?}"
if [ -d "$qmlDir" ]
then
qtWrapperArgs+=(--prefix QML2_IMPORT_PATH : "$qmlDir")
fi
}
addEnvHooks "$targetOffset" qtHostPathHook
makeQtWrapper() {
local original="$1"
local wrapper="$2"
shift 2
makeWrapper "$original" "$wrapper" "${qtWrapperArgs[@]}" "$@"
}
wrapQtApp() {
local program="$1"
shift 1
wrapProgram "$program" "${qtWrapperArgs[@]}" "$@"
}
qtOwnPathsHook() {
local xdgDataDir="${!outputBin}/share"
if [ -d "$xdgDataDir" ]
then
qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "$xdgDataDir")
fi
local xdgConfigDir="${!outputBin}/etc/xdg"
if [ -d "$xdgConfigDir" ]
then
qtWrapperArgs+=(--prefix XDG_CONFIG_DIRS : "$xdgConfigDir")
fi
qtHostPathHook "${!outputBin}"
}
preFixupPhases+=" qtOwnPathsHook"
# Note: $qtWrapperArgs still gets defined even if ${dontWrapQtApps-} is set.
wrapQtAppsHook() {
# skip this hook when requested
[ -z "${dontWrapQtApps-}" ] || return 0
# guard against running multiple times (e.g. due to propagation)
[ -z "$wrapQtAppsHookHasRun" ] || return 0
wrapQtAppsHookHasRun=1
local targetDirs=( "$prefix/bin" "$prefix/sbin" "$prefix/libexec" "$prefix/Applications" "$prefix/"*.app )
echo "wrapping Qt applications in ${targetDirs[@]}"
for targetDir in "${targetDirs[@]}"
do
[ -d "$targetDir" ] || continue
find "$targetDir" ! -type d -executable -print0 | while IFS= read -r -d '' file
do
isELF "$file" || isMachO "$file" || continue
if [ -f "$file" ]
then
echo "wrapping $file"
wrapQtApp "$file"
elif [ -h "$file" ]
then
target="$(readlink -e "$file")"
echo "wrapping $file -> $target"
rm "$file"
makeQtWrapper "$target" "$file"
fi
done
done
}
fixupOutputHooks+=(wrapQtAppsHook)
fi

View File

@ -0,0 +1,17 @@
{ lib, debug, wrapQtAppsHook }:
let inherit (lib) optional; in
mkDerivation:
args:
let
args_ = {
nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ wrapQtAppsHook ];
};
in
mkDerivation (args // args_)

View File

@ -0,0 +1,9 @@
{ lib, stdenv, qtModule, qtbase, qtdeclarative }:
qtModule {
pname = "qt3d";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
# error: use of undeclared identifier 'stat64'
env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dstat64=stat";
}

View File

@ -0,0 +1,375 @@
{ stdenv, lib
, src, patches, version, qtCompatVersion
, coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3
, which
# darwin support
, libiconv, libobjc, xcbuild, AGL, AppKit, ApplicationServices, AVFoundation, Carbon, Cocoa, CoreAudio, CoreBluetooth
, CoreLocation, CoreServices, DiskArbitration, Foundation, OpenGL, MetalKit, IOKit
, dbus, fontconfig, freetype, glib, harfbuzz, icu, libdrm, libX11, libXcomposite
, libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng , libxcb
, libxkbcommon, libxml2, libxslt, openssl, pcre2, sqlite, udev, xcbutil
, xcbutilimage, xcbutilkeysyms, xcbutilrenderutil, xcbutilwm , zlib, at-spi2-core
# optional dependencies
, cups ? null, postgresql ? null
, withGtk3 ? false, dconf, gtk3
# options
, libGLSupported ? !stdenv.isDarwin
, libGL
# qmake detection for libmysqlclient does not seem to work when cross compiling
, mysqlSupport ? stdenv.hostPlatform == stdenv.buildPlatform
, libmysqlclient
, buildExamples ? false
, buildTests ? false
, debug ? false
, developerBuild ? false
, decryptSslTraffic ? false
, testers
}:
let
debugSymbols = debug || developerBuild;
in
stdenv.mkDerivation (finalAttrs: {
pname = "qtbase";
inherit qtCompatVersion src version;
debug = debugSymbols;
propagatedBuildInputs = [
libxml2 libxslt openssl sqlite zlib
# Text rendering
harfbuzz icu
# Image formats
libjpeg libpng
pcre2
] ++ (
if stdenv.isDarwin then [
# TODO: move to buildInputs, this should not be propagated.
AGL AppKit ApplicationServices AVFoundation Carbon Cocoa CoreAudio CoreBluetooth
CoreLocation CoreServices DiskArbitration Foundation OpenGL
libobjc libiconv MetalKit IOKit
] else [
dbus glib udev
# Text rendering
fontconfig freetype
libdrm
# X11 libs
libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil
xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm
] ++ lib.optional libGLSupported libGL
);
buildInputs = [ python3 at-spi2-core ]
++ lib.optionals (!stdenv.isDarwin)
(
[ libinput ]
++ lib.optional withGtk3 gtk3
)
++ lib.optional developerBuild gdb
++ lib.optional (cups != null) cups
++ lib.optional (mysqlSupport) libmysqlclient
++ lib.optional (postgresql != null) postgresql;
nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which ]
++ lib.optionals stdenv.isDarwin [ xcbuild ];
propagatedNativeBuildInputs = [ lndir ];
enableParallelBuilding = true;
outputs = [ "bin" "dev" "out" ];
inherit patches;
fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
fix_qt_module_paths = ../hooks/fix-qt-module-paths.sh;
preHook = ''
. "$fix_qt_builtin_paths"
. "$fix_qt_module_paths"
. ${../hooks/move-qt-dev-tools.sh}
. ${../hooks/fix-qmake-libtool.sh}
'';
postPatch = ''
for prf in qml_plugin.prf qt_plugin.prf qt_docs.prf qml_module.prf create_cmake.prf; do
substituteInPlace "mkspecs/features/$prf" \
--subst-var qtPluginPrefix \
--subst-var qtQmlPrefix \
--subst-var qtDocPrefix
done
substituteInPlace configure --replace /bin/pwd pwd
substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i mkspecs/*/*.conf
sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5Config.cmake.in
sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5CoreMacros.cmake
sed -i 's/NO_DEFAULT_PATH//' src/gui/Qt5GuiConfigExtras.cmake.in
sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
# https://bugs.gentoo.org/803470
sed -i 's/-lpthread/-pthread/' mkspecs/common/linux.conf src/corelib/configure.json
patchShebangs ./bin
'' + (
if stdenv.isDarwin then ''
sed -i \
-e 's|/usr/bin/xcode-select|xcode-select|' \
-e 's|/usr/bin/xcrun|xcrun|' \
-e 's|/usr/bin/xcodebuild|xcodebuild|' \
-e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
./configure
substituteInPlace ./mkspecs/common/mac.conf \
--replace "/System/Library/Frameworks/OpenGL.framework/" "${OpenGL}/Library/Frameworks/OpenGL.framework/" \
--replace "/System/Library/Frameworks/AGL.framework/" "${AGL}/Library/Frameworks/AGL.framework/"
'' else lib.optionalString libGLSupported ''
sed -i mkspecs/common/linux.conf \
-e "/^QMAKE_INCDIR_OPENGL/ s|$|${libGL.dev or libGL}/include|" \
-e "/^QMAKE_LIBDIR_OPENGL/ s|$|${libGL.out}/lib|"
'' + lib.optionalString (stdenv.hostPlatform.isx86_32 && stdenv.cc.isGNU) ''
sed -i mkspecs/common/gcc-base-unix.conf \
-e "/^QMAKE_LFLAGS_SHLIB/ s/-shared/-shared -static-libgcc/"
''
);
qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins";
qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml";
qtDocPrefix = "share/doc/qt-${qtCompatVersion}";
setOutputFlags = false;
preConfigure = ''
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
# paralellize compilation of qtmake, which happens within ./configure
export MAKEFLAGS+=" -j$NIX_BUILD_CORES"
./bin/syncqt.pl -version $version
'';
postConfigure = ''
qmakeCacheInjectNixOutputs() {
local cache="$1/.qmake.stash"
echo "qmakeCacheInjectNixOutputs: $cache"
if ! [ -f "$cache" ]; then
echo >&2 "qmakeCacheInjectNixOutputs: WARNING: $cache does not exist"
fi
cat >>"$cache" <<EOF
NIX_OUTPUT_BIN = $bin
NIX_OUTPUT_DEV = $dev
NIX_OUTPUT_OUT = $out
NIX_OUTPUT_DOC = $dev/$qtDocPrefix
NIX_OUTPUT_QML = $bin/$qtQmlPrefix
NIX_OUTPUT_PLUGIN = $bin/$qtPluginPrefix
EOF
}
find . -name '.qmake.conf' | while read conf; do
qmakeCacheInjectNixOutputs "$(dirname $conf)"
done
'';
env.NIX_CFLAGS_COMPILE = toString ([
"-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields
''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"''
''-DLIBRESOLV_SO="${stdenv.cc.libc.out}/lib/libresolv"''
''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
] ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
++ lib.optional stdenv.isLinux "-DUSE_X11"
++ lib.optionals (stdenv.hostPlatform.system == "x86_64-darwin") [
# ignore "is only available on macOS 10.12.2 or newer" in obj-c code
"-Wno-error=unguarded-availability"
]
++ lib.optionals withGtk3 [
''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
] ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC");
prefixKey = "-prefix ";
# PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag
# if dependency paths contain the string "pq", which can occur in the hash.
# To prevent these failures, we need to override PostgreSQL detection.
PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq";
# TODO Remove obsolete and useless flags once the build will be totally mastered
configureFlags = [
"-plugindir $(out)/$(qtPluginPrefix)"
"-qmldir $(out)/$(qtQmlPrefix)"
"-docdir $(out)/$(qtDocPrefix)"
"-verbose"
"-confirm-license"
"-opensource"
"-release"
"-shared"
"-accessibility"
"-optimized-qmake"
# for separateDebugInfo
"-no-strip"
"-system-proxies"
"-pkg-config"
"-gui"
"-widgets"
"-opengl desktop"
"-icu"
"-L" "${icu.out}/lib"
"-I" "${icu.dev}/include"
"-pch"
]
++ lib.optional debugSymbols "-debug"
++ lib.optionals developerBuild [
"-developer-build"
"-no-warnings-are-errors"
] ++ (if (!stdenv.hostPlatform.isx86_64) then [
"-no-sse2"
] else [
"-sse2"
"${lib.optionalString (!stdenv.hostPlatform.sse3Support) "-no"}-sse3"
"${lib.optionalString (!stdenv.hostPlatform.ssse3Support) "-no"}-ssse3"
"${lib.optionalString (!stdenv.hostPlatform.sse4_1Support) "-no"}-sse4.1"
"${lib.optionalString (!stdenv.hostPlatform.sse4_2Support) "-no"}-sse4.2"
"${lib.optionalString (!stdenv.hostPlatform.avxSupport) "-no"}-avx"
"${lib.optionalString (!stdenv.hostPlatform.avx2Support) "-no"}-avx2"
]
) ++ [
"-no-mips_dsp"
"-no-mips_dspr2"
] ++ [
"-system-zlib"
"-L" "${zlib.out}/lib"
"-I" "${zlib.dev}/include"
"-system-libjpeg"
"-L" "${libjpeg.out}/lib"
"-I" "${libjpeg.dev}/include"
"-system-harfbuzz"
"-L" "${harfbuzz.out}/lib"
"-I" "${harfbuzz.dev}/include"
"-system-pcre"
"-openssl-linked"
"-L" "${lib.getLib openssl}/lib"
"-I" "${openssl.dev}/include"
"-system-sqlite"
''-${if mysqlSupport then "plugin" else "no"}-sql-mysql''
''-${if postgresql != null then "plugin" else "no"}-sql-psql''
"-make libs"
"-make tools"
''-${lib.optionalString (!buildExamples) "no"}make examples''
''-${lib.optionalString (!buildTests) "no"}make tests''
]
++ (
if stdenv.isDarwin then [
"-no-fontconfig"
"-qt-freetype"
"-qt-libpng"
"-no-framework"
] else [
"-rpath"
] ++ [
"-xcb"
"-qpa xcb"
"-L" "${libX11.out}/lib"
"-I" "${libX11.out}/include"
"-L" "${libXext.out}/lib"
"-I" "${libXext.out}/include"
"-L" "${libXrender.out}/lib"
"-I" "${libXrender.out}/include"
"-libinput"
''-${lib.optionalString (cups == null) "no-"}cups''
"-dbus-linked"
"-glib"
] ++ [
"-system-libpng"
] ++ lib.optional withGtk3 "-gtk"
++ [
"-inotify"
] ++ lib.optionals (cups != null) [
"-L" "${cups.lib}/lib"
"-I" "${cups.dev}/include"
] ++ lib.optionals (mysqlSupport) [
"-L" "${libmysqlclient}/lib"
"-I" "${libmysqlclient}/include"
]
);
# Move selected outputs.
postInstall = ''
moveToOutput "mkspecs" "$dev"
'';
devTools = [
"bin/fixqt4headers.pl"
"bin/moc"
"bin/qdbuscpp2xml"
"bin/qdbusxml2cpp"
"bin/qlalr"
"bin/qmake"
"bin/rcc"
"bin/syncqt.pl"
"bin/uic"
];
postFixup = ''
# Don't retain build-time dependencies like gdb.
sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri
fixQtModulePaths "''${!outputDev}/mkspecs/modules"
fixQtBuiltinPaths "''${!outputDev}" '*.pr?'
# Move development tools to $dev
moveQtDevTools
moveToOutput bin "$dev"
# fixup .pc file (where to find 'moc' etc.)
sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \
-e "/^host_bins=/ c host_bins=$dev/bin"
'';
dontStrip = debugSymbols;
setupHook = ../hooks/qtbase-setup-hook.sh;
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
homepage = "https://www.qt.io/";
description = "A cross-platform application framework for C++";
license = with licenses; [ fdl13Plus gpl2Plus lgpl21Plus lgpl3Plus ];
maintainers = with maintainers; [ qknight ttuegel periklis bkchr ];
pkgConfigModules = [
"Qt5Concurrent"
"Qt5Core"
"Qt5DBus"
"Qt5Gui"
"Qt5Network"
"Qt5OpenGL"
"Qt5OpenGLExtensions"
"Qt5PrintSupport"
#"Qt5Qml"
#"Qt5QmlModels"
#"Qt5Quick"
#"Qt5QuickTest"
#"Qt5QuickWidgets"
"Qt5Sql"
"Qt5Test"
"Qt5Widgets"
"Qt5Xml"
];
platforms = platforms.unix;
};
})

View File

@ -0,0 +1,7 @@
{ qtModule, qtbase, qtdeclarative }:
qtModule {
pname = "qtcharts";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
}

View File

@ -0,0 +1,8 @@
{ qtModule, lib, stdenv, qtbase, qtdeclarative, bluez }:
qtModule {
pname = "qtconnectivity";
qtInputs = [ qtbase qtdeclarative ];
buildInputs = lib.optional stdenv.isLinux bluez;
outputs = [ "out" "dev" "bin" ];
}

View File

@ -0,0 +1,24 @@
{ qtModule, lib, python3, qtbase, qtsvg }:
qtModule {
pname = "qtdeclarative";
qtInputs = [ qtbase qtsvg ];
nativeBuildInputs = [ python3 ];
outputs = [ "out" "dev" "bin" ];
preConfigure = ''
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QML2_IMPORT_PREFIX=\"$qtQmlPrefix\""
'';
configureFlags = [ "-qml-debug" ];
devTools = [
"bin/qml"
"bin/qmlcachegen"
"bin/qmleasing"
"bin/qmlimportscanner"
"bin/qmllint"
"bin/qmlmin"
"bin/qmlplugindump"
"bin/qmlprofiler"
"bin/qmlscene"
"bin/qmltestrunner"
];
}

View File

@ -0,0 +1,7 @@
{ qtModule, qtdeclarative }:
qtModule {
pname = "qtdoc";
qtInputs = [ qtdeclarative ];
outputs = [ "out" ];
}

View File

@ -0,0 +1,10 @@
{ lib, stdenv, qtModule, qtbase, qtdeclarative, GameController, pkg-config }:
qtModule {
pname = "qtgamepad";
qtInputs = [ qtbase qtdeclarative ]
++ lib.optional stdenv.isDarwin GameController;
buildInputs = [ ];
nativeBuildInputs = [ pkg-config ];
outputs = [ "out" "dev" "bin" ];
}

View File

@ -0,0 +1,7 @@
{ qtModule, qtdeclarative }:
qtModule {
pname = "qtgraphicaleffects";
qtInputs = [ qtdeclarative ];
outputs = [ "out" "dev" ];
}

View File

@ -0,0 +1,7 @@
{ qtModule, qtbase, libtiff }:
qtModule {
pname = "qtimageformats";
qtInputs = [ qtbase ];
propagatedBuildInputs = [ libtiff ];
}

View File

@ -0,0 +1,13 @@
{ lib, stdenv, qtModule, qtbase, qtmultimedia }:
qtModule {
pname = "qtlocation";
qtInputs = [ qtbase qtmultimedia ];
outputs = [ "bin" "out" "dev" ];
qmakeFlags = lib.optionals stdenv.isDarwin [
# boost uses std::auto_ptr which has been disabled in clang with libcxx
# This flag re-enables this feature
# https://libcxx.llvm.org/docs/UsingLibcxx.html#c-17-specific-configuration-macros
"QMAKE_CXXFLAGS+=-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR"
];
}

View File

@ -0,0 +1,9 @@
{ qtModule
, qtbase
, qtdeclarative
}:
qtModule {
pname = "qtlottie";
qtInputs = [ qtbase qtdeclarative ];
}

View File

@ -0,0 +1,10 @@
{ lib, qtModule, qtbase }:
qtModule {
pname = "qtmacextras";
qtInputs = [ qtbase ];
meta = with lib; {
maintainers = with maintainers; [ periklis ];
platforms = platforms.darwin;
};
}

View File

@ -0,0 +1,24 @@
{ qtModule
, lib
, stdenv
, qtbase
, qtdeclarative
, pkg-config
, alsa-lib
, gstreamer
, gst-plugins-base
, libpulseaudio
, wayland
}:
qtModule {
pname = "qtmultimedia";
qtInputs = [ qtbase qtdeclarative ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ gstreamer gst-plugins-base ]
# https://github.com/NixOS/nixpkgs/pull/169336 regarding libpulseaudio
++ lib.optionals stdenv.isLinux [ libpulseaudio alsa-lib wayland ];
outputs = [ "bin" "dev" "out" ];
qmakeFlags = [ "GST_VERSION=1.0" ];
NIX_LDFLAGS = lib.optionalString (stdenv.isDarwin) "-lobjc";
}

View File

@ -0,0 +1,6 @@
{ qtModule, qtbase }:
qtModule {
pname = "qtnetworkauth";
qtInputs = [ qtbase ];
}

View File

@ -0,0 +1,6 @@
{ qtModule, qtdeclarative }:
qtModule {
pname = "qtquickcontrols";
qtInputs = [ qtdeclarative ];
}

View File

@ -0,0 +1,7 @@
{ qtModule, qtdeclarative }:
qtModule {
pname = "qtquickcontrols2";
qtInputs = [ qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
}

View File

@ -0,0 +1,6 @@
{ qtModule, qtbase, qttools }:
qtModule {
pname = "qtscript";
qtInputs = [ qtbase qttools ];
}

View File

@ -0,0 +1,7 @@
{ qtModule, qtbase, qtdeclarative }:
qtModule {
pname = "qtscxml";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
}

View File

@ -0,0 +1,7 @@
{ qtModule, qtbase, qtdeclarative }:
qtModule {
pname = "qtsensors";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
}

View File

@ -0,0 +1,6 @@
{ qtModule, qtbase, qtserialport }:
qtModule {
pname = "qtserialbus";
qtInputs = [ qtbase qtserialport ];
}

View File

@ -0,0 +1,7 @@
{ qtModule, stdenv, lib, qtbase, systemd }:
qtModule {
pname = "qtserialport";
qtInputs = [ qtbase ];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-DNIXPKGS_LIBUDEV=\"${lib.getLib systemd}/lib/libudev\"";
}

View File

@ -0,0 +1,9 @@
{ lib, qtModule, stdenv, speechd, pkg-config }:
qtModule {
pname = "qtspeech";
qtInputs = [ ];
buildInputs = lib.optionals stdenv.isLinux [ speechd ];
nativeBuildInputs = [ pkg-config ];
outputs = [ "out" "dev" ];
}

View File

@ -0,0 +1,7 @@
{ qtModule, qtbase }:
qtModule {
pname = "qtsvg";
qtInputs = [ qtbase ];
outputs = [ "out" "dev" "bin" ];
}

View File

@ -0,0 +1,42 @@
{ qtModule, stdenv, lib, qtbase, qtdeclarative }:
qtModule {
pname = "qttools";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
# fixQtBuiltinPaths overwrites a builtin path we should keep
postPatch = ''
sed -i "src/linguist/linguist.pro" \
-e '/^cmake_linguist_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${lib.getDev qtbase}|'
sed -i "src/qtattributionsscanner/qtattributionsscanner.pro" \
-e '/^cmake_qattributionsscanner_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${lib.getDev qtbase}|'
'';
devTools = [
"bin/qcollectiongenerator"
"bin/linguist"
"bin/assistant"
"bin/qdoc"
"bin/lconvert"
"bin/designer"
"bin/qtattributionsscanner"
"bin/lrelease"
"bin/lrelease-pro"
"bin/pixeltool"
"bin/lupdate"
"bin/lupdate-pro"
"bin/qtdiag"
"bin/qhelpgenerator"
"bin/qtplugininfo"
"bin/qthelpconverter"
"bin/lprodump"
"bin/qdistancefieldgenerator"
] ++ lib.optionals stdenv.isDarwin [
"bin/macdeployqt"
];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
setupHook = ../hooks/qttools-setup-hook.sh;
}

View File

@ -0,0 +1,6 @@
{ qtModule, qttools }:
qtModule {
pname = "qttranslations";
qtInputs = [ qttools ];
}

View File

@ -0,0 +1,6 @@
{ qtModule, qtbase, qtdeclarative, qtsvg, hunspell }:
qtModule {
pname = "qtvirtualkeyboard";
qtInputs = [ qtbase qtdeclarative qtsvg hunspell ];
}

View File

@ -0,0 +1,36 @@
Ensure that the correct `app_id` for Wayland is set. The upstream implementation
uses `QFileInfo::baseName()`[1] which strips everything away after the first dot.
This means that `.foo-wrapped` has an empty `app_id` because `baseName` returns
an empty string in this case.
The patch basically checks whether the program has the form `.foo-wrapped` (i.e. got
wrapped by `makeWrapper`) and if that's the case, `foo` will be the correct `app_id`.
[1] https://doc.qt.io/qt-5/qfileinfo.html#baseName
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index ba881cb..b3fd031 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -167,7 +167,20 @@ void QWaylandWindow::initWindow()
Qt::SkipEmptyParts);
if (domainName.isEmpty()) {
- mShellSurface->setAppId(fi.baseName());
+ auto baseName = fi.baseName();
+ if (baseName.isEmpty()) {
+ auto fileName = fi.fileName();
+ if (fileName.endsWith("-wrapped") && fileName.startsWith(".")) {
+ do {
+ auto len = fileName.length();
+ fileName = fileName.right(len - 1);
+ fileName = fileName.left(len - 9);
+ } while (fileName.endsWith("-wrapped") && fileName.startsWith("."));
+ mShellSurface->setAppId(fileName);
+ }
+ } else {
+ mShellSurface->setAppId(baseName);
+ }
} else {
QString appId;
for (int i = 0; i < domainName.count(); ++i)

View File

@ -0,0 +1,24 @@
{ lib, qtModule, qtbase, qtquickcontrols, wayland, pkg-config, fetchpatch }:
qtModule {
pname = "qtwayland";
qtInputs = [ qtbase qtquickcontrols ];
buildInputs = [ wayland ];
nativeBuildInputs = [ pkg-config ];
outputs = [ "out" "dev" "bin" ];
patches = [
# NixOS-specific, ensure that app_id is correctly determined for
# wrapped executables from `wrapQtAppsHook` (see comment in patch for further
# context). Beware: shared among different Qt5 versions.
./qtwayland-app_id.patch
# Backport of https://codereview.qt-project.org/c/qt/qtwayland/+/388338
# Pulled from Fedora as they modified it to not apply to KDE as Plasma 5.x
# doesn't behave properly with the patch applied. See the discussion at
# https://invent.kde.org/qt/qt/qtwayland/-/merge_requests/39 for details
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/qt5-qtwayland/raw/46376bb00d4c3dd3db2e82ad7ca5301ce16ea4ab/f/0080-Client-set-constraint-adjustments-for-popups-in-xdg.patch";
sha256 = "sha256-XP+noYCk8fUdA0ItCqMjV7lSXDlNdB7Az9q7NRpupHc=";
})
];
}

View File

@ -0,0 +1,8 @@
{ qtModule, qtbase, qtdeclarative }:
qtModule {
pname = "qtwebchannel";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
}

View File

@ -0,0 +1,254 @@
{ qtModule
, qtdeclarative, qtquickcontrols, qtlocation, qtwebchannel
, bison, flex, git, gperf, ninja, pkg-config, python, which
, nodejs, qtbase, perl
, xorg, libXcursor, libXScrnSaver, libXrandr, libXtst
, fontconfig, freetype, harfbuzz, icu, dbus, libdrm
, zlib, minizip, libjpeg, libpng, libtiff, libwebp, libopus
, jsoncpp, protobuf, libvpx, srtp, snappy, nss, libevent
, alsa-lib
, libcap
, pciutils
, systemd
, enableProprietaryCodecs ? true
, gn
, cctools, libobjc, libpm, libunwind, sandbox, xnu
, ApplicationServices, AVFoundation, Foundation, ForceFeedback, GameController, AppKit
, ImageCaptureCore, CoreBluetooth, IOBluetooth, CoreWLAN, Quartz, Cocoa, LocalAuthentication
, MediaPlayer, MediaAccessibility, SecurityInterface, Vision, CoreML
, cups, openbsm, runCommand, xcbuild, writeScriptBin
, ffmpeg_4 ? null
, lib, stdenv, fetchpatch
, version ? null
, qtCompatVersion
, pipewireSupport ? stdenv.isLinux
, pipewire_0_2
, postPatch ? ""
}:
qtModule {
pname = "qtwebengine";
qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ];
nativeBuildInputs = [
bison flex git gperf ninja pkg-config python which gn nodejs
] ++ lib.optional stdenv.isDarwin xcbuild;
doCheck = true;
outputs = [ "bin" "dev" "out" ];
enableParallelBuilding = true;
# Dont use the gn setup hook
dontUseGnConfigure = true;
# ninja builds some components with -Wno-format,
# which cannot be set at the same time as -Wformat-security
hardeningDisable = [ "format" ];
postPatch = ''
# Patch Chromium build tools
(
cd src/3rdparty/chromium;
# Manually fix unsupported shebangs
substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \
--replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true
# TODO: be more precise
patchShebangs .
)
''
# Prevent Chromium build script from making the path to `clang` relative to
# the build directory. `clang_base_path` is the value of `QMAKE_CLANG_DIR`
# from `src/core/config/mac_osx.pri`.
+ lib.optionalString stdenv.isDarwin ''
substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \
--replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"'
''
# Patch library paths in Qt sources
+ ''
sed -i \
-e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \
-e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \
-e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \
src/core/web_engine_library_info.cpp
''
# Patch library paths in Chromium sources
+ lib.optionalString (!stdenv.isDarwin) ''
sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \
src/3rdparty/chromium/device/udev_linux/udev?_loader.cc
sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
'' + lib.optionalString stdenv.isDarwin (''
substituteInPlace src/buildtools/config/mac_osx.pri \
--replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
# Following is required to prevent a build error:
# ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it
substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \
--replace '$sysroot/usr' "${xnu}"
# Apple has some secret stuff they don't share with OpenBSM
substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \
--replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]"
substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \
--replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]"
# ld: warning: directory not found for option '-L/nix/store/...-xcodebuild-0.1.2-pre/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/lib'
# ld: fatal warning(s) induced error (-fatal_warnings)
substituteInPlace src/3rdparty/chromium/build/config/compiler/BUILD.gn \
--replace "-Wl,-fatal_warnings" ""
'') + postPatch;
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
# with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
"-Wno-class-memaccess"
] ++ lib.optionals (stdenv.hostPlatform.gcc.arch or "" == "sandybridge") [
# it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940
# TODO: investigate and fix properly
"-march=westmere"
] ++ lib.optionals stdenv.cc.isClang [
"-Wno-elaborated-enum-base"
]);
preConfigure = ''
export NINJAFLAGS=-j$NIX_BUILD_CORES
if [ -d "$PWD/tools/qmake" ]; then
QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
fi
'';
qmakeFlags = [ "--" "-system-ffmpeg" ]
++ lib.optional pipewireSupport "-webengine-webrtc-pipewire"
++ lib.optional enableProprietaryCodecs "-proprietary-codecs";
propagatedBuildInputs = [
# Image formats
libjpeg libpng libtiff libwebp
# Video formats
srtp libvpx
# Audio formats
libopus
# Text rendering
harfbuzz icu
libevent
ffmpeg_4
] ++ lib.optionals (!stdenv.isDarwin) [
dbus zlib minizip snappy nss protobuf jsoncpp
# Audio formats
alsa-lib
# Text rendering
fontconfig freetype
libcap
pciutils
# X11 libs
xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst
xorg.libXcomposite xorg.libXdamage libdrm xorg.libxkbfile
] ++ lib.optionals pipewireSupport [
# Pipewire
pipewire_0_2
]
# FIXME These dependencies shouldn't be needed but can't find a way
# around it. Chromium pulls this in while bootstrapping GN.
++ lib.optionals stdenv.isDarwin [
libobjc
cctools
# frameworks
ApplicationServices
AVFoundation
Foundation
ForceFeedback
GameController
AppKit
ImageCaptureCore
CoreBluetooth
IOBluetooth
CoreWLAN
Quartz
Cocoa
LocalAuthentication
MediaPlayer
MediaAccessibility
SecurityInterface
Vision
CoreML
openbsm
libunwind
];
buildInputs = lib.optionals stdenv.isDarwin [
cups
libpm
sandbox
# `sw_vers` is used by `src/3rdparty/chromium/build/config/mac/sdk_info.py`
# to get some information about the host platform.
(writeScriptBin "sw_vers" ''
#!${stdenv.shell}
while [ $# -gt 0 ]; do
case "$1" in
-buildVersion) echo "17E199";;
*) break ;;
esac
shift
done
'')
];
dontUseNinjaBuild = true;
dontUseNinjaInstall = true;
postInstall = lib.optionalString stdenv.isLinux ''
cat > $out/libexec/qt.conf <<EOF
[Paths]
Prefix = ..
EOF
'' + ''
# Fix for out-of-sync QtWebEngine and Qt releases (since 5.15.3)
sed 's/${lib.head (lib.splitString "-" version)} /${qtCompatVersion} /' -i "$out"/lib/cmake/*/*Config.cmake
'';
requiredSystemFeatures = [ "big-parallel" ];
meta = with lib; {
description = "A web engine based on the Chromium web browser";
maintainers = with maintainers; [ matthewbauer ];
# qtwebengine-5.15.8: "QtWebEngine can only be built for x86,
# x86-64, ARM, Aarch64, and MIPSel architectures."
platforms =
lib.trivial.pipe lib.systems.doubles.all [
(map (double: lib.systems.elaborate { system = double; }))
(lib.lists.filter (parsedPlatform: with parsedPlatform;
isUnix &&
(isx86_32 ||
isx86_64 ||
isAarch32 ||
isAarch64 ||
(isMips && isLittleEndian))))
(map (plat: plat.system))
];
broken = stdenv.isDarwin && stdenv.isx86_64;
# This build takes a long time; particularly on slow architectures
timeout = 24 * 3600;
};
}

View File

@ -0,0 +1,6 @@
{ qtModule, qtbase, qtwebsockets }:
qtModule {
pname = "qtwebglplugin";
qtInputs = [ qtbase qtwebsockets ];
}

View File

@ -0,0 +1,62 @@
{ qtModule, stdenv, lib, fetchurl
, qtbase, qtdeclarative, qtlocation, qtmultimedia, qtsensors, qtwebchannel
, fontconfig, libwebp, libxml2, libxslt
, sqlite, systemd, glib, gst_all_1, cmake
, bison, flex, gdb, gperf, perl, pkg-config, python38, ruby
, ICU, OpenGL
}:
let
hyphen = stdenv.mkDerivation rec {
pname = "hyphen";
version = "2.8.8";
src = fetchurl {
url = "http://dev-www.libreoffice.org/src/5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-${version}.tar.gz";
sha256 = "304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705";
};
postPatch = ''
patchShebangs tests
'';
buildInputs = [ perl ];
};
in
qtModule {
pname = "qtwebkit";
qtInputs = [ qtbase qtdeclarative qtlocation qtsensors qtwebchannel ]
++ lib.optional stdenv.isDarwin qtmultimedia;
buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base hyphen ]
++ lib.optionals stdenv.isDarwin [ ICU OpenGL ];
nativeBuildInputs = [ bison flex gdb gperf perl pkg-config python38 ruby cmake ];
cmakeFlags = [ "-DPORT=Qt" ]
++ lib.optionals stdenv.isDarwin [
"-DQt5Multimedia_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5Multimedia"
"-DQt5MultimediaWidgets_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets"
"-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF"
];
env.NIX_CFLAGS_COMPILE = toString ([
# with gcc7 this warning blows the log over Hydra's limit
"-Wno-expansion-to-defined"
]
# with gcc8, -Wclass-memaccess became part of -Wall and this too exceeds the logging limit
++ lib.optional stdenv.cc.isGNU "-Wno-class-memaccess"
# with clang this warning blows the log over Hydra's limit
++ lib.optional stdenv.isDarwin "-Wno-inconsistent-missing-override"
++ lib.optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${lib.getLib systemd}/lib/libudev"'');
doCheck = false; # fails 13 out of 13 tests (ctest)
# Hack to avoid TMPDIR in RPATHs.
preFixup = ''
rm -rf "$(pwd)"
mkdir "$(pwd)"
'';
meta = {
maintainers = with lib.maintainers; [ abbradar periklis ];
knownVulnerabilities = [
"QtWebkit upstream is unmaintained and receives no security updates, see https://blogs.gnome.org/mcatanzaro/2022/11/04/stop-using-qtwebkit/"
];
};
}

View File

@ -0,0 +1,7 @@
{ qtModule, qtbase, qtdeclarative }:
qtModule {
pname = "qtwebsockets";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
}

View File

@ -0,0 +1,12 @@
{ lib, stdenv, qtModule, qtdeclarative, qtwebengine, CoreFoundation, WebKit }:
qtModule {
pname = "qtwebview";
qtInputs = [ qtdeclarative qtwebengine ];
buildInputs = lib.optionals stdenv.isDarwin [
CoreFoundation
WebKit
];
outputs = [ "out" "dev" "bin" ];
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreFoundation -framework WebKit";
}

View File

@ -0,0 +1,6 @@
{ qtModule, qtbase }:
qtModule {
pname = "qtx11extras";
qtInputs = [ qtbase ];
}

View File

@ -0,0 +1,7 @@
{ qtModule, qtbase, qtdeclarative }:
qtModule {
pname = "qtxmlpatterns";
qtInputs = [ qtbase qtdeclarative ];
devTools = [ "bin/xmlpatterns" "bin/xmlpatternsvalidator" ];
}

21
nix/pkgs/qt-5/qt-env.nix Normal file
View File

@ -0,0 +1,21 @@
{ buildEnv, qtbase }: name: paths:
buildEnv {
inherit name;
paths = [ qtbase ] ++ paths;
pathsToLink = [ "/bin" "/mkspecs" "/include" "/lib" "/share" ];
extraOutputsToInstall = [ "out" "dev" ];
postBuild = ''
rm "$out/bin/qmake"
cp "${qtbase.dev}/bin/qmake" "$out/bin"
cat >"$out/bin/qt.conf" <<EOF
[Paths]
Prefix = $out
Plugins = ${qtbase.qtPluginPrefix}
Qml2Imports = ${qtbase.qtQmlPrefix}
Documentation = ${qtbase.qtDocPrefix}
EOF
'';
}

View File

@ -0,0 +1,77 @@
{ lib, mkDerivation, perl }:
let inherit (lib) licenses maintainers platforms; in
{ self, srcs, patches }:
args:
let
inherit (args) pname;
version = args.version or srcs.${pname}.version;
src = args.src or srcs.${pname}.src;
in
mkDerivation (args // {
inherit pname version src;
patches = (args.patches or []) ++ (patches.${pname} or []);
nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ perl self.qmake ];
propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []);
outputs = args.outputs or [ "out" "dev" ];
setOutputFlags = args.setOutputFlags or false;
preHook = ''
. ${./hooks/move-qt-dev-tools.sh}
. ${./hooks/fix-qt-builtin-paths.sh}
'';
preConfigure = ''
${args.preConfigure or ""}
fixQtBuiltinPaths . '*.pr?'
'' + lib.optionalString (builtins.compareVersions "5.15.0" version <= 0)
# Note: We use ${version%%-*} to remove any tag from the end of the version
# string. Version tags are added by Nixpkgs maintainers and not reflected in
# the source version.
''
if [[ -z "$dontCheckQtModuleVersion" ]] \
&& grep -q '^MODULE_VERSION' .qmake.conf 2>/dev/null \
&& ! grep -q -F "''${version%%-*}" .qmake.conf 2>/dev/null
then
echo >&2 "error: could not find version ''${version%%-*} in .qmake.conf"
echo >&2 "hint: check .qmake.conf and update the package version in Nixpkgs"
exit 1
fi
if [[ -z "$dontSyncQt" && -f sync.profile ]]; then
syncqt.pl -version "''${version%%-*}"
fi
'';
dontWrapQtApps = args.dontWrapQtApps or true;
postFixup = ''
if [ -d "''${!outputDev}/lib/pkgconfig" ]; then
find "''${!outputDev}/lib/pkgconfig" -name '*.pc' | while read pc; do
sed -i "$pc" \
-e "/^prefix=/ c prefix=''${!outputLib}" \
-e "/^exec_prefix=/ c exec_prefix=''${!outputBin}" \
-e "/^includedir=/ c includedir=''${!outputDev}/include"
done
fi
moveQtDevTools
${args.postFixup or ""}
'';
meta = {
homepage = "https://www.qt.io";
description = "A cross-platform application framework for C++";
license = with licenses; [ fdl13Plus gpl2Plus lgpl21Plus lgpl3Plus ];
maintainers = with maintainers; [ qknight ttuegel periklis bkchr ];
platforms = platforms.unix;
} // (args.meta or {});
})