Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 701988

Summary: app-office/texmacs - Allow disabling QT toolkit
Product: Gentoo Linux Reporter: Dennis Nezic <dennisn>
Component: Current packagesAssignee: Andrey Grozin <grozin>
Status: UNCONFIRMED ---    
Severity: normal CC: sci
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: add x11 flag and use configure instead of cmake

Description Dennis Nezic 2019-12-04 19:34:39 UTC
Created attachment 598478 [details, diff]
add x11 flag and use configure instead of cmake

The new qt versions of texmacs are way too slow on my computer, so I'm trying to compile the older faster (uglier?) traditional x11 version, by adding a "x11" USE flag to the ebuild (diff attached).

I ran into many compilation problems when I simply added -DTEXMACS_GUI=X11 to the mycmakeargs ... I think PDF_RENDERER should have been unset (but wasn't), or there's some other issue with the QTTEXMACS #ifdefs ... the first error that popped up was: pdf_hummus_renderer.cpp:681:5: error: ‘QImage’ was not declared in this scope

I eventually gave up trying to get it to compile with cmake, and instead tried to use "econf --disable-qt" (aka. ./configure), and that eventually worked, although I had to hack "-pthread" into the g++ flags, and I had to comment out a reference to "payloads" in ./src/Edit/Interface/edit_mouse.cpp, to finally get it to create texmacs-shared.bin. But then after "successful" compilation, the install phase failed with:

make -j1 install 
mkdir -p /usr/libexec/TeXmacs
 * ACCESS DENIED:  mkdir:        /usr/libexec/TeXmacs
mkdir: cannot create directory ‘/usr/libexec/TeXmacs’: Permission denied

How can I get this properly installed?
Comment 1 Brian Evans (RETIRED) gentoo-dev 2019-12-04 21:21:01 UTC
(In reply to Dennis New from comment #0)
> Created attachment 598478 [details, diff] [details, diff]
> add x11 flag and use configure instead of cmake
> 
> The new qt versions of texmacs are way too slow on my computer, so I'm
> trying to compile the older faster (uglier?) traditional x11 version, by
> adding a "x11" USE flag to the ebuild (diff attached).


FWIW, you likely want the X USE not x11 as that is the common flag to signify xorg GUI.
Comment 2 Brian Evans (RETIRED) gentoo-dev 2019-12-04 21:28:26 UTC
Rereading it, perhaps this should be qt5 instead (default on).  Sorry for the confusion
Comment 3 Dennis Nezic 2019-12-09 00:40:40 UTC
To get it to install and qmerge I had to add the src_install() function and explicitly set the DESTDIR for make - I'm not sure what needs to be added to make this work for the original qt5/cmake to also get installed.

src_install() {
        emake DESTDIR="${D}" install
}

Then I got another minor sandbox violation due to a call to "update-desktop-database" in the INSTALL portion of the Makefile.

Then I got a few mime collisions when trying to qmerge,
 *      /usr/share/mime/XMLnamespaces
 *      /usr/share/mime/globs
 *      /usr/share/mime/icons
 *      /usr/share/mime/magic
 *      /usr/share/mime/types
 *      /usr/share/mime/subclasses
 *      /usr/share/mime/globs2
 *      /usr/share/mime/treemagic
 *      /usr/share/mime/version
 *      /usr/share/mime/aliases
 *      /usr/share/mime/generic-icons
 *      /usr/share/mime/mime.cache
 *      /usr/share/mime/text/x-texmacs.xml
 *      /usr/share/icons/gnome/icon-theme.cache

But besides that, it works :P.
Comment 4 Dennis Nezic 2019-12-16 18:46:37 UTC
I had to change a few things to get the traditional x11 version of 1.99.12 to compile, but I got it to work without needing to use econf (ie. still using cmake). First I added the suggested qt5 IUSE flag

IUSE="debug jpeg netpbm sqlite svg spell +qt5"

And added the option to change the gui between Qt and X11 in src_configure's mycmakeargs

-DTEXMACS_GUI=$(usex qt5 Qt X11)

The previous ebuild's patches don't apply cleanly. The lines from texmacs-1.99-remove-new-declaration.patch are now at around line number 463 (instead of 384). I'm not sure if the math_util patch is still needed - things compiled fine for me without it.

There were a few compilation issues which I'll bring to the attention of the upstream devs. I had to delete the else block at line 676 of Plugins/Pdf/pdf_hummus_renderer.cpp because it references QImage which is not available with an X11 build.

Also "x" was oddly not defined in Plugins/Widkit/Basic/wk_widget.cpp at line 211 in the decode_length function, I just renamed it to "ex" for no good reason and crossed my fingers that things will still work :p.

And finally in the install phase I was warned that:

"InitialPreference" in group "Desktop Entry" is a reserved key for KDE

in TeXmacs/misc/mime/texmacs.desktop it is set to 99. I guess we should add a patch to change it or delete it?