Skip to content

Commit 4dcb6b0

Browse files
committed
feat: add support for stdeb
Signed-off-by: Esteve Fernandez <[email protected]>
1 parent 7529850 commit 4dcb6b0

File tree

10 files changed

+221
-4
lines changed

10 files changed

+221
-4
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
debug/
44
target/
55

6-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
7-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8-
Cargo.lock
9-
106
# These are backup files generated by rustfmt
117
**/*.rs.bk
128

Cargo.lock

Lines changed: 122 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cargo-ament-build (0.1.9-100) focal jammy noble bookworm trixie; urgency=low
2+
3+
* source package automatically created by stdeb 0.10.1
4+
5+
-- None <None> Sun, 08 Dec 2024 17:51:16 +0100

debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

debian/control

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Source: cargo-ament-build
2+
Maintainer: Esteve Fernandez <[email protected]>
3+
Section: python
4+
Priority: optional
5+
Build-Depends: dh-python, python3-setuptools, python3-setuptools-rust, python3-all-dev, debhelper (>= 9)
6+
Standards-Version: 3.9.1
7+
Homepage: None
8+
X-Python3-Version: >= 3.6
9+
10+
Package: python3-cargo-ament-build
11+
Architecture: any
12+
Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends}
13+
Description: Cargo plugin for use with colcon workspaces
14+
Cargo plugin for use with colcon workspaces
15+

debian/rules

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/make -f
2+
3+
# This file was automatically generated by stdeb 0.10.1 at
4+
# Sun, 08 Dec 2024 17:51:16 +0100
5+
6+
%:
7+
dh $@ --with python3 --buildsystem=python_distutils
8+
9+
override_dh_auto_clean:
10+
python3 setup.py clean -a
11+
find . -name \*.pyc -exec rm {} \;
12+
13+
override_dh_auto_build:
14+
python3 setup.py build --force
15+
16+
override_dh_auto_install:
17+
python3 setup.py install --force --root=debian/python3-cargo-ament-build --no-compile -O0 --install-layout=deb --prefix=/usr
18+
19+
override_dh_python2:
20+
dh_python2 --no-guessing-versions
21+
22+
override_dh_strip:
23+
dh_strip --no-automatic-dbgsym

debian/source/format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)

debian/source/options

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extend-diff-ignore="\.egg-info$"

setup.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import os
2+
import shlex
3+
4+
try:
5+
import tomllib
6+
except ModuleNotFoundError:
7+
import tomli as tomllib
8+
from setuptools import setup
9+
10+
from setuptools_rust import RustBin
11+
12+
# Force the wheel to be platform specific
13+
# https://stackoverflow.com/a/45150383/3549270
14+
# There's also the much more concise solution in
15+
# https://stackoverflow.com/a/53463910/3549270,
16+
# but that would require python-dev
17+
try:
18+
# noinspection PyPackageRequirements,PyUnresolvedReferences
19+
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
20+
21+
# noinspection PyPep8Naming,PyAttributeOutsideInit
22+
class bdist_wheel(_bdist_wheel):
23+
def finalize_options(self):
24+
_bdist_wheel.finalize_options(self)
25+
self.root_is_pure = False
26+
27+
except ImportError:
28+
bdist_wheel = None
29+
30+
with open("Cargo.toml", "rb") as fp:
31+
cargo_data = tomllib.load(fp)
32+
version = cargo_data["package"]["version"]
33+
description = cargo_data["package"]["description"]
34+
35+
# Use `--no-default-features` by default for a minimal build to support PEP 517.
36+
# `MATURIN_SETUP_ARGS` env var can be used to pass customized arguments to cargo.
37+
cargo_args = ["--no-default-features"]
38+
long_description = description
39+
40+
setup(
41+
version=version,
42+
cmdclass={"bdist_wheel": bdist_wheel},
43+
rust_extensions=[RustBin("cargo-ament-build", args=cargo_args, cargo_manifest_args=["--locked"])],
44+
zip_safe=False,
45+
description=description,
46+
long_description=long_description,
47+
)

stdeb.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[cargo-ament-build]
2+
No-Python2:
3+
Build-Depends: python3-setuptools-rust
4+
Suite: focal jammy noble bookworm trixie
5+
X-Python3-Version: >= 3.6
6+
Debian-Version: 100

0 commit comments

Comments
 (0)