Bytes. Distributed. For all languages.
Project description
iroh-ffi
Foreign Function Interface (FFI) bindings for Iroh
This repo defines Python & Swift bindings for iroh, which is written in Rust.
Published Packages:
Planned Support:
We're hoping to ship support for the following langauges in the future
- Kotlin
Library Compilation
Running cargo build --release
will produce a dynamic library and a static library.
For builds targeting older versions of MacOS, build with with: MACOSX_DEPLOYMENT_TARGET=10.7 && cargo build --target x86_64-apple-darwin --release
.
Swift
Xcode and IOS
- Run
make.sh
. - Add
IrohLib
as a local package dependency underFrameworks, Libraries, and Embedded Content
in theGeneral
settings of your project. - Run
Build
- Check that it is now listed under
Frameworks, Libraries, and Embedded Content
, if not click+
again and add it from the list. - Add
SystemConfiguration
as a Framework. - Now you can just import the library in Swift with a standard import statement like
import IrohLib
.
Python
- Install
maturin
for python development and packaging. - Install
uniffi-bindgen
withpip
maturin develop
will build your package
Building wheels
Invoking maturin build
will build a wheel in target/wheels
. This
will likely only work on your specific platform. To build a portable
wheel for linux use:
docker run --rm -v $(pwd):/mnt -w /mnt quay.io/pypa/manylinux2014_x86_64 /mnt/build-wheel.sh
Go
Running
To make sure everything go needs to find is included the following is needed
LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}:<binaries path>" \
CGO_LDFLAGS="-liroh -L <binaries path>" \
go <actual go command to build or run>
where <binaries path
needs to be replaced with the absolute path to where the rust build output is. Eg /<path to repo>/iroh-ffi/target/debug
in debug mode.
Updating the bindings
Install uniffi-bindgen-go
:
cargo install uniffi-bindgen-go --git https://github.com/dignifiedquire/uniffi-bindgen-go --branch upgarde-uniffi-24
Development
- This uses https://mozilla.github.io/uniffi-rs/ for building the interface
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for iroh-0.2.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef3773269d2373e99d79baf237858d3fb559a8fde01e22cbf21eb646fa485cb0 |
|
MD5 | 52671c774ff885819bade2a0caf393d2 |
|
BLAKE2b-256 | 5d3fbe9e033b99ae68beb438014865717e48630306759b9679ca61b4d9c1d18b |
Hashes for iroh-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbe0b3c311497dd75735bb925845faf74c88b5d18253def12d7569c1be933cc3 |
|
MD5 | 4ea6458759b2779223d1dca8dc1d5b07 |
|
BLAKE2b-256 | a4d64625e2762063f6ad0be991fd22002e20bf6c59f0dfbb75939a178269213e |
Hashes for iroh-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 872be4d398ff124f78f1b62614ee1e008e3f336c873d596e5e1df1079e328218 |
|
MD5 | 1bb5db6017e7e28a0803b4c4a72bb5bf |
|
BLAKE2b-256 | 9a77ebf66774c708ab2a3eaada1d17c6435d6489ec61e90183792688a1f36563 |
Hashes for iroh-0.2.0-py3-none-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24701e9870b61f01788fc5bacf08a5e3f081829d1c093da3619bdf8e66ddc345 |
|
MD5 | 86e35afb9f4afc63e26a346a836f9f6a |
|
BLAKE2b-256 | 0ce97d1448e1df090f97a63dc87ce3430f5ed00b546f8fbfb23f88025f3c13d6 |
Hashes for iroh-0.2.0-py3-none-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d067013563e80f76b15100dbac70e74106f6bde8cc42aacb9ccadaf15031726f |
|
MD5 | 3f788de338c22ea8fc21b4b078696692 |
|
BLAKE2b-256 | 53ae7cb073b85bed2d3eafcc7de868573c4cf9d2dd2e73eacabe450393e4797e |