Patchwork gnu: Add qscintilla.

login
register
mail settings
Submitter Kei Yamashita
Date Sept. 14, 2016, 6:11 p.m.
Message ID <87vaxyic67.fsf@openmailbox.org>
Download mbox | patch
Permalink /patch/15637/
State New
Headers show

Comments

Kei Yamashita - Sept. 14, 2016, 6:11 p.m.
Leo Famulari <leo@famulari.name> writes:

> On Tue, Sep 13, 2016 at 08:48:43PM +0000, Efraim Flashner wrote:
>> On September 13, 2016 11:37:35 PM GMT+03:00, Kei Kebreau
>> <kei@openmailbox.org> wrote:
>> >In this case, should I leave qtscintilla-qt4 as a public package in
>> >qt.scm
>> >instead of maths.scm as Leo suggested?
>> 
>> That's where I would leave it. You could also leave a note, saying
>> that it was for octave, and if they switch to qt5 then we can get rid
>> of it. We still have an old vte package I added for a terminal since
>> all the bug reports around it haven't been cleared yet, and that's
>> with the other versions of vte.  -- 
>
> Sounds like a plan!

Alright then! I have all three patches here. Tell me if I did anything
funny. The order of application is "Add qscintilla, Add qscintilla-qt4,
Enable Octave's Qt 4 GUI." :)
From 9304e67ff085853ebbd5d7f1c976171de498bf5b Mon Sep 17 00:00:00 2001
From: Kei Kebreau <kei@openmailbox.org>
Date: Wed, 14 Sep 2016 13:56:33 -0400
Subject: [PATCH] gnu: Add qscintilla.

* gnu/packages/qt.scm (qscintilla): New variable.
---
 gnu/packages/qt.scm | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
Leo Famulari - Sept. 14, 2016, 6:56 p.m.
On Wed, Sep 14, 2016 at 02:11:44PM -0400, Kei Kebreau wrote:
> Leo Famulari <leo@famulari.name> writes:
> 
> > On Tue, Sep 13, 2016 at 08:48:43PM +0000, Efraim Flashner wrote:
> >> On September 13, 2016 11:37:35 PM GMT+03:00, Kei Kebreau
> >> <kei@openmailbox.org> wrote:
> >> >In this case, should I leave qtscintilla-qt4 as a public package in
> >> >qt.scm
> >> >instead of maths.scm as Leo suggested?
> >> 
> >> That's where I would leave it. You could also leave a note, saying
> >> that it was for octave, and if they switch to qt5 then we can get rid
> >> of it. We still have an old vte package I added for a terminal since
> >> all the bug reports around it haven't been cleared yet, and that's
> >> with the other versions of vte.  -- 
> >
> > Sounds like a plan!
> 
> Alright then! I have all three patches here. Tell me if I did anything
> funny. The order of application is "Add qscintilla, Add qscintilla-qt4,
> Enable Octave's Qt 4 GUI." :)

The patches "Add qscintilla" and "Add qscintilla-qt4" both add both
packages.

Patch

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a482d75..de3e656 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 Kei Kebreau <kei@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1112,3 +1113,70 @@  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 qscintilla
+  (package
+    (name "qscintilla")
+    (version "2.9.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/QScintilla2/QScintilla-"
+                                  version "/QScintilla_gpl-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0znvdncpj64zcpbkyvj11dm8bdc3nfn5girggj33ammhfcyvkalq"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'change-directory
+           (lambda _ (chdir "Qt4Qt5") #t))
+         (replace 'configure
+           (lambda _ (zero? (system* "qmake" "qscintilla.pro"))))
+         (add-before 'install 'fix-Makefiles
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out    (assoc-ref outputs "out"))
+                   (qtbase (assoc-ref inputs "qtbase")))
+               (substitute* (find-files "." "Makefile")
+                 (((string-append "INSTALL_ROOT)" qtbase))
+                   (string-append "INSTALL_ROOT)" out))))
+             #t)))))
+    (native-inputs
+     `(("python-pyqt" ,python-pyqt)
+       ("qtbase" ,qtbase))) ; for qmake
+    (home-page "https://www.riverbankcomputing.com/software/qscintilla/intro")
+    (synopsis "Qt5 port of the Scintilla editing component")
+    (description
+     "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++ editor control.
+As well as features found in standard text editing components, QScintilla
+includes features especially useful when editing and debugging source code.
+These include support for syntax styling, error indicators, code completion and
+call tips.")
+    (license (list license:bsd-2 ; Python/configure.py
+                   license:expat ; src/ and include/
+                   license:gpl3))))
+
+;; required for Octave until its GUI is updated to Qt 5
+(define-public qscintilla-qt4
+  (package
+    (inherit qscintilla)
+    (name "qscintilla-qt4")
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'change-directory
+           (lambda _ (chdir "Qt4Qt5") #t))
+         (replace 'configure
+           (lambda _ (zero? (system* "qmake" "qscintilla.pro"))))
+         (add-before 'install 'fix-Makefiles
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out    (assoc-ref outputs "out"))
+                   (qt (assoc-ref inputs "qt")))
+               (substitute* (find-files "." "Makefile")
+                 (((string-append "INSTALL_ROOT)" qt))
+                   (string-append "INSTALL_ROOT)" out))))
+             #t)))))
+    (native-inputs
+     `(("python-pyqt" ,python-pyqt-4)
+       ("qt" ,qt-4))) ; for qmake
+    (synopsis "Qt4 port of the Scintilla editing component")))