Score:5

How to satisfy 'libadwaita-1' build dependency (in gnome/meson)?

bb flag

The question, in short:

How can I install the libadwaita-1 dependency for a meson-built project?

(Specifically gnome-calculator, if that matters.)

Background:

I was interested in making a small tweak to the Gnome Calculator app, just for my own amusement mostly (I want to change the π button to a button, because pi is wrong ;) ), and so was downloading the source and trying to build it, in hopes of then making the change.

It seems to expect to be built with meson (with which I was previously unfamiliar), so... I'm trying to get it to build with that, so I can make my tweaks and go from there.

System information

I'm doing this on Ubuntu budgie...

: $; lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:        21.10
Codename:       impish

What I've tried so far

  • git clone https://gitlab.gnome.org/GNOME/gnome-calculator.git (got it with commit 214649c at HEAD)

  • cd gnome-calculator

  • (looked at README, poked around at various things, figured out that I probably wanted meson, did some reading on that...)

  • sudo apt install meson

  • meson build

  • I then proceeded to find various dependencies unmet, that I was able to figure out how to resolve... doing sudo apt install on each of:

    • valac
    • cmake
    • libxml2-dev
    • libsoup-gnome2.4-dev
    • libgee-0.8-dev
    • libmpc-dev
    • libgtk-4-dev (side-note: this installed 4.4.0, and I edited meson.build to change the requirement to that from 4.4.1... Which I suppose might create other problems, but I'll figure that out if/when I get to them.)
  • But finally, i got to one that... I thought I could maybe resolve with sudo apt install libadwaitaqt-dev, but that didn't do the trick:

What I got (abbreviated version):

: $; meson build
The Meson build system
Version: 0.56.2
Source dir: /home/lindes/src/gits/gnome/gnome-calculator
Build dir: /home/lindes/src/gits/gnome/gnome-calculator/build
Build type: native build
Project name: gnome-calculator
Project version: 41.0
[... a bunch of found dependencies elided; see below for full list ...]
Found CMake: /usr/bin/cmake (3.18.4)
Run-time dependency libadwaita-1 found: NO (tried pkgconfig and cmake)

meson.build:85:0: ERROR: Dependency "libadwaita-1" not found, tried pkgconfig and cmake

The problem:

So, in short, I'd like to know how to resolve the following dependency:

Run-time dependency libadwaita-1 found: NO

Again, I tried sudo apt install on libadwaitaqt-dev, and that installation worked, but it didn't resolve the build dependency. I also tried libadwaitaqt1 and adwaita-qt.

More specifically, here's what I have installed, while it still fails:

: $; dpkg-query -l '*adwaita*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                    Version         Architecture Description
+++-=======================-===============-============-==========================================================
ii  adwaita-icon-theme      40.1.1-1ubuntu1 all          default icon theme of GNOME (small subset)
un  adwaita-icon-theme-full <none>          <none>       (no description available)
ii  adwaita-qt:amd64        1.4.0-2         amd64        Qt 5 port of GNOME’s Adwaita theme
ii  libadwaitaqt-dev:amd64  1.4.0-2         amd64        Qt 5 port of GNOME’s Adwaita theme — development files
ii  libadwaitaqt1:amd64     1.4.0-2         amd64        Qt 5 port of GNOME’s Adwaita theme — public library
ii  libadwaitaqtpriv1:amd64 1.4.0-2         amd64        Qt 5 port of GNOME’s Adwaita theme — private library

The question, reiterated with this background:

How can I install this and/or correct the dependency checking to use what I've got?

Further notes on the question:

  1. I'd strongly prefer to install dependencies with some sort of package management, though I may try building adwaita from source next, and see if I can get that working. My hope was to only have to build gnome-calculator itself from scratch.

  2. Also: am I doing anything wrong with my meson build command line? Again, I'm new to meson, so tips in that regard are lso welcome, though I did try a few options, and they all seem to produce the same result, if they do anything at all useful-seeming.

What I got (full version):

: $; meson build
The Meson build system
Version: 0.56.2
Source dir: /home/lindes/src/gits/gnome/gnome-calculator
Build dir: /home/lindes/src/gits/gnome/gnome-calculator/build
Build type: native build
Project name: gnome-calculator
Project version: 41.0
C compiler for the host machine: cc (gcc 11.2.0 "gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0")
C linker for the host machine: cc ld.bfd 2.37
Vala compiler for the host machine: valac (valac 0.52.6)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Run-time dependency gio-2.0 found: YES 2.68.4
Run-time dependency glib-2.0 found: YES 2.68.4
Run-time dependency gmodule-export-2.0 found: YES 2.68.4
Run-time dependency gobject-2.0 found: YES 2.68.4
Run-time dependency libxml-2.0 found: YES 2.9.12
Run-time dependency libsoup-2.4 found: YES 2.72.0
Run-time dependency gee-0.8 found: YES 0.20.4
Library m found: YES
Library mpc found: YES
Library mpc found: YES
Library mpfr found: YES
Library mpfr found: YES
Library posix found: YES
Configuring config.h using configuration
Program meson_post_install.py found: YES (/home/lindes/src/gits/gnome/gnome-calculator/meson_post_install.py)
Configuring gcalc-2.pc using configuration
Configuring gcalc-2.deps using configuration
Configuring namespace-info.vala using configuration
Configuring config.h using configuration
Program g-ir-compiler found: YES (/usr/bin/g-ir-compiler)
Run-time dependency gtk4 found: YES 4.4.0
Found CMake: /usr/bin/cmake (3.18.4)
Run-time dependency libadwaita-1 found: NO (tried pkgconfig and cmake)

meson.build:85:0: ERROR: Dependency "libadwaita-1" not found, tried pkgconfig and cmake

A full log can be found at /home/lindes/src/gits/gnome/gnome-calculator/build/meson-logs/meson-log.txt
hr flag
It looks like the `libadwaita-1` development files are not provided until Ubuntu "jammy" release by package [libadwaita-1-dev](https://packages.ubuntu.com/jammy/libadwaita-1-dev)
Score:6
zw flag

You are trying to make Ubuntu act as Gentoo, LFS or ArchLinux. So you did wrong steps.

To build/rebuild/patch gnome-calculator you have to get its sources for deb-package for your Ubuntu 21.10 release. At first enable Source Code repositories from Software & Updates (software-properties-gtk) and then execute the following commands:

sudo apt-get install build-essential dpkg-dev devscripts
sudo apt-get build-dep gnome-calculator

cd ~/Downloads
apt-get source gnome-calculator
cd gnome-calculator-40.1/
# do some patching/coding here
dpkg-buildpackage -uc -us

sudo apt-get install ../gnome-calculator_40.1-1ubuntu2_amd64.deb

If you are sure about compilation of latest non-Ubuntu gnome-calculator version - then you have to build libadwaita-1 package from upcoming 22.04 LTS first by:

sudo apt-get install debhelper-compat dh-sequence-gir libgirepository1.0-dev libgnome-desktop-3-dev libgtk-4-dev meson sassc valac xvfb

cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/universe/liba/libadwaita-1/libadwaita-1_1.0.0~alpha.2.orig.tar.gz
cd libadwaita-1-1.0.0~alpha.2/
wget http://archive.ubuntu.com/ubuntu/pool/universe/liba/libadwaita-1/libadwaita-1_1.0.0~alpha.2-1.debian.tar.xz
tar -xf libadwaita-1_1.0.0~alpha.2-1.debian.tar.xz
rm libadwaita-1_1.0.0~alpha.2-1.debian.tar.xz

export DEB_BUILD_OPTIONS=nocheck
dpkg-buildpackage -uc -us
sudo apt-get install ../*adw*.deb

and then proceed with compilation of missed libgtksourceview-5-dev package:

sudo apt-get install dh-sequence-gnome gtk-doc-tools libxml2-utils libglib2.0-doc libgtk-3-doc libgdk-pixbuf2.0-doc libpango1.0-doc

cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gtksourceview5/gtksourceview5_5.2.0.orig.tar.xz
cd gtksourceview-5.2.0/
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gtksourceview5/gtksourceview5_5.2.0-2.debian.tar.xz
tar -xf gtksourceview5_5.2.0-2.debian.tar.xz
rm gtksourceview5_5.2.0-2.debian.tar.xz
dpkg-buildpackage -uc -us
sudo apt-get install ../*gtksource*.deb

And only then you can try to proceed with compilation of git master-branch version of gnome-calculator.

bb flag
I'm unsure what you mean by that first sentence... what does it mean that I'm "trying to make Ubuntu act as Gentoo, LFS or ArchLinux"? Anyway, thanks for the answer. I'm on a different machine at the moment, but will try this out soon, and vote and/or comment according to how it goes.
us flag
libadwaita is available for 21.10 in this PPA. https://launchpad.net/~ubuntuhandbook1/+archive/ubuntu/giara/+packages
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.