Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build broken with exiv2 0.28.0 #951

Open
cbinner opened this issue Jun 8, 2023 · 7 comments
Open

Build broken with exiv2 0.28.0 #951

cbinner opened this issue Jun 8, 2023 · 7 comments

Comments

@cbinner
Copy link

cbinner commented Jun 8, 2023

Building version 3.17.2282 fails with the new exiv2 version I got through the repository updates today. This is the error message:

In file included from /home/xxx/.cache/yay/nomacs/src/nomacs-3.17.2282/ImageLounge/src/DkGui/DkControlWidget.cpp:32: /home/xxx/.cache/yay/nomacs/src/nomacs-3.17.2282/ImageLounge/src/DkCore/DkMetaData.h:158:19: error: 'AutoPtr' in 'class Exiv2::Image' does not name a type 158 | Exiv2::Image::AutoPtr loadSidecar(const QString &filePath) const; | ^~~~~~~ /home/xxx/.cache/yay/nomacs/src/nomacs-3.17.2282/ImageLounge/src/DkCore/DkMetaData.h:167:19: error: 'AutoPtr' in 'class Exiv2::Image' does not name a type 167 | Exiv2::Image::AutoPtr mExifImg; // TODO std::unique_ptr<Exiv2::Image> (and all other *::AutoPtr) | ^~~~~~~ make[2]: *** [CMakeFiles/nomacsCore.dir/build.make:239: CMakeFiles/nomacsCore.dir/src/DkGui/DkControlWidget.cpp.o] Error 1 make[2]: Leaving directory '/home/xxx/.cache/yay/nomacs/src/nomacs-3.17.2282/build' make[1]: *** [CMakeFiles/Makefile2:242: CMakeFiles/nomacsCore.dir/all] Error 2 make[1]: Leaving directory '/home/xxx/.cache/yay/nomacs/src/nomacs-3.17.2282/build' make: *** [Makefile:156: all] Error 2 make: Leaving directory '/home/xxx/.cache/yay/nomacs/src/nomacs-3.17.2282/build' ==> ERROR: A failure occurred in build(). Aborting...

BTW the installation instructions on the website could use a little correction, in Arch Linux nomacs has been moved to the AUR.

@iq2luc
Copy link

iq2luc commented Jun 9, 2023

Hello,

the attached patch nomacs-fix-exiv2-0.28.patch.txt fixes the issue on my side.

If you're an Archlinux user and the AUR package build fails for you, see the attached tarball nomacs-3.17.2282-arch+fix-exiv2-0.28.tar.gz.

Disclaimer: my whole experience with the project is a quick 5 minutes glance over the code so, unless it is properly reviewed, please consider it as a quick and dirty workaround for having this great program work on Arch.

Thanks,
Luc

@TobiasReich
Copy link

Stupid question perhaps but how do I apply that patch file? I'm not sure what to do with it.
Thanks!

@iq2luc
Copy link

iq2luc commented Jun 13, 2023

Hello @TobiasReich, if you're on Arch, you may just download the whole tarball (it already contains the patch and the PKGBUILD needed to build the program), unpack and use makepkg to build it and than use pacman to install it.

Something like this:

> mkdir nomacs && cd nomacs
> wget https://github.com/nomacs/nomacs/files/11725301/nomacs-3.17.2282-arch+fix-exiv2-0.28.tar.gz
> tar -xf nomacs-3.17.2282-arch+fix-exiv2-0.28.tar.gz
> makepkg
> pacman -U nomacs-3.17.2282-1-x86_64.pkg.tar.zst

If you want to hack the nomacs source code yourself, and apply the patch manually, you need to clone the nomacs repo including submodules (for plugins), then switch to tag 3.17.2282 for nomacs and 3.16 for nomacs-plugins, then change to nomacs source directory and apply the patch with patch -Np1 -i /patch_dir/nomacs-fix-exiv2-0.28.patch (where patchdir is the directory where you downloaded the patch file). After that, you need to generate the make files using cmake and then start the build with make.

I have to confess I never encountered a stupid question, only stupid answers :-) and I hope mine is not in that category and it helps you a bit (at least enough to give you some hints / keywords you may further use to search for more information).

@TobiasReich
Copy link

TobiasReich commented Jun 13, 2023

Thanks for the quick reply but I still get an error like the one I get when building it from the Arch AUR repository. So what am I missing? Do I have to apply the patch somehow? I followed your steps but fail at this error:

error: ‘UniquePtr’ in ‘class Exiv2::Image’ does not name a type
158 |     Exiv2::Image::UniquePtr loadSidecar(const QString &filePath) const;
...

@iq2luc
Copy link

iq2luc commented Jun 14, 2023

So what am I missing?

Looking at your error, most probably you are missing exiv2 library version 0.28.0. Could you please check your version? Something like this:

> pacman -Qi exiv2
Name            : exiv2
Version         : 0.28.0-1
...

Edit: Also check in /etc/pacman.conf if exiv2 is not in your IgnorePkg list (remove it if exists).

If you have aother version instead of 0.28.0, please update it to latest version from Arch repos:

> pacman -Syy
> pacman -S exiv2

and rebuild the nomacs package as mentioned in the previous post.

Do I have to apply the patch somehow?

If you're building using the PKGBUILD mentioned above you don't need to manually apply the patch, it is automatically applied in the prepare() section (see PKGBUILD file, line 29).

I followed your steps but fail at this error:

error: ‘UniquePtr’ in ‘class Exiv2::Image’ does not name a type
158 |     Exiv2::Image::UniquePtr loadSidecar(const QString &filePath) const;
...

Looking at exiv2 source code (/usr/include/exiv2/image.hpp, line 53), we can see Exiv2::Image::UniquePtr appears in exiv2 version 0.28.0, in previous versions it was Exiv2::Image::AutoPtr, so most probably you have an older version of the library.

I hope the above information helps.

@a17r
Copy link
Contributor

a17r commented Sep 3, 2023

#982

@ryandesign
Copy link

Can a stable version of nomacs that supports exiv2 0.28.x and later be released, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants