LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-05-2020, 07:28 PM   #1
GeekBoy
Member
 
Registered: Dec 2006
Distribution: Fedora v6
Posts: 63

Rep: Reputation: 0
Question Building .deb package with Meson/Ninja


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!
 
Old 03-14-2020, 09:12 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
As an example, see debian/rules for xed from Linux Mint.

OTOH, meson and ninja are listed among build systems recognized by debhelper, so I guess for most packages the standard dh magic should work, too. And if debhelper wrongly determines the used build system itself, you may always specify it explicitly:
Code:
%:
        dh $@ --buildsystem=meson

Last edited by shruggy; 03-14-2020 at 09:36 AM.
 
2 members found this post helpful.
Old 03-31-2020, 08:27 PM   #3
GeekBoy
Member
 
Registered: Dec 2006
Distribution: Fedora v6
Posts: 63

Original Poster
Rep: Reputation: 0
When I tried the normal build, it would report not finding classic stuff like configure.


When I tried entering "dh $@ --buildsystem=meson" it reported back, "dh: error: Unknown sequence --buildsystem=meson (options should not come before the sequence)"

Thanks for responding.
 
Old 04-01-2020, 02:29 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
1. What's your distro?
Code:
grep ^PRETTY /etc/os-release
2. What's your version of debhelper? (meson/ninja support was added in debhelper 10.3, i.e. if you're on Debian 9 (Stretch) you should use debhelper from stretch-backports, and if you're still on Debian 8 (Jessie) or Ubuntu 16.04 LTS (Xenial) you're out of luck)
Code:
dpkg -l debhelper
3. What's the output of
Code:
dh build --no-act --buildsystem=meson
(run the last command from inside your package source directory, i.e. one level above the debian directory).

Last edited by shruggy; 04-01-2020 at 02:55 AM.
 
Old 04-01-2020, 11:30 PM   #5
GeekBoy
Member
 
Registered: Dec 2006
Distribution: Fedora v6
Posts: 63

Original Poster
Rep: Reputation: 0
Here are the responses.


Quote:
PRETTY_NAME="Debian GNU/Linux bullseye/sid"

Quote:
| 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 debhelper 12.9 all helper programs for debian/rules
Quote:
dh_testdir -O--buildsystem=meson
dh_update_autotools_config -O--buildsystem=meson
dh_autoreconf -O--buildsystem=meson
debian/rules override_dh_auto_configure
debian/rules override_dh_auto_build
dh_auto_test -O--buildsystem=meson
create-stamp debian/debhelper-build-stamp
 
Old 04-02-2020, 02:15 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
I don't see anything wrong with your setup.

1. What software are you trying to build? Have you tried to build it manually, according to upstream instructions (they are usually in files named INSTALL*, README* and the like)? Did it work?

2. Please show the contents of debian/rules.
 
Old 04-03-2020, 02:36 PM   #7
GeekBoy
Member
 
Registered: Dec 2006
Distribution: Fedora v6
Posts: 63

Original Poster
Rep: Reputation: 0
It is Budgie Desktop 10.5.

And yes, I have tried the manual build


Here is the content of debian/rules

Code:
#!/usr/bin/make -f
export DH_VERBOSE = 1
export MAKE = ninja -v
export LC_ALL=C.UTF-8
export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

%:
        dh $@

override_dh_clean:
        dh_clean
        rm -rf debian/build
ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo ubuntu),ubuntu)

        @if [ -e ./debian/ubuntu/applied ]; then \
                patch -R -p1 < debian/ubuntu/show_nm-applet_in_tray.patch ; \
                rm ./debian/ubuntu/applied ; \
        fi
endif

override_dh_auto_configure:
        mkdir -p debian/build
ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo ubuntu),ubuntu)
        patch -p1 < debian/ubuntu/show_nm-applet_in_tray.patch
        touch ./debian/ubuntu/applied
endif
        cd debian/build && LDFLAGS="-Wl,-z,now -Wl,-z,relro -O1" meson -Dwith-desktop-icons=none --buildtype plain --prefix=/usr --libdir=/usr/lib --sysconfdir=/etc ../..

override_dh_auto_build:
        cd debian/build && $(MAKE)

override_dh_auto_install:
        dh_auto_install
        cd debian/build && DESTDIR=$(CURDIR)/debian/tmp $(MAKE) install
        mkdir -p "$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/girepository-1.0"
        mv "$(CURDIR)/debian/tmp/usr/lib/girepository-1.0/Budgie-1.0.typelib" "$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/girepository-1.0"
        rm -rf "$(CURDIR)/debian/tmp/usr/lib/girepository-1.0"

override_dh_installgsettings:
        # install override but budgie has to take precedence over
        # gnome-shell defaults
        dh_installgsettings --priority=15

override_dh_installchangelogs:
        dh_installchangelogs debian/changelog-announcement.txt
 
Old 04-04-2020, 04:06 AM   #8
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
budgie-desktop 10.5.1-3 is currently in sid. Why not just install it from the official repo?

Just to be sure, I've rebuilt budgie-desktop 10.5.1-6 currently in experimental from source. The only problem was package libmutter-6-dev still being in experimental. So I did
Code:
sudo pbuilder --update --override-config --distribution experimental
Update. Now I've also rebuilt budgie-desktop 10.5.1-3 from sid source with no changes and no problems whatsoever.

Last edited by shruggy; 04-04-2020 at 07:21 AM.
 
Old 04-09-2020, 09:43 PM   #9
GeekBoy
Member
 
Registered: Dec 2006
Distribution: Fedora v6
Posts: 63

Original Poster
Rep: Reputation: 0
Reason for not using packages is to learn how to make various packages, and learn how to make my own repos.

I had downloaded the source packages from the upstream developer repo on Github.
Maybe that is why I am having issues.

I tried downloading source from the Deb source repos using "apt-get source", but I guess I have to do that as sudo user.
 
Old 04-10-2020, 12:31 AM   #10
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
No, it's not necessary to be root in order to use apt-get source. From the apt-get(1) manpage:
Quote:
Note that source packages are not installed and tracked in the dpkg database like binary packages; they are simply downloaded to the current directory, like source tarballs.
But you should have enabled the corresponding deb-src line in /etc/apt/sources.list. From the same manpage:
Quote:
Source packages are tracked separately from binary packages via deb-src lines in the sources.list(5) file. This means that you will need to add such a line for each repository you want to get sources from; otherwise you will probably get either the wrong (too old/too new) source versions or none at all.
Alternatively to apt-get source you can try dget from package devscripts.

From Ubuntu's pbuilder Howto:
Quote:
There will be times when a package you want or need to build is not in the repositories of the current version of Ubuntu you are running. Rather than entering deb-src lines in your sources.list configuration for other versions of Ubuntu you are not running, you can use dget instead to download a package. dget is included in the devscripts package, hence why you should have installed it.

To use dget, first locate the .dsc file of the package you are going to build. Good places to look are http://packages.ubuntu.com/ or http://packages.debian.org/. Once you located the .dsc file, copy the link address to it and then in a command prompt run:
Code:
dget <link_address_to_foo.dsc>
Quote:
Originally Posted by GeekBoy View Post
I had downloaded the source packages from the upstream developer repo on Github. Maybe that is why I am having issues.
I don't think so. Just compare your debian/rules with that from the official Debian package. Why are you overriding dh_auto_build? Why changing the MAKE variable?

Last edited by shruggy; 04-10-2020 at 01:12 AM.
 
1 members found this post helpful.
Old 04-17-2020, 11:57 PM   #11
GeekBoy
Member
 
Registered: Dec 2006
Distribution: Fedora v6
Posts: 63

Original Poster
Rep: Reputation: 0
Been a while. With so many people at the house all the time now, I get endlessly interrupted, and hard to sit down and work on this stuff.



Anyway, I was trying to get the source from apt the wrong way.
Just running "apt-get source budgie-desktop" worked out fine.

Got a folder labeled "budgie-desktop-10.5," archive named, "budgie-desktop_10.5.orig.tar.xz," file named "budgie-desktop_10.5.orig.tar.xz.asc," another archive named "budgie-desktop_10.5-1.debian.tar.xz," and a file named "budgie-desktop_10.5-1.dsc."

At this point, I am not even sure what to do with all the different files as there seems to be no Debian documentation on what to to to get it to compile/patch/make .deb package.


Overriding dh_auto_build? Changing MAKE variable? Not sure what you mean. I have not changed anything. Just trying to learn how to build this, and make a repo package.

Any docs to point me to, or help on that?

Thanks again!
 
Old 04-18-2020, 04:31 AM   #12
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Code:
sudo apt install build-essential devscripts
cd budgie-desktop-10.5
debuild -us -uc
ls ../*.deb
Quote:
Originally Posted by GeekBoy View Post
Any docs to point me to, or help on that?
If all this is just in order to try your hand in rebuilding a Debian package, why not choose something simple like hello?
 
Old 04-19-2020, 01:05 AM   #13
GeekBoy
Member
 
Registered: Dec 2006
Distribution: Fedora v6
Posts: 63

Original Poster
Rep: Reputation: 0
[QUOTE=shruggy;6113082]
Code:
sudo apt install build-essential devscripts
cd budgie-desktop-10.5
debuild -us -uc
ls ../*.deb
That did not work out. It spit out about 100 or so errors.

I will check out the links.

Reason is because the simples are really not learning to build harder packages. Just do the commands and its done. Here we have something really to learn here.

Thanks

Last edited by GeekBoy; 04-19-2020 at 01:06 AM.
 
Old 04-19-2020, 02:26 AM   #14
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Quote:
Originally Posted by GeekBoy View Post
That did not work out. It spit out about 100 or so errors.
Are you sure the directory budgie-desktop-10.5 was unpacked by apt source and not left behind from your previous experiments?
Code:
rm -rf budgie-desktop-10.5
dpkg-source -x budgie-desktop-10.5-1.dsc
Lather, rinse, repeat
 
Old 04-19-2020, 11:33 PM   #15
GeekBoy
Member
 
Registered: Dec 2006
Distribution: Fedora v6
Posts: 63

Original Poster
Rep: Reputation: 0
No. I removed all previous ones, then made a special directory just for this project on April 17, then did the apt source.

However, I did go ahead and did those two commands above, and reran "debuild -us -uc" and got bit of a different result, but still a failure.



Quote:
[130/265] ccache cc -Isrc/wm/131f9c0@@budgie-wm@exe -Isrc/wm -I../../src/wm -I. -I../../ -Isrc/config -I../../src/config -I/usr/include/mutter -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/mutter/clutter-3 -I/usr/include/atk-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/json-glib-1.0 -I/usr/include/mutter/cogl -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/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libdrm -I/usr/include/gsettings-desktop-schemas -I/usr/include/gnome-desktop-3.0 -I/usr/include/ibus-1.0 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -w -std=c11 -fstack-protector -pedantic -Wstrict-prototypes -Wundef -Werror-implicit-function-declaration -Wformat -Wformat-security -Werror=format-security -Wconversion -Wunused-variable -Wunreachable-code -Wall -W '-DGETTEXT_PACKAGE="budgie-desktop"' -g -O2 -fdebug-prefix-map=/home/trent/Developer/budgie/budgie-desktop-10.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -pthread -DGNOME_DESKTOP_USE_UNSTABLE_API -MD -MQ 'src/wm/131f9c0@@budgie-wm@exe/meson-generated_wm.c.o' -MF 'src/wm/131f9c0@@budgie-wm@exe/meson-generated_wm.c.o.d' -o 'src/wm/131f9c0@@budgie-wm@exe/meson-generated_wm.c.o' -c 'src/wm/131f9c0@@budgie-wm@exe/wm.c'
ninja: build stopped: subcommand failed.
make[1]: *** [debian/rules:30: override_dh_auto_build] Error 1
make[1]: Leaving directory '/home/trent/Developer/budgie/budgie-desktop-10.5'
make: *** [debian/rules:8: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui failed
 
  


Reply

Tags
packaging


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 14 02-23-2021 08:35 PM
[SOLVED] dconf package does not build with meson 0.52 TheRealGrogan Slackware 9 10-16-2019 02:54 PM
[SOLVED] Slackbuilding with meson/ninja for Pithos src to avoid flatpack bamunds Slackware 12 02-18-2019 02:36 PM
[SOLVED] Which package should provide ninja and meson? Lennie Linux From Scratch 6 12-29-2017 02:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration