• Stars
    star
    478
  • Rank 89,133 (Top 2 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Compile Rust projects against the Android NDK without hassle

cargo-ndk - Build Rust code for Android

CI Minimum supported Rust version: 1.68

This cargo extension handles all the environment configuration needed for successfully building libraries for Android from a Rust codebase, with support for generating the correct jniLibs directory structure.

Installing

cargo install cargo-ndk

You'll also need to install all the toolchains you intend to use. Simplest way is with the following:

rustup target add \
    aarch64-linux-android \
    armv7-linux-androideabi \
    x86_64-linux-android \
    i686-linux-android

Modify as necessary for your use case.

Usage

If you have installed the NDK with Android Studio to its default location, cargo ndk will automatically detect the most recent NDK version and use it. This can be overriden by specifying the path to the NDK root directory in the ANDROID_NDK_HOME environment variable.

Example: building a library for 32-bit and 64-bit ARM systems

cargo ndk -t armeabi-v7a -t arm64-v8a -o ./jniLibs build --release

This specifies the Android targets to be built (ordinary triples are also supported), the output directory to use for placing the .so files in the layout expected by Android, and then the ordinary flags to be passed to cargo.

Example

Supported hosts

  • Linux
  • macOS (x86_64 and arm64)
  • Windows

Local development

git clone and then install the crate with cargo:

cargo install --path .

Similar projects

  • cargo-cocoapods - for building .a files for all Apple platforms, and bundling for CocoaPods

License

This project is licensed under either of

at your option.

More Repositories

1

box

Box - Open Standard Archive Format, a zip killer.
Rust
47
star
2

cargo-cocoapods

Bundle Cargo crates for use with macOS/iOS in Xcode
Rust
28
star
3

mio-named-pipes

Rust
23
star
4

registry-rs

A convenient crate for safely accessing and mutating the Windows Registry.
Rust
20
star
5

borg-machine

macOS wrapper for borg backup
Swift
12
star
6

sax

A native macOS client for Mastodon
JavaScript
12
star
7

iso639-databases

ISO 639 tables for managing autonyms, LCIDs and default ISO 15924 scripts in a machine-readable format
10
star
8

cargo-proc-macro

Kickstart a proc-macro project with a straight-forward template.
Rust
9
star
9

oyster

JavaScript
9
star
10

pathos

A natural API for handling OS-specific user or system directories, including iOS and Android.
Rust
8
star
11

xml-pretty

XML prettifier
Rust
8
star
12

skog-python

Generate visual dependency trees for FreeBSD ports
Python
7
star
13

spdx-lookup-python

SPDX license list query tool
Python
7
star
14

eventlog

A log-compatible wrapper around the Windows Event Log API
Rust
7
star
15

vlq-rust

Variable-length quantity (VLQ) encoder/decoder for Rust
Rust
6
star
16

jscore-rs

JavaScriptCore (iOS, macOS) library for Rust
Rust
6
star
17

fastvlq

A fast variant of Variable-Length Quantity with a focus on speed and no_std support.
Rust
5
star
18

regex-static

Compile-time validated regex, with convenience functions for lazy and static regexes.
Rust
5
star
19

comde

Compression/decompression crate akin to serde
Rust
5
star
20

sourcepan

Experimental GTK Git client written in Rust
Rust
5
star
21

xmlem

mlem
Rust
5
star
22

mongo-swift

MongoDB bindings for Swift (using MongoDB C drivers)
Swift
5
star
23

tornado-mongo-session

Session and authentication handling using MongoDB for Tornado
Python
4
star
24

ts

Print ISO 8601 or Unix timestamps on the command line
Rust
4
star
25

swift-rust-bindings-example

The most cursed thing I think I've ever made.
Shell
4
star
26

nova

Newtype macros for commonly reused types in Rust.
Rust
4
star
27

mendo

MongoDB-style document manipulation for objects within arrays, in JavaScript (including in the browser).
JavaScript
4
star
28

pylibtextcat

pylibtextcat ported to Python 3!
C
4
star
29

raunch

A safe wrapper around launchd launch_activate_socket
Rust
4
star
30

cucumber-rust-example

An example repository demonstrating how to use Cucumber with Rust.
Rust
4
star
31

eideasy-rs

API wrapper for eIDEasy
Rust
3
star
32

bandar

Create development overlays for the ports tree
Python
3
star
33

moment-recur2

A modern fork of moment-recur
JavaScript
3
star
34

bbqweb

bbqsrc.net offline content management system (unmaintained alpha)
Python
3
star
35

foitorrent

Torrent generator for FOI Disclosure Logs
Python
3
star
36

bbqws

A minimalist websocket wrapper.
Python
3
star
37

apertium-tgl-ceb

A morphological dictionary to translate between Tagalog and Cebuano
Python
3
star
38

censorwatch.me

Watching the censors, watching us, watching them.
Python
3
star
39

collections

Rust
3
star
40

dtd-rust

Rust
3
star
41

arc-ext

Extensions for Arc<T> such as field projection.
Rust
3
star
42

hardcongress

A simple, transient voting system for seamless integration of remote delegates into a harsh, real world.
CoffeeScript
3
star
43

clasrip

Classification.gov.au ripper
Ruby
2
star
44

countgap

Python
2
star
45

robust

Python
2
star
46

bbqutils

A set of utilities for simplification of common tasks in Python
Python
2
star
47

svniter

Iterate through your SVN repository by update with ease!
Python
2
star
48

dvchart

Divvun chart generator
Python
2
star
49

gurka

Rust
2
star
50

webgap

stopgap's web frontend
JavaScript
2
star
51

motionbot

JavaScript
2
star
52

txjsonrpc

Python
2
star
53

fbs-rs

Rust
2
star
54

consul

An ncurses frontend for console emulators, written in Vala
Vala
2
star
55

textkitty

Extendable text categorisation library. Like textcat, but in pure Python.
Python
2
star
56

every

Run a method at a set interval
Python
2
star
57

htmlconsole

An HTML console implementation
JavaScript
2
star
58

bbqcrm

A minimalist customer relationship manager with a non-government organisational focus.
Python
2
star
59

tokio-named-pipe

Rust
2
star
60

bbqwiki

Minimalist, embeddable wiki with Python backend
JavaScript
2
star
61

jsonrpc2

JSON-RPC draft 2.0 implementation in Python (Twisted)
Python
2
star
62

bbqbooks

An invoice manager. Cook the books!
Python
2
star
63

passport-mongodb

A turnkey implementation of a local passport.js strategy using MongoDB.
JavaScript
2
star
64

telekom

JavaScript
2
star
65

koa-rutt

Another koa routing library
JavaScript
1
star
66

vapour

Link aggregation and sharing for the rest of us.
Python
1
star
67

tts-http-api

Python
1
star
68

windirs

A safe wrapper around `SHGetKnownFolderPath`.
Rust
1
star
69

taskrunner-server

Rust
1
star
70

cursed

[WIP] Making that cursed FFI work a little bit safer, but only a little.
Rust
1
star
71

polyglot

Multilingual wiki
Python
1
star
72

centredown

JavaScript
1
star
73

koa-simple-body

A clean body parser for Koa v2
JavaScript
1
star
74

stopgap

Voting system, stopgap.
Python
1
star
75

qname

Rust
1
star
76

iso639

Command line tool and library for manipulating ISO639-1 and -3 tags, autonyms and data.
Rust
1
star
77

fakturera

JavaScript
1
star
78

robust-android

Java
1
star
79

android-autotools

Build autotools projects for Android without screaming endlessly
Python
1
star
80

scrapo

What you call a classification.gov.au scraper when you're drunk.
JavaScript
1
star
81

hardvote

A fairly minimalist voting system with unique emailable user tokens per poll
Python
1
star
82

dontdns

Dynamic DNS: Not Even Onceβ„’
Rust
1
star
83

bbqsrc

1
star
84

proxenv

JavaScript
1
star
85

pyoxidizer-bug-repro

Starlark
1
star
86

static_init

Fork of https://gitlab.com/okannen/static_init
Rust
1
star
87

wargs

Rust
1
star
88

github-api

Github API version 3 library for Python
Python
1
star
89

govstalk

They change their websites and hide things without notice. Let's ensure that doesn't happen again.
Python
1
star
90

huggare

Android-style logging for ECMAScript (JavaScript, you pleb.)
JavaScript
1
star
91

simplebdd

A simple implementation of a behaviour-driven development style testing framework.
Python
1
star
92

legalese

Markup language similar to Markdown for use in more formal documents.
JavaScript
1
star
93

svtool

JavaScript
1
star
94

intl-rs

Internationalisation and localisation framework for Rust
Rust
1
star
95

huggare-audit

Audit with Huggare.
JavaScript
1
star
96

pathtrie

A specialised trie for paths in the style of a Patricia or radix trie, with optional optimised FST output
Rust
1
star
97

sparkle-tools

Tools for generating and maintaining Sparkle appcasts and projects
JavaScript
1
star
98

starbound-mod-server

Python
1
star
99

tsirc

Twitter Search IRC bot returns query results to an IRC channel!
Python
1
star