Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 617024 - sci-mathematics/octave w/ >=x11-libs/qscintilla-2.10 - GUI editor not working
Summary: sci-mathematics/octave w/ >=x11-libs/qscintilla-2.10 - GUI editor not working
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Mathematics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: qscintilla-2.10
  Show dependency tree
 
Reported: 2017-04-29 18:38 UTC by m.manico
Modified: 2017-10-08 16:45 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
makes it build with new qscintilla (qscintilla-2.10.patch,429 bytes, patch)
2017-08-18 21:43 UTC, Sławomir Nizio
Details | Diff
Builds for me. (file_617024.txt,418 bytes, patch)
2017-08-26 13:51 UTC, Josef Larsson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description m.manico 2017-04-29 18:38:23 UTC
In octave 4.2.1 the GUI editor (qscintilla) is not working.

I have the qt4 AND qt5 useflag set for x11-libs/qscintilla

Similar issues are reported to the octave upstream bug tracker, where it is determined that this is a configuration issue.
https://savannah.gnu.org/bugs/?47360
https://savannah.gnu.org/bugs/?50663
https://savannah.gnu.org/bugs/?49680

This prompted me to revisit the build logs.
If you want to inspect the logs yourself run:
$ sudo FEATURES="keepwork keeptemp" emerge octave
$ sudo cat  /var/tmp/portage/sci-mathematics/octave-4.2.1/temp/build.log | grep QScin
checking for the QScintilla library for Qt 5... no
configure: WARNING: QScintilla library not found; disabling built-in Qt GUI editor

If you want to test if you are hit by the same issue (apart from noticing the same misbehaviour as described below) type into the octave terminal:
>>> __have_feature__ QSCINTILLA
ans = 0

Symptoms:

1) Trying to open a document does not have any effect.
2) Menu Window/Show Editor has no effect.
3) Using "new script" button has no effect.
4) Setting vim/geany/foo in Menu Edit/Preferences/Editor/Use custom file editor does not allow me to open/edit files in the GUI either.
5) editing ~/.octaverc to
edit mode async;
EDITOR("/usr/bin/geany %s");
does not help me either in any way.
6) running "edit foo.txt" from the terminal in the GUI does not open the editor (fails for both, native and external editor)

BUT

7) Starting octave with the --no-gui option and then running "edit foo.m" starts the configured external editor correctly.
Comment 1 tdr 2017-04-29 20:41:50 UTC
Expected behavior for working gui:

>> __have_feature__ QSCINTILLA
ans = 1

Result obtained:

>>> __have_feature__ QSCINTILLA

ans = 0



x11-libs/qscintilla-2.10 (version used when bug was reported)uses multibuild eclass, allowing both qt4 + qt5 USE flags to be enabled.

Octave appears to be looking for only qt5 version of qscintilla libs for the gui and during build looks for the library itself, not a header. 

Header locations for the qt4/qt5 versions have consistent naming convention:
    /usr/include/qt4/...
    /usr/include/qt5/...

Install paths for the qt4-linked qscintilla libs are prepended with qt4 inside lib64 .. the qt5 versions are not:


    # qlist qscintilla | grep lib64
    /usr/lib64/qt4/libqscintilla2_qt4.so.13.0.0
    /usr/lib64/qt5/mkspecs/features/qscintilla2.prf
    /usr/lib64/libqscintilla2_qt5.so.13.0.0
    /usr/lib64/libqscintilla2_qt5.so.13.0
    /usr/lib64/libqscintilla2_qt5.so.13
    /usr/lib64/libqscintilla2_qt5.so
    /usr/lib64/qt4/libqscintilla2_qt4.so.13.0
    /usr/lib64/qt4/libqscintilla2_qt4.so.13
    /usr/lib64/qt4/libqscintilla2_qt4.so 


When built with only qt5 flag qscintilla uses /usr/lib64 for librries (no qt5 prepend). Verified with earlier version (x11-libs/qscintilla-2.9.4) that lib location is the same:

    # qlist x11-libs/qscintilla  | grep lib64
    /usr/lib64/qt5/mkspecs/features/qscintilla2.prf
    /usr/lib64/libqscintilla2.so.12.0.2
    /usr/lib64/libqscintilla2.so.12.0
    /usr/lib64/libqscintilla2.so.12
    /usr/lib64/libqscintilla2.so


Latest sci-mathematics/octave is 4.2.1 and for gui requires:
    >=x11-libs/qscintilla-2.9.3-r2:=[qt5(+)]


Why is a hard masked qscintilla being used?  Library versions 12 and 13 not compatible?


Try with USE=qt5 =x11-libs/qscintilla-2.9.4
Comment 2 m.manico 2017-04-30 10:52:06 UTC
After some investigation on my side I think I know how things happened.

1) I had octave and qscintilla(v.29, +qt5 -qt4) installed. Everything worked.

2) I installed openscad, which requires qscintilla +qt4. Since qscintilla 2.9 can only have EITHER qt4 OR qt5, portage resolved the issue by unmasking qscintilla 2.10 which allows to have qt4 AND qt5 use flags enabled.

cat /etc/portage/package.unmask 
# required by @__auto_slot_operator_replace_installed__ (argument)
# /usr/portage/profiles/package.mask:
# Davide Pesavento <pesa@gentoo.org> (25 Feb 2017)
# Library name changed in 2.10, breaking many consumers.
# Needs full revdep testing.
=x11-libs/qscintilla-2.10

This led to my bug report.
Trying qsintilla 2.10 with -qt4 +qt5 did not help with the missing editor in octave. I think this is what the message in package.unmask is warning about.

I reverted back  to qscintilla 2.9 -qt4 +qt5, so that octave's editor is operational again. I unemerge openscad.
Comment 3 Josef Larsson 2017-08-08 16:34:35 UTC
The official release of openscad supports qt up to version 5.4 (https://github.com/openscad/openscad/tree/openscad-2015.03 - see readme), and the master branch support qt 5.x. Perhaps the ebuild could be adjusted, together with patches if necessary, so that octave with a working GUI editor and openscad can co-exist on a gentoo system.
Comment 4 Sławomir Nizio 2017-08-18 21:43:59 UTC
Created attachment 489558 [details, diff]
makes it build with new qscintilla

--- a/sci-mathematics/octave/octave-4.2.1.ebuild
+++ b/sci-mathematics/octave/octave-4.2.1.ebuild
@@ -91,7 +91,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-4.2.0-pkgbuilddir.patch
        "${FILESDIR}"/${PN}-4.2.0-ncurses-pkgconfig.patch
        "${FILESDIR}"/${PN}-4.2.0-zlib-underlinking.patch
-       "${FILESDIR}"/${PN}-4.2.0-fix-qscintilla-detection.patch
+       "${FILESDIR}"/qscintilla-2.10.patch
 )
 
 src_prepare() {
Comment 5 Josef Larsson 2017-08-26 13:51:35 UTC
Created attachment 490688 [details, diff]
Builds for me.

This variant of the patch applied for me and gave me a working GUI. Thank you for the inspiration.
Comment 6 Sławomir Nizio 2017-08-29 07:41:16 UTC
(In reply to Josef Larsson from comment #5)
> Created attachment 490688 [details, diff] [details, diff]
> Builds for me.
> 
> This variant of the patch applied for me and gave me a working GUI. Thank
> you for the inspiration.

The effect of your patch is the same as mine, and the difference is that your one is applied on top of the one already used by the ebuild, and my patch replaces the old one.

Good to know that it works for you!
Comment 7 Andreas Sturmlechner gentoo-dev 2017-10-08 16:45:30 UTC
Thanks all, fixed in git commit b028a2c63ff7fe94201305761d6d9daf3745af5f