Building .deb package with Meson/Ninja

User discussion about Debian Development, Debian Project News and Announcements. Not for support questions.
Post Reply
Message
Author
KNERD
Posts: 8
Joined: 2020-03-07 03:39

Building .deb package with Meson/Ninja

#1 Post by KNERD »

I have seen a lot of guides/How-Tos on building .deb packages using the traditional configure & make method, and those work out great.

However, I am not seeing anything on building packages based on the Meson & Ninja build setup.

Not even Debian's own guide mentions anything on this.

Can anyone point me to something?

Thanks!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 135 times

Re: Building .deb package with Meson/Ninja

#2 Post by Head_on_a_Stick »

I'm pretty sure debhelper can handle them automagically with dh_auto_configure & dh_auto_build.

What have you actually tried so far?
deadbang

KNERD
Posts: 8
Joined: 2020-03-07 03:39

Re: Building .deb package with Meson/Ninja

#3 Post by KNERD »

Thanks for taking the time to respond, but those you listed are for the traditional configure and make, not for Meson and Ninja.


That is why I am asking as I previously mentioned, I cannot find anything about building for Meson & Ninja

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 135 times

Re: Building .deb package with Meson/Ninja

#4 Post by Head_on_a_Stick »

KNERD wrote:those you listed are for the traditional configure and make, not for Meson and Ninja
Well the man page says:
dh_auto_build(1) wrote: dh_auto_build is a debhelper program that tries to automatically build
a package. It does so by running the appropriate command for the build
system it detects the package uses. For example, if a Makefile is
found, this is done by running make (or MAKE, if the environment
variable is set). If there's a setup.py, or Build.PL, it is run to
build the package.

This is intended to work for about 90% of packages. If it doesn't work,
you're encouraged to skip using dh_auto_build at all, and just run the
build process manually.
And this bug report is marked "fixed" for debhelper >10.3:

https://bugs.debian.org/cgi-bin/bugrepo ... bug=795253

So I ask again: what have you actually tried so far?

Or if you haven't tried anything then how about supplying a link to the software you are trying to package?

If debhelper doesn't work then you can over-ride the automation as outlined here:

https://lists.debian.org/debian-devel/2 ... 00348.html
deadbang

KNERD
Posts: 8
Joined: 2020-03-07 03:39

Re: Building .deb package with Meson/Ninja

#5 Post by KNERD »

Exactly my point, dh_auto_build is calling configure and make. It does not seem work with this, that is why I keep mentioned Meson & Ninja

I have also tried dh_make

I am trying to build Mutter. https://github.com/GNOME/mutter

Using dh_auto_build returns:
dh_auto_configure: Package-field must be a valid package name, got: "mutterBROKEN", should match "(?^:^(?^:[a-z0-9][-+\.a-z0-9]+)$)"
Compilation failed in require at /usr/bin/dh_auto_configure line 12.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 135 times

Re: Building .deb package with Meson/Ninja

#6 Post by Head_on_a_Stick »

KNERD wrote:dh_auto_build is calling configure and make
Only if it finds the relevant build files. If Meson & Ninja are used as a build system then debhelper should invoke those automatically. Please read my links.
KNERD wrote:I am trying to build Mutter.
Why? That is already available in Debian's official repositories. And debian/rules for that package seems to rely on dh_auto_build with only a few options added to dh_auto_configure.

Would it not be easier to download the Debian source and patch that? What is the actual problem you are trying to solve here? This is starting to look like an XY-problem.
deadbang

KNERD
Posts: 8
Joined: 2020-03-07 03:39

Re: Building .deb package with Meson/Ninja

#7 Post by KNERD »

The version in Debian 10 is 3.30.2, plus I am trying to learn how to build different packages.

I need version 3.34,

Which option are needed for dh_auto_build?

User avatar
stevepusser
Posts: 13030
Joined: 2009-10-06 05:53
Has thanked: 45 times
Been thanked: 92 times

Re: Building .deb package with Meson/Ninja

#8 Post by stevepusser »

You merely need to use

Code: Select all

%:
	dh $@ --with meson
in debian/rules to invoke the newer debhelper's built-in Meson support, but I'm looking at Bullseye's rules file for their 3.34.3 build, and they go at it manually instead.

I hate to break it to you, but compiling packages isn't all "configure, make, sudo make install". Many times it's terribly more complicated than that. Since testing already has that version, I assume you're trying to build the new Mutter on Buster or even older. That's pretty much impossible without backporting all of the rest of GNOME 3.33+ along with it.

I have backported packages that needed even newer versions of Meson than Buster has, and even packaged from scratch some packages use meson builds, (i.e. Foliate) so I know something about I'm talking about. If you need that version of Mutter, the best advice it to run Testing or Sid.
MX Linux packager and developer

KNERD
Posts: 8
Joined: 2020-03-07 03:39

Re: Building .deb package with Meson/Ninja

#9 Post by KNERD »

Thanks for all this helpful information.

This does lead me to more questions though. My end result is to try to learn to build the Budgie Desktop as a package.

I see Debian 10 Buster already has version 10.5.1 built. Which is the same version I am trying to at least just straight compile for now. So this leads me to ask how was it even build for Buster if is a there version issue with various Mutter?

It wants Mutter >=3.43 which I was able to get installed from your advice.
Now from the Git source, I see it wants Glib >=2.62 meanwhile 2.58.2 is on Buster.
Not having Glib issue with the Oct 2019 release package.

User avatar
stevepusser
Posts: 13030
Joined: 2009-10-06 05:53
Has thanked: 45 times
Been thanked: 92 times

Re: Building .deb package with Meson/Ninja

#10 Post by stevepusser »

Buster has Budgie 10.5, not 10.5.1. The "-1" as the end of Buster's 10.5-1 is a Debian build version, not part of the release version number. That's no doubt why you're getting the confusion about dependencies for the newer version. Debian testing has 10.5.1-3, though.
MX Linux packager and developer

KNERD
Posts: 8
Joined: 2020-03-07 03:39

Re: Building .deb package with Meson/Ninja

#11 Post by KNERD »

I found the source online that Debian is using.

I see there was some patch files making it compatible with the older version of Glib.

However, when trying to enter your suggested command, " dh $@ --with meson" it is returning "dh: error: Unknown sequence --buildsystem=meson (options should not come before the sequence)"

User avatar
stevepusser
Posts: 13030
Joined: 2009-10-06 05:53
Has thanked: 45 times
Been thanked: 92 times

Re: Building .deb package with Meson/Ninja

#12 Post by stevepusser »

Hmmm---is that line indented with a tab?

Is this Budgie or Mutter that you're trying to build now? I still don't think it's compatible with Buster's GTK 3...
MX Linux packager and developer

User avatar
stevepusser
Posts: 13030
Joined: 2009-10-06 05:53
Has thanked: 45 times
Been thanked: 92 times

Re: Building .deb package with Meson/Ninja

#13 Post by stevepusser »

I'm trying to backport upstream's Budgie, but the tweaked version still fails about a third of the way through with what may be a valac error. There's a newer version of valac in buster-backports, though...
MX Linux packager and developer

Post Reply