unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob d0a544ca54f7b7deefad98a54008353565698cdd 10710 bytes (raw)
name: gnu/packages/patches/phantomjs-qt55.patch 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
 
This patch ports PhantomJS to QT5.5.

Taken from Debian phantomjs/debian/patches/

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
 
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
@@ -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()
 {
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)) {
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)

debug log:

solving d0a544c ...
found d0a544c in https://yhetil.org/guix-devel/20161214190330.30433-7-janneke@gnu.org/

applying [1/1] https://yhetil.org/guix-devel/20161214190330.30433-7-janneke@gnu.org/
diff --git a/gnu/packages/patches/phantomjs-qt55.patch b/gnu/packages/patches/phantomjs-qt55.patch
new file mode 100644
index 0000000..d0a544c

1:20: trailing whitespace.
 
1:26: trailing whitespace.
 
1:28: trailing whitespace.
 
1:49: trailing whitespace.
 
1:54: trailing whitespace.
 
Checking patch gnu/packages/patches/phantomjs-qt55.patch...
Applied patch gnu/packages/patches/phantomjs-qt55.patch cleanly.
warning: squelched 28 whitespace errors
warning: 33 lines add whitespace errors.

index at:
100644 d0a544ca54f7b7deefad98a54008353565698cdd	gnu/packages/patches/phantomjs-qt55.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).