Preamble:
I have decided that I would like to build gnome-shell from source (after applying some tweaks).
My system is a stock Ubuntu 20.04.2 with Xorg Server, GDM3, Gnome desktop, and Mutter.
I have cloned the gnome-shell source-code from Launchpad (recursively) with git, and have checked out the gnome-3-36
branch. On the only git submodule, subprojects/gvc
, I have checked out the master
branch, because studying git branch --all
, that seemed to be the only one to make sense.
Then I installed meson
(v 0.53.2), and tried running meson builddir
in the gnome-shell working tree root, as I have seen from this tutorial.
Challenge:
Through error messages I have learned about missing dependencies.
Then I have installed gcc
, and after another failed attempt, cmake
.
After this, I still got errors about missing dependencies, which I started to search for and install with Synaptic one by one, after each error message of a new failed build attempt.
In this fashion, I have so far installed such packages as libecal2.0-dev
, libgcr-3-dev
, libgirepository1.0-dev
, and libgjs-dev
.
Now I feel stupid, and I think meson could install all these for me in a single process, with some command: like npm does with npm install
.
The meson.build
file looks somewhat like the npm ecosystem's package.json
, so I guess I should be able to have dependencies installed by meson...
Is that right?
Now, to remain with the npm comparison, it strikes me that when I run npm install
, I get a self-contained directory, node_modules/
, where the (project's) dependencies are added. In contrast, I so far have installed my meson dependencies globally on my system. Does that make sense? Should I do it differently? Is there a better way?
Update 1:
This guide suggests this command: sudo apt install build-essential
I thought it might be a useful shortcut, but for me it returns: "build-essential is already the newest version". Seems like the gnome-shell project's dependencies are beyond of what's considered essential.
Update 2:
I have continued with manually installing dependencies as they came up, while keeping notes of what these were:
libecal2.0-dev
libgcr-3-dev
libgirepository1.0-dev
libgjs-dev
libmutter-6-dev
libpolkit-agent-1-dev
libstartup-notification0-dev
libgnome-desktop-3-dev
libgnome-bluetooth-dev
libnm-dev
xsltproc
sassc
libpulse-dev
asciidoc-base
After installing these with Synaptic, the meson build
command proceeded until a successful exit.
Just for a note, this stuff was huge (the dependencies of dependencies), I have the impression that gigabytes of disk space was used for them.
At this point @muru suggested this thread:
# So I ran
sudo apt-get build-dep gnome-shell --dry-run
then
sudo apt-get build-dep gnome-shell
For this to work however, I had to check a checkbox and select a server for "Source code" in the Software & Updates utility — again, thanks to @muru's guidance.
Anyways, sudo apt-get build-dep gnome-shell
has installed 36 more packages on top of what already had been installed.
At this point however I feel optimistic that I am well equipped for the actual compilation, not just for the mere meson build
.
Update 3:
Considering how helpful this thread may be for any newcomer willing to work with meson in general or on the gnome-shell specifically, I would like to save this question from being deleted.
I would like to move the info in the "Update 2" section into an answer. That would enable us to keep this collection of valuable information together in one place. So I cast a reopen vote.
meson
is just a build system, not a whole package management system that can get dependencies for you. – muru Feb 24 '21 at 22:31sudo apt-get build-dep gnome-shell --dry-run
saysYou must put some 'deb-src' URIs in your sources.list
I'm not sure how to handle that. – Levente Feb 24 '21 at 22:33meson
tag. And searching for anything with the meson tag brings up now 0 results (in a private browsing window). – Levente Feb 25 '21 at 00:32noredirect=1
URL get parameter. Only I, the author of the question, and maybe some mods get that noredirect parameter, I expect. – Levente Feb 25 '21 at 00:34