diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix index 77b8c3f525a2..680debc164f7 100644 --- a/pkgs/development/libraries/qt-5/5.12/default.nix +++ b/pkgs/development/libraries/qt-5/5.12/default.nix @@ -14,21 +14,18 @@ top-level attribute to `top-level/all-packages.nix`. */ -{ - newScope, - lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper, - bison, cups ? null, harfbuzz, libGL, perl, - gstreamer, gst-plugins-base, gtk3, dconf, - llvmPackages_5, +{ newScope +, lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper +, bison, cups ? null, harfbuzz, libGL, perl +, gstreamer, gst-plugins-base, gtk3, dconf +, llvmPackages_5, darwin # options - developerBuild ? false, - decryptSslTraffic ? false, - debug ? false, +, developerBuild ? false +, decryptSslTraffic ? false +, debug ? false }: -with lib; - let qtCompatVersion = srcs.qtbase.version; @@ -50,31 +47,30 @@ let }; patches = { - qtbase = - [ - ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch - ./qtbase.patch.d/0002-qtbase-mac.patch - ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch + qtbase = [ + ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch + ./qtbase.patch.d/0002-qtbase-mac.patch + ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch - # Patch framework detection to support X.framework/X.tbd, - # extending the current support for X.framework/X. - ./qtbase.patch.d/0015-qtbase-tbd-frameworks.patch + # Patch framework detection to support X.framework/X.tbd, + # extending the current support for X.framework/X. + ./qtbase.patch.d/0015-qtbase-tbd-frameworks.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-xcompose.patch - ./qtbase.patch.d/0009-qtbase-tzdir.patch - ./qtbase.patch.d/0010-qtbase-qtpluginpath.patch - ./qtbase.patch.d/0011-qtbase-assert.patch - ./qtbase.patch.d/0012-fix-header_module.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-xcompose.patch + ./qtbase.patch.d/0009-qtbase-tzdir.patch + ./qtbase.patch.d/0010-qtbase-qtpluginpath.patch + ./qtbase.patch.d/0011-qtbase-assert.patch + ./qtbase.patch.d/0012-fix-header_module.patch - # Ensure -I${includedir} is added to Cflags in pkg-config files. - # See https://github.com/NixOS/nixpkgs/issues/52457 - ./qtbase.patch.d/0014-qtbase-pkg-config.patch - ]; + # Ensure -I${includedir} is added to Cflags in pkg-config files. + # See https://github.com/NixOS/nixpkgs/issues/52457 + ./qtbase.patch.d/0014-qtbase-pkg-config.patch + ]; qtdeclarative = [ ./qtdeclarative.patch ]; qtlocation = [ ./qtlocation-gcc-9.patch ]; qtscript = [ ./qtscript.patch ]; @@ -143,6 +139,9 @@ let inherit bison cups harfbuzz libGL; withGtk3 = true; inherit dconf gtk3; inherit debug developerBuild decryptSslTraffic; + inherit (darwin.apple_sdk.frameworks) AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth + CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit; + inherit (darwin) libobjc; }; qtcharts = callPackage ../modules/qtcharts.nix {}; @@ -173,11 +172,21 @@ let qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix {}; qtwayland = callPackage ../modules/qtwayland.nix {}; qtwebchannel = callPackage ../modules/qtwebchannel.nix {}; - qtwebengine = callPackage ../modules/qtwebengine.nix {}; + qtwebengine = callPackage ../modules/qtwebengine.nix { + inherit (darwin) cctools libobjc libunwind xnu; + inherit (darwin.apple_sdk.libs) sandbox; + inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit + ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication; + }; qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {}; - qtwebkit = callPackage ../modules/qtwebkit.nix {}; + qtwebkit = callPackage ../modules/qtwebkit.nix { + inherit (darwin) ICU; + inherit (darwin.apple_sdk.frameworks) OpenGL; + }; qtwebsockets = callPackage ../modules/qtwebsockets.nix {}; - qtwebview = callPackage ../modules/qtwebview.nix {}; + qtwebview = callPackage ../modules/qtwebview.nix { + inherit (darwin.apple_sdk.frameworks) CoreFoundation WebKit; + }; qtx11extras = callPackage ../modules/qtx11extras.nix {}; qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {}; @@ -188,8 +197,8 @@ let qtscript qtsensors qtserialport qtsvg qttools qttranslations qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets qtwebview qtx11extras qtxmlpatterns - ] ++ optional (!stdenv.isDarwin) qtwayland - ++ optional (stdenv.isDarwin) qtmacextras); + ] ++ lib.optional (!stdenv.isDarwin) qtwayland + ++ lib.optional (stdenv.isDarwin) qtmacextras); qmake = makeSetupHook { deps = [ self.qtbase.dev ]; @@ -200,12 +209,11 @@ let } ../hooks/qmake-hook.sh; wrapQtAppsHook = makeSetupHook { - deps = - [ self.qtbase.dev makeWrapper ] - ++ optional stdenv.isLinux self.qtwayland.dev; + deps = [ self.qtbase.dev makeWrapper ] + ++ lib.optional stdenv.isLinux self.qtwayland.dev; } ../hooks/wrap-qt-apps-hook.sh; }; - self = makeScope newScope addPackages; + self = lib.makeScope newScope addPackages; in self diff --git a/pkgs/development/libraries/qt-5/5.14/default.nix b/pkgs/development/libraries/qt-5/5.14/default.nix index 02b170e0eb17..eaf7998047f0 100644 --- a/pkgs/development/libraries/qt-5/5.14/default.nix +++ b/pkgs/development/libraries/qt-5/5.14/default.nix @@ -14,21 +14,18 @@ top-level attribute to `top-level/all-packages.nix`. */ -{ - newScope, - lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper, - bison, cups ? null, harfbuzz, libGL, perl, - gstreamer, gst-plugins-base, gtk3, dconf, - llvmPackages_5, +{ newScope +, lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper +, bison, cups ? null, harfbuzz, libGL, perl +, gstreamer, gst-plugins-base, gtk3, dconf +, llvmPackages_5, darwin # options - developerBuild ? false, - decryptSslTraffic ? false, - debug ? false, +, developerBuild ? false +, decryptSslTraffic ? false +, debug ? false }: -with lib; - let qtCompatVersion = srcs.qtbase.version; @@ -51,29 +48,27 @@ let }; patches = { - qtbase = - optionals stdenv.isDarwin [ - ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch + qtbase = lib.optionals stdenv.isDarwin [ + ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch - # Downgrade minimal required SDK to 10.12 - ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch - ./qtbase.patch.d/qtbase-sdk-10.12-mac.patch + # Downgrade minimal required SDK to 10.12 + ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch + ./qtbase.patch.d/qtbase-sdk-10.12-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/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 - ]; + # 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/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 ]; qtlocation = [ ./qtlocation-gcc-9.patch ]; qtscript = [ ./qtscript.patch ]; @@ -103,8 +98,7 @@ let stripLen = 1; extraPrefix = "src/3rdparty/"; }) - ] - ++ optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch; + ] ++ lib.optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch; qtwebkit = [ (fetchpatch { name = "qtwebkit-bison-3.7-build.patch"; @@ -118,7 +112,7 @@ let }) ./qtwebkit.patch ./qtwebkit-icu68.patch - ] ++ optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ ./qtwebkit-darwin-no-readline.patch ./qtwebkit-darwin-no-qos-classes.patch ]; @@ -157,6 +151,9 @@ let inherit bison cups harfbuzz libGL; withGtk3 = true; inherit dconf gtk3; inherit debug developerBuild decryptSslTraffic; + inherit (darwin.apple_sdk.frameworks) AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth + CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit; + inherit (darwin) libobjc; }; qtcharts = callPackage ../modules/qtcharts.nix {}; @@ -185,11 +182,21 @@ let qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix {}; qtwayland = callPackage ../modules/qtwayland.nix {}; qtwebchannel = callPackage ../modules/qtwebchannel.nix {}; - qtwebengine = callPackage ../modules/qtwebengine.nix {}; + qtwebengine = callPackage ../modules/qtwebengine.nix { + inherit (darwin) cctools libobjc libunwind xnu; + inherit (darwin.apple_sdk.libs) sandbox; + inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit + ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication; + }; qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {}; - qtwebkit = callPackage ../modules/qtwebkit.nix {}; + qtwebkit = callPackage ../modules/qtwebkit.nix { + inherit (darwin) ICU; + inherit (darwin.apple_sdk.frameworks) OpenGL; + }; qtwebsockets = callPackage ../modules/qtwebsockets.nix {}; - qtwebview = callPackage ../modules/qtwebview.nix {}; + qtwebview = callPackage ../modules/qtwebview.nix { + inherit (darwin.apple_sdk.frameworks) CoreFoundation WebKit; + }; qtx11extras = callPackage ../modules/qtx11extras.nix {}; qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {}; @@ -200,8 +207,8 @@ let qtscript qtsensors qtserialport qtsvg qttools qttranslations qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets qtwebview qtx11extras qtxmlpatterns - ] ++ optional (!stdenv.isDarwin) qtwayland - ++ optional (stdenv.isDarwin) qtmacextras); + ] ++ lib.optional (!stdenv.isDarwin) qtwayland + ++ lib.optional (stdenv.isDarwin) qtmacextras); qmake = makeSetupHook { deps = [ self.qtbase.dev ]; @@ -212,12 +219,11 @@ let } ../hooks/qmake-hook.sh; wrapQtAppsHook = makeSetupHook { - deps = - [ self.qtbase.dev makeWrapper ] - ++ optional stdenv.isLinux self.qtwayland.dev; + deps = [ self.qtbase.dev makeWrapper ] + ++ lib.optional stdenv.isLinux self.qtwayland.dev; } ../hooks/wrap-qt-apps-hook.sh; }; - self = makeScope newScope addPackages; + self = lib.makeScope newScope addPackages; in self diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix index 1bd1b5633509..b078a696d9c7 100644 --- a/pkgs/development/libraries/qt-5/5.15/default.nix +++ b/pkgs/development/libraries/qt-5/5.15/default.nix @@ -14,21 +14,18 @@ top-level attribute to `top-level/all-packages.nix`. */ -{ - newScope, - lib, stdenv, fetchurl, fetchpatch, fetchgit, fetchFromGitHub, makeSetupHook, makeWrapper, - bison, cups ? null, harfbuzz, libGL, perl, - gstreamer, gst-plugins-base, gtk3, dconf, - llvmPackages_5, +{ newScope +, lib, stdenv, fetchurl, fetchgit, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper +, bison, cups ? null, harfbuzz, libGL, perl +, gstreamer, gst-plugins-base, gtk3, dconf +, llvmPackages_5, darwin # options - developerBuild ? false, - decryptSslTraffic ? false, - debug ? false, +, developerBuild ? false +, decryptSslTraffic ? false +, debug ? false }: -with lib; - let qtCompatVersion = srcs.qtbase.version; @@ -67,7 +64,7 @@ let inherit rev branchName; fetchSubmodules = true; leaveDotGit = true; - name = "qtwebengine-${substring 0 7 rev}.tar.gz"; + name = "qtwebengine-${lib.substring 0 7 rev}.tar.gz"; postFetch = '' # remove submodule .git directory rm -rf $out/src/3rdparty/.git @@ -87,40 +84,38 @@ let }; patches = { - qtbase = - optionals stdenv.isDarwin [ - ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch + qtbase = lib.optionals stdenv.isDarwin [ + ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch - # Downgrade minimal required SDK to 10.12 - ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch - ./qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch - ./qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch - ./qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch - ./qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch - ./qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch - ./qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch - ./qtbase.patch.d/qtbase-sdk-10.12-mac.patch + # Downgrade minimal required SDK to 10.12 + ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch + ./qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch + ./qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch + ./qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch + ./qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch + ./qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch + ./qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch + ./qtbase.patch.d/qtbase-sdk-10.12-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/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 - (fetchpatch { # This can be removed when https://codereview.qt-project.org/c/qt/qtbase/+/339323 is included in an release. - name = "0014-gcc11-compat.patch"; - url = "https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=patch;h=049e14870c13235cd066758f29c42dc96c1ccdf8"; - sha256 = "1cb2hwi859hds0fa2cbap014qaa7mah9p0rcxcm2cvj2ybl33qfc"; - }) - ]; + # 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/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 + (fetchpatch { # This can be removed when https://codereview.qt-project.org/c/qt/qtbase/+/339323 is included in an release. + name = "0014-gcc11-compat.patch"; + url = "https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=patch;h=049e14870c13235cd066758f29c42dc96c1ccdf8"; + sha256 = "1cb2hwi859hds0fa2cbap014qaa7mah9p0rcxcm2cvj2ybl33qfc"; + }) + ]; qtdeclarative = [ ./qtdeclarative.patch ]; qtscript = [ ./qtscript.patch ]; qtserialport = [ ./qtserialport.patch ]; @@ -136,7 +131,7 @@ let name = "qtwebengine-everywhere-src-5.15.5-_1904652.patch"; sha256 = "01q7hagq0ysii1jnrh5adm97vdm9cis592xr6im7accyw6hgcn7b"; }) - ] ++ optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ ./qtwebengine-darwin-no-platform-check.patch ./qtwebengine-mac-dont-set-dsymutil-path.patch ]; @@ -153,7 +148,7 @@ let }) ./qtwebkit.patch ./qtwebkit-icu68.patch - ] ++ optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ ./qtwebkit-darwin-no-readline.patch ./qtwebkit-darwin-no-qos-classes.patch ]; @@ -191,6 +186,9 @@ let inherit bison cups harfbuzz libGL; withGtk3 = true; inherit dconf gtk3; inherit developerBuild decryptSslTraffic; + inherit (darwin.apple_sdk.frameworks) AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth + CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit; + inherit (darwin) libobjc; }; qtcharts = callPackage ../modules/qtcharts.nix {}; @@ -222,11 +220,20 @@ let qtwebchannel = callPackage ../modules/qtwebchannel.nix {}; qtwebengine = callPackage ../modules/qtwebengine.nix { inherit (srcs.qtwebengine) version; + inherit (darwin) cctools libobjc libunwind xnu; + inherit (darwin.apple_sdk.libs) sandbox; + inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit + ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication; }; qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {}; - qtwebkit = callPackage ../modules/qtwebkit.nix {}; + qtwebkit = callPackage ../modules/qtwebkit.nix { + inherit (darwin) ICU; + inherit (darwin.apple_sdk.frameworks) OpenGL; + }; qtwebsockets = callPackage ../modules/qtwebsockets.nix {}; - qtwebview = callPackage ../modules/qtwebview.nix {}; + qtwebview = callPackage ../modules/qtwebview.nix { + inherit (darwin.apple_sdk.frameworks) CoreFoundation WebKit; + }; qtx11extras = callPackage ../modules/qtx11extras.nix {}; qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {}; @@ -237,8 +244,8 @@ let qtscript qtsensors qtserialport qtsvg qttools qttranslations qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets qtwebview qtx11extras qtxmlpatterns - ] ++ optional (!stdenv.isDarwin) qtwayland - ++ optional (stdenv.isDarwin) qtmacextras); + ] ++ lib.optional (!stdenv.isDarwin) qtwayland + ++ lib.optional (stdenv.isDarwin) qtmacextras); qmake = makeSetupHook { deps = [ self.qtbase.dev ]; @@ -249,12 +256,11 @@ let } ../hooks/qmake-hook.sh; wrapQtAppsHook = makeSetupHook { - deps = - [ self.qtbase.dev makeWrapper ] - ++ optional stdenv.isLinux self.qtwayland.dev; + deps = [ self.qtbase.dev makeWrapper ] + ++ lib.optional stdenv.isLinux self.qtwayland.dev; } ../hooks/wrap-qt-apps-hook.sh; }; - self = makeScope newScope addPackages; + self = lib.makeScope newScope addPackages; in self diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index 4291390c72ca..04a89558c3d0 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -1,30 +1,30 @@ -{ - stdenv, lib, - src, patches, version, qtCompatVersion, +{ stdenv, lib +, src, patches, version, qtCompatVersion - coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3, - which, +, coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3 +, which # darwin support - darwin, libiconv, xcbuild, +, libiconv, libobjc, xcbuild, AGL, AppKit, ApplicationServices, Carbon, Cocoa, CoreAudio, CoreBluetooth +, CoreLocation, CoreServices, DiskArbitration, Foundation, OpenGL, MetalKit, IOKit - dbus, fontconfig, freetype, glib, harfbuzz, icu, libX11, libXcomposite, - libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng, - libxcb, libxkbcommon, libxml2, libxslt, openssl, pcre16, pcre2, sqlite, udev, - xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilrenderutil, xcbutilwm, - zlib, +, dbus, fontconfig, freetype, glib, harfbuzz, icu, libX11, libXcomposite +, libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng +, libxcb, libxkbcommon, libxml2, libxslt, openssl, pcre16, pcre2, sqlite, udev +, xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilrenderutil, xcbutilwm +, zlib # optional dependencies - cups ? null, libmysqlclient ? null, postgresql ? null, - withGtk3 ? false, dconf ? null, gtk3 ? null, +, cups ? null, libmysqlclient ? null, postgresql ? null +, withGtk3 ? false, dconf ? null, gtk3 ? null # options - libGLSupported ? !stdenv.isDarwin, - libGL, - buildExamples ? false, - buildTests ? false, - debug ? false, - developerBuild ? false, - decryptSslTraffic ? false +, libGLSupported ? !stdenv.isDarwin +, libGL +, buildExamples ? false +, buildTests ? false +, debug ? false +, developerBuild ? false +, decryptSslTraffic ? false }: assert withGtk3 -> dconf != null; @@ -32,53 +32,43 @@ assert withGtk3 -> gtk3 != null; let compareVersion = v: builtins.compareVersions version v; - qmakeCacheName = - if compareVersion "5.12.4" < 0 then ".qmake.cache" else ".qmake.stash"; + qmakeCacheName = if compareVersion "5.12.4" < 0 then ".qmake.cache" else ".qmake.stash"; debugSymbols = debug || developerBuild; in stdenv.mkDerivation { - - name = "qtbase-${version}"; + pname = "qtbase"; inherit qtCompatVersion src version; debug = debugSymbols; - propagatedBuildInputs = - [ - libxml2 libxslt openssl sqlite zlib + propagatedBuildInputs = [ + libxml2 libxslt openssl sqlite zlib + + # Text rendering + harfbuzz icu + + # Image formats + libjpeg libpng + (if compareVersion "5.9.0" < 0 then pcre16 else pcre2) + ] ++ ( + if stdenv.isDarwin then [ + # TODO: move to buildInputs, this should not be propagated. + AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth + CoreLocation CoreServices DiskArbitration Foundation OpenGL + libobjc libiconv MetalKit IOKit + ] else [ + dbus glib udev # Text rendering - harfbuzz icu + fontconfig freetype - # Image formats - libjpeg libpng - (if compareVersion "5.9.0" < 0 then pcre16 else pcre2) - ] - ++ ( - if stdenv.isDarwin - then with darwin.apple_sdk.frameworks; - [ - # TODO: move to buildInputs, this should not be propagated. - AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth - CoreLocation CoreServices DiskArbitration Foundation OpenGL - darwin.libobjc libiconv MetalKit IOKit - ] - else - [ - dbus glib udev + # X11 libs + libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil + xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm + ] ++ lib.optional libGLSupported libGL + ); - # Text rendering - fontconfig freetype - - # X11 libs - libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil - xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm - ] - ++ lib.optional libGLSupported libGL - ); - - buildInputs = - [ python3 ] + buildInputs = [ python3 ] ++ lib.optionals (!stdenv.isDarwin) ( [ libinput ] @@ -89,8 +79,7 @@ stdenv.mkDerivation { ++ lib.optional (libmysqlclient != null) libmysqlclient ++ lib.optional (postgresql != null) postgresql; - nativeBuildInputs = - [ bison flex gperf lndir perl pkg-config which ] + nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which ] ++ lib.optionals stdenv.isDarwin [ xcbuild ]; propagatedNativeBuildInputs = [ lndir ]; @@ -108,53 +97,42 @@ stdenv.mkDerivation { . ${../hooks/fix-qmake-libtool.sh} ''; - postPatch = + 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 + '' + ( + 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/" '' - 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 - '' - - + ( - 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/" "${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework/" - substituteInPlace ./mkspecs/common/mac.conf \ - --replace "/System/Library/Frameworks/AGL.framework/" "${darwin.apple_sdk.frameworks.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"; @@ -213,153 +191,128 @@ stdenv.mkDerivation { 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)" + configureFlags = [ + "-plugindir $(out)/$(qtPluginPrefix)" + "-qmldir $(out)/$(qtQmlPrefix)" + "-docdir $(out)/$(qtDocPrefix)" - "-verbose" - "-confirm-license" - "-opensource" + "-verbose" + "-confirm-license" + "-opensource" - "-release" - "-shared" - "-accessibility" - "-optimized-qmake" - "-strip" - "-system-proxies" - "-pkg-config" + "-release" + "-shared" + "-accessibility" + "-optimized-qmake" + "-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 (compareVersion "5.11.0" < 0) - [ - "-qml-debug" - ] - ++ lib.optionals (compareVersion "5.9.0" < 0) - [ - "-c++11" - "-no-reduce-relocations" - ] - ++ lib.optionals developerBuild [ - "-developer-build" - "-no-warnings-are-errors" + "-gui" + "-widgets" + "-opengl desktop" + "-icu" + "-L" "${icu.out}/lib" + "-I" "${icu.dev}/include" + "-pch" + ] ++ lib.optional debugSymbols "-debug" + ++ lib.optionals (compareVersion "5.11.0" < 0) [ + "-qml-debug" + ] ++ lib.optionals (compareVersion "5.9.0" < 0) [ + "-c++11" + "-no-reduce-relocations" + ] ++ lib.optionals developerBuild [ + "-developer-build" + "-no-warnings-are-errors" + ] ++ (if (!stdenv.hostPlatform.isx86_64) then [ + "-no-sse2" + ] else lib.optionals (compareVersion "5.9.0" >= 0) [ + "-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" "${openssl.out}/lib" + "-I" "${openssl.dev}/include" + "-system-sqlite" + ''-${if libmysqlclient != null 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'' + ] ++ lib.optional (compareVersion "5.15.0" < 0) "-v" ++ ( - if (!stdenv.hostPlatform.isx86_64) then [ - "-no-sse2" - ] else if (compareVersion "5.9.0" >= 0) then [ - "-sse2" - "${if stdenv.hostPlatform.sse3Support then "" else "-no"}-sse3" - "${if stdenv.hostPlatform.ssse3Support then "" else "-no"}-ssse3" - "${if stdenv.hostPlatform.sse4_1Support then "" else "-no"}-sse4.1" - "${if stdenv.hostPlatform.sse4_2Support then "" else "-no"}-sse4.2" - "${if stdenv.hostPlatform.avxSupport then "" else "-no"}-avx" - "${if stdenv.hostPlatform.avx2Support then "" else "-no"}-avx2" - ] else [ - ] - ) - ++ [ - "-no-mips_dsp" - "-no-mips_dspr2" + if stdenv.isDarwin then [ + "-platform macx-clang" + "-no-fontconfig" + "-qt-freetype" + "-qt-libpng" + "-no-framework" + ] else [ + "-${lib.optionalString (compareVersion "5.9.0" < 0) "no-"}rpath" + ] ++ lib.optional (compareVersion "5.15.0" < 0) "-system-xcb" + ++ [ + "-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" + ] ++ lib.optional (compareVersion "5.15.0" < 0) "-system-libjpeg" + ++ [ + "-system-libpng" + ] ++ lib.optional withGtk3 "-gtk" + ++ lib.optional (compareVersion "5.9.0" >= 0) "-inotify" + ++ lib.optionals (compareVersion "5.10.0" >= 0) [ + # Without these, Qt stops working on kernels < 3.17. See: + # https://github.com/NixOS/nixpkgs/issues/38832 + "-no-feature-renameat2" + "-no-feature-getentropy" + ] ++ lib.optionals (compareVersion "5.12.1" < 0) [ + # use -xkbcommon and -xkbcommon-evdev for versions before 5.12.1 + "-system-xkbcommon" + "-xkbcommon-evdev" + ] ++ lib.optionals (cups != null) [ + "-L" "${cups.lib}/lib" + "-I" "${cups.dev}/include" + ] ++ lib.optionals (libmysqlclient != null) [ + "-L" "${libmysqlclient}/lib" + "-I" "${libmysqlclient}/include" ] + ); - ++ [ - "-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" "${openssl.out}/lib" - "-I" "${openssl.dev}/include" - "-system-sqlite" - ''-${if libmysqlclient != null 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'' - ] - ++ lib.optional (compareVersion "5.15.0" < 0) "-v" - - ++ ( - if stdenv.isDarwin - then - [ - "-platform macx-clang" - "-no-fontconfig" - "-qt-freetype" - "-qt-libpng" - "-no-framework" - ] - else - [ - "-${lib.optionalString (compareVersion "5.9.0" < 0) "no-"}rpath" - ] - ++ lib.optional (compareVersion "5.15.0" < 0) "-system-xcb" - ++ [ - "-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" - ] - ++ lib.optional (compareVersion "5.15.0" < 0) "-system-libjpeg" - ++ [ - "-system-libpng" - ] - ++ lib.optional withGtk3 "-gtk" - ++ lib.optional (compareVersion "5.9.0" >= 0) "-inotify" - ++ lib.optionals (compareVersion "5.10.0" >= 0) [ - # Without these, Qt stops working on kernels < 3.17. See: - # https://github.com/NixOS/nixpkgs/issues/38832 - "-no-feature-renameat2" - "-no-feature-getentropy" - ] - ++ lib.optionals (compareVersion "5.12.1" < 0) [ - # use -xkbcommon and -xkbcommon-evdev for versions before 5.12.1 - "-system-xkbcommon" - "-xkbcommon-evdev" - ] - ++ lib.optionals (cups != null) [ - "-L" "${cups.lib}/lib" - "-I" "${cups.dev}/include" - ] - ++ lib.optionals (libmysqlclient != null) [ - "-L" "${libmysqlclient}/lib" - "-I" "${libmysqlclient}/include" - ] - ); - - postInstall = - # Move selected outputs. - '' - moveToOutput "mkspecs" "$dev" - ''; + # Move selected outputs. + postInstall = '' + moveToOutput "mkspecs" "$dev" + ''; devTools = [ "bin/fixqt4headers.pl" @@ -373,35 +326,27 @@ stdenv.mkDerivation { "bin/uic" ]; - postFixup = + 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?' - '' + 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" - '' + 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" - ''; + sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \ + -e "/^host_bins=/ c host_bins=$dev/bin" + ''; dontStrip = debugSymbols; setupHook = ../hooks/qtbase-setup-hook.sh; meta = with lib; { - homepage = "http://www.qt.io"; + homepage = "https://www.qt.io/"; description = "A cross-platform application framework for C++"; license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ]; maintainers = with maintainers; [ qknight ttuegel periklis bkchr ]; diff --git a/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix b/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix index 97248ca18076..89f2672c26dd 100644 --- a/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix +++ b/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix @@ -1,7 +1,5 @@ { qtModule, lib, python3, qtbase, qtsvg }: -with lib; - qtModule { pname = "qtdeclarative"; qtInputs = [ qtbase qtsvg ]; diff --git a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix index 0d2d565fe7ae..baf5c30e73c4 100644 --- a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix +++ b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix @@ -1,17 +1,24 @@ -{ qtModule, lib, stdenv, qtbase, qtdeclarative, pkg-config -, alsa-lib, gstreamer, gst-plugins-base, libpulseaudio, wayland +{ qtModule +, lib +, stdenv +, qtbase +, qtdeclarative +, pkg-config +, alsa-lib +, gstreamer +, gst-plugins-base +, libpulseaudio +, wayland }: -with lib; - qtModule { pname = "qtmultimedia"; qtInputs = [ qtbase qtdeclarative ]; nativeBuildInputs = [ pkg-config ]; buildInputs = [ gstreamer gst-plugins-base libpulseaudio ] - ++ optional (stdenv.isLinux) alsa-lib - ++ optional (versionAtLeast qtbase.version "5.14.0" && stdenv.isLinux) wayland; + ++ lib.optional (stdenv.isLinux) alsa-lib + ++ lib.optional (lib.versionAtLeast qtbase.version "5.14.0" && stdenv.isLinux) wayland; outputs = [ "bin" "dev" "out" ]; qmakeFlags = [ "GST_VERSION=1.0" ]; - NIX_LDFLAGS = optionalString (stdenv.isDarwin) "-lobjc"; + NIX_LDFLAGS = lib.optionalString (stdenv.isDarwin) "-lobjc"; } diff --git a/pkgs/development/libraries/qt-5/modules/qtserialport.nix b/pkgs/development/libraries/qt-5/modules/qtserialport.nix index caeaedbcf3d5..89d96eb29124 100644 --- a/pkgs/development/libraries/qt-5/modules/qtserialport.nix +++ b/pkgs/development/libraries/qt-5/modules/qtserialport.nix @@ -1,11 +1,7 @@ { qtModule, stdenv, lib, qtbase, systemd }: -let inherit (lib) getLib optional; in - qtModule { pname = "qtserialport"; qtInputs = [ qtbase ]; - NIX_CFLAGS_COMPILE = - optional stdenv.isLinux - ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"''; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-DNIXPKGS_LIBUDEV=\"${lib.getLib systemd}/lib/libudev\""; } diff --git a/pkgs/development/libraries/qt-5/modules/qttools.nix b/pkgs/development/libraries/qt-5/modules/qttools.nix index 437ec6cef743..27008f6714ed 100644 --- a/pkgs/development/libraries/qt-5/modules/qttools.nix +++ b/pkgs/development/libraries/qt-5/modules/qttools.nix @@ -1,7 +1,5 @@ { qtModule, stdenv, lib, qtbase, qtdeclarative }: -with lib; - qtModule { pname = "qttools"; qtInputs = [ qtbase qtdeclarative ]; @@ -10,9 +8,9 @@ qtModule { # 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.*\]|${getDev qtbase}|' + -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.*\]|${getDev qtbase}|' + -e '/^cmake_qattributionsscanner_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${lib.getDev qtbase}|' ''; devTools = [ @@ -34,12 +32,11 @@ qtModule { "bin/qthelpconverter" "bin/lprodump" "bin/qdistancefieldgenerator" - ] ++ optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ "bin/macdeployqt" ]; - NIX_CFLAGS_COMPILE = - lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"''; + NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"''; setupHook = ../hooks/qttools-setup-hook.sh; } diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index e60ae2082f4a..36e6eb6a226e 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -15,21 +15,22 @@ , pipewire_0_2 , enableProprietaryCodecs ? true , gn -, cups, darwin, openbsm, runCommand, xcbuild, writeScriptBin +, cctools, libobjc, libunwind, sandbox, xnu +, ApplicationServices, AVFoundation, Foundation, ForceFeedback, GameController, AppKit +, ImageCaptureCore, CoreBluetooth, IOBluetooth, CoreWLAN, Quartz, Cocoa, LocalAuthentication +, cups, openbsm, runCommand, xcbuild, writeScriptBin , ffmpeg ? null , lib, stdenv, fetchpatch , version ? null , qtCompatVersion }: -with lib; - qtModule { pname = "qtwebengine"; qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ]; nativeBuildInputs = [ bison coreutils flex git gperf ninja pkg-config python2 which gn nodejs - ] ++ optional stdenv.isDarwin xcbuild; + ] ++ lib.optional stdenv.isDarwin xcbuild; doCheck = true; outputs = [ "bin" "dev" "out" ]; @@ -42,66 +43,65 @@ qtModule { # which cannot be set at the same time as -Wformat-security hardeningDisable = [ "format" ]; - postPatch = - '' - # Patch Chromium build tools - ( - cd src/3rdparty/chromium; + 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 + # 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 - 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`. - + 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 - + 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 + # 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 - '' - + optionalString stdenv.isDarwin ( - (if (lib.versionAtLeast qtCompatVersion "5.14") then '' - substituteInPlace src/buildtools/config/mac_osx.pri \ - --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' - '' else '' - substituteInPlace src/core/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' "${darwin.xnu}" - '' - # Apple has some secret stuff they don't share with OpenBSM - + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' - 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]" - '' else '' - substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \ - --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]" - '')); + 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 ( + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' + substituteInPlace src/buildtools/config/mac_osx.pri \ + --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' + '' else '' + substituteInPlace src/core/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 + + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' + 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]" + '' else '' + substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \ + --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]" + '')); NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit @@ -134,8 +134,8 @@ qtModule { ''; qmakeFlags = [ "--" "-system-ffmpeg" ] - ++ optional (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) "-webengine-webrtc-pipewire" - ++ optional enableProprietaryCodecs "-proprietary-codecs"; + ++ lib.optional (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) "-webengine-webrtc-pipewire" + ++ lib.optional enableProprietaryCodecs "-proprietary-codecs"; propagatedBuildInputs = [ # Image formats @@ -152,7 +152,7 @@ qtModule { libevent ffmpeg - ] ++ optionals (!stdenv.isDarwin) [ + ] ++ lib.optionals (!stdenv.isDarwin) [ dbus zlib minizip snappy nss protobuf jsoncpp # Audio formats @@ -168,14 +168,14 @@ qtModule { xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst xorg.libXcomposite xorg.libXdamage libdrm - ] ++ optionals (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) [ + ] ++ lib.optionals (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) [ # 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 (with darwin; with apple_sdk.frameworks; [ + ++ lib.optionals stdenv.isDarwin [ libobjc cctools @@ -196,11 +196,11 @@ qtModule { openbsm libunwind - ]); + ]; - buildInputs = optionals stdenv.isDarwin (with darwin; [ + buildInputs = lib.optionals stdenv.isDarwin [ cups - apple_sdk.libs.sandbox + sandbox # `sw_vers` is used by `src/3rdparty/chromium/build/config/mac/sdk_info.py` # to get some information about the host platform. @@ -216,7 +216,7 @@ qtModule { shift done '') - ]); + ]; dontUseNinjaBuild = true; dontUseNinjaInstall = true; @@ -240,5 +240,4 @@ qtModule { # This build takes a long time; particularly on slow architectures timeout = 24 * 3600; }; - } diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix index e2dd0d4b19c7..dc9f5ccb9eb2 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix @@ -3,15 +3,15 @@ , fontconfig, libwebp, libxml2, libxslt , sqlite, systemd, glib, gst_all_1, cmake , bison, flex, gdb, gperf, perl, pkg-config, python2, ruby -, darwin +, ICU, OpenGL }: let - inherit (lib) optional optionals getDev getLib; hyphen = stdenv.mkDerivation rec { - name = "hyphen-2.8.8"; + pname = "hyphen"; + version = "2.8.8"; src = fetchurl { - url = "http://dev-www.libreoffice.org/src/5ade6ae2a99bc1e9e57031ca88d36dad-${name}.tar.gz"; + url = "http://dev-www.libreoffice.org/src/5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-${version}.tar.gz"; sha256 = "304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705"; }; postPatch = '' @@ -24,19 +24,19 @@ in qtModule { pname = "qtwebkit"; qtInputs = [ qtbase qtdeclarative qtlocation qtsensors ] - ++ optional (stdenv.isDarwin && lib.versionAtLeast qtbase.version "5.9.0") qtmultimedia - ++ optional usingAnnulenWebkitFork qtwebchannel; + ++ lib.optional (stdenv.isDarwin && lib.versionAtLeast qtbase.version "5.9.0") qtmultimedia + ++ lib.optional usingAnnulenWebkitFork qtwebchannel; buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ] - ++ optionals (stdenv.isDarwin) (with darwin; with apple_sdk.frameworks; [ ICU OpenGL ]) - ++ optional usingAnnulenWebkitFork hyphen; + ++ lib.optionals stdenv.isDarwin [ ICU OpenGL ] + ++ lib.optional usingAnnulenWebkitFork hyphen; nativeBuildInputs = [ bison flex gdb gperf perl pkg-config python2 ruby - ] ++ optional usingAnnulenWebkitFork cmake; + ] ++ lib.optional usingAnnulenWebkitFork cmake; - cmakeFlags = optionals usingAnnulenWebkitFork ([ "-DPORT=Qt" ] - ++ optionals stdenv.isDarwin [ - "-DQt5Multimedia_DIR=${getDev qtmultimedia}/lib/cmake/Qt5Multimedia" - "-DQt5MultimediaWidgets_DIR=${getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets" + cmakeFlags = lib.optionals usingAnnulenWebkitFork ([ "-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" ]); @@ -50,19 +50,22 @@ qtModule { ''; NIX_CFLAGS_COMPILE = [ - # 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 - ++ optional stdenv.cc.isGNU "-Wno-class-memaccess" - # with clang this warning blows the log over Hydra's limit - ++ optional stdenv.isDarwin "-Wno-inconsistent-missing-override" - ++ optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"''; + # 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)" ''; + preFixup = '' + rm -rf "$(pwd)" + mkdir "$(pwd)" + ''; meta = { maintainers = with lib.maintainers; [ abbradar periklis ]; diff --git a/pkgs/development/libraries/qt-5/modules/qtwebview.nix b/pkgs/development/libraries/qt-5/modules/qtwebview.nix index 1df8ef866389..14f7937a2e24 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebview.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebview.nix @@ -1,14 +1,12 @@ -{ darwin, lib, stdenv, qtModule, qtdeclarative, qtwebengine }: - -with lib; +{ lib, stdenv, qtModule, qtdeclarative, qtwebengine, CoreFoundation, WebKit }: qtModule { pname = "qtwebview"; qtInputs = [ qtdeclarative qtwebengine ]; - buildInputs = optional (stdenv.isDarwin) [ - darwin.apple_sdk.frameworks.CoreFoundation - darwin.apple_sdk.frameworks.WebKit + buildInputs = lib.optional stdenv.isDarwin [ + CoreFoundation + WebKit ]; outputs = [ "out" "dev" "bin" ]; - NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation -framework WebKit"; + NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreFoundation -framework WebKit"; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e5f186a4e1c2..ef94fb1ef964 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18072,45 +18072,27 @@ in (import ../development/libraries/qt-5/5.12) { inherit newScope; inherit lib stdenv fetchurl fetchpatch fetchFromGitHub makeSetupHook makeWrapper; - inherit bison; - inherit cups; - inherit dconf; - inherit harfbuzz; - inherit libGL; - inherit perl; - inherit gtk3; + inherit bison cups dconf harfbuzz libGL perl gtk3; inherit (gst_all_1) gstreamer gst-plugins-base; - inherit llvmPackages_5; + inherit llvmPackages_5 darwin; }); qt514 = recurseIntoAttrs (makeOverridable (import ../development/libraries/qt-5/5.14) { inherit newScope; inherit lib stdenv fetchurl fetchpatch fetchFromGitHub makeSetupHook makeWrapper; - inherit bison; - inherit cups; - inherit dconf; - inherit harfbuzz; - inherit libGL; - inherit perl; - inherit gtk3; + inherit bison cups dconf harfbuzz libGL perl gtk3; inherit (gst_all_1) gstreamer gst-plugins-base; - inherit llvmPackages_5; + inherit llvmPackages_5 darwin; }); qt515 = recurseIntoAttrs (makeOverridable (import ../development/libraries/qt-5/5.15) { inherit newScope; inherit lib stdenv fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper; - inherit bison; - inherit cups; - inherit dconf; - inherit harfbuzz; - inherit libGL; - inherit perl; - inherit gtk3; + inherit bison cups dconf harfbuzz libGL perl gtk3; inherit (gst_all_1) gstreamer gst-plugins-base; - inherit llvmPackages_5; + inherit llvmPackages_5 darwin; }); libsForQt512 = recurseIntoAttrs (import ./qt5-packages.nix {