ahodesuka / ahoviewer

A GTK image viewer, manga reader, and booru browser
MIT License
479 stars 30 forks source link

Optional libpeas causes the build to fail on Ubuntu 20.04 #112

Closed GNULain closed 3 years ago

GNULain commented 3 years ago

Ubuntu 20.04 currently has libpeas-dev (1.26.0-2) in its repos. When trying to build with this installed, ninja will fail giving this error:

➜  ahoviewer git:(master) meson build -Dbuildtype=release
The Meson build system
Version: 0.55.1
Source dir: /home/anon/ahoviewer
Build dir: /home/anon/ahoviewer/build
Build type: native build
Project name: ahoviewer
Project version: 1.6.5-133-g77bc172
C compiler for the host machine: cc (gcc 9.3.0 "cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0")
C linker for the host machine: cc ld.bfd 2.34
C++ compiler for the host machine: c++ (gcc 9.3.0 "c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0")
C++ linker for the host machine: c++ ld.bfd 2.34
Host machine cpu family: x86_64
Host machine cpu: x86_64
Run-time dependency threads found: YES
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Run-time dependency glibmm-2.4 found: YES 2.64.2
Run-time dependency sigc++-2.0 found: YES 2.10.2
Run-time dependency gtk+-3.0 found: YES 3.24.20
Run-time dependency gtkmm-3.0 found: YES 3.24.2
Run-time dependency x11 found: YES 1.6.9
Run-time dependency libconfig++ found: YES 1.5
Run-time dependency libxml-2.0 found: YES 2.9.10
Run-time dependency libcurl found: YES 7.68.0
Dependency openssl found: NO found 1.1.1f but need: '<1.1.0'
Found CMake: /usr/bin/cmake (3.16.3)
Run-time dependency openssl found: NO (tried pkgconfig and cmake)
Run-time dependency gstreamer-1.0 found: NO (tried pkgconfig and cmake)
Run-time dependency gstreamer-audio-1.0 found: NO (tried pkgconfig and cmake)
Run-time dependency gstreamer-video-1.0 found: NO (tried pkgconfig and cmake)
Run-time dependency libpeas-1.0 found: YES 1.26.0
Run-time dependency libsecret-1 found: YES 0.20.3
Run-time dependency libunrar found: NO (tried pkgconfig and cmake)
Library libunrar found: NO
Has header "dll.hpp" : NO 
Has header "dll.hpp" : NO 
Run-time dependency libzip found: YES 1.5.1
Run-time dependency libnsgif found: NO (tried pkgconfig and cmake)
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Build-time dependency gobject-introspection-1.0 found: YES 1.64.1
Program g_ir_scanner found: YES (/usr/bin/g-ir-scanner)
Program g_ir_compiler found: YES (/usr/bin/g-ir-compiler)
Configuring config.h using configuration
Build targets in project: 7

Found ninja-1.10.0 at /usr/bin/ninja
➜  ahoviewer git:(master) cd build 
➜  build git:(master) ninja
[41/50] Compiling C++ object src/ahoviewer.p/settings.cc.o
FAILED: src/ahoviewer.p/settings.cc.o 
c++ -Isrc/ahoviewer.p -Isrc -I../src -I../ext/entities -I../ext/date/include -I../ext/json -I../ext/libnsgif -I/usr/include/glibmm-2.4 -I/usr/lib/x86_64-linux-gnu/glibmm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -I/usr/include/gtkmm-3.0 -I/usr/lib/x86_64-linux-gnu/gtkmm-3.0/include -I/usr/include/atkmm-1.6 -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib/x86_64-linux-gnu/gdkmm-3.0/include -I/usr/include/giomm-2.4 -I/usr/lib/x86_64-linux-gnu/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/x86_64-linux-gnu/pangomm-1.4/include -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairomm-1.0 -I/usr/lib/x86_64-linux-gnu/cairomm-1.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/libpeas-1.0 -I/usr/include/gobject-introspection-1.0 -I/usr/include/libsecret-1 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -O3 -pthread -DHAS_REMOTE_API=1 -DHAS_UNCAUGHT_EXCEPTIONS=1 -MD -MQ src/ahoviewer.p/settings.cc.o -MF src/ahoviewer.p/settings.cc.o.d -o src/ahoviewer.p/settings.cc.o -c ../src/settings.cc
../src/settings.cc: In member function ‘void AhoViewer::SettingsManager::load_keybindings()’:
../src/settings.cc:450:54: error: no match for ‘operator[]’ (operand types are ‘libconfig::Setting’ and ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’})
  450 |                                 keys[i.first.c_str()][p->get_action_name()].c_str();
      |                                                      ^
In file included from ../src/settings.h:5,
                 from ../src/settings.cc:1:
/usr/include/libconfig.h++:223:13: note: candidate: ‘libconfig::Setting& libconfig::Setting::operator[](const char*) const’
  223 |   Setting & operator[](const char *name) const;
      |             ^~~~~~~~
/usr/include/libconfig.h++:223:36: note:   no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const char*’
  223 |   Setting & operator[](const char *name) const;
      |                        ~~~~~~~~~~~~^~~~
/usr/include/libconfig.h++:224:13: note: candidate: ‘libconfig::Setting& libconfig::Setting::operator[](int) const’
  224 |   Setting & operator[](int index) const;
      |             ^~~~~~~~
/usr/include/libconfig.h++:224:28: note:   no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘int’
  224 |   Setting & operator[](int index) const;
      |                        ~~~~^~~~~
[49/50] Compiling C++ object src/ahoviewer.p/mainwindow.cc.o
ninja: build stopped: subcommand failed.
➜  build git:(master) 

By removing libpeas-dev from my system, the software was able to compile properly.

ahodesuka commented 3 years ago

Those errors are actually caused by libconfig (only occurs in libconfig 1.5 as far as I remember). I need to change the plugin settings loading code to match the other parts to be compatible with libconfig 1.5.

ahodesuka commented 3 years ago

This should fix the issue, but I have not tested to make sure.