diff mbox

gnu: Add qscintilla.

Message ID 87r38ndfwb.fsf@openmailbox.org
State New
Headers show

Commit Message

Kei Yamashita Sept. 13, 2016, 2:37 p.m. UTC
Kei Kebreau <kei@openmailbox.org> writes:

> A component necessary for GNU Octave's GUI.
> How does it look?
Not sure how packaging Qt packages goes, but I've discovered that
GNU Octave's GUI only builds with Qt4 support. I've changed the patch to
adjust this. Should I leave the old patch as is and add a qt4 package
that inherits from it?
From 51da032547ed3e1c2b7825b35b1f39a5e922b44b Mon Sep 17 00:00:00 2001
From: Kei Kebreau <kei@openmailbox.org>
Date: Tue, 13 Sep 2016 10:34:59 -0400
Subject: [PATCH] gnu: Add qscintilla.

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

Comments

Leo Famulari Sept. 13, 2016, 5:05 p.m. UTC | #1
On Tue, Sep 13, 2016 at 10:37:56AM -0400, Kei Kebreau wrote:
> Kei Kebreau <kei@openmailbox.org> writes:
> > A component necessary for GNU Octave's GUI.
> > How does it look?
> Not sure how packaging Qt packages goes, but I've discovered that
> GNU Octave's GUI only builds with Qt4 support. I've changed the patch to
> adjust this. Should I leave the old patch as is and add a qt4 package
> that inherits from it?

Since Qt 4 is no longer supported upstream, we are trying to remove
users of the qt-4 package so that we can eventually remove the qt-4
package itself.

With that in mind, how about a qscintilla-for-octave package? This
package can inherit from a qscintilla that uses qtbase, and I think it
should be declared privately [using (define) instead of (define-public].

> +         (replace 'configure
> +           (lambda _
> +             (chdir "Qt4Qt5")
> +             (zero? (system* "qmake" "qscintilla.pro"))))

I would change directory in a separate 'chdir' phase.

> +               (substitute* (find-files "." "Makefile")
> +                 (((string-append "INSTALL_ROOT)" qt))
> +                  (string-append "INSTALL_ROOT)" out)))))))))
                     ^
Inconsistent indentation. Also, this phase should return #t, since the
return value of substitute* is unspecified.

> +    (synopsis "Qt5 port of the Scintilla editing component")

Make sure to adjust the Qt name as appropriate :)
Kei Yamashita Sept. 13, 2016, 6:01 p.m. UTC | #2
Leo Famulari <leo@famulari.name> writes:

> On Tue, Sep 13, 2016 at 10:37:56AM -0400, Kei Kebreau wrote:
>> Kei Kebreau <kei@openmailbox.org> writes:
>> > A component necessary for GNU Octave's GUI.
>> > How does it look?
>> Not sure how packaging Qt packages goes, but I've discovered that
>> GNU Octave's GUI only builds with Qt4 support. I've changed the patch to
>> adjust this. Should I leave the old patch as is and add a qt4 package
>> that inherits from it?
>
> Since Qt 4 is no longer supported upstream, we are trying to remove
> users of the qt-4 package so that we can eventually remove the qt-4
> package itself.
>
> With that in mind, how about a qscintilla-for-octave package? This
> package can inherit from a qscintilla that uses qtbase, and I think it
> should be declared privately [using (define) instead of (define-public].
>
>> +         (replace 'configure
>> +           (lambda _
>> +             (chdir "Qt4Qt5")
>> +             (zero? (system* "qmake" "qscintilla.pro"))))
>
> I would change directory in a separate 'chdir' phase.
>
>> +               (substitute* (find-files "." "Makefile")
>> +                 (((string-append "INSTALL_ROOT)" qt))
>> +                  (string-append "INSTALL_ROOT)" out)))))))))
>                      ^
> Inconsistent indentation. Also, this phase should return #t, since the
> return value of substitute* is unspecified.
>
>> +    (synopsis "Qt5 port of the Scintilla editing component")
>
> Make sure to adjust the Qt name as appropriate :)

Like below? And how could I then access qscintilla-for-octave from
maths.scm if it isn't defined publicly?

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

(define qtscintilla-for-octave
  (package
    (inherit qtscintilla)
    (name "qtscintilla-for-octave")
    (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)
       ("qt" ,qt-4))) ; for qmake
    (synopsis "Qt4 port of the Scintilla editing component")))
Leo Famulari Sept. 13, 2016, 6:14 p.m. UTC | #3
On Tue, Sep 13, 2016 at 02:01:33PM -0400, Kei Kebreau wrote:
> Like below? And how could I then access qscintilla-for-octave from
> maths.scm if it isn't defined publicly?

Yes, that looks right. But I would put qscintilla-for-octave in
maths.scm to avoid the issue you describe.
Kei Yamashita Sept. 13, 2016, 6:59 p.m. UTC | #4
Leo Famulari <leo@famulari.name> writes:

> On Tue, Sep 13, 2016 at 02:01:33PM -0400, Kei Kebreau wrote:
>> Like below? And how could I then access qscintilla-for-octave from
>> maths.scm if it isn't defined publicly?
>
> Yes, that looks right. But I would put qscintilla-for-octave in
> maths.scm to avoid the issue you describe.

So would you say that this is clean enough that I could push both of
these changes in their respecitive files before modifying the Octave definition?
Leo Famulari Sept. 13, 2016, 7:04 p.m. UTC | #5
On Tue, Sep 13, 2016 at 02:59:31PM -0400, Kei Kebreau wrote:
> Leo Famulari <leo@famulari.name> writes:
> 
> > On Tue, Sep 13, 2016 at 02:01:33PM -0400, Kei Kebreau wrote:
> >> Like below? And how could I then access qscintilla-for-octave from
> >> maths.scm if it isn't defined publicly?
> >
> > Yes, that looks right. But I would put qscintilla-for-octave in
> > maths.scm to avoid the issue you describe.
> 
> So would you say that this is clean enough that I could push both of
> these changes in their respecitive files before modifying the Octave definition?

I would wait to push the Qt 4 variant until you have made sure it works
with Octave.

Also, I didn't notice a difference between the arguments for each
package variant. If there is no difference, could the Qt 4 variant
inherit the arguments, too?
Efraim Flashner Sept. 13, 2016, 7:39 p.m. UTC | #6
On Tue, Sep 13, 2016 at 02:01:33PM -0400, Kei Kebreau wrote:
> Leo Famulari <leo@famulari.name> writes:
> 
> > On Tue, Sep 13, 2016 at 10:37:56AM -0400, Kei Kebreau wrote:
> >> Kei Kebreau <kei@openmailbox.org> writes:
> >> > A component necessary for GNU Octave's GUI.
> >> > How does it look?
> >> Not sure how packaging Qt packages goes, but I've discovered that
> >> GNU Octave's GUI only builds with Qt4 support. I've changed the patch to
> >> adjust this. Should I leave the old patch as is and add a qt4 package
> >> that inherits from it?
> >
> > Since Qt 4 is no longer supported upstream, we are trying to remove
> > users of the qt-4 package so that we can eventually remove the qt-4
> > package itself.
> >
> > With that in mind, how about a qscintilla-for-octave package? This
> > package can inherit from a qscintilla that uses qtbase, and I think it
> > should be declared privately [using (define) instead of (define-public].
> >
> >> +         (replace 'configure
> >> +           (lambda _
> >> +             (chdir "Qt4Qt5")
> >> +             (zero? (system* "qmake" "qscintilla.pro"))))
> >
> > I would change directory in a separate 'chdir' phase.
> >
> >> +               (substitute* (find-files "." "Makefile")
> >> +                 (((string-append "INSTALL_ROOT)" qt))
> >> +                  (string-append "INSTALL_ROOT)" out)))))))))
> >                      ^
> > Inconsistent indentation. Also, this phase should return #t, since the
> > return value of substitute* is unspecified.
> >
> >> +    (synopsis "Qt5 port of the Scintilla editing component")
> >
> > Make sure to adjust the Qt name as appropriate :)
> 
> Like below? And how could I then access qscintilla-for-octave from
> maths.scm if it isn't defined publicly?
> 
> (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))))
> 
> (define qtscintilla-for-octave

This should be qtscintilla-qt4, we might have a use for it outside of
octave

>   (package
>     (inherit qtscintilla)
>     (name "qtscintilla-for-octave")
>     (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)

python-pyqt is built against qt-5

>        ("qt" ,qt-4))) ; for qmake
>     (synopsis "Qt4 port of the Scintilla editing component")))
Kei Yamashita Sept. 13, 2016, 7:40 p.m. UTC | #7
Leo Famulari <leo@famulari.name> writes:

> On Tue, Sep 13, 2016 at 02:59:31PM -0400, Kei Kebreau wrote:
>> Leo Famulari <leo@famulari.name> writes:
>> 
>> > On Tue, Sep 13, 2016 at 02:01:33PM -0400, Kei Kebreau wrote:
>> >> Like below? And how could I then access qscintilla-for-octave from
>> >> maths.scm if it isn't defined publicly?
>> >
>> > Yes, that looks right. But I would put qscintilla-for-octave in
>> > maths.scm to avoid the issue you describe.
>> 
>> So would you say that this is clean enough that I could push both of
>> these changes in their respecitive files before modifying the Octave definition?
>
> I would wait to push the Qt 4 variant until you have made sure it works
> with Octave.

I have Octave successfully running with a GUI on my machine using the Qt
4 version of the QScintilla patch, though I've yet to test with the
qscintilla-for-octave package.
>
> Also, I didn't notice a difference between the arguments for each
> package variant. If there is no difference, could the Qt 4 variant
> inherit the arguments, too?

There is a small difference in the two fix-Makefiles phases. They
replace different folder paths (the Qt 5 version changes the qtbase path to
the package output path, the Qt 4 version changes the qt-4 path to the
package output path).
Kei Yamashita Sept. 13, 2016, 8:37 p.m. UTC | #8
Efraim Flashner <efraim@flashner.co.il> writes:

> On Tue, Sep 13, 2016 at 02:01:33PM -0400, Kei Kebreau wrote:
>> Leo Famulari <leo@famulari.name> writes:
>> 
>> > On Tue, Sep 13, 2016 at 10:37:56AM -0400, Kei Kebreau wrote:
>> >> Kei Kebreau <kei@openmailbox.org> writes:
>> >> > A component necessary for GNU Octave's GUI.
>> >> > How does it look?
>> >> Not sure how packaging Qt packages goes, but I've discovered that
>> >> GNU Octave's GUI only builds with Qt4 support. I've changed the patch to
>> >> adjust this. Should I leave the old patch as is and add a qt4 package
>> >> that inherits from it?
>> >
>> > Since Qt 4 is no longer supported upstream, we are trying to remove
>> > users of the qt-4 package so that we can eventually remove the qt-4
>> > package itself.
>> >
>> > With that in mind, how about a qscintilla-for-octave package? This
>> > package can inherit from a qscintilla that uses qtbase, and I think it
>> > should be declared privately [using (define) instead of (define-public].
>> >
>> >> +         (replace 'configure
>> >> +           (lambda _
>> >> +             (chdir "Qt4Qt5")
>> >> +             (zero? (system* "qmake" "qscintilla.pro"))))
>> >
>> > I would change directory in a separate 'chdir' phase.
>> >
>> >> +               (substitute* (find-files "." "Makefile")
>> >> +                 (((string-append "INSTALL_ROOT)" qt))
>> >> +                  (string-append "INSTALL_ROOT)" out)))))))))
>> >                      ^
>> > Inconsistent indentation. Also, this phase should return #t, since the
>> > return value of substitute* is unspecified.
>> >
>> >> +    (synopsis "Qt5 port of the Scintilla editing component")
>> >
>> > Make sure to adjust the Qt name as appropriate :)
>> 
>> Like below? And how could I then access qscintilla-for-octave from
>> maths.scm if it isn't defined publicly?
>> 
>> (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))))
>> 
>> (define qtscintilla-for-octave
>
> This should be qtscintilla-qt4, we might have a use for it outside of
> octave
>

In this case, should I leave qtscintilla-qt4 as a public package in qt.scm
instead of maths.scm as Leo suggested?
Efraim Flashner Sept. 13, 2016, 8:48 p.m. UTC | #9
On September 13, 2016 11:37:35 PM GMT+03:00, Kei Kebreau <kei@openmailbox.org> wrote:
>Efraim Flashner <efraim@flashner.co.il> writes:
>
>> On Tue, Sep 13, 2016 at 02:01:33PM -0400, Kei Kebreau wrote:
>>> Leo Famulari <leo@famulari.name> writes:
>>> 
>>> > On Tue, Sep 13, 2016 at 10:37:56AM -0400, Kei Kebreau wrote:
>>> >> Kei Kebreau <kei@openmailbox.org> writes:
>>> >> > A component necessary for GNU Octave's GUI.
>>> >> > How does it look?
>>> >> Not sure how packaging Qt packages goes, but I've discovered that
>>> >> GNU Octave's GUI only builds with Qt4 support. I've changed the
>patch to
>>> >> adjust this. Should I leave the old patch as is and add a qt4
>package
>>> >> that inherits from it?
>>> >
>>> > Since Qt 4 is no longer supported upstream, we are trying to
>remove
>>> > users of the qt-4 package so that we can eventually remove the
>qt-4
>>> > package itself.
>>> >
>>> > With that in mind, how about a qscintilla-for-octave package? This
>>> > package can inherit from a qscintilla that uses qtbase, and I
>think it
>>> > should be declared privately [using (define) instead of
>(define-public].
>>> >
>>> >> +         (replace 'configure
>>> >> +           (lambda _
>>> >> +             (chdir "Qt4Qt5")
>>> >> +             (zero? (system* "qmake" "qscintilla.pro"))))
>>> >
>>> > I would change directory in a separate 'chdir' phase.
>>> >
>>> >> +               (substitute* (find-files "." "Makefile")
>>> >> +                 (((string-append "INSTALL_ROOT)" qt))
>>> >> +                  (string-append "INSTALL_ROOT)" out)))))))))
>>> >                      ^
>>> > Inconsistent indentation. Also, this phase should return #t, since
>the
>>> > return value of substitute* is unspecified.
>>> >
>>> >> +    (synopsis "Qt5 port of the Scintilla editing component")
>>> >
>>> > Make sure to adjust the Qt name as appropriate :)
>>> 
>>> Like below? And how could I then access qscintilla-for-octave from
>>> maths.scm if it isn't defined publicly?
>>> 
>>> (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))))
>>> 
>>> (define qtscintilla-for-octave
>>
>> This should be qtscintilla-qt4, we might have a use for it outside of
>> octave
>>
>
>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.
Leo Famulari Sept. 14, 2016, 5:08 p.m. UTC | #10
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!
Andreas Enge Sept. 18, 2016, 8:36 a.m. UTC | #11
Hello,

On Tue, Sep 13, 2016 at 04:37:35PM -0400, Kei Kebreau wrote:
> In this case, should I leave qtscintilla-qt4 as a public package in qt.scm
> instead of maths.scm as Leo suggested?

since it is used for only one package and relies on the deprecated qt@4,
I would leave it private, regardless its name.

Andreas
Kei Yamashita Sept. 18, 2016, 8:10 p.m. UTC | #12
Andreas Enge <andreas@enge.fr> writes:

> Hello,
>
> On Tue, Sep 13, 2016 at 04:37:35PM -0400, Kei Kebreau wrote:
>> In this case, should I leave qtscintilla-qt4 as a public package in qt.scm
>> instead of maths.scm as Leo suggested?
>
> since it is used for only one package and relies on the deprecated qt@4,
> I would leave it private, regardless its name.
>
> Andreas

It seems that there are conflicting opinions here. :)
If no one minds, I can support this feature out-of-tree until GNU Octave
updates its UI to use Qt 5.

Opinions?
Leo Famulari Sept. 18, 2016, 8:56 p.m. UTC | #13
On Sun, Sep 18, 2016 at 04:10:15PM -0400, Kei Kebreau wrote:
> Andreas Enge <andreas@enge.fr> writes:
> > On Tue, Sep 13, 2016 at 04:37:35PM -0400, Kei Kebreau wrote:
> >> In this case, should I leave qtscintilla-qt4 as a public package in qt.scm
> >> instead of maths.scm as Leo suggested?
> >
> > since it is used for only one package and relies on the deprecated qt@4,
> > I would leave it private, regardless its name.
> 
> It seems that there are conflicting opinions here. :)
> If no one minds, I can support this feature out-of-tree until GNU Octave
> updates its UI to use Qt 5.
> 
> Opinions?

I don't think we need to keep it out of tree.

I agree with Andreas that we should discourage use of Qt 4, but I don't
think we should not use it at all, or else I would have suggested
removing all Qt 4 related software.

I think that if there is a reason to export the package at this time, we
should do so. Otherwise, I think we should keep it private. If we need
to export it later, we can.

Efraim, do you have a use for a Qt 4 variant of qscintilla?
Efraim Flashner Sept. 18, 2016, 9:02 p.m. UTC | #14
On Sun, Sep 18, 2016 at 04:56:34PM -0400, Leo Famulari wrote:
> On Sun, Sep 18, 2016 at 04:10:15PM -0400, Kei Kebreau wrote:
> > Andreas Enge <andreas@enge.fr> writes:
> > > On Tue, Sep 13, 2016 at 04:37:35PM -0400, Kei Kebreau wrote:
> > >> In this case, should I leave qtscintilla-qt4 as a public package in qt.scm
> > >> instead of maths.scm as Leo suggested?
> > >
> > > since it is used for only one package and relies on the deprecated qt@4,
> > > I would leave it private, regardless its name.
> > 
> > It seems that there are conflicting opinions here. :)
> > If no one minds, I can support this feature out-of-tree until GNU Octave
> > updates its UI to use Qt 5.
> > 
> > Opinions?
> 
> I don't think we need to keep it out of tree.
> 
> I agree with Andreas that we should discourage use of Qt 4, but I don't
> think we should not use it at all, or else I would have suggested
> removing all Qt 4 related software.
> 
> I think that if there is a reason to export the package at this time, we
> should do so. Otherwise, I think we should keep it private. If we need
> to export it later, we can.
> 
> Efraim, do you have a use for a Qt 4 variant of qscintilla?

Nope.
Kei Yamashita Sept. 19, 2016, 1:18 p.m. UTC | #15
Efraim Flashner <efraim@flashner.co.il> writes:

> On Sun, Sep 18, 2016 at 04:56:34PM -0400, Leo Famulari wrote:
>> On Sun, Sep 18, 2016 at 04:10:15PM -0400, Kei Kebreau wrote:
>> > Andreas Enge <andreas@enge.fr> writes:
>> > > On Tue, Sep 13, 2016 at 04:37:35PM -0400, Kei Kebreau wrote:
>> > >> In this case, should I leave qtscintilla-qt4 as a public
>> > >> package in qt.scm
>> > >> instead of maths.scm as Leo suggested?
>> > >
>> > > since it is used for only one package and relies on the deprecated qt@4,
>> > > I would leave it private, regardless its name.
>> > 
>> > It seems that there are conflicting opinions here. :)
>> > If no one minds, I can support this feature out-of-tree until GNU Octave
>> > updates its UI to use Qt 5.
>> > 
>> > Opinions?
>> 
>> I don't think we need to keep it out of tree.
>> 
>> I agree with Andreas that we should discourage use of Qt 4, but I don't
>> think we should not use it at all, or else I would have suggested
>> removing all Qt 4 related software.
>> 
>> I think that if there is a reason to export the package at this time, we
>> should do so. Otherwise, I think we should keep it private. If we need
>> to export it later, we can.
>> 
>> Efraim, do you have a use for a Qt 4 variant of qscintilla?
>
> Nope.

To get this right: qscintilla will be defined publicly in qt.scm,
qscintilla-qt4 will be defined privately in maths.scm (how do I inherit
a package from another module?), and Octave will include qscintilla-qt4
and qt-4 as inputs.
Ricardo Wurmus Sept. 19, 2016, 1:25 p.m. UTC | #16
Kei Kebreau <kei@openmailbox.org> writes:

> (how do I inherit a package from another module?)

Just like inheriting from any other package: you declare that the module
containing the package variable be used, and then inherit from the
package variable.

~~ Ricardo
Andreas Enge Sept. 19, 2016, 1:30 p.m. UTC | #17
On Mon, Sep 19, 2016 at 09:18:45AM -0400, Kei Kebreau wrote:
> To get this right: qscintilla will be defined publicly in qt.scm,
> qscintilla-qt4 will be defined privately in maths.scm (how do I inherit
> a package from another module?), and Octave will include qscintilla-qt4
> and qt-4 as inputs.

Sounds good!

It should be enough to include
  #:use-module (gnu packages qt)
in maths.scm for inheritance.

Andreas
Kei Yamashita Sept. 19, 2016, 2:47 p.m. UTC | #18
Ricardo Wurmus <rekado@elephly.net> writes:

> Kei Kebreau <kei@openmailbox.org> writes:
>
>> (how do I inherit a package from another module?)
>
> Just like inheriting from any other package: you declare that the module
> containing the package variable be used, and then inherit from the
> package variable.
>
> ~~ Ricardo

Using

  #:use-module (gnu packages qt)

and

  (define qscintilla-qt4
    (package
      (inherit qscintilla)
      ...))

gives me an unbound variable error. Any idea what's going wrong here?
Leo Famulari Sept. 19, 2016, 9:32 p.m. UTC | #19
On Mon, Sep 19, 2016 at 10:47:56AM -0400, Kei Kebreau wrote:
> Using
> 
>   #:use-module (gnu packages qt)
> 
> and
> 
>   (define qscintilla-qt4
>     (package
>       (inherit qscintilla)
>       ...))
> 
> gives me an unbound variable error. Any idea what's going wrong here?

Can you send the patch that gives the error?
diff mbox

Patch

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a482d75..159832a 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,44 @@  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
+         (replace 'configure
+           (lambda _
+             (chdir "Qt4Qt5")
+             (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)))))))))
+    (native-inputs
+     `(("python-pyqt" ,python-pyqt)
+       ("qt" ,qt-4))) ; 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))))