Annotator icon indicating copy to clipboard operation
Annotator copied to clipboard

Can't build from source on Ubuntu 20.04

Open eugene-rom opened this issue 4 years ago • 10 comments

libhandy-1 built from source, other packages installed from standard repository.

$ ./app test
The Meson build system
Version: 0.53.2
Source dir: /home/eugene/src/Annotator/Annotator
Build dir: /home/eugene/src/Annotator/Annotator/build
Build type: native build
Project name: com.github.phase1geo.annotator
Project version: 1.0.0
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
Vala compiler for the host machine: valac (valac 0.48.6)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Configuring config.h using configuration
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Run-time dependency gtk+-3.0 found: YES 3.24.20
Library m found: YES
Run-time dependency gobject-2.0 found: YES 2.64.6
Run-time dependency glib-2.0 found: YES 2.64.6
Run-time dependency gee-0.8 found: YES 0.20.3
Run-time dependency granite found: YES 5.3.0
Dependency gtk+-3.0 found: YES 3.24.20 (cached)
Run-time dependency libxml-2.0 found: YES 2.9.10
Run-time dependency libhandy-1 found: YES 1.4.0
Program meson/post_install.py found: YES (/home/eugene/src/Annotator/Annotator/meson/post_install.py)
Build targets in project: 11

Found ninja-1.10.0 at /usr/bin/ninja
[6/65] Compiling Vala source
...
../src/MainWindow.vala:130.28-130.43: error: The name `Settings' does not exist in the context of `Granite' (granite)
    var granite_settings = Granite.Settings.get_default();
                           ^^^^^^^^^^^^^^^^
../src/MainWindow.vala:132.95-132.110: error: The name `Settings' does not exist in the context of `Granite' (granite)
    gtk_settings.gtk_application_prefer_dark_theme = granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK;
                                                                                              ^^^^^^^^^^^^^^^^

Well, looks like this code used only to handle dark theme, trying comment out content of method handle_prefer_dark_changes() and try compile again:

./app test
Directory already configured.

Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
If ninja fails, run "ninja reconfigure" or "meson --reconfigure"
to force Meson to regenerate.

If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.
To change option values, run "meson configure" instead.
[5/60] Compiling C object 'com.github.phase1geo.annotator@exe/meson-generated_src_CanvasImage.c.o'.
FAILED: com.github.phase1geo.annotator@exe/meson-generated_src_CanvasImage.c.o 
cc -Icom.github.phase1geo.annotator@exe -I. -I.. -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gee-0.8 -I/usr/include/granite -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/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -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/libhandy-1 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -w -g '-DGETTEXT_PACKAGE="com.github.phase1geo.annotator"' -pthread -include config.h -MD -MQ 'com.github.phase1geo.annotator@exe/meson-generated_src_CanvasImage.c.o' -MF 'com.github.phase1geo.annotator@exe/meson-generated_src_CanvasImage.c.o.d' -o 'com.github.phase1geo.annotator@exe/meson-generated_src_CanvasImage.c.o' -c 'com.github.phase1geo.annotator@exe/src/CanvasImage.c'
../src/CanvasImage.vala: In function ‘canvas_image_instance_init’:
../src/CanvasImage.vala:51:31: error: expected expression before ‘{’ token
   51 |   public RGBA             average_color { get; private set; default = {1.0, 1.0, 1.0, 1.0}; }
      |                               ^
[9/60] Compiling C object 'com.github.phase1geo.annotator@exe/meson-generated_src_CanvasPoint.c.o'.
ninja: build stopped: subcommand failed.
Unable to build project, please review log

Oh, this error puzzled me completely. 😶️

eugene-rom avatar Oct 06 '21 07:10 eugene-rom

Zorin 16 (Ubuntu 20) All dependencies checked, same error: ../src/MainWindow.vala:123.28-123.43: error: The name Settings' does not exist in the context of Granite' (granite) var granite_settings = Granite.Settings.get_default(); Please let me know if this get solved...

stdav avatar Oct 26 '21 06:10 stdav

Can you install libgranite6-dev on your system?

phase1geo avatar Oct 26 '21 11:10 phase1geo

Only version 5.3.0 in repo. Will try to build v6 from source later.

eugene-rom avatar Oct 26 '21 11:10 eugene-rom

Found v6 built for 20.04 here https://apt.pop-os.org/staging/libgranite-6/pool/focal/granite/ba840447d3b1ceaf2becbdcef7d33994161f66ea/ Will try.

eugene-rom avatar Oct 26 '21 12:10 eugene-rom

With granite 6 no error on Granite.Settings, but still fails on average_color:

./app test
The Meson build system
Version: 0.53.2
Source dir: /home/eugene/src/Annotator/Annotator
Build dir: /home/eugene/src/Annotator/Annotator/build
Build type: native build
Project name: com.github.phase1geo.annotator
Project version: 1.0.0
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
Vala compiler for the host machine: valac (valac 0.48.6)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Configuring config.h using configuration
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Run-time dependency gtk+-3.0 found: YES 3.24.20
Library m found: YES
Run-time dependency gobject-2.0 found: YES 2.64.6
Run-time dependency glib-2.0 found: YES 2.64.6
Run-time dependency gee-0.8 found: YES 0.20.3
Run-time dependency granite found: YES 6.0.0
Dependency gtk+-3.0 found: YES 3.24.20 (cached)
Run-time dependency libxml-2.0 found: YES 2.9.10
Run-time dependency libhandy-1 found: YES 1.4.0
Program meson/post_install.py found: YES (/home/eugene/src/Annotator/Annotator/meson/post_install.py)
Build targets in project: 11

Found ninja-1.10.0 at /usr/bin/ninja
[9/65] Compiling C object 'com.github.phase1geo.annotator@exe/meson-generated_src_CanvasImage.c.o'.
FAILED: com.github.phase1geo.annotator@exe/meson-generated_src_CanvasImage.c.o 
cc -Icom.github.phase1geo.annotator@exe -I. -I.. -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gee-0.8 -I/usr/include/granite -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/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -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/libhandy-1 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -w -g '-DGETTEXT_PACKAGE="com.github.phase1geo.annotator"' -pthread -include config.h -MD -MQ 'com.github.phase1geo.annotator@exe/meson-generated_src_CanvasImage.c.o' -MF 'com.github.phase1geo.annotator@exe/meson-generated_src_CanvasImage.c.o.d' -o 'com.github.phase1geo.annotator@exe/meson-generated_src_CanvasImage.c.o' -c 'com.github.phase1geo.annotator@exe/src/CanvasImage.c'
../src/CanvasImage.vala: In function ‘canvas_image_instance_init’:
../src/CanvasImage.vala:51:31: error: expected expression before ‘{’ token
   51 |   public RGBA             average_color { get; private set; default = {1.0, 1.0, 1.0, 1.0}; }
      |                               ^
[13/65] Compiling C object 'com.github.phase1geo.annotator@exe/meson-generated_src_CanvasItems.c.o'.
ninja: build stopped: subcommand failed.
Unable to build project, please review log

eugene-rom avatar Oct 26 '21 12:10 eugene-rom

only 5.3.0-1 Synaptics does not find libgranite6-dev On Tuesday, October 26, 2021, 07:43:09 PM GMT+8, Trevor Williams @.***> wrote:

Can you install libgranite6-dev on your system?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

stdav avatar Oct 27 '21 00:10 stdav

It builds with granite 5.5.0 and vala 0.48.19. I've made it into PPA for those wanna try it out.

PandaJim avatar Nov 19 '21 16:11 PandaJim

It builds with granite 5.5.0 and vala 0.48.19. I've made it into PPA for those wanna try it out.

Installed! Thank you, @PandaJim!

eugene-rom avatar Nov 22 '21 07:11 eugene-rom

Flatpak build does not work and the installation should not require root access!

cartok avatar Sep 05 '22 16:09 cartok