unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add qtwebkit.
@ 2016-10-28  9:26 Thomas Danckaert
  2016-10-28 14:44 ` Roel Janssen
  2016-10-30  0:22 ` Leo Famulari
  0 siblings, 2 replies; 11+ messages in thread
From: Thomas Danckaert @ 2016-10-28  9:26 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: Text/Plain, Size: 976 bytes --]

Hi,

this patch adds QtWebKit 5.7 as a separate package (hopefully this will reduce security concerns: only packages which really need QtWebKit will include it).

QtWebKit is not officially supported anymore as of Qt 5.6, so this is a “community release” (not exactly sure what that entails, or if this includes any updates at all since the Qt 5.5 version).  I suppose many projects are switching to Qt WebEngine, and there are some efforts to create an updated version of QtWebKit (https://github.com/annulen/webkit), but in the mean time, this package might help build packages which still rely on the old QtWebKit.

By default, the qmake build system for qtwebkit insists on installing into the same prefix as qtbase, and it seems no command line parameters will change that. The solution I came up with, was to substitute all the necessary paths in the generated Makefiles. This makes the patch a bit lengthy.

I've also attached a minimal example.

Thomas

[-- Attachment #2: 0001-gnu-Add-qtwebkit.patch --]
[-- Type: Text/X-Patch, Size: 6808 bytes --]

From ef2830cfc9342a88ce473f6a9bc55fee68991b74 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Wed, 26 Oct 2016 11:11:01 +0200
Subject: [PATCH] gnu: Add qtwebkit.

* gnu/packages/qt.scm (qtwebkit): New variable.
---
 gnu/packages/qt.scm | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a1e5fde..8e710ab 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1112,3 +1113,115 @@ contain over 620 classes.")
       "QtKeychain is a Qt library to store passwords and other secret data
 securely.  It will not store any data unencrypted unless explicitly requested.")
     (license license:bsd-3)))
+
+(define-public qtwebkit
+  (package
+    (name "qtwebkit")
+    (version "5.7.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "http://download.qt.io/community_releases/"
+                            (version-major+minor version)
+                            "/" version "/qtwebkit-opensource-src-" version
+                            ".tar.xz"))
+        (sha256
+         (base32
+          "1prlpl3zslzpr1iv7m3irvxjxn3v8nlxh21v9k2kaq4fpwy2b8y7"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("perl" ,perl)
+       ("python" ,python-2.7)
+       ("ruby" ,ruby)
+       ("bison" ,bison)
+       ("flex" ,flex)
+       ("gperf" ,gperf)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("icu" ,icu4c)
+       ("libjpeg" ,libjpeg)
+       ("libpng" ,libpng)
+       ("libwebp" ,libwebp)
+       ("sqlite" ,sqlite)
+       ("fontconfig" ,fontconfig)
+       ("libxrender", libxrender)
+       ("qtbase" ,qtbase)
+       ("qtdeclarative" ,qtdeclarative)
+       ("qtmultimedia" ,qtmultimedia)
+       ("libxml2" ,libxml2)
+       ("libxslt" ,libxslt)
+       ("libx11" ,libx11)
+       ("libxcomposite" ,libxcomposite)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+                  (lambda* (#:key outputs #:allow-other-keys)
+                    (let ((out (assoc-ref outputs "out")))
+                      (setenv "QMAKEPATH"
+                              (string-append (getcwd) "/Tools/qmake:"
+                                             (getenv "QMAKEPATH")))
+                      (system* "qmake"))))
+         ;; prevent webkit from trying to install into the qtbase store directory,
+         ;; and replace references to the build directory in linker options:
+         (add-before 'build 'patch-installpaths
+                     (lambda* (#:key outputs inputs #:allow-other-keys)
+                       (let* ((out (assoc-ref outputs "out"))
+                              (qtbase (assoc-ref inputs "qtbase"))
+                              (builddir (getcwd))
+                              (linkbuild (string-append "-L" builddir))
+                              (linkout (string-append "-L" out))
+                              (makefiles
+                               (map-in-order
+                                (lambda (i)
+                                  (let* ((in (car i))
+                                         (mf (string-append (dirname in) "/"
+                                                            (cdr i))))
+                                    ;; by default, these Makefiles are
+                                    ;; generated during install, but we need
+                                    ;; to generate them now
+                                    (system* "qmake" in "-o" mf)
+                                    mf))
+                                '(("Source/api.pri" . "Makefile.api")
+                                  ("Source/widgetsapi.pri"
+                                   . "Makefile.widgetsapi")
+                                  ("Source/WebKit2/WebProcess.pro"
+                                   . "Makefile.WebProcess")
+                                  ("Source/WebKit2/PluginProcess.pro"
+                                   . "Makefile.PluginProcess")
+                                  ("Source/WebKit/qt/declarative/public.pri"
+                                   . "Makefile.declarative.public")
+                                  ("Source/WebKit/qt/declarative/experimental/experimental.pri"
+                                   . "Makefile.declarative.experimental")
+                                  ("Source/WebKit/qt/examples/platformplugin/platformplugin.pro"
+                                   . "Makefile")))))
+                         ;; Order of qmake calls and substitutions matters here.
+                         (system* "qmake" "-prl" "Source/widgetsapi.pri"
+                                  "-o" "Source/Makefile")
+                         (substitute* (find-files "lib" "libQt5.*\\.prl")
+                           ((linkbuild) linkout))
+                         (substitute* (find-files "lib"
+                                                  "libQt5WebKit.*\\.la")
+                           (("libdir='.*'")
+                            (string-append "libdir='" out "/lib'"))
+                           ((linkbuild) linkout))
+                         (substitute* (find-files "lib/pkgconfig"
+                                                  "Qt5WebKit.*\\.pc")
+                           (((string-append "prefix=" qtbase))
+                            (string-append "prefix=" out))
+                           ((linkbuild) linkout))
+                         ;; Makefiles must be modified after .prl/.la/.pc
+                         ;; files, lest they get rebuilt:
+                         (substitute* makefiles
+                           (((string-append "\\$\\(INSTALL_ROOT\\)" qtbase))
+                            out )
+                           (((string-append "-Wl,-rpath," builddir))
+                            (string-append "-Wl,-rpath," out)))))))))
+    (home-page "https://www.webkit.org")
+    (synopsis "Web browser engine and classes to render and interact with web
+content")
+    (description "QtWebKit provides a Web browser engine that makes it easy to
+embed content from the World Wide Web into your Qt application.  At the same
+time Web content can be enhanced with native controls.")
+
+    (license license:lgpl2.1+)))
-- 
2.7.4


[-- Attachment #3: example.pro --]
[-- Type: Text/Plain, Size: 72 bytes --]

QT += widgets
QT += webkit
QT += webkitwidgets
SOURCES = example.cpp
  

[-- Attachment #4: example.cpp --]
[-- Type: Text/Plain, Size: 234 bytes --]

#include <QWebView>
#include <QApplication>

int main(int argc, char** argv) {
    QApplication app(argc, argv);
    QWebView view;
    view.show();
    view.setUrl(QUrl("https://www.gnu.org/software/guix"));
    return app.exec();
}

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add qtwebkit.
  2016-10-28  9:26 [PATCH] gnu: Add qtwebkit Thomas Danckaert
@ 2016-10-28 14:44 ` Roel Janssen
  2016-11-02 12:35   ` Roel Janssen
  2016-10-30  0:22 ` Leo Famulari
  1 sibling, 1 reply; 11+ messages in thread
From: Roel Janssen @ 2016-10-28 14:44 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel


Thomas Danckaert writes:

> Hi,
>
> this patch adds QtWebKit 5.7 as a separate package (hopefully this will reduce security concerns: only packages which really need QtWebKit will include it).
>
> QtWebKit is not officially supported anymore as of Qt 5.6, so this is a “community release” (not exactly sure what that entails, or if this includes any updates at all since the Qt 5.5 version).  I suppose many projects are switching to Qt WebEngine, and there are some efforts to create an updated version of QtWebKit (https://github.com/annulen/webkit), but in the mean time, this package might help build packages which still rely on the old QtWebKit.
>
> By default, the qmake build system for qtwebkit insists on installing into the same prefix as qtbase, and it seems no command line parameters will change that. The solution I came up with, was to substitute all the necessary paths in the generated Makefiles. This makes the patch a bit lengthy.
>
> I've also attached a minimal example.
>
> Thomas
> QT += widgets
> QT += webkit
> QT += webkitwidgets
> SOURCES = example.cpp
>   
> #include <QWebView>
> #include <QApplication>
>
> int main(int argc, char** argv) {
>     QApplication app(argc, argv);
>     QWebView view;
>     view.show();
>     view.setUrl(QUrl("https://www.gnu.org/software/guix"));
>     return app.exec();
> }

Thanks a lot for this patch.  I can confirm it builds fine, yet I have
to test it on some Qt packages that need QtWebkit (Texmaker).

Kind regards,
Roel Janssen

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add qtwebkit.
  2016-10-28  9:26 [PATCH] gnu: Add qtwebkit Thomas Danckaert
  2016-10-28 14:44 ` Roel Janssen
@ 2016-10-30  0:22 ` Leo Famulari
  2016-11-02 13:05   ` Thomas Danckaert
  1 sibling, 1 reply; 11+ messages in thread
From: Leo Famulari @ 2016-10-30  0:22 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel

On Fri, Oct 28, 2016 at 11:26:01AM +0200, Thomas Danckaert wrote:
> Hi,
> 
> this patch adds QtWebKit 5.7 as a separate package (hopefully this
> will reduce security concerns: only packages which really need
> QtWebKit will include it).
> 
> QtWebKit is not officially supported anymore as of Qt 5.6, so this is
> a “community release” (not exactly sure what that entails, or if this
> includes any updates at all since the Qt 5.5 version).  I suppose many
> projects are switching to Qt WebEngine, and there are some efforts to
> create an updated version of QtWebKit
> (https://github.com/annulen/webkit), but in the mean time, this
> package might help build packages which still rely on the old
> QtWebKit.

Interesting!

Is there any official statement from Qt about these "community
releases"? I see that it is hosted on qt.io, so presumably they are
somehow blessed by Qt, but I'd like more information.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add qtwebkit.
  2016-10-28 14:44 ` Roel Janssen
@ 2016-11-02 12:35   ` Roel Janssen
  2016-11-02 13:00     ` Thomas Danckaert
  0 siblings, 1 reply; 11+ messages in thread
From: Roel Janssen @ 2016-11-02 12:35 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel


Roel Janssen writes:

> Thomas Danckaert writes:
>
>> Hi,
>>
>> this patch adds QtWebKit 5.7 as a separate package (hopefully this will reduce security concerns: only packages which really need QtWebKit will include it).
>>
>> QtWebKit is not officially supported anymore as of Qt 5.6, so this is a “community release” (not exactly sure what that entails, or if this includes any updates at all since the Qt 5.5 version).  I suppose many projects are switching to Qt WebEngine, and there are some efforts to create an updated version of QtWebKit (https://github.com/annulen/webkit), but in the mean time, this package might help build packages which still rely on the old QtWebKit.
>>
>> By default, the qmake build system for qtwebkit insists on installing into the same prefix as qtbase, and it seems no command line parameters will change that. The solution I came up with, was to substitute all the necessary paths in the generated Makefiles. This makes the patch a bit lengthy.
>>
>> I've also attached a minimal example.
>>
>> Thomas
>> QT += widgets
>> QT += webkit
>> QT += webkitwidgets
>> SOURCES = example.cpp
>>   
>> #include <QWebView>
>> #include <QApplication>
>>
>> int main(int argc, char** argv) {
>>     QApplication app(argc, argv);
>>     QWebView view;
>>     view.show();
>>     view.setUrl(QUrl("https://www.gnu.org/software/guix"));
>>     return app.exec();
>> }
>
> Thanks a lot for this patch.  I can confirm it builds fine, yet I have
> to test it on some Qt packages that need QtWebkit (Texmaker).

I think this patch works fine.  Unfortunately for me, it does not fix
Texmaker's build because it needs QtWebkitWidgets which is apparently a
different thing.

Kind regards,
Roel Janssen

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add qtwebkit.
  2016-11-02 12:35   ` Roel Janssen
@ 2016-11-02 13:00     ` Thomas Danckaert
  2016-11-02 13:32       ` Roel Janssen
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Danckaert @ 2016-11-02 13:00 UTC (permalink / raw)
  To: roel; +Cc: guix-devel

From: Roel Janssen <roel@gnu.org>
Subject: Re: [PATCH] gnu: Add qtwebkit.
Date: Wed, 02 Nov 2016 13:35:21 +0100

> I think this patch works fine.  Unfortunately for me, it does not 
> fix
> Texmaker's build because it needs QtWebkitWidgets which is 
> apparently a
> different thing.

I'm quite sure QtWebkitWidgets is in there (there's a 
libqtwebkitwidgets.so or something like that if you look in the lib 
directory. See also the 'QT+=webkitwidgets' in the example I 
attached). I don't know how Texmaker's build system works, maybe some 
of qtwebkit's qmake/pkg-config/libtool auxiliary files are incomplete 
or incorrect, and this is why texmaker doesn't find qtwebkitwidgets?  
If you can find out how texmaker looks for qtwebkitwidgets, we might 
improve the patch.

Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add qtwebkit.
  2016-10-30  0:22 ` Leo Famulari
@ 2016-11-02 13:05   ` Thomas Danckaert
  2016-11-05 18:45     ` Leo Famulari
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Danckaert @ 2016-11-02 13:05 UTC (permalink / raw)
  To: leo; +Cc: guix-devel

From: Leo Famulari <leo@famulari.name>
Subject: Re: [PATCH] gnu: Add qtwebkit.
Date: Sat, 29 Oct 2016 20:22:14 -0400

> Is there any official statement from Qt about these "community
> releases"? I see that it is hosted on qt.io, so presumably they are
> somehow blessed by Qt, but I'd like more information.

I wasn't able to find any information at all.  Maybe someone on #kde 
can tell us more.

Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add qtwebkit.
  2016-11-02 13:00     ` Thomas Danckaert
@ 2016-11-02 13:32       ` Roel Janssen
  0 siblings, 0 replies; 11+ messages in thread
From: Roel Janssen @ 2016-11-02 13:32 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel


Thomas Danckaert writes:

> From: Roel Janssen <roel@gnu.org>
> Subject: Re: [PATCH] gnu: Add qtwebkit.
> Date: Wed, 02 Nov 2016 13:35:21 +0100
>
>> I think this patch works fine.  Unfortunately for me, it does not 
>> fix
>> Texmaker's build because it needs QtWebkitWidgets which is 
>> apparently a
>> different thing.
>
> I'm quite sure QtWebkitWidgets is in there (there's a 
> libqtwebkitwidgets.so or something like that if you look in the lib 
> directory. See also the 'QT+=webkitwidgets' in the example I 
> attached). I don't know how Texmaker's build system works, maybe some 
> of qtwebkit's qmake/pkg-config/libtool auxiliary files are incomplete 
> or incorrect, and this is why texmaker doesn't find qtwebkitwidgets?  
> If you can find out how texmaker looks for qtwebkitwidgets, we might 
> improve the patch.

So I thought.  I'll try to figure out why Texmaker doesn't find the
QtWebkitWidgets module and report my findings.

Kind regards,
Roel Janssen

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add qtwebkit.
  2016-11-02 13:05   ` Thomas Danckaert
@ 2016-11-05 18:45     ` Leo Famulari
  2016-11-05 20:24       ` Thomas Danckaert
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Famulari @ 2016-11-05 18:45 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel

On Wed, Nov 02, 2016 at 02:05:09PM +0100, Thomas Danckaert wrote:
> From: Leo Famulari <leo@famulari.name>
> Subject: Re: [PATCH] gnu: Add qtwebkit.
> Date: Sat, 29 Oct 2016 20:22:14 -0400
> 
> > Is there any official statement from Qt about these "community
> > releases"? I see that it is hosted on qt.io, so presumably they are
> > somehow blessed by Qt, but I'd like more information.
> 
> I wasn't able to find any information at all.  Maybe someone on #kde can
> tell us more.

I found this statement on the Qt mailing list:

"QtQuick1 and QtWebKit are _not_ supported anymore since Qt 5.6. 

What we have said is that we will provide QtWebKit source packages as
courtesy 
on a  best-effort basis. That is, also the QtWebKit source package under

http://download.qt.io/community_releases/5.6/5.6.0/

is not part of Qt anymore, and not supported. Use it at your own risk.
There's also no promise we can continue providing these."

source: http://lists.qt-project.org/pipermail/development/2016-May/025923.html

Well, none of this software comes with a warranty, so I think it's fine.
Can you add a code comment mentioning that this package is not
officially supported by the Qt project?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add qtwebkit.
  2016-11-05 18:45     ` Leo Famulari
@ 2016-11-05 20:24       ` Thomas Danckaert
  2016-11-07  9:17         ` Ludovic Courtès
  2016-11-07  9:47         ` Roel Janssen
  0 siblings, 2 replies; 11+ messages in thread
From: Thomas Danckaert @ 2016-11-05 20:24 UTC (permalink / raw)
  To: leo; +Cc: guix-devel

[-- Attachment #1: Type: Text/Plain, Size: 337 bytes --]

From: Leo Famulari <leo@famulari.name>
Subject: Re: [PATCH] gnu: Add qtwebkit.
Date: Sat, 5 Nov 2016 14:45:38 -0400

> Can you add a code comment mentioning that this package is not
> officially supported by the Qt project?

done!

I've attached an updated patch, as well as a follow-up patch for the 
texmaker package.

cheers,

Thomas

[-- Attachment #2: 0002-gnu-texmaker-Use-modular-qt-and-qtwebkit.patch --]
[-- Type: Text/X-Patch, Size: 1208 bytes --]

From 68a4c4accb53cb11c70d242d78e14259e788ac86 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Sat, 5 Nov 2016 21:18:13 +0100
Subject: [PATCH 2/2] gnu: texmaker: Use modular qt and qtwebkit.

* gnu/packages/tex.scm (texmaker)[inputs]: Use modular qt and qtwebkit.
---
 gnu/packages/tex.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index c8114c2..9186e46 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
+;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -439,7 +440,9 @@ PDF documents.")
                                "texmaker.pro"))))))))
     (inputs
      `(("poppler-qt5" ,poppler-qt5)
-       ("qt" ,qt)
+       ("qtbase" ,qtbase)
+       ("qtscript" ,qtscript)
+       ("qtwebkit" ,qtwebkit)
        ("zlib" ,zlib)))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
-- 
2.7.4


[-- Attachment #3: 0001-gnu-Add-qtwebkit.patch --]
[-- Type: Text/X-Patch, Size: 6887 bytes --]

From 0348e13d0aaae4034e8a76f47512e64432b1f84f Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Wed, 26 Oct 2016 11:11:01 +0200
Subject: [PATCH 1/2] gnu: Add qtwebkit.

* gnu/packages/qt.scm (qtwebkit): New variable.
---
 gnu/packages/qt.scm | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 114 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a1e5fde..cf6af6a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1112,3 +1113,116 @@ contain over 620 classes.")
       "QtKeychain is a Qt library to store passwords and other secret data
 securely.  It will not store any data unencrypted unless explicitly requested.")
     (license license:bsd-3)))
+
+(define-public qtwebkit
+  (package
+    (name "qtwebkit")
+    (version "5.7.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "http://download.qt.io/community_releases/"
+                            (version-major+minor version)
+                            "/" version "/qtwebkit-opensource-src-" version
+                            ".tar.xz"))
+        ;; note: since Qt 5.6, Qt no longer officially supports qtwebkit
+        (sha256
+         (base32
+          "1prlpl3zslzpr1iv7m3irvxjxn3v8nlxh21v9k2kaq4fpwy2b8y7"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("perl" ,perl)
+       ("python" ,python-2.7)
+       ("ruby" ,ruby)
+       ("bison" ,bison)
+       ("flex" ,flex)
+       ("gperf" ,gperf)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("icu" ,icu4c)
+       ("libjpeg" ,libjpeg)
+       ("libpng" ,libpng)
+       ("libwebp" ,libwebp)
+       ("sqlite" ,sqlite)
+       ("fontconfig" ,fontconfig)
+       ("libxrender", libxrender)
+       ("qtbase" ,qtbase)
+       ("qtdeclarative" ,qtdeclarative)
+       ("qtmultimedia" ,qtmultimedia)
+       ("libxml2" ,libxml2)
+       ("libxslt" ,libxslt)
+       ("libx11" ,libx11)
+       ("libxcomposite" ,libxcomposite)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+                  (lambda* (#:key outputs #:allow-other-keys)
+                    (let ((out (assoc-ref outputs "out")))
+                      (setenv "QMAKEPATH"
+                              (string-append (getcwd) "/Tools/qmake:"
+                                             (getenv "QMAKEPATH")))
+                      (system* "qmake"))))
+         ;; prevent webkit from trying to install into the qtbase store directory,
+         ;; and replace references to the build directory in linker options:
+         (add-before 'build 'patch-installpaths
+                     (lambda* (#:key outputs inputs #:allow-other-keys)
+                       (let* ((out (assoc-ref outputs "out"))
+                              (qtbase (assoc-ref inputs "qtbase"))
+                              (builddir (getcwd))
+                              (linkbuild (string-append "-L" builddir))
+                              (linkout (string-append "-L" out))
+                              (makefiles
+                               (map-in-order
+                                (lambda (i)
+                                  (let* ((in (car i))
+                                         (mf (string-append (dirname in) "/"
+                                                            (cdr i))))
+                                    ;; by default, these Makefiles are
+                                    ;; generated during install, but we need
+                                    ;; to generate them now
+                                    (system* "qmake" in "-o" mf)
+                                    mf))
+                                '(("Source/api.pri" . "Makefile.api")
+                                  ("Source/widgetsapi.pri"
+                                   . "Makefile.widgetsapi")
+                                  ("Source/WebKit2/WebProcess.pro"
+                                   . "Makefile.WebProcess")
+                                  ("Source/WebKit2/PluginProcess.pro"
+                                   . "Makefile.PluginProcess")
+                                  ("Source/WebKit/qt/declarative/public.pri"
+                                   . "Makefile.declarative.public")
+                                  ("Source/WebKit/qt/declarative/experimental/experimental.pri"
+                                   . "Makefile.declarative.experimental")
+                                  ("Source/WebKit/qt/examples/platformplugin/platformplugin.pro"
+                                   . "Makefile")))))
+                         ;; Order of qmake calls and substitutions matters here.
+                         (system* "qmake" "-prl" "Source/widgetsapi.pri"
+                                  "-o" "Source/Makefile")
+                         (substitute* (find-files "lib" "libQt5.*\\.prl")
+                           ((linkbuild) linkout))
+                         (substitute* (find-files "lib"
+                                                  "libQt5WebKit.*\\.la")
+                           (("libdir='.*'")
+                            (string-append "libdir='" out "/lib'"))
+                           ((linkbuild) linkout))
+                         (substitute* (find-files "lib/pkgconfig"
+                                                  "Qt5WebKit.*\\.pc")
+                           (((string-append "prefix=" qtbase))
+                            (string-append "prefix=" out))
+                           ((linkbuild) linkout))
+                         ;; Makefiles must be modified after .prl/.la/.pc
+                         ;; files, lest they get rebuilt:
+                         (substitute* makefiles
+                           (((string-append "\\$\\(INSTALL_ROOT\\)" qtbase))
+                            out )
+                           (((string-append "-Wl,-rpath," builddir))
+                            (string-append "-Wl,-rpath," out)))))))))
+    (home-page "https://www.webkit.org")
+    (synopsis "Web browser engine and classes to render and interact with web
+content")
+    (description "QtWebKit provides a Web browser engine that makes it easy to
+embed content from the World Wide Web into your Qt application.  At the same
+time Web content can be enhanced with native controls.")
+
+    (license license:lgpl2.1+)))
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add qtwebkit.
  2016-11-05 20:24       ` Thomas Danckaert
@ 2016-11-07  9:17         ` Ludovic Courtès
  2016-11-07  9:47         ` Roel Janssen
  1 sibling, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2016-11-07  9:17 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel

Hi,

Thomas Danckaert <post@thomasdanckaert.be> skribis:

> From: Leo Famulari <leo@famulari.name>
> Subject: Re: [PATCH] gnu: Add qtwebkit.
> Date: Sat, 5 Nov 2016 14:45:38 -0400
>
>> Can you add a code comment mentioning that this package is not
>> officially supported by the Qt project?
>
> done!

I agree with Leo that it’s okay to provide QtWebKit.

I went ahead and pushed these two patches:

> From 68a4c4accb53cb11c70d242d78e14259e788ac86 Mon Sep 17 00:00:00 2001
> From: Thomas Danckaert <thomas.danckaert@gmail.com>
> Date: Sat, 5 Nov 2016 21:18:13 +0100
> Subject: [PATCH 2/2] gnu: texmaker: Use modular qt and qtwebkit.
>
> * gnu/packages/tex.scm (texmaker)[inputs]: Use modular qt and qtwebkit.

[...]

> From 0348e13d0aaae4034e8a76f47512e64432b1f84f Mon Sep 17 00:00:00 2001
> From: Thomas Danckaert <thomas.danckaert@gmail.com>
> Date: Wed, 26 Oct 2016 11:11:01 +0200
> Subject: [PATCH 1/2] gnu: Add qtwebkit.
>
> * gnu/packages/qt.scm (qtwebkit): New variable.

[...]

> +    (source
> +      (origin
> +        (method url-fetch)
> +        (uri (string-append "http://download.qt.io/community_releases/"
> +                            (version-major+minor version)
> +                            "/" version "/qtwebkit-opensource-src-" version
> +                            ".tar.xz"))
> +        ;; note: since Qt 5.6, Qt no longer officially supports qtwebkit

I added a link to the message that Leo mentioned here.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add qtwebkit.
  2016-11-05 20:24       ` Thomas Danckaert
  2016-11-07  9:17         ` Ludovic Courtès
@ 2016-11-07  9:47         ` Roel Janssen
  1 sibling, 0 replies; 11+ messages in thread
From: Roel Janssen @ 2016-11-07  9:47 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel


Thomas Danckaert writes:

> From: Leo Famulari <leo@famulari.name>
> Subject: Re: [PATCH] gnu: Add qtwebkit.
> Date: Sat, 5 Nov 2016 14:45:38 -0400
>
>> Can you add a code comment mentioning that this package is not
>> officially supported by the Qt project?
>
> done!
>
> I've attached an updated patch, as well as a follow-up patch for the 
> texmaker package.

Thanks!

Kind regards,
Roel Janssen

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-11-07  9:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-28  9:26 [PATCH] gnu: Add qtwebkit Thomas Danckaert
2016-10-28 14:44 ` Roel Janssen
2016-11-02 12:35   ` Roel Janssen
2016-11-02 13:00     ` Thomas Danckaert
2016-11-02 13:32       ` Roel Janssen
2016-10-30  0:22 ` Leo Famulari
2016-11-02 13:05   ` Thomas Danckaert
2016-11-05 18:45     ` Leo Famulari
2016-11-05 20:24       ` Thomas Danckaert
2016-11-07  9:17         ` Ludovic Courtès
2016-11-07  9:47         ` Roel Janssen

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).