Scribus Forums

Scribus => Installation and Setup => Topic started by: scriber on November 29, 2019, 01:28:59 pm

Title: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on November 29, 2019, 01:28:59 pm
Hi all!
I'm trying to build Scribus 1.5.5 on my Slackware stable, which is 14.2 version.
This system has an outdated version of poppler (0.45). I can't upgrade it because on that depend many other software installed.
On the other hand Scribus-1.5.5 needs a libpoppler newer than 0.58, if I well understood... Actually it fails with a CMAKE error (lipoppler not found >= 0.58)

So I successfuly tried to build a more recent version poppler (0.68) along the old one. I built it so that it is installed in an "alternative" path:
Code: [Select]
/opt/poppler-new
Code: [Select]
# ls /opt/poppler-new/
bin/  doc/  include/  lib64/  man/  share/

# ls /opt/poppler-new/lib64/
girepository-1.0/     libpoppler-cpp.so.0.5.0*  libpoppler-glib.so.8.9.0*  libpoppler-qt4.so.4.11.0*  libpoppler.so.79.0.0*
libpoppler-cpp.so@    libpoppler-glib.so@       libpoppler-qt4.so@         libpoppler.so@             pkgconfig/
libpoppler-cpp.so.0@  libpoppler-glib.so.8@     libpoppler-qt4.so.4@       libpoppler.so.79@

I also read a bit of scribus sources and I found this:
https://gitlab.com/scribus/scribus/blob/master/cmake/modules/FindPOPPLER.cmake

If I'm not mistaken, it contains paths where CMAKE looks for poppler libs, headers and so on...

Now the question:
Is there a way to build scribus linking it to a poppler installation located in an alternative path?
(in mi specific case /opt/poppler-new ?
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: a.l.e on November 29, 2019, 04:49:09 pm
i had to do some research:

you should add

-DPOPPLER_DIR=/opt/poppler

to your cmake command.

and we are very gratefull to our debian / ubuntu maintainer for all the work he has done for getting poppler to work with scribus and debian!

i think it's one of the (important) dependencies that has given us the most headaches!
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on November 29, 2019, 07:20:11 pm
Thanks for reply!

Build script I'm using launches cmake as follows:
Code: [Select]
export CC=clang
export CXX=clang++
cmake . \
  -DCMAKE_C_FLAGS="$SLKCFLAGS" \
  -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
  -DCMAKE_INSTALL_PREFIX:PATH=/usr \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_SKIP_RPATH=ON \
  -DLIB_SUFFIX=${LIBDIRSUFFIX} \
  -DPOPPLER_DIR=/opt/poppler-new \
  -DWANT_CPP11=1 \
  -DRENDER_LIB=CAIRO \
  -DWANT_GRAPHICSMAGICK=1

Tried to add:
Code: [Select]
-DPOPPLER_DIR=/opt/poppler-new
But still it can't find new libpoppler version... :(
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: a.l.e on November 29, 2019, 07:40:06 pm
a/ you should not install in /usr. really. but well, slackware might be a different world...
b/ you should not use the main source directory as the compile directory. you should create a build directory and do a "cmake .." instead of a "cmake .".

c/ did you run the command in a clean build directory? (if you had a build directory, the answer to this question would be more straight forward...)

sadly, if -D directive does not work, i don't really know how to get there...
you might want to ask in the cmake community (and then post here your findings as soon as you have sorted it out).
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on November 29, 2019, 09:04:19 pm
Yes /usr dir as target follows Slackware guidelines. It could be installed in something different like /usr/local, but it's just a usual line Slackware packagers follow.
Some resources:
https://slackbuilds.org/howto/
https://www.slackwiki.com/Writing_A_SlackBuild_Script

Main source dir is deleted at the begining of the slackbuild script.
I'm using this one (slackbuilds are just bash scripts):

https://github.com/gperon/mmyy_slackbuilds/blob/master/office/scribus/scribus.SlackBuild

And there you find all few files needed by slackware pkgtools (slack-desc, doinst.sh, info file etc):

https://github.com/gperon/mmyy_slackbuilds/blob/master/office/scribus

So, the environment should be clean, because build directory is re-created any time I launch slackbuild script.

Have you any links to cmake community to ask to?
Thanks anyway for your answer!  :)
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: a.l.e on November 29, 2019, 10:52:45 pm
Ok, if you're following some sort of packaging then it's fine.
I still would install it in ~/bin/scribus... but with slackware, everything is a bit different : - )

Comcerning cmake I have asked my question in #cmake on freenode and a friendly person did reply. I don't know if the channel is busy during weekends, though.

Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on November 30, 2019, 04:48:02 pm
Some progress!
On #cmake chat suggested PKG_CONFIG_PATH environment variable.
It has to contain the path to the dir in which there are ".*pc" files.
For poppler is in my case:
Code: [Select]
/opt/poppler-new/lib64/pkgconfig
It has to be exported before cmake launch. In my slackbuild bash script it is added as follows:
Code: [Select]
export CC=clang
export CXX=clang++
export PKG_CONFIG_PATH=/opt/poppler-new/lib64/pkgconfig
cmake . \
  -DCMAKE_C_FLAGS="$SLKCFLAGS" \
  -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
  -DCMAKE_INSTALL_PREFIX:PATH=/usr \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_SKIP_RPATH=ON \
  -DLIB_SUFFIX=${LIBDIRSUFFIX} \
  -DWANT_CPP11=1 \
  -DRENDER_LIB=CAIRO \
  -DWANT_GRAPHICSMAGICK=1

With this VAR added newer version of poppler is found and config check is passed! :)

Now an other issue appears after a long time of computing.
Here's the output of building:
Code: [Select]
[ 84%] Building CXX object scribus/CMakeFiles/scribus.dir/ui/modetoolbar.cpp.o
[ 85%] Building CXX object scribus/CMakeFiles/scribus.dir/ui/pdftoolbar.cpp.o
[ 85%] Building CXX object scribus/CMakeFiles/scribus.dir/ui/viewtoolbar.cpp.o
[ 85%] Building CXX object scribus/CMakeFiles/scribus.dir/ui/unicodesearch.cpp.o
[ 85%] Building CXX object scribus/CMakeFiles/scribus.dir/ui/vruler.cpp.o
[ 85%] Building CXX object scribus/CMakeFiles/scribus.dir/ui/useprintermarginsdialog.cpp.o
[ 85%] Building CXX object scribus/CMakeFiles/scribus.dir/ui/weldedit.cpp.o
[ 85%] Building CXX object scribus/CMakeFiles/scribus.dir/imagedataloaders/scimgdataloader_gmagick.cpp.o
[ 85%] Building C object scribus/CMakeFiles/scribus.dir/third_party/hyphen/hnjalloc.c.o
[ 85%] Building C object scribus/CMakeFiles/scribus.dir/third_party/hyphen/hyphen.c.o
[ 85%] Building CXX object scribus/CMakeFiles/scribus.dir/main.cpp.o
[ 85%] Linking CXX executable scribus
[ 85%] Built target scribus
[ 85%] Generating moc_xpsexplugin.cpp
[ 85%] Generating moc_svgexplugin.cpp
[ 85%] Generating ui_exportform.h
[ 85%] Generating moc_dialog.cpp
Scanning dependencies of target xpsexplugin
[ 85%] Generating moc_export.cpp
Scanning dependencies of target svgexplugin
Scanning dependencies of target scribusexportpixmap
[ 85%] Building CXX object scribus/plugins/export/xpsexport/CMakeFiles/xpsexplugin.dir/xpsexplugin.cpp.o
[ 85%] Building CXX object scribus/plugins/export/svgexplugin/CMakeFiles/svgexplugin.dir/svgexplugin.cpp.o
[ 85%] Building CXX object scribus/plugins/export/pixmapexport/CMakeFiles/scribusexportpixmap.dir/dialog.cpp.o
[ 85%] Building CXX object scribus/plugins/export/pixmapexport/CMakeFiles/scribusexportpixmap.dir/export.cpp.o
[ 85%] Building CXX object scribus/plugins/export/pixmapexport/CMakeFiles/scribusexportpixmap.dir/moc_dialog.cpp.o
[ 85%] Building CXX object scribus/plugins/export/pixmapexport/CMakeFiles/scribusexportpixmap.dir/moc_export.cpp.o
[ 85%] Building CXX object scribus/plugins/export/xpsexport/CMakeFiles/xpsexplugin.dir/moc_xpsexplugin.cpp.o
[ 85%] Building CXX object scribus/plugins/export/svgexplugin/CMakeFiles/svgexplugin.dir/moc_svgexplugin.cpp.o
[ 85%] Linking CXX shared module libscribusexportpixmap.so
[ 85%] Linking CXX shared module libxpsexplugin.so
[ 85%] Built target scribusexportpixmap
[ 85%] Generating moc_importaiplugin.cpp
[ 85%] Generating moc_importai.cpp
Scanning dependencies of target importai
[ 85%] Building CXX object scribus/plugins/import/ai/CMakeFiles/importai.dir/importai.cpp.o
[ 85%] Built target xpsexplugin
[ 85%] Generating moc_importcdrplugin.cpp
[ 85%] Linking CXX shared module libsvgexplugin.so
[ 85%] Generating moc_importcdr.cpp
Scanning dependencies of target importcdr
[ 85%] Building CXX object scribus/plugins/import/cdr/CMakeFiles/importcdr.dir/__/revenge/rawpainter.cpp.o
[ 85%] Built target svgexplugin
[ 85%] Building CXX object scribus/plugins/import/cdr/CMakeFiles/importcdr.dir/importcdr.cpp.o
[ 85%] Generating moc_importcgmplugin.cpp
[ 85%] Generating moc_importcgm.cpp
Scanning dependencies of target importcgm
[ 85%] Building CXX object scribus/plugins/import/cgm/CMakeFiles/importcgm.dir/importcgm.cpp.o
[ 85%] Building CXX object scribus/plugins/import/cdr/CMakeFiles/importcdr.dir/importcdrplugin.cpp.o
[ 85%] Building CXX object scribus/plugins/import/cdr/CMakeFiles/importcdr.dir/moc_importcdr.cpp.o
[ 85%] Building CXX object scribus/plugins/import/cgm/CMakeFiles/importcgm.dir/importcgmplugin.cpp.o
[ 85%] Building CXX object scribus/plugins/import/cdr/CMakeFiles/importcdr.dir/moc_importcdrplugin.cpp.o
[ 85%] Building CXX object scribus/plugins/import/ai/CMakeFiles/importai.dir/importaiplugin.cpp.o
[ 86%] Building CXX object scribus/plugins/import/cgm/CMakeFiles/importcgm.dir/moc_importcgm.cpp.o
[ 86%] Linking CXX shared module libimportcdr.so
[ 86%] Built target importcdr
[ 86%] Generating moc_importcvgplugin.cpp
[ 86%] Building CXX object scribus/plugins/import/ai/CMakeFiles/importai.dir/moc_importai.cpp.o
[ 86%] Generating moc_importcvg.cpp
[ 86%] Building CXX object scribus/plugins/import/cgm/CMakeFiles/importcgm.dir/moc_importcgmplugin.cpp.o
Scanning dependencies of target importcvg
[ 86%] Building CXX object scribus/plugins/import/cvg/CMakeFiles/importcvg.dir/importcvg.cpp.o
[ 86%] Building CXX object scribus/plugins/import/ai/CMakeFiles/importai.dir/moc_importaiplugin.cpp.o
[ 86%] Linking CXX shared module libimportcgm.so
[ 86%] Built target importcgm
[ 86%] Generating moc_importdrwplugin.cpp
[ 86%] Generating moc_importdrw.cpp
Scanning dependencies of target importdrw
[ 86%] Building CXX object scribus/plugins/import/drw/CMakeFiles/importdrw.dir/importdrw.cpp.o
[ 86%] Building CXX object scribus/plugins/import/cvg/CMakeFiles/importcvg.dir/importcvgplugin.cpp.o
[ 86%] Linking CXX shared module libimportai.so
[ 86%] Built target importai
[ 86%] Building CXX object scribus/plugins/import/drw/CMakeFiles/importdrw.dir/importdrwplugin.cpp.o
[ 86%] Building CXX object scribus/plugins/import/cvg/CMakeFiles/importcvg.dir/moc_importcvg.cpp.o
[ 86%] Building CXX object scribus/plugins/import/drw/CMakeFiles/importdrw.dir/moc_importdrw.cpp.o
[ 86%] Building CXX object scribus/plugins/import/cvg/CMakeFiles/importcvg.dir/moc_importcvgplugin.cpp.o
[ 86%] Building CXX object scribus/plugins/import/drw/CMakeFiles/importdrw.dir/moc_importdrwplugin.cpp.o
[ 86%] Generating moc_importemfplugin.cpp
[ 86%] Generating moc_importemf.cpp
Scanning dependencies of target importemf
[ 86%] Building CXX object scribus/plugins/import/emf/CMakeFiles/importemf.dir/importemf.cpp.o
[ 86%] Linking CXX shared module libimportcvg.so
[ 86%] Linking CXX shared module libimportdrw.so
[ 86%] Built target importdrw
[ 86%] Generating moc_importfhplugin.cpp
[ 86%] Built target importcvg
[ 86%] Generating moc_importidmlplugin.cpp
[ 86%] Generating moc_importfh.cpp
[ 86%] Generating moc_importidml.cpp
Scanning dependencies of target importfh
Scanning dependencies of target importidml
[ 86%] Building CXX object scribus/plugins/import/fh/CMakeFiles/importfh.dir/__/revenge/rawpainter.cpp.o
[ 86%] Building CXX object scribus/plugins/import/idml/CMakeFiles/importidml.dir/importidml.cpp.o
[ 87%] Building CXX object scribus/plugins/import/emf/CMakeFiles/importemf.dir/importemfplugin.cpp.o
[ 87%] Building CXX object scribus/plugins/import/fh/CMakeFiles/importfh.dir/importfh.cpp.o
[ 87%] Building CXX object scribus/plugins/import/emf/CMakeFiles/importemf.dir/moc_importemf.cpp.o
[ 87%] Building CXX object scribus/plugins/import/emf/CMakeFiles/importemf.dir/moc_importemfplugin.cpp.o
[ 87%] Building CXX object scribus/plugins/import/fh/CMakeFiles/importfh.dir/importfhplugin.cpp.o
[ 87%] Building CXX object scribus/plugins/import/idml/CMakeFiles/importidml.dir/importidmlplugin.cpp.o
[ 87%] Linking CXX shared module libimportemf.so
[ 87%] Building CXX object scribus/plugins/import/fh/CMakeFiles/importfh.dir/moc_importfh.cpp.o
[ 87%] Built target importemf
[ 88%] Generating moc_importodgplugin.cpp
[ 88%] Generating moc_importodg.cpp
Scanning dependencies of target importodg
[ 88%] Building CXX object scribus/plugins/import/odg/CMakeFiles/importodg.dir/importodg.cpp.o
[ 88%] Building CXX object scribus/plugins/import/fh/CMakeFiles/importfh.dir/moc_importfhplugin.cpp.o
[ 88%] Building CXX object scribus/plugins/import/idml/CMakeFiles/importidml.dir/moc_importidml.cpp.o
[ 88%] Linking CXX shared module libimportfh.so
[ 88%] Built target importfh
[ 88%] Generating moc_importpagesplugin.cpp
[ 88%] Generating moc_importpages.cpp
Scanning dependencies of target importpages
[ 88%] Building CXX object scribus/plugins/import/idml/CMakeFiles/importidml.dir/moc_importidmlplugin.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pages/CMakeFiles/importpages.dir/importpages.cpp.o
[ 88%] Linking CXX shared module libimportidml.so
[ 88%] Built target importidml
[ 88%] Building CXX object scribus/plugins/import/pages/CMakeFiles/importpages.dir/importpagesplugin.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pages/CMakeFiles/importpages.dir/moc_importpages.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pages/CMakeFiles/importpages.dir/moc_importpagesplugin.cpp.o
[ 88%] Building CXX object scribus/plugins/import/odg/CMakeFiles/importodg.dir/importodgplugin.cpp.o
[ 88%] Building CXX object scribus/plugins/import/odg/CMakeFiles/importodg.dir/moc_importodg.cpp.o
[ 88%] Linking CXX shared module libimportpages.so
[ 88%] Built target importpages
[ 88%] Generating moc_importpctplugin.cpp
[ 88%] Generating moc_importpct.cpp
Scanning dependencies of target importpct
[ 88%] Building CXX object scribus/plugins/import/pct/CMakeFiles/importpct.dir/importpct.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pct/CMakeFiles/importpct.dir/importpctplugin.cpp.o
[ 88%] Building CXX object scribus/plugins/import/odg/CMakeFiles/importodg.dir/moc_importodgplugin.cpp.o
[ 88%] Linking CXX shared module libimportodg.so
[ 88%] Building CXX object scribus/plugins/import/pct/CMakeFiles/importpct.dir/moc_importpct.cpp.o
[ 88%] Built target importodg
[ 88%] Generating ui_pdfimportoptions.h
[ 88%] Generating moc_importpdf.cpp
[ 88%] Generating moc_importpdfplugin.cpp
[ 88%] Generating moc_pdfimportoptions.cpp
Scanning dependencies of target importpdf
[ 88%] Building CXX object scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/importpdf.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pct/CMakeFiles/importpct.dir/moc_importpctplugin.cpp.o
[ 88%] Generating moc_importpmplugin.cpp
[ 88%] Generating moc_importpm.cpp
Scanning dependencies of target importpm
[ 88%] Building CXX object scribus/plugins/import/pm/CMakeFiles/importpm.dir/__/revenge/rawpainter.cpp.o
[ 89%] Linking CXX shared module libimportpct.so
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:518:36: error: too few arguments to function call, expected at least 2, have 1; did
      you mean 'std::get'?
                                                                        Object orderItem = order->get(i);
                                                                                                  ^~~
                                                                                                  std::get
/usr/bin/../lib64/gcc/x86_64-slackware-linux/5.5.0/../../../../include/c++/5.5.0/utility:147:5: note: 'std::get' declared here
    get(std::pair<_Tp1, _Tp2>& __in) noexcept
    ^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:521:68: error: too few arguments to function call, expected 2, have 1
                                                                                POPPLER_CONST_075 Object POPPLER_REF ref = order->getNF(i);
                                                                                                                           ~~~~~~~~~~~~  ^
/usr/include/poppler/Array.h:69:3: note: 'getNF' declared here
  Object *getNF(int i, Object *obj);
  ^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:627:40: error: too few arguments to function call, single argument 'obj' was not
      specified
                                                Object info = pdfDoc->getDocInfo();
                                                              ~~~~~~~~~~~~~~~~~~ ^
/usr/include/poppler/PDFDoc.h:231:3: note: 'getDocInfo' declared here
  Object *getDocInfo(Object *obj) { return xref->getDocInfo(obj); }
  ^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:632:46: error: too few arguments to function call, expected at least 2, have 1
                                                        obj = infoDict->lookup((char*) "Title");
                                                              ~~~~~~~~~~~~~~~~                ^
/usr/include/poppler/Dict.h:79:3: note: 'lookup' declared here
  Object *lookup(const char *key, Object *obj, int recursion = 0);
  ^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:637:47: error: too few arguments to function call, expected at least 2, have 1
                                                        obj = infoDict->lookup((char*) "Author");
                                                              ~~~~~~~~~~~~~~~~                 ^
/usr/include/poppler/Dict.h:79:3: note: 'lookup' declared here
  Object *lookup(const char *key, Object *obj, int recursion = 0);
  ^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:642:48: error: too few arguments to function call, expected at least 2, have 1
                                                        obj = infoDict->lookup((char*) "Subject");
                                                              ~~~~~~~~~~~~~~~~                  ^
/usr/include/poppler/Dict.h:79:3: note: 'lookup' declared here
  Object *lookup(const char *key, Object *obj, int recursion = 0);
  ^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:647:49: error: too few arguments to function call, expected at least 2, have 1
                                                        obj = infoDict->lookup((char*) "Keywords");
                                                              ~~~~~~~~~~~~~~~~                   ^
/usr/include/poppler/Dict.h:79:3: note: 'lookup' declared here
  Object *lookup(const char *key, Object *obj, int recursion = 0);
  ^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:773:53: error: too few arguments to function call, single argument 'obj' was not
      specified
                                                        Object trans = pdfDoc->getPage(pp)->getTrans();
                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/usr/include/poppler/Page.h:203:3: note: 'getTrans' declared here
  Object *getTrans(Object *obj) { return trans.fetch(xref, obj); }
  ^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:825:55: error: too few arguments to function call, single argument 'obj' was not
      specified
                                                        Object catDict = pdfDoc->getXRef()->getCatalog();
                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/usr/include/poppler/XRef.h:143:3: note: 'getCatalog' declared here
  Object *getCatalog(Object *obj);
  ^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:828:50: error: too few arguments to function call, expected at least 2, have 1
                                                                Object names = catDict.dictLookup("Names");
                                                                               ~~~~~~~~~~~~~~~~~~        ^
/usr/include/poppler/Object.h:329:1: note: 'dictLookup' declared here
inline Object *Object::dictLookup(const char *key, Object *obj, int recursion)
^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:831:52: error: too few arguments to function call, expected at least 2, have 1
                                                                        Object obj = names.dictLookup("JavaScript");
                                                                                     ~~~~~~~~~~~~~~~~             ^
/usr/include/poppler/Object.h:329:1: note: 'dictLookup' declared here
inline Object *Object::dictLookup(const char *key, Object *obj, int recursion)
^
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:838:48: error: too few arguments to function call, expected at least 2, have 1
                                                                names = catDict.dictLookup("OpenAction");
                                                                        ~~~~~~~~~~~~~~~~~~             ^
/usr/include/poppler/Object.h:329:1: note: 'dictLookup' declared here
inline Object *Object::dictLookup(const char *key, Object *obj, int recursion)
^
[ 89%] Built target importpct
[ 89%] Building CXX object scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/importpdfplugin.cpp.o
12 errors generated.
scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/build.make:77: set di istruzioni per l'obiettivo "scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/importpdf.cpp.o" non riuscito
make[2]: *** [scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/importpdf.cpp.o] Errore 1
make[2]: *** Attesa per i processi non terminati....
[ 89%] Building CXX object scribus/plugins/import/pm/CMakeFiles/importpm.dir/importpm.cpp.o
CMakeFiles/Makefile2:1831: set di istruzioni per l'obiettivo "scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/all" non riuscito
make[1]: *** [scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/all] Errore 2
make[1]: *** Attesa per i processi non terminati....
[ 89%] Building CXX object scribus/plugins/import/pm/CMakeFiles/importpm.dir/importpmplugin.cpp.o
[ 89%] Building CXX object scribus/plugins/import/pm/CMakeFiles/importpm.dir/moc_importpm.cpp.o
[ 89%] Building CXX object scribus/plugins/import/pm/CMakeFiles/importpm.dir/moc_importpmplugin.cpp.o
[ 90%] Linking CXX shared module libimportpm.so
[ 90%] Built target importpm
Makefile:149: set di istruzioni per l'obiettivo "all" non riuscito
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: a.l.e on November 30, 2019, 07:46:10 pm
i guess that you should make sure that in your version of poppler, Array.h has the following signature:

Object get(int i, int recursion = 0) const;

and it took note of the shell variable. thanks for reporting it!
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on December 01, 2019, 03:05:40 pm
Mmmmm.....
So, does It seem there's just a syntax trouble!?

Actually my poppler version (0.68.0) has an Array.h file containing the following:
Code: [Select]
  // Accessors.
  Object get(int i, int resursion = 0) const;
  Object getNF(int i) const;
  GBool getString(int i, GooString *string) const;

resursion !!??

Is it a bug?

I'll try to fix it changing in recursion

Hope it solve the build process issues!!!

Thanks a lot!   :D
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: a.l.e on December 01, 2019, 03:16:48 pm
if you look at the error you will notice that it affirms that Array defines

Object *getNF(int i, Object *obj);

but you paste that 0.68.0 has

Object getNF(int i) const;

my guess is that it's still using the older poppler...
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on December 01, 2019, 04:17:38 pm
I think you are right!

"resursion" or "recursion" that doesn't seem the matter.

Code: [Select]
$ grep -A3 Accessors /usr/include/poppler/Array.h
  // Accessors.
  Object *get(int i, Object *obj, int resursion = 0);
  Object *getNF(int i, Object *obj);
  GBool getString(int i, GooString *string);

So the config is passed: poppler-0.68 is found, but then it decides to use the system older poppler 0.45, maybe it give priority to the one installed in /usr/ than the new in /opt/poppler-new...

How could I force to "cmake" to use the new poppler and not the old one?
There must be an other env variable or a build directive.
Could I try to remove old poppler, just for the time needed to  build scribus, then reinstall it. So that the only poppler available will be the new one... But I think there's a cleaner way to set which poppler installation to use.
 Any ideas?
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on December 01, 2019, 06:55:31 pm
Tried to uninstall old poppler version.

Config check is passed as before due to PKG_CONFIG_PATH set to /opt/poppler-new/lib64/pkgconfig.

But when build process reach about 90% , it returns an error and It can't find poppler/Errorcodes.h file. But acctually that file is present in

Code: [Select]
/opt/poppler-new/include/poppler/ErrorCodes.h
So I think your suppose about  cmake is right: it can find poppler new version at config time, but it can't during build process.

Code: [Select]
Scanning dependencies of target importpct
[ 88%] Generating moc_importpdf.cpp
[ 88%] Building CXX object scribus/plugins/import/pct/CMakeFiles/importpct.dir/importpct.cpp.o
[ 88%] Generating moc_importpdfplugin.cpp
[ 88%] Generating moc_pdfimportoptions.cpp
Scanning dependencies of target importpdf
[ 88%] Building CXX object scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/importpdf.cpp.o
[ 88%] Linking CXX shared module libimportodg.so
[ 88%] Built target importodg
[ 88%] Generating moc_importpmplugin.cpp
[ 88%] Generating moc_importpm.cpp
Scanning dependencies of target importpm
/tmp/SBo/scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp:21:10: fatal error: 'poppler/ErrorCodes.h' file not found
#include <poppler/ErrorCodes.h>
         ^
[ 88%] Building CXX object scribus/plugins/import/pm/CMakeFiles/importpm.dir/__/revenge/rawpainter.cpp.o
1 error generated.
scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/build.make:77: set di istruzioni per l'obiettivo "scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/importpdf.cpp.o" non riuscito
make[2]: *** [scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/importpdf.cpp.o] Errore 1
CMakeFiles/Makefile2:1831: set di istruzioni per l'obiettivo "scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/all" non riuscito
make[1]: *** [scribus/plugins/import/pdf/CMakeFiles/importpdf.dir/all] Errore 2
make[1]: *** Attesa per i processi non terminati....
[ 88%] Building CXX object scribus/plugins/import/pm/CMakeFiles/importpm.dir/importpm.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pct/CMakeFiles/importpct.dir/importpctplugin.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pm/CMakeFiles/importpm.dir/importpmplugin.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pct/CMakeFiles/importpct.dir/moc_importpct.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pm/CMakeFiles/importpm.dir/moc_importpm.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pm/CMakeFiles/importpm.dir/moc_importpmplugin.cpp.o
[ 88%] Building CXX object scribus/plugins/import/pct/CMakeFiles/importpct.dir/moc_importpctplugin.cpp.o
[ 89%] Linking CXX shared module libimportpm.so
[ 89%] Built target importpm
[ 90%] Linking CXX shared module libimportpct.so
[ 90%] Built target importpct
Makefile:149: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2

I asked to #cmake chat but nobody answered.
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: a.l.e on December 03, 2019, 03:20:54 pm
hi scriber

so i think that i got through it.

on top of passing the PKG_CONFIG_PATH, you need to do the following change to your scribus sources:

https://gitlab.com/a.l.e/scribus/commit/63026e6c1b47dcfa05c223653ecf78fcec9a59ae

(this is the same as the sed command you got from Dakon)

would you mind trying it?
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on December 04, 2019, 12:03:20 am
Yes but I have to try on 1.5.5 version because my system has cmake 3.5.2. I tried to build 1.5.6 but it complains about a newer cmake version not found.
What scribus version is your patch is related to?
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: a.l.e on December 04, 2019, 10:02:41 am
yes, this is what i was suggesting:

try to do to your 1.5.5  the same changes i did to 1.5.6svn...

you can of course also use the sed command dakon gave you, but depending on your confidence with sed, looking at a diff might be easier to understand and apply.

ciao
a.l.e
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on December 04, 2019, 12:17:19 pm
I'll try as soon as I can. Thank you!!!  ;)
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on December 04, 2019, 03:16:00 pm
I've tried it applied as usual for patches:


Code: [Select]
wget https://gitlab.com/a.l.e/scribus/commit/63026e6c1b47dcfa05c223653ecf78fcec9a59ae.diff
mv 63026e6c1b47dcfa05c223653ecf78fcec9a59ae.diff 20191203-ale.diff

Then I edit my build script: as you can see I insert a "read" control to ensure your patch is applied as expected.
I also removed "sed editing"  to the CMakeCache.txt.

Code: [Select]
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
cd $PRGNAM-$VERSION
echo patching...
patch -p1 < $CWD/20191203-ale.diff
echo patch applied, press ENTER
read
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
sed \
        -e 's|#!/usr/bin/python|#!/usr/bin/python2|' \
        -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' \
        -i scribus/plugins/scriptplugin/{samples,scripts}/*
export CC=clang
export CXX=clang++
export PKG_CONFIG_PATH=/opt/poppler-new/lib64/pkgconfig
cmake . \
  -DCMAKE_C_FLAGS="$SLKCFLAGS" \
  -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
  -DCMAKE_INSTALL_PREFIX:PATH=/usr \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_SKIP_RPATH=ON \
  -DLIB_SUFFIX=${LIBDIRSUFFIX} \
  -DWANT_CPP11=1 \
  -DRENDER_LIB=CAIRO \
  -DWANT_GRAPHICSMAGICK=1
make $NUMJOBS
make install DESTDIR=$PKG

Ok, it builds without any issues!
Great progress.  :)

But after installation, when I launch it, a pop up still appears!
It is the same I said few days ago:

Code: [Select]
C'è un problema nel caricare 1 di 53 estensioni.
libimportpdf.so
Ciò è causato probabilmente da qualche tipo di anomalia relativa a dipendenze o vecchie estensioni nella cartella d'installazione. Se il problema persiste anche dopo aver svuotato e reinstallato l'estensione, segnalare l'errore su bugs.scribus.net.

This error doesn't prevent to use scribus: if I ignore it and press OK button on the popoup, scribus GUI come up quickly (it seems a bit faster than the old 1.5.4, maybe due to the new poppler, or pherhaps to scribus itself improovments, anyway...).
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: a.l.e on December 04, 2019, 08:54:12 pm
some more notes:

sed \
        -e 's|#!/usr/bin/python|#!/usr/bin/python2|' \
        -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' \
        -i scribus/plugins/scriptplugin/{samples,scripts}/*

you don't need that! that line at the beginning of the scribus scripts is an error and is never used.
some people thing that if it does not help it does not hurt either...

and future escribus will be python3 only.

patch -p1 < $CWD/20191203-ale.diff

the idea was to manually apply that patch. i'm not 100% sure that all lines in there apply to your code. (but i can't really test, since i'm travelling)

finally, i hope that i don't get the same error... i did not check...
and the error means that you probably won't be able to export to pdf...
which is not really good.
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on December 05, 2019, 01:17:27 am
I tried a little check comparing the 4 files after applying your patch with the original ones:

--->  slaoutput.h
Code: [Select]
$ diff -y scribus-1.5.5/scribus/plugins/import/pdf/slaoutput.h slaoutput.h|grep \|

#include <goo/gtypes.h>                                       | #include <poppler/goo/gtypes.h>
#include <Object.h>                                           | #include <poppler/Object.h>
#include <OutputDev.h>                                        | #include <poppler/OutputDev.h>
#include <Gfx.h>                                              | #include <poppler/Gfx.h>
#include <GfxState.h>                                         | #include <poppler/GfxState.h>
#include <Stream.h>                                           | #include <poppler/Stream.h>
#include <GfxFont.h>                                          | #include <poppler/GfxFont.h>
#include <Link.h>                                             | #include <poppler/Link.h>
#include <PDFDoc.h>                                           | #include <poppler/PDFDoc.h>
#include <Error.h>                                            | #include <poppler/Error.h>
#include <Form.h>                                             | #include <poppler/Form.h>
#include <Page.h>                                             | #include <poppler/Page.h>
#include <Catalog.h>                                          | #include <poppler/Catalog.h>
#include <CharCodeToUnicode.h>                                | #include <poppler/CharCodeToUnicode.h>
#include <FontEncodingTables.h>                               | #include <poppler/FontEncodingTables.h>
#include <splash/SplashFontFileID.h>                          | #include <poppler/splash/SplashFontFileID.h>
#include <splash/SplashFontFile.h>                            | #include <poppler/splash/SplashFontFile.h>
#include <splash/SplashFontEngine.h>                          | #include <poppler/splash/SplashFontEngine.h>
#include <splash/SplashFont.h>                                | #include <poppler/splash/SplashFont.h>
#include <splash/SplashMath.h>                                | #include <poppler/splash/SplashMath.h>
#include <splash/SplashPath.h>                                | #include <poppler/splash/SplashPath.h>
#include <splash/SplashGlyphBitmap.h>                         | #include <poppler/splash/SplashGlyphBitmap.h>

--->  slaoutput.cpp
Code: [Select]
# diff -y scribus-1.5.5/scribus/plugins/import/pdf/slaoutput.cpp slaoutput.cpp|grep \|
// <include poppler>                                          | #include <poppler/GlobalParams.h>
#include <GlobalParams.h>                                     | #include <poppler/poppler-config.h>
#include <poppler-config.h>                                   | #include <poppler/FileSpec.h>
#include <FileSpec.h>                                         | #include <poppler/fofi/FoFiTrueType.h>

Code: [Select]
$ grep '^#include <' slaoutput.cpp |cat -n

     1  #include <poppler/GlobalParams.h>
     2  #include <poppler/poppler-config.h>
     3  #include <poppler/FileSpec.h>
     4  #include <poppler/fofi/FoFiTrueType.h>
     5  #include <QApplication>
     6  #include <QFile>
     7  #include <tiffio.h>

$ grep '^#include <' scribus-1.5.5/scribus/plugins/import/pdf/slaoutput.cpp |cat -n

     1  #include <GlobalParams.h>
     2  #include <poppler-config.h>
     3  #include <FileSpec.h>
     4  #include <fofi/FoFiTrueType.h>
     5  #include <QApplication>
     6  #include <QFile>
     7  #include <tiffio.h>

--->  importpdf.cpp
Code: [Select]
$ diff -y scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp importpdf.cpp|grep \|

// <include poppler>                                          | #include <poppler/ErrorCodes.h>
#include <ErrorCodes.h>                                       | #include <poppler/GlobalParams.h>
#include <GlobalParams.h>                                     | #include <poppler/OptionalContent.h>
#include <OptionalContent.h>                                  | #include <poppler/PageTransition.h>
#include <PageTransition.h>                                   | #include <poppler/ViewerPreferences.h>
#include <ViewerPreferences.h>                                | #include <poppler/poppler-config.h>
#include <poppler-config.h>                                   | #include <poppler/cpp/poppler-version.h>
#include <cpp/poppler-version.h>                              | #include <poppler/SplashOutputDev.h>
#include <SplashOutputDev.h>                                  | #include <poppler/splash/SplashBitmap.h>

Code: [Select]
$ diff -y <(grep '^#include <' importpdf.cpp |cat -n) <(grep '^#include <' scribus-1.5.5/scribus/plugins/import/pdf/importpdf.cpp |cat -n) |grep \|

    12  #include <poppler/ErrorCodes.h>                       |     12  #include <ErrorCodes.h>
    13  #include <poppler/GlobalParams.h>                     |     13  #include <GlobalParams.h>
    14  #include <poppler/OptionalContent.h>                  |     14  #include <OptionalContent.h>
    15  #include <poppler/PageTransition.h>                   |     15  #include <PageTransition.h>
    16  #include <poppler/ViewerPreferences.h>                |     16  #include <ViewerPreferences.h>
    17  #include <poppler/poppler-config.h>                   |     17  #include <poppler-config.h>
    18  #include <poppler/cpp/poppler-version.h>              |     18  #include <cpp/poppler-version.h>
    19  #include <poppler/SplashOutputDev.h>                  |     19  #include <SplashOutputDev.h>
    20  #include <poppler/splash/SplashBitmap.h>              |     20  #include <splash/SplashBitmap.h>

--->  importpdfconfig.h
Code: [Select]
$ diff -y <(grep '^#include <' importpdfconfig.h |cat -n) <(grep '^#include <' scribus-1.5.5/scribus/plugins/import/pdf/importpdfconfig.h |cat -n) |grep \|

     1  #include <poppler/cpp/poppler-version.h>              |      1  #include <cpp/poppler-version.h>


So... your patch, seems to be applied as expected also by applying it automatically with patch command as shown in my above messages.
The issue scribus complain about seems related to some LIBS_PATH that it doens' consider. I don't know if it is a scribus issue or due to my system. I any case my poppler alternative installation path seems not fully considered at scribus runtime. I mean: when scribus start libimportpdf.so doesn't work as expected (and returns error message popup).
Why?
Well looking at that libimportpdf...

Code: [Select]
ldd /usr/lib64/scribus/plugins/libimportpdf.so|grep not
        libpoppler.so.79 => not found

It doesnt find libpoppler.so.79, likely because it is installed in our exotic path /opt/poppler-new/...
Here's the matter:
Code: [Select]
ls -l /opt/poppler-new/lib64/libpoppler.so.79*
lrwxrwxrwx 1 root root      20 dic  4 12:51 /opt/poppler-new/lib64/libpoppler.so.79 -> libpoppler.so.79.0.0*
-rwxr-xr-x 1 root root 2771336 dic  4 12:31 /opt/poppler-new/lib64/libpoppler.so.79.0.0*

EDIT
I tried a bit dirty trick!
Code: [Select]
cd /usr/lib64; ln -s /opt/poppler-new/lib64/libpoppler.so.79.0.0 libpoppler.so.79
Well after that, at scribus startup nothing complains anymore, no error poupup comes anymore!
Maybe the right way to fix this issue is to edit my build script for poppler-new and add there the symbolic link in /usr/lib64 path.
What do you think about ?
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: a.l.e on December 05, 2019, 09:58:25 am
can you try to also apply this patch, too?

https://gitlab.com/a.l.e/scribus/commit/2cae1afc0671b682b72f21f3add11a94dadf3ed9

(on top of the other one!)


it removes the poppler detection file and does int a simpler (and probably more correct way) in the CMakeLists_Dependencies.txt file...

i've tried it in my instance and with all the changes i did, the pdf export still works...

ciao
a.l.e
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on December 05, 2019, 11:19:30 am
Thank you!
I'll try it too of course!   :)


PS.
An other question I was thinking...
Is there a way to build scribus statically linked to poppler?
So that there's non need to have poppler installed on the system after scribus build...?

Maybe it would be a better choice in my case, cause poppler new version is needed and used just by scribus....
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: scriber on December 05, 2019, 11:46:07 am
The fiel CMakeLists_Dependencies.cmake it is not present within scribus-1.5.5 sources...
Your last patch doesn't seem applicable to 1.5.5 version... If I'm not wrong.
Code: [Select]
patch -p1 < $CWD/20191205-ale.diff
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/CMakeLists_Dependencies.cmake b/CMakeLists_Dependencies.cmake
|index 05017a973c8cd30673fd6101501e051ada3ba4c2..ad6cdbe608a9084af535b496481914f13fc4c8b1 100644
|--- a/CMakeLists_Dependencies.cmake
|+++ b/CMakeLists_Dependencies.cmake
--------------------------
Title: Re: Build Scribus 1.5.5 - specfy to CMAKE libpoppler path
Post by: a.l.e on December 05, 2019, 12:06:16 pm
ah, yes...

the patch is applicable, but you need to apply it to the main CMakeLists.txt

if you come to the chat we can try to sort it out...