bartoszek / AUR-openboard

1 stars 1 forks source link

Build broken with latest version of poppler from arch extra repository #8

Closed gerritdrost closed 2 years ago

gerritdrost commented 2 years ago

Tried to install openboard from AUR today, but the compilation failed. I think I figured out the reason: poppler was updated yesterday from version 21.11.0-1 to 22.01.0-1 in the arch extra repo. Since poppler 21.12 it uses c++17 according to popplers releases notes, while the openboard build looks to be using c++11. The compilation error seems to confirm this:

[...]

In file included from /usr/include/poppler/PDFDoc.h:61,
                 from src/pdf/XPDFRenderer.h:51,
                 from src/pdf/PDFRenderer.cpp:35:
/usr/include/poppler/Form.h:320:10: error: ‘optional’ in namespace ‘std’ does not name a template type
  320 |     std::optional<GooString> getCheckedSignature(Goffset *checkedFileSize);
      |          ^~~~~~~~
/usr/include/poppler/Form.h:320:5: note: ‘std::optional’ is only available from C++17 onwards
  320 |     std::optional<GooString> getCheckedSignature(Goffset *checkedFileSize);
      |     ^~~
/usr/include/poppler/Form.h:611:10: error: ‘optional’ in namespace ‘std’ does not name a template type
  611 |     std::optional<GooString> getCheckedSignature(Goffset *checkedFileSize);
      |          ^~~~~~~~
/usr/include/poppler/Form.h:611:5: note: ‘std::optional’ is only available from C++17 onwards
  611 |     std::optional<GooString> getCheckedSignature(Goffset *checkedFileSize);
      |     ^~~

[...]

I worked around the problem by downgrading poppler to 21.11.0-1.

koderik commented 2 years ago

Hello, I am having the same issue. Could you explain how you went about downgrading poppler? I am a total beginner at this :). Thank you!

gerritdrost commented 2 years ago

The Arch wiki has a page about downgrading packages: https://wiki.archlinux.org/title/downgrading_packages. In my case the previous version of poppler was still in the cache. I downgraded the packages poppler and poppler-glib.

iGormilhit commented 2 years ago

@gerritdrost Thank for having spotted the issue and provided a workaround!

pacoandres commented 2 years ago

I've changed poppler.patch setting CONFIG += c++1z instead of CONFIG += c++14 and it worked.

I've take it from https://forum.qt.io/topic/84269/can-i-use-clang-with-std-c-17-in-qmake

iGormilhit commented 2 years ago

@pacoandres I tried it, but the build failed with the exact same error.

After editing the poppler.patch file, I've started the build with makepkg in the AUR-openboard directory.

pacoandres commented 2 years ago

It looks I'm messing with an old PKGBUILD version.

The current PKGBUILD doesn't apply the popper.patch and the only way is modify the OpenBoard.pro file and make change before qmake is called.

tombenko commented 2 years ago

I've changed poppler.patch setting CONFIG += c++1z instead of CONFIG += c++14 and it worked.

I've take it from https://forum.qt.io/topic/84269/can-i-use-clang-with-std-c-17-in-qmake

Even with the new patch fails to build the pkg. The error is the same.

pacoandres commented 2 years ago

This is the diff output for the OpenBoard.pro I've used and the original one. ` --- orig/OpenBoard.pro 2022-01-17 19:21:33.000000000 +0100 +++ OpenBoard-1.6.1/OpenBoard.pro 2022-01-13 20:52:35.000000000 +0100 @@ -1,11 +1,12 @@ TARGET = "OpenBoard" TEMPLATE = app

-CONFIG += c++14 +CONFIG += c++1z CONFIG -= flat CONFIG += debug_and_release \ no_include_pwd

+QMAKE_CXXFLAGS += -std=c++17

VERSION_MAJ = 1 VERSION_MIN = 6 @@ -450,8 +451,8 @@ LIBS += -lcrypto

LIBS += -lprofiler

 LIBS += -lX11
pacoandres commented 2 years ago

This is the diff output for the OpenBoard.pro I've used and the original one. ` --- orig/OpenBoard.pro 2022-01-17 19:21:33.000000000 +0100 +++ OpenBoard-1.6.1/OpenBoard.pro 2022-01-13 20:52:35.000000000 +0100 @@ -1,11 +1,12 @@ TARGET = "OpenBoard" TEMPLATE = app

-CONFIG += c++14 +CONFIG += c++1z CONFIG -= flat CONFIG += debug_and_release no_include_pwd

+QMAKE_CXXFLAGS += -std=c++17

VERSION_MAJ = 1 VERSION_MIN = 6 @@ -450,8 +451,8 @@ LIBS += -lcrypto #LIBS += -lprofiler LIBS += -lX11

* LIBS += -lquazip5

* INCLUDEPATH += "/usr/include/quazip"

* LIBS += "-lquazip1-qt5"

* INCLUDEPATH += /usr/include/QuaZip-Qt5-1.2/quazip
  LIBS += -lpoppler
  INCLUDEPATH += "/usr/include/poppler"
  @@ -514,4 +515,3 @@
  resources/images/moveDown.svg 
  resources/images/moveDownDisabled.svg

` I haven't made any other changes.

Don't know why the format of the diff file is broken when inserted as code. Better to upload the file as txt. c++17.patch.txt

tombenko commented 2 years ago

This is the diff output for the OpenBoard.pro I've used and the original one.

I tried to apply the patch, but it fails:

patch -p1 poppler.patch c++17.patch 
patching file poppler.patch
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 450.
Hunk #3 FAILED at 514.
3 out of 3 hunks FAILED -- saving rejects to file poppler.patch.rej
pacoandres commented 2 years ago

It's not a patch for poppler.patch file, it's for OpenBoard.pro

For applying the patch you must be in the same folder that OpenBoard.pro is, and the command must be: patch -p1 < [path to c++17.patch]

I'll try to do a pull request for including it in next AUR version.

PD: this patch includes quazip.patch, so be carefull.

pacoandres commented 2 years ago

Pull Request created:

9

bartoszek commented 2 years ago

Thanks gays, fixed in 5be8e7dded14612512421c7746c80970ac1d717b

iGormilhit commented 2 years ago

@bartoszek When will the AUR git repository be updated (I don't even know how this is done)? It's still on the precedent commit.

Photon89 commented 2 years ago

The openboard-git package seems to be updated with this, but openboard (non-git) still shows this problem. Will it get the fix as well? Thanks! :smiley:

vitaminace33 commented 2 years ago

Shouldn't pkgrel be upgraded?

Photon89 commented 2 years ago

That's not the problem, I did a clean build of the latest version and got the error from the original report. The patch just isn't included in the non-git package yet.

vitaminace33 commented 2 years ago

Although not explicit, my comment was directed to @bartoszek and @pacoandres. I think pkgrel should be upgraded to 5.

fsiegert commented 2 years ago

Hi @vitaminace33 @Photon89 @iGormilhit @pacoandres ,

I only see this now and realise that @bartoszek seems to not have pushed this to the AUR after pushing it to this internal repository. I had in the meantime pushed a similar fix to AUR: https://aur.archlinux.org/cgit/aur.git/commit/?h=openboard&id=b3b7a23d5778941f226a9c9a958b14d266e3dcc4

But I'm trying to fix the parallel issue with ffmpeg at the moment and another one with an even newer Poppler version. Will push a hopefully working version for all three issues to the AUR in a minute.