[packages/phantomjs/dev-2.1: 1/9] up to 2.1.1
glen
glen at pld-linux.org
Wed Mar 23 07:05:38 CET 2016
commit c339060dbbe4534eb002dd269c99106593f7f829
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Tue Mar 22 19:43:51 2016 +0200
up to 2.1.1
breakbad is gone
0005-unbundle-qt.patch | 149 +++++++++++++++++++--------------------
phantomjs-disable-breakpad.patch | 114 ------------------------------
phantomjs-qt.patch | 11 ---
phantomjs.spec | 18 ++---
4 files changed, 82 insertions(+), 210 deletions(-)
---
diff --git a/phantomjs.spec b/phantomjs.spec
index 4847f80..bb3eb36 100644
--- a/phantomjs.spec
+++ b/phantomjs.spec
@@ -1,16 +1,20 @@
+# NOTES
+# - fedora's attempt to package this: https://bugzilla.redhat.com/show_bug.cgi?id=891461
+#
+# Conditional build:
%bcond_with system_qcommandline
+
Summary: Headless WebKit with a JavaScript API
Name: phantomjs
-Version: 2.0.0
-Release: 3
+Version: 2.1.1
+Release: 1
License: BSD
Group: Applications/Networking
-Source0: https://bitbucket.org/ariya/phantomjs/downloads/%{name}-%{version}-source.zip
-# Source0-md5: feabe9064100e241d21347739312e64d
+Source0: https://github.com/ariya/phantomjs/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: db2d71e67e3557a977c2f269f1ec7fee
Patch0: %{name}-qt.patch
Patch1: %{name}-env.patch
Patch3: 0003-unbundle-mongoose.patch
-Patch4: %{name}-disable-breakpad.patch
Patch5: 0005-unbundle-qt.patch
Patch6: 0006-unbundle-linenoise.patch
Patch7: 0007-unbundle-QCommandLine.patch
@@ -41,12 +45,10 @@ rm -r src/mongoose
rm -r src/qt
rm -r src/linenoise
%{?with_system_qcommandline:rm -r src/qcommandline}
-rm -r src/breakpad
-%patch0 -p1
+#%patch0 -p1
%patch1 -p1
%patch3 -p1
-%patch4 -p1
%patch5 -p1
%patch6 -p1
%{?with_system_qcommandline:%patch7 -p1}
diff --git a/0005-unbundle-qt.patch b/0005-unbundle-qt.patch
index c2ce40a..32ce1c6 100644
--- a/0005-unbundle-qt.patch
+++ b/0005-unbundle-qt.patch
@@ -21,113 +21,113 @@ index 226c98f..2bf3fdb 100644
}
QString Config::helpText() const
-diff --git a/src/phantom.cpp b/src/phantom.cpp
-index 1f31795..efc4449 100644
---- a/src/phantom.cpp
-+++ b/src/phantom.cpp
-@@ -372,7 +372,11 @@ void Phantom::loadModule(const QString &
- "require.cache['" + filename + "'].exports," +
- "require.cache['" + filename + "']" +
- "));";
-- m_page->mainFrame()->evaluateJavaScript(scriptSource, "");
-+ m_page->mainFrame()->evaluateJavaScript(scriptSource
+--- phantomjs-2.1.1/src/phantom.cpp 2016-03-22 19:59:31.131744793 +0200
++++ phantomjs-2.1.1/src/phantom.cpp 2016-03-22 20:08:17.872582605 +0200
+@@ -381,7 +381,11 @@
+ "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
+#ifdef HAVE_QT_JS_STACK_TRACES
-+ , ""
++ , QString(JAVASCRIPT_SOURCE_PLATFORM_URL).arg(QFileInfo(filename).fileName())
+#endif
-+ );
++ );
}
- bool Phantom::injectJs(const QString &jsFilePath)
-@@ -419,8 +423,10 @@ void Phantom::onInitialized()
+ bool Phantom::injectJs(const QString& jsFilePath)
+@@ -478,8 +482,11 @@
// Bootstrap the PhantomJS scope
m_page->mainFrame()->evaluateJavaScript(
-- Utils::readResourceFileUtf8(":/bootstrap.js"),
-- QString("phantomjs://bootstrap.js")
-+ Utils::readResourceFileUtf8(":/bootstrap.js")
+- Utils::readResourceFileUtf8(":/bootstrap.js"),
++ Utils::readResourceFileUtf8(":/bootstrap.js")
+#ifdef HAVE_QT_JS_STACK_TRACES
-+ , QString("phantomjs://bootstrap.js")
++ ,
+ QString(JAVASCRIPT_SOURCE_PLATFORM_URL).arg("bootstrap.js")
+#endif
- );
+ );
}
-diff --git a/src/repl.cpp b/src/repl.cpp
-index 5ac69da..7b1872d 100644
---- a/src/repl.cpp
-+++ b/src/repl.cpp
-@@ -147,7 +147,11 @@ REPL::REPL(QWebFrame *webframe, Phantom *parent)
+--- phantomjs-2.1.1/src/repl.cpp~ 2016-01-24 20:24:05.000000000 +0200
++++ phantomjs-2.1.1/src/repl.cpp 2016-03-22 20:01:59.629454535 +0200
+@@ -147,7 +147,11 @@
linenoiseSetCompletionCallback(REPL::offerCompletion);
// Inject REPL utility functions
-- m_webframe->evaluateJavaScript(Utils::readResourceFileUtf8(":/repl.js"), QString("phantomjs://repl.js"));
+- m_webframe->evaluateJavaScript(Utils::readResourceFileUtf8(":/repl.js"), QString(JAVASCRIPT_SOURCE_PLATFORM_URL).arg("repl.js"));
+ m_webframe->evaluateJavaScript(Utils::readResourceFileUtf8(":/repl.js")
+#ifdef HAVE_QT_JS_STACK_TRACES
-+ , QString("phantomjs://repl.js")
++ , QString(JAVASCRIPT_SOURCE_PLATFORM_URL).arg("repl.js")
+#endif
-+ );
++ );
// Add self to JavaScript world
m_webframe->addToJavaScriptWindowObject("_repl", this);
-@@ -184,8 +188,10 @@ void REPL::offerCompletion(const char *buf, linenoiseCompletions *lc)
+@@ -184,8 +188,11 @@
QStringList completions = REPL::getInstance()->m_webframe->evaluateJavaScript(
- QString(JS_RETURN_POSSIBLE_COMPLETIONS).arg(
- toInspect,
-- toComplete),
-- QString()
-+ toComplete)
+ QString(JS_RETURN_POSSIBLE_COMPLETIONS).arg(
+ toInspect,
+- toComplete),
++ toComplete)
+#ifdef HAVE_QT_JS_STACK_TRACES
-+ , QString()
++ ,
+ QString()
+#endif
- ).toStringList();
+ ).toStringList();
- foreach (QString c, completions) {
-@@ -210,7 +216,11 @@ void REPL::startLoop()
+ foreach(QString c, completions) {
+@@ -210,7 +217,11 @@
// 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('"', "\\\""))
+ QString(JS_EVAL_USER_INPUT).arg(
+- QString(userInput).replace('"', "\\\"")), QString("phantomjs://repl-input"));
++ QString(userInput).replace('"', "\\\""))
+#ifdef HAVE_QT_JS_STACK_TRACES
-+ , QString("phantomjs://repl-input")
++ , QString("phantomjs://repl-input")
+#endif
-+ );
++ );
// Save command in the REPL history
linenoiseHistoryAdd(userInput);
-diff --git a/src/utils.cpp b/src/utils.cpp
-index 8bbdeca..df2a866 100644
---- a/src/utils.cpp
-+++ b/src/utils.cpp
-@@ -119,7 +119,11 @@ bool Utils::injectJsInFrame(const QString &jsFilePath, const Encoding &jsFileEnc
+--- phantomjs-2.1.1/src/utils.cpp 2016-03-22 20:03:26.137279205 +0200
++++ phantomjs-2.1.1/src/utils.cpp 2016-03-22 20:16:15.640771018 +0200
+@@ -132,7 +132,11 @@
return false;
}
// Execute JS code in the context of the document
-- targetFrame->evaluateJavaScript(scriptBody, jsFilePath);
+- targetFrame->evaluateJavaScript(scriptBody, QString(JAVASCRIPT_SOURCE_CODE_URL).arg(QFileInfo(scriptPath).fileName()));
+ targetFrame->evaluateJavaScript(scriptBody
+#ifdef HAVE_QT_JS_STACK_TRACES
-+ , jsFilePath
++ , QString(JAVASCRIPT_SOURCE_CODE_URL).arg(QFileInfo(scriptPath).fileName())
+#endif
-+ );
++ );
return true;
}
-@@ -138,7 +142,11 @@ bool Utils::loadJSForDebug(const QString& jsFilePath, const Encoding& jsFileEnc,
- targetFrame->setHtml(remoteDebuggerHarnessSrc);
+@@ -147,10 +151,18 @@
+ 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
++#ifdef HAVE_QT_JS_STACK_TRACES
++ , QString(JAVASCRIPT_SOURCE_CODE_URL).arg(QFileInfo(scriptPath).fileName())
++#endif
++ );
if (autorun) {
- targetFrame->evaluateJavaScript("__run()", QString());
+ targetFrame->evaluateJavaScript("__run()"
+#ifdef HAVE_QT_JS_STACK_TRACES
-+ , QString()
++ , QString()
+#endif
-+ );
++ );
}
return true;
-diff --git a/src/webpage.cpp b/src/webpage.cpp
-index c76a4b8..fe6f816 100644
---- a/src/webpage.cpp
-+++ b/src/webpage.cpp
+--- phantomjs-2.1.1/src/webpage.cpp~ 2016-03-22 20:03:50.000000000 +0200
++++ phantomjs-2.1.1/src/webpage.cpp 2016-03-22 20:05:19.069859587 +0200
@@ -570,7 +570,9 @@ void WebPage::applySettings(const QVariantMap &def)
opt->setAttribute(QWebSettings::JavascriptEnabled, def[PAGE_SETTINGS_JS_ENABLED].toBool());
opt->setAttribute(QWebSettings::XSSAuditingEnabled, def[PAGE_SETTINGS_XSS_AUDITING].toBool());
@@ -138,17 +138,17 @@ index c76a4b8..fe6f816 100644
opt->setAttribute(QWebSettings::JavascriptCanOpenWindows, def[PAGE_SETTINGS_JS_CAN_OPEN_WINDOWS].toBool());
opt->setAttribute(QWebSettings::JavascriptCanCloseWindows, def[PAGE_SETTINGS_JS_CAN_CLOSE_WINDOWS].toBool());
-@@ -679,8 +681,11 @@ QVariant WebPage::evaluateJavaScript(const QString &code)
+@@ -753,8 +755,11 @@
qDebug() << "WebPage - evaluateJavaScript" << function;
evalResult = m_currentFrame->evaluateJavaScript(
-- function, //< function evaluated
-- QString("phantomjs://webpage.evaluate()")); //< reference source file
-+ function //< function evaluated
+- function, //< function evaluated
+- QString("phantomjs://webpage.evaluate()")); //< reference source file
++ function //< function evaluated
+#ifdef HAVE_QT_JS_STACK_TRACES
-+ , QString("phantomjs://webpage.evaluate()") //< reference source file
++ , QString("phantomjs://webpage.evaluate()")
+#endif
-+ );
++ ); //< reference source file
qDebug() << "WebPage - evaluateJavaScript result" << evalResult;
@@ -177,12 +177,12 @@ index c76a4b8..fe6f816 100644
return true;
}
-@@ -1180,6 +1193,7 @@ QString WebPage::windowName() const
+@@ -1288,6 +1288,7 @@
return m_mainFrame->evaluateJavaScript("window.name;").toString();
}
+#ifdef HAVE_QWEBFRAME_PRINT_ADDONS
- qreal getHeight(const QVariantMap &map, const QString &key)
+ qreal getHeight(const QVariantMap& map, const QString& key)
{
QVariant footer = map.value(key);
@@ -1219,7 +1233,11 @@ QString getHeaderFooter(const QVariantMap &map, const QString &key, QWebFrame *f
@@ -206,21 +206,19 @@ index c76a4b8..fe6f816 100644
void WebPage::_uploadFile(const QString &selector, const QStringList &fileNames)
{
-@@ -1255,7 +1274,11 @@ bool WebPage::injectJs(const QString &jsFilePath) {
- }
+@@ -1369,7 +1371,11 @@
- void WebPage::_appendScriptElement(const QString &scriptUrl) {
+ 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)
+#ifdef HAVE_QT_JS_STACK_TRACES
-+ , scriptUrl
++ , scriptUrl
+#endif
-+ );
++ );
}
- QObject *WebPage::_getGenericCallback() {
-diff --git a/src/webpage.h b/src/webpage.h
-index e065bb4..0bdfa27 100644
+ QObject* WebPage::_getGenericCallback()
--- a/src/webpage.h
+++ b/src/webpage.h
@@ -43,7 +43,10 @@ class NetworkAccessManager;
@@ -248,6 +246,3 @@ index e065bb4..0bdfa27 100644
void setZoomFactor(qreal zoom);
qreal zoomFactor() const;
---
-1.7.11.7
-
diff --git a/phantomjs-disable-breakpad.patch b/phantomjs-disable-breakpad.patch
deleted file mode 100644
index 054efa7..0000000
--- a/phantomjs-disable-breakpad.patch
+++ /dev/null
@@ -1,114 +0,0 @@
---- phantomjs-2.0.0/src/crashdump.cpp~ 2015-01-24 03:19:52.000000000 +0100
-+++ phantomjs-2.0.0/src/crashdump.cpp 2015-03-31 10:42:18.791404606 +0200
-@@ -37,7 +37,7 @@
- #include <exception>
- #include <cstdlib>
-
--#ifdef Q_OS_LINUX
-+#if 0
- #include "client/linux/handler/exception_handler.h"
- #define HAVE_BREAKPAD
- #define EHC_EXTRA_ARGS true
---- phantomjs-2.0.0/src/phantomjs.pro~ 2015-03-31 12:19:42.000000000 +0200
-+++ phantomjs-2.0.0/src/phantomjs.pro 2015-03-31 12:20:46.849769573 +0200
-@@ -68,44 +68,6 @@ LIBS += -lmongoose
- LIBS += -llinenoise
- LIBS += -lqcommandline
-
--linux*|mac|openbsd* {
-- INCLUDEPATH += breakpad/src
--
-- SOURCES += breakpad/src/client/minidump_file_writer.cc \
-- breakpad/src/common/convert_UTF.c \
-- breakpad/src/common/md5.cc \
-- breakpad/src/common/string_conversion.cc
--}
--
--linux* {
-- SOURCES += breakpad/src/client/linux/crash_generation/crash_generation_client.cc \
-- breakpad/src/client/linux/handler/exception_handler.cc \
-- breakpad/src/client/linux/log/log.cc \
-- breakpad/src/client/linux/minidump_writer/linux_dumper.cc \
-- breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
-- breakpad/src/client/linux/minidump_writer/minidump_writer.cc \
-- breakpad/src/common/linux/file_id.cc \
-- breakpad/src/common/linux/guid_creator.cc \
-- breakpad/src/common/linux/memory_mapped_file.cc \
-- breakpad/src/common/linux/safe_readlink.cc
--}
--
--mac {
-- SOURCES += breakpad/src/client/mac/crash_generation/crash_generation_client.cc \
-- breakpad/src/client/mac/handler/exception_handler.cc \
-- breakpad/src/client/mac/handler/minidump_generator.cc \
-- breakpad/src/client/mac/handler/dynamic_images.cc \
-- breakpad/src/client/mac/handler/breakpad_nlist_64.cc \
-- breakpad/src/common/mac/bootstrap_compat.cc \
-- breakpad/src/common/mac/file_id.cc \
-- breakpad/src/common/mac/macho_id.cc \
-- breakpad/src/common/mac/macho_utilities.cc \
-- breakpad/src/common/mac/macho_walker.cc \
-- breakpad/src/common/mac/string_utilities.cc
--
-- OBJECTIVE_SOURCES += breakpad/src/common/mac/MachIPC.mm
--}
--
- win32: RC_FILE = phantomjs_win.rc
- os2: RC_FILE = phantomjs_os2.rc
-
-@@ -119,10 +81,6 @@ mac {
-
- win32-msvc* {
- LIBS += -lCrypt32 -llibxml2
-- INCLUDEPATH += breakpad/src
-- SOURCES += breakpad/src/client/windows/handler/exception_handler.cc \
-- breakpad/src/client/windows/crash_generation/crash_generation_client.cc \
-- breakpad/src/common/windows/guid_string.cc
- CONFIG(static) {
- DEFINES += STATIC_BUILD
- }
---- phantomjs-2.0.0/src/crashdump.h~ 2015-01-24 03:19:52.000000000 +0100
-+++ phantomjs-2.0.0/src/crashdump.h 2015-03-31 13:02:08.664129280 +0200
-@@ -31,9 +31,11 @@
- #ifndef CRASHDUMP_H
- #define CRASHDUMP_H
-
-+#ifdef HAVE_BREAKPAD
- namespace google_breakpad {
- class ExceptionHandler;
- }
-+#endif
-
- class CrashHandler
- {
-@@ -43,7 +45,9 @@
-
- private:
- void (*old_terminate_handler)();
-+#ifdef HAVE_BREAKPAD
- google_breakpad::ExceptionHandler *eh;
-+#endif
- };
-
- #endif // CRASHDUMP_H
---- phantomjs-2.0.0/src/crashdump.cpp~ 2015-03-31 13:02:35.000000000 +0200
-+++ phantomjs-2.0.0/src/crashdump.cpp 2015-03-31 13:05:36.369213390 +0200
-@@ -188,12 +188,16 @@
- // and crash promptly if not.
-
- CrashHandler::CrashHandler()
-- : old_terminate_handler(std::set_terminate(std::abort)),
-- eh(initBreakpad())
-+ : old_terminate_handler(std::set_terminate(std::abort))
-+#ifdef HAVE_BREAKPAD
-+ ,eh(initBreakpad())
-+#endif
- {}
-
- CrashHandler::~CrashHandler()
- {
-+#ifdef HAVE_BREAKPAD
- delete eh;
-+#endif
- std::set_terminate(old_terminate_handler);
- }
diff --git a/phantomjs-qt.patch b/phantomjs-qt.patch
index 40c4075..f1f3445 100644
--- a/phantomjs-qt.patch
+++ b/phantomjs-qt.patch
@@ -1,14 +1,3 @@
---- phantomjs-2.0.0/src/phantomjs.pro~ 2015-03-31 11:33:10.000000000 +0200
-+++ phantomjs-2.0.0/src/phantomjs.pro 2015-03-31 11:35:56.083153334 +0200
-@@ -1,6 +1,6 @@
-
--if(!equals(QT_MAJOR_VERSION, 5)|!equals(QT_MINOR_VERSION, 3)) {
-- error("This program can only be compiled with Qt 5.3.x.")
-+if(!equals(QT_MAJOR_VERSION, 5)|!equals(QT_MINOR_VERSION, 4)) {
-+ error("This program can only be compiled with Qt 5.4.x.")
- }
-
- TEMPLATE = app
--- phantomjs-2.0.0/src/phantomjs.pro~ 2015-03-31 12:28:29.000000000 +0200
+++ phantomjs-2.0.0/src/phantomjs.pro 2015-03-31 12:30:37.684374103 +0200
@@ -5,7 +5,7 @@
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/phantomjs.git/commitdiff/a82c74c1bebc21f1e68a4deede33d5d9c92de44c
More information about the pld-cvs-commit
mailing list