Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perlffi/plbindgen
https://github.com/perlffi/plbindgen
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/perlffi/plbindgen
- Owner: PerlFFI
- Created: 2024-06-16T08:04:55.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-23T07:14:36.000Z (7 months ago)
- Last Synced: 2024-10-12T11:38:12.749Z (3 months ago)
- Language: Rust
- Homepage:
- Size: 15.6 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
plbindgen creates perl cpan distributions for Rust libraries that expose a public C API.
It uses `syn` perform a very rudimentary parse of the Rust source code to extract the
public C API. It then uses [FFI::Platypus](https://metacpan.org/pod/FFI::Platypus) and
[FFI::Platypus::Lang::Rust](https://metacpan.org/pod/FFI::Platypus::Lang::Rust) expose
that C API to Perl.plbindgen is highly opinionated and is primarily designed to automate
the process of writing Platypus bindings to rust, in particular for [Rust::mysql](https://github.com/dylanwh/Rust-mysql).If this description still doesn't make sense, this is basically a h2xs for rust,
that you will probably enjoy using a lot more than h2xs.# SYNOPSIS
```bash
plbindgen -n Rust::mysqlcd Rust-mysql
perl Makefile.PL
make
make install
```# USAGE
```bash
plbindgen --helpplbindgen - Generate Perl bindings for Rust code
This tool generates Perl bindings for Rust code using FFI::Platypus.
Usage: plbindgen [OPTIONS] --name
Options:
-n, --name
This serves as the base package for the generated Perl module--distname
The name of the distribution, typically similar to the name but with dashes instead of colons--module-file
The path to the main perl module file, relative to the root of the perl distribution--crate-file
Path to the Rust crate file, relative to the root of the perl distribution
[default: ffi/src/lib.rs]--cargo-toml
Path to the Cargo.toml file for the Rust crate, relative to the root of the perl distribution
[default: ffi/Cargo.toml]-h, --help
Print help (see a summary with '-h')```