From a98b25897cdb49196dbdb24c3d13149177d5ce15 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 17 Feb 2019 21:33:15 -0500 Subject: [PATCH 1/4] qt5.qtwebkit: link against libicucore.dylib from darwin.ICU instead of /usr/lib The impure library was introduced in 775531c1e3 ('qt58: extend darwin compatibility') cmake-based build can use a non-apple ICU if -DMACOS_USE_SYSTEM_ICU=OFF is set. (cherry picked from commit f212dd2e32f51ab95b62c8cbad2c8b56a3b42dce) --- pkgs/development/libraries/qt-5/5.9/qtwebkit.patch | 13 ------------- .../development/libraries/qt-5/modules/qtwebkit.nix | 6 +----- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch b/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch index c78cb58f564b..718bda361943 100644 --- a/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch +++ b/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch @@ -1,16 +1,3 @@ -diff --git a/Source/WTF/WTF.pri b/Source/WTF/WTF.pri -index 69e4cd1f3..3f729a75e 100644 ---- a/Source/WTF/WTF.pri -+++ b/Source/WTF/WTF.pri -@@ -12,7 +12,7 @@ mac { - # Mac OS does ship libicu but not the associated header files. - # Therefore WebKit provides adequate header files. - INCLUDEPATH = $${ROOT_WEBKIT_DIR}/Source/WTF/icu $$INCLUDEPATH -- LIBS += -licucore -+ LIBS += /usr/lib/libicucore.dylib - } else:!use?(wchar_unicode): { - win32 { - CONFIG(static, static|shared) { diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp index a923d49aa..46772a4bb 100644 --- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix index 526fc2b8b2d1..64fb22770ec0 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix @@ -27,7 +27,7 @@ qtModule { ++ optional (stdenv.isDarwin && lib.versionAtLeast qtbase.version "5.9.0") qtmultimedia ++ optional (lib.versionAtLeast qtbase.version "5.11.0") 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; [ cf-private OpenGL ]) + ++ optionals (stdenv.isDarwin) (with darwin; with apple_sdk.frameworks; [ cf-private ICU OpenGL ]) ++ optionals (lib.versionAtLeast qtbase.version "5.11.0") [ hyphen ]; nativeBuildInputs = [ bison2 flex gdb gperf perl pkgconfig python2 ruby @@ -35,10 +35,6 @@ qtModule { cmakeFlags = optionals (lib.versionAtLeast qtbase.version "5.11.0") [ "-DPORT=Qt" ]; - __impureHostDeps = optionals (stdenv.isDarwin) [ - "/usr/lib/libicucore.dylib" - ]; - # QtWebKit overrides qmake's default_pre and default_post features, # so its custom qmake files must be found first at the front of QMAKEPATH. preConfigure = '' From fb24cb25ddd191ac7f4d8c55bdb5931f77d9db86 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 17 Feb 2019 22:33:32 -0500 Subject: [PATCH 2/4] qt5.qtwebkit: refactor version comparison This introduces usingAnnulenWebkitFork variable. Using version check for qtbase.version is misleading because annulen's fork is not tied to a specific qt5 release. (cherry picked from commit 67186defdaf4db1d5cc36cb8795b625ef43a6106) --- pkgs/development/libraries/qt-5/modules/qtwebkit.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix index 64fb22770ec0..42b95f5d7415 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix @@ -20,20 +20,21 @@ let ''; buildInputs = [ perl ]; }; + usingAnnulenWebkitFork = lib.versionAtLeast qtbase.version "5.11.0"; in qtModule { name = "qtwebkit"; qtInputs = [ qtbase qtdeclarative qtlocation qtsensors ] ++ optional (stdenv.isDarwin && lib.versionAtLeast qtbase.version "5.9.0") qtmultimedia - ++ optional (lib.versionAtLeast qtbase.version "5.11.0") qtwebchannel; + ++ 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; [ cf-private ICU OpenGL ]) - ++ optionals (lib.versionAtLeast qtbase.version "5.11.0") [ hyphen ]; + ++ optional usingAnnulenWebkitFork hyphen; nativeBuildInputs = [ bison2 flex gdb gperf perl pkgconfig python2 ruby - ] ++ optionals (lib.versionAtLeast qtbase.version "5.11.0") [ cmake ]; + ] ++ optional usingAnnulenWebkitFork cmake; - cmakeFlags = optionals (lib.versionAtLeast qtbase.version "5.11.0") [ "-DPORT=Qt" ]; + cmakeFlags = optional usingAnnulenWebkitFork "-DPORT=Qt"; # QtWebKit overrides qmake's default_pre and default_post features, # so its custom qmake files must be found first at the front of QMAKEPATH. From 91f2dc0a350391d4d350132976094ffe23a0159b Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 17 Feb 2019 22:42:57 -0500 Subject: [PATCH 3/4] qt511.qtwebkit: fix on darwin readline is used on macOS and iOS for some javascript console (JSC). It seems to be easier to disable it than to fix it. (cherry picked from commit 4bbd00e934c5d529bf4b5c08ddeea6a6c62ff113) --- .../libraries/qt-5/5.11/default.nix | 6 ++- .../5.11/qtwebkit-darwin-no-qos-classes.patch | 11 +++++ .../5.11/qtwebkit-darwin-no-readline.patch | 45 +++++++++++++++++++ .../libraries/qt-5/5.12/default.nix | 6 ++- .../5.12/qtwebkit-darwin-no-qos-classes.patch | 11 +++++ .../5.12/qtwebkit-darwin-no-readline.patch | 45 +++++++++++++++++++ .../libraries/qt-5/modules/qtwebkit.nix | 9 +++- 7 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-qos-classes.patch create mode 100644 pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-readline.patch create mode 100644 pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch create mode 100644 pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch diff --git a/pkgs/development/libraries/qt-5/5.11/default.nix b/pkgs/development/libraries/qt-5/5.11/default.nix index b6e24c632224..11191ea09da2 100644 --- a/pkgs/development/libraries/qt-5/5.11/default.nix +++ b/pkgs/development/libraries/qt-5/5.11/default.nix @@ -65,7 +65,11 @@ let qtwebengine = [ ./qtwebengine-no-build-skip.patch ] ++ optional stdenv.cc.isClang ./qtwebengine-clang-fix.patch ++ optional stdenv.isDarwin ./qtwebengine-darwin-sdk-10.10.patch; - qtwebkit = [ ./qtwebkit.patch ]; + qtwebkit = [ ./qtwebkit.patch ] + ++ optionals stdenv.isDarwin [ + ./qtwebkit-darwin-no-readline.patch + ./qtwebkit-darwin-no-qos-classes.patch + ]; }; mkDerivation = diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-qos-classes.patch b/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-qos-classes.patch new file mode 100644 index 000000000000..a7087f517623 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-qos-classes.patch @@ -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) diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-readline.patch b/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-readline.patch new file mode 100644 index 000000000000..26d189d86019 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-readline.patch @@ -0,0 +1,45 @@ +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) +diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake +--- a/Source/WTF/wtf/PlatformMac.cmake ++++ b/Source/WTF/wtf/PlatformMac.cmake +@@ -2,11 +2,9 @@ set(WTF_LIBRARY_TYPE SHARED) + + find_library(COCOA_LIBRARY Cocoa) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) +-find_library(READLINE_LIBRARY Readline) + list(APPEND WTF_LIBRARIES + ${COREFOUNDATION_LIBRARY} + ${COCOA_LIBRARY} +- ${READLINE_LIBRARY} + libicucore.dylib + ) + diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix index 4b002837c3d5..512833a06823 100644 --- a/pkgs/development/libraries/qt-5/5.12/default.nix +++ b/pkgs/development/libraries/qt-5/5.12/default.nix @@ -61,7 +61,11 @@ let qtscript = [ ./qtscript.patch ]; qtserialport = [ ./qtserialport.patch ]; qtwebengine = [ ./qtwebengine-no-build-skip.patch ]; - qtwebkit = [ ./qtwebkit.patch ]; + qtwebkit = [ ./qtwebkit.patch ] + ++ optionals stdenv.isDarwin [ + ./qtwebkit-darwin-no-readline.patch + ./qtwebkit-darwin-no-qos-classes.patch + ]; }; mkDerivation = diff --git a/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch b/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch new file mode 100644 index 000000000000..a7087f517623 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch @@ -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) diff --git a/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch b/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch new file mode 100644 index 000000000000..26d189d86019 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch @@ -0,0 +1,45 @@ +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) +diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake +--- a/Source/WTF/wtf/PlatformMac.cmake ++++ b/Source/WTF/wtf/PlatformMac.cmake +@@ -2,11 +2,9 @@ set(WTF_LIBRARY_TYPE SHARED) + + find_library(COCOA_LIBRARY Cocoa) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) +-find_library(READLINE_LIBRARY Readline) + list(APPEND WTF_LIBRARIES + ${COREFOUNDATION_LIBRARY} + ${COCOA_LIBRARY} +- ${READLINE_LIBRARY} + libicucore.dylib + ) + diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix index 42b95f5d7415..90b4168ff21c 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix @@ -8,7 +8,7 @@ }: let - inherit (lib) optional optionals getLib; + inherit (lib) optional optionals getDev getLib; hyphen = stdenv.mkDerivation rec { name = "hyphen-2.8.8"; src = fetchurl { @@ -34,7 +34,12 @@ qtModule { bison2 flex gdb gperf perl pkgconfig python2 ruby ] ++ optional usingAnnulenWebkitFork cmake; - cmakeFlags = optional usingAnnulenWebkitFork "-DPORT=Qt"; + cmakeFlags = optionals usingAnnulenWebkitFork ([ "-DPORT=Qt" ] + ++ optionals stdenv.isDarwin [ + "-DQt5Multimedia_DIR=${getDev qtmultimedia}/lib/cmake/Qt5Multimedia" + "-DQt5MultimediaWidgets_DIR=${getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets" + "-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF" + ]); # QtWebKit overrides qmake's default_pre and default_post features, # so its custom qmake files must be found first at the front of QMAKEPATH. From 6f380466ce423eed5f5dfd8d554c0256d9141646 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 17 Feb 2019 22:48:50 -0500 Subject: [PATCH 4/4] qt5.qtwebkit: don't set qmake variables for cmake build (cherry picked from commit 518f997eb5a893bdc16a8f18f0b1e98b895f49a9) --- pkgs/development/libraries/qt-5/modules/qtwebkit.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix index 90b4168ff21c..6b43f6ed25c0 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix @@ -43,7 +43,7 @@ qtModule { # QtWebKit overrides qmake's default_pre and default_post features, # so its custom qmake files must be found first at the front of QMAKEPATH. - preConfigure = '' + preConfigure = stdenv.lib.optionalString (!usingAnnulenWebkitFork) '' QMAKEPATH="$PWD/Tools/qmake''${QMAKEPATH:+:}$QMAKEPATH" fixQtBuiltinPaths . '*.pr?' # Fix hydra's "Log limit exceeded"