diff options
author | Heinz Wiesinger <pprkut@slackbuilds.org> | 2021-11-20 20:24:27 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-11-22 09:10:20 +0700 |
commit | 80dde6cb9fb24583c26dc3fc1d2d6ce45de47771 (patch) | |
tree | d25d6c6d05a7ce4cbf735c5a2f7775b04dec83a0 /development/phantomjs/patches | |
parent | 0b1d0630dade44cb8cbace138ec338bdffffe79c (diff) | |
download | slackbuilds-80dde6cb9fb24583c26dc3fc1d2d6ce45de47771.tar.gz |
development/phantomjs: Updated for version 2.1.1
Signed-off-by: Heinz Wiesinger <pprkut@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/phantomjs/patches')
8 files changed, 396 insertions, 0 deletions
diff --git a/development/phantomjs/patches/build-no-ghostdriver.patch b/development/phantomjs/patches/build-no-ghostdriver.patch new file mode 100644 index 0000000000..b0462f98a6 --- /dev/null +++ b/development/phantomjs/patches/build-no-ghostdriver.patch @@ -0,0 +1,63 @@ +Last-Update: 2016-02-15 +Forwarded: not-needed +Author: Dmitry Smirnov <onlyjob@debian.org> +Description: fix compilation without non-DFSG Selenium "ghostdriver/third_party/webdriver-atoms/*" files + +--- a/src/ghostdriver/ghostdriver.qrc ++++ b/src/ghostdriver/ghostdriver.qrc +@@ -17,55 +17,8 @@ + <file>third_party/console++.js</file> + <file>third_party/har.js</file> + <file>third_party/parseuri.js</file> + <file>third_party/uuid.js</file> +- <file>third_party/webdriver-atoms/active_element.js</file> +- <file>third_party/webdriver-atoms/clear.js</file> +- <file>third_party/webdriver-atoms/clear_local_storage.js</file> +- <file>third_party/webdriver-atoms/clear_session_storage.js</file> +- <file>third_party/webdriver-atoms/click.js</file> +- <file>third_party/webdriver-atoms/double_click.js</file> +- <file>third_party/webdriver-atoms/drag.js</file> +- <file>third_party/webdriver-atoms/execute_async_script.js</file> +- <file>third_party/webdriver-atoms/execute_script.js</file> +- <file>third_party/webdriver-atoms/execute_sql.js</file> +- <file>third_party/webdriver-atoms/find_element.js</file> +- <file>third_party/webdriver-atoms/find_elements.js</file> +- <file>third_party/webdriver-atoms/focus_on_element.js</file> +- <file>third_party/webdriver-atoms/get_appcache_status.js</file> +- <file>third_party/webdriver-atoms/get_attribute.js</file> +- <file>third_party/webdriver-atoms/get_attribute_value.js</file> +- <file>third_party/webdriver-atoms/get_current_position.js</file> +- <file>third_party/webdriver-atoms/get_local_storage_item.js</file> +- <file>third_party/webdriver-atoms/get_local_storage_keys.js</file> +- <file>third_party/webdriver-atoms/get_local_storage_size.js</file> +- <file>third_party/webdriver-atoms/get_location.js</file> +- <file>third_party/webdriver-atoms/get_location_in_view.js</file> +- <file>third_party/webdriver-atoms/get_session_storage_item.js</file> +- <file>third_party/webdriver-atoms/get_session_storage_keys.js</file> +- <file>third_party/webdriver-atoms/get_session_storage_size.js</file> +- <file>third_party/webdriver-atoms/get_size.js</file> +- <file>third_party/webdriver-atoms/get_text.js</file> +- <file>third_party/webdriver-atoms/get_value_of_css_property.js</file> +- <file>third_party/webdriver-atoms/is_displayed.js</file> +- <file>third_party/webdriver-atoms/is_enabled.js</file> +- <file>third_party/webdriver-atoms/is_online.js</file> +- <file>third_party/webdriver-atoms/is_selected.js</file> +- <file>third_party/webdriver-atoms/lastupdate</file> +- <file>third_party/webdriver-atoms/move_mouse.js</file> +- <file>third_party/webdriver-atoms/pinch.js</file> +- <file>third_party/webdriver-atoms/remove_local_storage_item.js</file> +- <file>third_party/webdriver-atoms/remove_session_storage_item.js</file> +- <file>third_party/webdriver-atoms/right_click.js</file> +- <file>third_party/webdriver-atoms/rotate.js</file> +- <file>third_party/webdriver-atoms/scroll_into_view.js</file> +- <file>third_party/webdriver-atoms/scroll_mouse.js</file> +- <file>third_party/webdriver-atoms/set_local_storage_item.js</file> +- <file>third_party/webdriver-atoms/set_session_storage_item.js</file> +- <file>third_party/webdriver-atoms/submit.js</file> +- <file>third_party/webdriver-atoms/swipe.js</file> +- <file>third_party/webdriver-atoms/tap.js</file> +- <file>third_party/webdriver-atoms/type.js</file> + <file>webdriver_atoms.js</file> + <file>webelementlocator.js</file> + </qresource> + </RCC> diff --git a/development/phantomjs/patches/build-qt-components.patch b/development/phantomjs/patches/build-qt-components.patch new file mode 100644 index 0000000000..de52fb4370 --- /dev/null +++ b/development/phantomjs/patches/build-qt-components.patch @@ -0,0 +1,18 @@ +Last-Update: 2016-02-15 +Forwarded: no +Author: Dmitry Smirnov <onlyjob@debian.org> +Description: fix FTBFS. + +--- a/src/phantomjs.pro ++++ b/src/phantomjs.pro +@@ -8,9 +8,9 @@ + } + + TEMPLATE = app + TARGET = phantomjs +-QT += network webkitwidgets ++QT += network webkitwidgets printsupport + CONFIG += console + + DESTDIR = ../bin + diff --git a/development/phantomjs/patches/build-qt55-evaluateJavaScript.patch b/development/phantomjs/patches/build-qt55-evaluateJavaScript.patch new file mode 100644 index 0000000000..ba1f5301d7 --- /dev/null +++ b/development/phantomjs/patches/build-qt55-evaluateJavaScript.patch @@ -0,0 +1,169 @@ +Last-Update: 2016-02-15 +Forwarded: no +Bug-Upstream: https://github.com/ariya/phantomjs/issues/13727 +Author: Ximin Luo <infinity0@debian.org> +Reviewed-By: Dmitry Smirnov <onlyjob@debian.org> +Description: Port to Qt 5.5 + - Remove second argument to evaluateJavascript(), which was not really used + for anything, anyways + +--- a/src/utils.cpp ++++ b/src/utils.cpp +@@ -37,8 +37,9 @@ + #include <QDateTime> + #include <QDir> + #include <QtWebKitWidgets/QWebFrame> + ++ + static QString findScript(const QString& jsFilePath, const QString& libraryPath) + { + if (!jsFilePath.isEmpty()) { + QFile jsFile; +@@ -131,9 +132,9 @@ + } + return false; + } + // Execute JS code in the context of the document +- targetFrame->evaluateJavaScript(scriptBody, QString(JAVASCRIPT_SOURCE_CODE_URL).arg(QFileInfo(scriptPath).fileName())); ++ targetFrame->evaluateJavaScript(scriptBody); + return true; + } + + bool loadJSForDebug(const QString& jsFilePath, const QString& libraryPath, QWebFrame* targetFrame, const bool autorun) +@@ -146,12 +147,12 @@ + QString scriptPath = findScript(jsFilePath, libraryPath); + QString scriptBody = jsFromScriptFile(scriptPath, jsFileLanguage, jsFileEnc); + + scriptBody = QString("function __run() {\n%1\n}").arg(scriptBody); +- targetFrame->evaluateJavaScript(scriptBody, QString(JAVASCRIPT_SOURCE_CODE_URL).arg(QFileInfo(scriptPath).fileName())); ++ targetFrame->evaluateJavaScript(scriptBody); + + if (autorun) { +- targetFrame->evaluateJavaScript("__run()", QString()); ++ targetFrame->evaluateJavaScript("__run()"); + } + + return true; + } +--- a/src/repl.cpp ++++ b/src/repl.cpp +@@ -146,9 +146,9 @@ + // Set the static callback to offer Completions to the User + linenoiseSetCompletionCallback(REPL::offerCompletion); + + // Inject REPL utility functions +- m_webframe->evaluateJavaScript(Utils::readResourceFileUtf8(":/repl.js"), QString(JAVASCRIPT_SOURCE_PLATFORM_URL).arg("repl.js")); ++ m_webframe->evaluateJavaScript(Utils::readResourceFileUtf8(":/repl.js")); + + // Add self to JavaScript world + m_webframe->addToJavaScriptWindowObject("_repl", this); + +@@ -183,10 +183,9 @@ + // This will return an array of String with the possible completions + QStringList completions = REPL::getInstance()->m_webframe->evaluateJavaScript( + QString(JS_RETURN_POSSIBLE_COMPLETIONS).arg( + toInspect, +- toComplete), +- QString() ++ toComplete) + ).toStringList(); + + foreach(QString c, completions) { + if (lastIndexOfDot > -1) { +@@ -209,9 +208,9 @@ + if (userInput[0] != '\0') { + // Send the user input to the main Phantom frame for evaluation + m_webframe->evaluateJavaScript( + QString(JS_EVAL_USER_INPUT).arg( +- QString(userInput).replace('"', "\\\"")), QString("phantomjs://repl-input")); ++ QString(userInput).replace('"', "\\\""))); + + // Save command in the REPL history + linenoiseHistoryAdd(userInput); + linenoiseHistorySave(m_historyFilepath.data()); //< requires "char *" +--- a/src/phantom.cpp ++++ b/src/phantom.cpp +@@ -380,9 +380,9 @@ + "require.cache['" + filename + "']._getRequire()," + + "require.cache['" + filename + "'].exports," + + "require.cache['" + filename + "']" + + "));"; +- m_page->mainFrame()->evaluateJavaScript(scriptSource, QString(JAVASCRIPT_SOURCE_PLATFORM_URL).arg(QFileInfo(filename).fileName())); ++ m_page->mainFrame()->evaluateJavaScript(scriptSource); + } + + bool Phantom::injectJs(const QString& jsFilePath) + { +@@ -477,10 +477,9 @@ + m_page->mainFrame()->addToJavaScriptWindowObject("phantom", this); + + // Bootstrap the PhantomJS scope + m_page->mainFrame()->evaluateJavaScript( +- Utils::readResourceFileUtf8(":/bootstrap.js"), +- QString(JAVASCRIPT_SOURCE_PLATFORM_URL).arg("bootstrap.js") ++ Utils::readResourceFileUtf8(":/bootstrap.js") + ); + } + + bool Phantom::setCookies(const QVariantList& cookies) +--- a/src/config.cpp ++++ b/src/config.cpp +@@ -176,9 +176,9 @@ + QWebPage webPage; + // Add this object to the global scope + webPage.mainFrame()->addToJavaScriptWindowObject("config", this); + // Apply the JSON config settings to this very object +- webPage.mainFrame()->evaluateJavaScript(configurator.arg(jsonConfig), QString()); ++ webPage.mainFrame()->evaluateJavaScript(configurator.arg(jsonConfig)); + } + + QString Config::helpText() const + { +--- a/src/webpage.cpp ++++ b/src/webpage.cpp +@@ -752,10 +752,10 @@ + + qDebug() << "WebPage - evaluateJavaScript" << function; + + evalResult = m_currentFrame->evaluateJavaScript( +- function, //< function evaluated +- QString("phantomjs://webpage.evaluate()")); //< reference source file ++ function //< function evaluated ++ ); + + qDebug() << "WebPage - evaluateJavaScript result" << evalResult; + + return evalResult; +@@ -925,9 +925,9 @@ + networkOp = QNetworkAccessManager::DeleteOperation; + } + + if (networkOp == QNetworkAccessManager::UnknownOperation) { +- m_mainFrame->evaluateJavaScript("console.error('Unknown network operation: " + operation + "');", QString()); ++ m_mainFrame->evaluateJavaScript("console.error('Unknown network operation: " + operation + "');"); + return; + } + + if (address == "about:blank") { +@@ -1314,9 +1314,9 @@ + return ret.toString(); + } + } + } +- frame->evaluateJavaScript("console.error('Bad header callback given, use phantom.callback);", QString()); ++ frame->evaluateJavaScript("console.error('Bad header callback given, use phantom.callback);"); + return QString(); + } + + QString WebPage::header(int page, int numPages) +@@ -1353,9 +1353,9 @@ + } + + void WebPage::_appendScriptElement(const QString& scriptUrl) + { +- m_currentFrame->evaluateJavaScript(QString(JS_APPEND_SCRIPT_ELEMENT).arg(scriptUrl), scriptUrl); ++ m_currentFrame->evaluateJavaScript(QString(JS_APPEND_SCRIPT_ELEMENT).arg(scriptUrl)); + } + + QObject* WebPage::_getGenericCallback() + { diff --git a/development/phantomjs/patches/build-qt55-no-websecurity.patch b/development/phantomjs/patches/build-qt55-no-websecurity.patch new file mode 100644 index 0000000000..9311c93cf0 --- /dev/null +++ b/development/phantomjs/patches/build-qt55-no-websecurity.patch @@ -0,0 +1,54 @@ +Last-Update: 2016-02-15 +Forwarded: not-needed +Bug-Upstream: https://github.com/ariya/phantomjs/issues/13727 +Author: Ximin Luo <infinity0@debian.org> +Reviewed-By: Dmitry Smirnov <onlyjob@debian.org> +Description: Port to Qt 5.5 + - Remove "webSecurity" option since that's not exposed in Qt 5.5 + +--- a/src/consts.h ++++ b/src/consts.h +@@ -63,9 +63,8 @@ + #define PAGE_SETTINGS_USERNAME "userName" + #define PAGE_SETTINGS_PASSWORD "password" + #define PAGE_SETTINGS_MAX_AUTH_ATTEMPTS "maxAuthAttempts" + #define PAGE_SETTINGS_RESOURCE_TIMEOUT "resourceTimeout" +-#define PAGE_SETTINGS_WEB_SECURITY_ENABLED "webSecurityEnabled" + #define PAGE_SETTINGS_JS_CAN_OPEN_WINDOWS "javascriptCanOpenWindows" + #define PAGE_SETTINGS_JS_CAN_CLOSE_WINDOWS "javascriptCanCloseWindows" + + #define DEFAULT_WEBDRIVER_CONFIG "127.0.0.1:8910" +--- a/src/phantom.cpp ++++ b/src/phantom.cpp +@@ -135,9 +135,8 @@ + m_defaultPageSettings[PAGE_SETTINGS_JS_ENABLED] = QVariant::fromValue(true); + m_defaultPageSettings[PAGE_SETTINGS_XSS_AUDITING] = QVariant::fromValue(false); + m_defaultPageSettings[PAGE_SETTINGS_USER_AGENT] = QVariant::fromValue(m_page->userAgent()); + m_defaultPageSettings[PAGE_SETTINGS_LOCAL_ACCESS_REMOTE] = QVariant::fromValue(m_config.localToRemoteUrlAccessEnabled()); +- m_defaultPageSettings[PAGE_SETTINGS_WEB_SECURITY_ENABLED] = QVariant::fromValue(m_config.webSecurityEnabled()); + m_defaultPageSettings[PAGE_SETTINGS_JS_CAN_OPEN_WINDOWS] = QVariant::fromValue(m_config.javascriptCanOpenWindows()); + m_defaultPageSettings[PAGE_SETTINGS_JS_CAN_CLOSE_WINDOWS] = QVariant::fromValue(m_config.javascriptCanCloseWindows()); + m_page->applySettings(m_defaultPageSettings); + +--- a/src/webpage.cpp ++++ b/src/webpage.cpp +@@ -367,9 +367,8 @@ + // attribute "WebSecurityEnabled" must be applied during the initializing + // security context for Document instance. Setting up it later will not cause any effect + // see <qt\src\3rdparty\webkit\Source\WebCore\dom\Document.cpp:4468> + QWebSettings* settings = m_customWebPage->settings(); +- settings->setAttribute(QWebSettings::WebSecurityEnabled, phantomCfg->webSecurityEnabled()); + + m_mainFrame = m_customWebPage->mainFrame(); + m_currentFrame = m_mainFrame; + m_mainFrame->setHtml(BLANK_HTML, baseUrl); +@@ -621,9 +620,8 @@ + opt->setAttribute(QWebSettings::AutoLoadImages, def[PAGE_SETTINGS_LOAD_IMAGES].toBool()); + opt->setAttribute(QWebSettings::JavascriptEnabled, def[PAGE_SETTINGS_JS_ENABLED].toBool()); + opt->setAttribute(QWebSettings::XSSAuditingEnabled, def[PAGE_SETTINGS_XSS_AUDITING].toBool()); + opt->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, def[PAGE_SETTINGS_LOCAL_ACCESS_REMOTE].toBool()); +- opt->setAttribute(QWebSettings::WebSecurityEnabled, def[PAGE_SETTINGS_WEB_SECURITY_ENABLED].toBool()); + opt->setAttribute(QWebSettings::JavascriptCanOpenWindows, def[PAGE_SETTINGS_JS_CAN_OPEN_WINDOWS].toBool()); + opt->setAttribute(QWebSettings::JavascriptCanCloseWindows, def[PAGE_SETTINGS_JS_CAN_CLOSE_WINDOWS].toBool()); + + if (def.contains(PAGE_SETTINGS_USER_AGENT)) { diff --git a/development/phantomjs/patches/build-qt55-print.patch b/development/phantomjs/patches/build-qt55-print.patch new file mode 100644 index 0000000000..62984c5c61 --- /dev/null +++ b/development/phantomjs/patches/build-qt55-print.patch @@ -0,0 +1,34 @@ +Last-Update: 2016-02-15 +Forwarded: no +Bug-Upstream: https://github.com/ariya/phantomjs/issues/13727 +Author: Ximin Luo <infinity0@debian.org> +Reviewed-By: Dmitry Smirnov <onlyjob@debian.org> +Description: Port to Qt 5.5 + - In webpage, don't inherit QWebFrame::PrintCallback since it's not public + +--- a/src/webpage.cpp ++++ b/src/webpage.cpp +@@ -1254,9 +1254,9 @@ + } + + printer.setPageMargins(marginLeft, marginTop, marginRight, marginBottom, QPrinter::Point); + +- m_mainFrame->print(&printer, this); ++ m_mainFrame->print(&printer); + return true; + } + + void WebPage::setZoomFactor(qreal zoom) +--- a/src/webpage.h ++++ b/src/webpage.h +@@ -44,9 +44,9 @@ + class NetworkAccessManager; + class QWebInspector; + class Phantom; + +-class WebPage : public QObject, public QWebFrame::PrintCallback ++class WebPage : public QObject + { + Q_OBJECT + Q_PROPERTY(QString title READ title) + Q_PROPERTY(QString frameTitle READ frameTitle) diff --git a/development/phantomjs/patches/build-qtpath.patch b/development/phantomjs/patches/build-qtpath.patch new file mode 100644 index 0000000000..6fa48bc0d3 --- /dev/null +++ b/development/phantomjs/patches/build-qtpath.patch @@ -0,0 +1,18 @@ +Last-Update: 2016-02-15 +Forwarded: not-needed +Author: Dmitry Smirnov <onlyjob@debian.org> +Description: build system correction(s). + +--- a/build.py ++++ b/build.py +@@ -80,9 +80,9 @@ + def qmakePath(): + exe = "qmake" + if platform.system() == "Windows": + exe += ".exe" +- return os.path.abspath("src/qt/qtbase/bin/" + exe) ++ return os.path.abspath("/usr/lib64/qt5/bin/" + exe) + + # returns paths for 3rd party libraries (Windows only) + def findThirdPartyDeps(): + include_dirs = [] diff --git a/development/phantomjs/patches/fix-missing-webkit-include-files.patch b/development/phantomjs/patches/fix-missing-webkit-include-files.patch new file mode 100644 index 0000000000..9e1fe8aacc --- /dev/null +++ b/development/phantomjs/patches/fix-missing-webkit-include-files.patch @@ -0,0 +1,23 @@ +diff --git a/src/webpage.cpp b/src/webpage.cpp +index fc235bc..2151e4e 100644 +--- a/src/webpage.cpp ++++ b/src/webpage.cpp +@@ -45,12 +45,12 @@ + #include <QNetworkRequest> + #include <QPainter> + #include <QtPrintSupport/QPrinter> +-#include <QWebHistory> +-#include <QWebHistoryItem> +-#include <QWebElement> +-#include <QWebFrame> +-#include <QWebPage> +-#include <QWebInspector> ++#include <QtWebKit/QWebHistory> ++#include <QtWebKit/QWebHistoryItem> ++#include <QtWebKit/QWebElement> ++#include <QtWebKitWidgets/QWebFrame> ++#include <QtWebKitWidgets/QWebPage> ++#include <QtWebKitWidgets/QWebInspector> + #include <QMapIterator> + #include <QBuffer> + #include <QDebug> diff --git a/development/phantomjs/patches/unlock-qt.patch b/development/phantomjs/patches/unlock-qt.patch new file mode 100644 index 0000000000..1a6d5b0b71 --- /dev/null +++ b/development/phantomjs/patches/unlock-qt.patch @@ -0,0 +1,17 @@ +Last-Update: 2016-06-16 +Forwarded: not-needed +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=827421 +Author: Dmitry Smirnov <onlyjob@debian.org> +Description: allow build with QT-5.5+ + +--- a/src/phantomjs.pro ++++ b/src/phantomjs.pro +@@ -1,8 +1,4 @@ + +-if(!equals(QT_MAJOR_VERSION, 5)|!equals(QT_MINOR_VERSION, 5)) { +- error("This program can only be compiled with Qt 5.5.x.") +-} +- + TEMPLATE = app + TARGET = phantomjs + QT += network webkitwidgets |