Build Scribus 1.5.5 - specfy to CMAKE libpoppler path

Previous topic - Next topic

scriber


scriber

#16
I've tried it applied as usual for patches:


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.

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:

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

a.l.e

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.

scriber

#18
I tried a little check comparing the 4 files after applying your patch with the original ones:

--->  slaoutput.h
$ 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
# 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>


$ 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
$ 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>


$ 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
$ 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...

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:
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!
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 ?

a.l.e

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

scriber

#20
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....

scriber

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.
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
--------------------------


a.l.e

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...