Bug 417349 - Krusader installation (make) fails when trying to build krarc
Summary: Krusader installation (make) fails when trying to build krarc
Status: RESOLVED FIXED
Alias: None
Product: krusader
Classification: Applications
Component: krarc (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-09 17:39 UTC by yaron160
Modified: 2020-02-22 19:08 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The patch that was applied after the '#include <QCoreApplication>' line was added. (1.16 KB, patch)
2020-02-10 22:16 UTC, Toni Asensi Esteve
Details
A screenshot of the result: Krusader and Unity (194.70 KB, image/png)
2020-02-10 22:19 UTC, Toni Asensi Esteve
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yaron160 2020-02-09 17:39:15 UTC
SUMMARY
I'm trying to build the git version of krusader (2.8.0-dev) on ubuntu 16.04. I managed to run "cmake" successfully, but "make" fails with error messages related to krarc.

STEPS TO REPRODUCE
1. Install all dependencies for krusader. 
2. In ubuntu 16.04 QT version is 5.5.1, and krusader needs 5.9, so: also install QT5 version 5.9.0. I did this with an online installer downloaded from the QT website.
3. create the dir "krusader-build" in the git root dir, and cd to it.
4. run: sudo cmake ../krusader -DCMAKE_INSTALL_PREFIX=/opt/applications/krusader/ -DCMAKE_C_FLAGS="-O2 -fPIC" -DCMAKE_CXX_FLAGS="-O2 -fPIC" -DCMAKE_PREFIX_PATH=/opt/applications/Qt/5.9/gcc_64/ -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
This step completed successfully on my system. No problems here. Note I had to use the QT version I installed manually.
5. run: sudo make

OBSERVED RESULT
make failed with the messages:
[ 93%] Building CXX object krArc/CMakeFiles/kio_krarc.dir/krarc.cpp.o
/opt/sources/krusader-2.8.0-dev/krusader/krArc/krarc.cpp: In function ‘int kdemain(int, char**)’:
/opt/sources/krusader-2.8.0-dev/krusader/krArc/krarc.cpp:130:9: error: ‘QCoreApplication’ was not declared in this scope
         QCoreApplication app(argc, argv);
         ^
/opt/sources/krusader-2.8.0-dev/krusader/krArc/krarc.cpp:131:9: error: ‘app’ was not declared in this scope
         app.setApplicationName(QStringLiteral("kio_krarc"));
         ^
krArc/CMakeFiles/kio_krarc.dir/build.make:62: recipe for target 'krArc/CMakeFiles/kio_krarc.dir/krarc.cpp.o' failed
make[2]: *** [krArc/CMakeFiles/kio_krarc.dir/krarc.cpp.o] Error 1
CMakeFiles/Makefile2:1998: recipe for target 'krArc/CMakeFiles/kio_krarc.dir/all' failed
make[1]: *** [krArc/CMakeFiles/kio_krarc.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2


EXPECTED RESULT
make should complete successfully, with no errors.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 16.04.6; kernel: 4.15.0-76-generic
Qt Version: 5.5.1 (I have also version 5.9.0 installed manually)

ADDITIONAL INFORMATION
I would appreciate help in resolving this problem.
Comment 1 Davide Gianforte 2020-02-09 21:20:41 UTC
You can try adding

#include <QCoreApplication>

at the top of the file near the other #include.

What version of Cmake do you have? You should have this file included automatically as dependency - check depend.internal and depend.make in krArc/CMakeFiles/kio_krarc.dir/.
Comment 2 yaron160 2020-02-09 22:18:49 UTC
(In reply to Davide Gianforte from comment #1)
> You can try adding
> 
> #include <QCoreApplication>
> 
> at the top of the file near the other #include.
> 
> What version of Cmake do you have? You should have this file included
> automatically as dependency - check depend.internal and depend.make in
> krArc/CMakeFiles/kio_krarc.dir/.

First of all, to ansewer your question, I have cmake version 3.5.1.1ubuntu3.
I looked in the depend.* files as you suggested, but couldn't find qcoreapplication mentioned anywhere in them.

As for your first suggestion, I added the header in krarc.h, and that seems to have solved the problem; however I now have another error when trying to generate index.cache.bz2. I get the following messages:

[100%] Generating index.cache.bz2
user-interface.docbook:406: parser error : Entity 'Ins' not defined
          using the mouse, with the &Ins; key or the
                                         ^
user-interface.docbook:449: parser error : Entity 'Right' not defined
          &Right;</keycombo> and the right panel
                 ^
user-interface.docbook:464: parser error : Entity 'Left' not defined
          &Left;</keycombo> and the left panel
                ^
user-interface.docbook:479: parser error : Entity 'Down' not defined
      &Down;</keycombo> to open the
            ^
user-interface.docbook:818: parser error : chunk is not well balanced
index.docbook:352: parser error : Failure to process entity user-interface
  &user-interface;
                  ^
index.docbook:352: parser error : Entity 'user-interface' not defined
  &user-interface;
                  ^
Error: `xmllint --noout` outputted text
doc/CMakeFiles/doc-index-cache-bz2.dir/build.make:96: recipe for target 'doc/index.cache.bz2' failed
make[2]: *** [doc/index.cache.bz2] Error 1
CMakeFiles/Makefile2:2175: recipe for target 'doc/CMakeFiles/doc-index-cache-bz2.dir/all' failed
make[1]: *** [doc/CMakeFiles/doc-index-cache-bz2.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Comment 3 Toni Asensi Esteve 2020-02-10 22:14:30 UTC
Hello, 

> user-interface.docbook:406: parser error : Entity 'Ins' not defined

As Yuri Chornoivan wrote in https://www.mail-archive.com/kmymoney-devel@kde.org/msg14998.html :
    "This needs some newer kdoctools framework"
although a patch could also be applied. I'll attach one.

I compiled Krusader in Ubuntu 16.04, using, as you do:
    - Qt 5.9
    - a `#include <QCoreApplication>` line added to krusader/krArc/krarc.cpp;
and also:
    - I applied the attached path (using `patch -p1 < PATH_TO_THE_PATCH/"after adding the include QCoreApplication line.diff");
    - later I executed:
    
    cmake ../krusader -DCMAKE_INSTALL_PREFIX=/opt/applications/krusader -DCMAKE_C_FLAGS="-O2 -fPIC" -DCMAKE_CXX_FLAGS="-O2 -fPIC" -DCMAKE_PREFIX_PATH=/opt/applications/Qt/5.9/gcc_64/
    
    make
    
    sudo make install

(without using `-DKDE_INSTALL_USE_QT_SYS_PATHS=ON` nor `sudo make`).

Does it work for your case :-?
Comment 4 Toni Asensi Esteve 2020-02-10 22:16:52 UTC
Created attachment 125832 [details]
The patch that was applied after the '#include <QCoreApplication>' line was added.
Comment 5 Toni Asensi Esteve 2020-02-10 22:19:39 UTC
Created attachment 125833 [details]
A screenshot of the result: Krusader and Unity
Comment 6 yaron160 2020-02-11 12:57:56 UTC
Toni's solution works for me.
I now have krusader working on ubuntu 16.04 with unity.

Thanks to Davide and Toni for their help!
Comment 7 Toni Asensi Esteve 2020-02-15 17:14:43 UTC
Git commit a11b93d571572060af6c4cf8403ae6a777772858 by Toni Asensi Esteve.
Committed on 15/02/2020 at 17:13.
Pushed by asensi into branch 'master'.

Allow Krusader to be built under the 16.04 LTS versions of Ubuntu, Kubuntu, etc

FIXED: [ 417349 ] Krusader installation (make) fails when trying to build krarc

Differential Revision: https://phabricator.kde.org/D27335

M  +6    -0    INSTALL
M  +16   -0    doc/index.docbook
M  +1    -0    krArc/krarc.cpp

https://commits.kde.org/krusader/a11b93d571572060af6c4cf8403ae6a777772858
Comment 8 Toni Asensi Esteve 2020-02-15 18:50:25 UTC
yaron160, as the official source code of Krusader has been changed in order to solve this problem, and you have made modifications in your machine: you can "remove" those modifications and apply the official ones. That way you'll be able to continue using the official source code of Krusader (executing `git pull`, etc.).

If it may help, that's what I executed:

$ git commit -a -m TMP
[master 8c6384f] TMP
 2 files changed, 15 insertions(+)

$ git reset --hard HEAD^
HEAD is now at f636ba2 Select item from search window

$ git pull --rebase
remote: Counting objects: 52, done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 52 (delta 43), reused 0 (delta 0)
Unpacking objects: 100% (52/52), done.
De git://anongit.kde.org/krusader
   f636ba2..9b9fa9d  master     -> origin/master
   387fd96..23d9ead  stable     -> origin/stable
First, rewinding head to replay your work on top of it...
Fast-forwarded master to 9b9fa9d70d00c00869753522fffc95e04c80b757.
Comment 9 yaron160 2020-02-22 17:17:10 UTC
Toni, I've checked and confirm that now the head repository compiles well on ubuntu 16.04 with QT 5.9.
Comment 10 Toni Asensi Esteve 2020-02-22 19:08:16 UTC
That's good! If you have a problem building Krusader under Ubuntu 16.04 LTS, you can file a new bug report. 
    
Also, as you know how to build Krusader, if you want to propose an improvement in its source code, documentation, etc. you can tell us. Greetings!