Skip to contentSkip to conversation

bindings: rust: add README for crates.io

PATCH Applied Erik Schilling 3 participants 5 messages Jul 3, 2023 GPIO

lore
Share & tools
lore
#0 lore raw

v2 cover bindings: rust: add README for crates.io

The READMEs are displayed on crates.io for published crates. This tries to provide a little more context there.

To: Linux-GPIO <[email protected]>
Cc: Viresh Kumar <[email protected]>

---
Changes in v2:
- Fixed typo (thanks Viresh!)
- Added missing sign-off to 2/2
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Erik Schilling (2):
bindings: rust: add README.md for libgpiod crate
bindings: rust: mention the libgpiod crate from libgpiod-sys

 bindings/rust/libgpiod-sys/README.md |  3 +++
 bindings/rust/libgpiod/README.md     | 25 +++++++++++++++++++++++++
 2 files changed, 28 insertions(+)

---
base-commit: 37b3ac4bb5a35c0e84a98d95124f064ca038c4d1
change-id: 20230630-rust-readme-6560244a713d

Best regards,

Signature · 1 line
Erik Schilling <[email protected]>
#1 lore raw

PATCH v2 1/2 bindings: rust: add README.md for libgpiod crate

crates.io treats the README as landing page for a crate [1]. Since we have none, it currently displays a blank page. Lets add at least a little bit of info here so people can figure out what they are dealing with.

[1] https://crates.io/crates/libgpiod

---
 bindings/rust/libgpiod/README.md | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
bindings/rust/libgpiod/README.md new file +25 -0
new file mode 100644
index 0000000..8d514e7
@@ -0,0 +1,25 @@
+<!--
+SPDX-License-Identifier: CC0-1.0
+SPDX-FileCopyrightText: 2023 Linaro Ltd.
+SPDX-FileCopyrightText: 2023 Erik Schilling <[email protected]>
+-->
+
+# Safe wrapper around Rust FFI bindings for libgpiod
+
+[libgpiod](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/README)
+is a C library that provides an easy to use abstraction over the Linux GPIO
+character driver. This crate builds on top of `libgpiod-sys` and exports a safe
+interface to the C library.
+
+## Build requirements
+
+By default, `libgpiod-sys` builds against the libgpiod version identified via
+`pkg-config`. See the `README.md` of `libgpiod-sys` for options to override
+that.
+
+## License
+
+This project is licensed under either of
+
+- [Apache License](http://www.apache.org/licenses/LICENSE-2.0), Version 2.0
+- [BSD-3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
Signature · 1 line
2.41.0
#2 lore raw

PATCH v2 2/2 bindings: rust: mention the libgpiod crate from libgpiod-sys

In reply to Erik Schilling

If people view this README.md on crates.io [1], they likely want to use the safe wrapper instead. So this hints the existence of that other crate.

[1] https://crates.io/crates/libgpiod-sys

---
 bindings/rust/libgpiod-sys/README.md | 3 +++
 1 file changed, 3 insertions(+)
bindings/rust/libgpiod-sys/README.md +3 -0
index f9db496..05acd9e 100644
@@ -8,6 +8,9 @@ SPDX-FileCopyrightText: 2022 Viresh Kumar <[email protected]>
 Automatically generated Rust FFI bindings via
 	[bindgen](https://github.com/rust-lang/rust-bindgen).
 
+Typically, you will want to use the safe `libgpiod` wrapper crate instead of
+these unsafe wrappers around the C lib.
+
 ## Build requirements
 
 A compatible variant of the C library needs to detectable using pkg-config.
Signature · 1 line
2.41.0
#4 lore raw
In reply to Erik Schilling
Quoted 22 lines · Erik Schilling

The READMEs are displayed on crates.io for published crates. This tries to provide a little more context there.

To: Linux-GPIO <[email protected]>
Cc: Viresh Kumar <[email protected]>

---
Changes in v2:
- Fixed typo (thanks Viresh!)
- Added missing sign-off to 2/2
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Erik Schilling (2):
bindings: rust: add README.md for libgpiod crate
bindings: rust: mention the libgpiod crate from libgpiod-sys

 bindings/rust/libgpiod-sys/README.md |  3 +++
 bindings/rust/libgpiod/README.md     | 25 +++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
Quoted 8 lines

---
base-commit: 37b3ac4bb5a35c0e84a98d95124f064ca038c4d1
change-id: 20230630-rust-readme-6560244a713d

Best regards,
--
Erik Schilling <[email protected]>

Applied, thanks!

Bart