Skip to content

Commit

Permalink
add debian meson template
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Apr 10, 2023
1 parent 1fee551 commit e272bab
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bloom/generators/debian/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ def generate_substitutions_from_package(
pass
elif build_type == 'cmake':
pass
elif build_type == 'meson':
pass
elif build_type == 'ament_cmake':
pass
elif build_type == 'ament_python':
Expand Down
7 changes: 7 additions & 0 deletions bloom/generators/debian/templates/meson/changelog.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@[for change_version, change_date, changelog, main_name, main_email in changelogs]@(Package) (@(change_version)@(DebianInc)@(Distribution)) @(Distribution); urgency=high

@(changelog)

-- @(main_name) <@(main_email)> @(change_date)

@[end for]
1 change: 1 addition & 0 deletions bloom/generators/debian/templates/meson/compat.em
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@(debhelper_version)
14 changes: 14 additions & 0 deletions bloom/generators/debian/templates/meson/control.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: @(Package)
Section: misc
Priority: optional
Maintainer: @(Maintainer)
Build-Depends: debhelper (>= @(debhelper_version).0.0), @(', '.join(BuildDepends))
Homepage: @(Homepage)
Standards-Version: 4.6.0

Package: @(Package)
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, @(', '.join(Depends))
@[if Conflicts]Conflicts: @(', '.join(Conflicts))@\n@[end if]@
@[if Replaces]Replaces: @(', '.join(Replaces))@\n@[end if]@
Description: @(Description)
11 changes: 11 additions & 0 deletions bloom/generators/debian/templates/meson/copyright.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Format: Bloom subset of https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: @(Name)
@[if BugTracker]Upstream-Contact: @(BugTracker)@\n@[end if]@
@[if Source]Source: @(Source)@\n@[end if]@
@[for License, Text in Licenses]@

Files: See file headers in repository for details
Copyright: See package copyright in source code for details
License: @(License)
@(Text)
@[end for]@
3 changes: 3 additions & 0 deletions bloom/generators/debian/templates/meson/gbp.conf.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[git-buildpackage]
upstream-tag=@(release_tag)
upstream-tree=tag
52 changes: 52 additions & 0 deletions bloom/generators/debian/templates/meson/rules.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# TODO: remove the LDFLAGS override. It's here to avoid esoteric problems
# of this sort:
# https://code.ros.org/trac/ros/ticket/2977
# https://code.ros.org/trac/ros/ticket/3842
export LDFLAGS=
export PKG_CONFIG_PATH=@(InstallationPrefix)/lib/pkgconfig
# Explicitly enable -DNDEBUG, see:
# https://github.com/ros-infrastructure/bloom/issues/327
export DEB_CXXFLAGS_MAINT_APPEND=-DNDEBUG

# Solve shlibdeps errors in REP136 packages that use GNUInstallDirs:
export DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

%:
dh $@@ -v --buildsystem=meson --builddirectory=.obj-$(DEB_HOST_GNU_TYPE)

override_dh_auto_configure:
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \
dh_auto_configure -- \
--prefix="@(InstallationPrefix)" \
--cmake-prefix-path="@(InstallationPrefix)" \
--libdir=lib \
--libexecdir=lib

override_dh_auto_build:
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \
dh_auto_build

override_dh_auto_test:
echo -- Running tests. Even if one of them fails the build is not canceled.
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \
dh_auto_test || true

override_dh_shlibdeps:
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \
dh_shlibdeps -l$(CURDIR)/debian/@(Package)/@(InstallationPrefix)/lib/:$(CURDIR)/debian/@(Package)/@(InstallationPrefix)/lib/${DEB_HOST_MULTIARCH}

override_dh_auto_install:
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \
dh_auto_install
1 change: 1 addition & 0 deletions bloom/generators/debian/templates/meson/source/format.em
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (@(format))
6 changes: 6 additions & 0 deletions bloom/generators/debian/templates/meson/source/options.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@[if format and format == 'quilt']@
# Automatically add upstream changes to the quilt overlay.
# http://manpages.ubuntu.com/manpages/trusty/man1/dpkg-source.1.html
# This supports reusing the orig.tar.gz for debian increments.
auto-commit
@[end if]

0 comments on commit e272bab

Please sign in to comment.