diff --git a/.gitignore b/.gitignore index 6985cf1..73fab07 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,6 @@ debug/ target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - # These are backup files generated by rustfmt **/*.rs.bk diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..3e987bb --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,122 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anyhow" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "cargo-ament-build" +version = "0.1.9" +dependencies = [ + "anyhow", + "cargo-manifest", + "pico-args", +] + +[[package]] +name = "cargo-manifest" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5acda331466fdea759172dbc2fb9e650e382dbca6a8dd3f576d9aeeac76da6" +dependencies = [ + "serde", + "serde_derive", + "toml", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "pico-args" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.215" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.215" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "indexmap", + "serde", +] + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..22296c5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +cargo-ament-build (0.1.9-100) focal jammy noble bookworm trixie; urgency=low + + * source package automatically created by stdeb 0.10.1 + + -- None Sun, 08 Dec 2024 17:51:16 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..175bae5 --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: cargo-ament-build +Maintainer: Esteve Fernandez +Section: python +Priority: optional +Build-Depends: dh-python, python3-setuptools, python3-setuptools-rust, python3-all-dev, debhelper (>= 9) +Standards-Version: 3.9.1 +Homepage: None +X-Python3-Version: >= 3.6 + +Package: python3-cargo-ament-build +Architecture: any +Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends} +Description: Cargo plugin for use with colcon workspaces + Cargo plugin for use with colcon workspaces + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..7c2403a --- /dev/null +++ b/debian/rules @@ -0,0 +1,23 @@ +#!/usr/bin/make -f + +# This file was automatically generated by stdeb 0.10.1 at +# Sun, 08 Dec 2024 17:51:16 +0100 + +%: + dh $@ --with python3 --buildsystem=python_distutils + +override_dh_auto_clean: + python3 setup.py clean -a + find . -name \*.pyc -exec rm {} \; + +override_dh_auto_build: + python3 setup.py build --force + +override_dh_auto_install: + python3 setup.py install --force --root=debian/python3-cargo-ament-build --no-compile -O0 --install-layout=deb --prefix=/usr + +override_dh_python2: + dh_python2 --no-guessing-versions + +override_dh_strip: + dh_strip --no-automatic-dbgsym diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..bcc4bbb --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore="\.egg-info$" \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4eb39d5 --- /dev/null +++ b/setup.py @@ -0,0 +1,47 @@ +import os +import shlex + +try: + import tomllib +except ModuleNotFoundError: + import tomli as tomllib +from setuptools import setup + +from setuptools_rust import RustBin + +# Force the wheel to be platform specific +# https://stackoverflow.com/a/45150383/3549270 +# There's also the much more concise solution in +# https://stackoverflow.com/a/53463910/3549270, +# but that would require python-dev +try: + # noinspection PyPackageRequirements,PyUnresolvedReferences + from wheel.bdist_wheel import bdist_wheel as _bdist_wheel + + # noinspection PyPep8Naming,PyAttributeOutsideInit + class bdist_wheel(_bdist_wheel): + def finalize_options(self): + _bdist_wheel.finalize_options(self) + self.root_is_pure = False + +except ImportError: + bdist_wheel = None + +with open("Cargo.toml", "rb") as fp: + cargo_data = tomllib.load(fp) + version = cargo_data["package"]["version"] + description = cargo_data["package"]["description"] + +# Use `--no-default-features` by default for a minimal build to support PEP 517. +# `MATURIN_SETUP_ARGS` env var can be used to pass customized arguments to cargo. +cargo_args = ["--no-default-features"] +long_description = description + +setup( + version=version, + cmdclass={"bdist_wheel": bdist_wheel}, + rust_extensions=[RustBin("cargo-ament-build", args=cargo_args, cargo_manifest_args=["--locked"])], + zip_safe=False, + description=description, + long_description=long_description, +) diff --git a/stdeb.cfg b/stdeb.cfg new file mode 100644 index 0000000..cf6c7a2 --- /dev/null +++ b/stdeb.cfg @@ -0,0 +1,6 @@ +[cargo-ament-build] +No-Python2: +Build-Depends: python3-setuptools-rust +Suite: focal jammy noble bookworm trixie +X-Python3-Version: >= 3.6 +Debian-Version: 100