mirror of
https://github.com/RoboSats/robo-identities.git
synced 2025-07-30 22:51:44 +00:00
Generate Builds
This commit is contained in:
5
.cargo/config.toml
Normal file
5
.cargo/config.toml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[target.aarch64-linux-android]
|
||||||
|
linker = "/opt/android-sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang"
|
||||||
|
|
||||||
|
[target.armv7-linux-androideabi]
|
||||||
|
linker = "/opt/android-sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi30-clang"
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1 @@
|
|||||||
/target
|
/builds
|
||||||
/Cargo.lock
|
|
1464
Cargo.lock
generated
Normal file
1464
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
79
Dockerfile
Normal file
79
Dockerfile
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
FROM debian:testing-slim AS base
|
||||||
|
|
||||||
|
# install common packages
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y \
|
||||||
|
wget \
|
||||||
|
curl \
|
||||||
|
unzip \
|
||||||
|
build-essential \
|
||||||
|
openjdk-17-jre-headless \
|
||||||
|
--no-install-recommends \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Set an environment variable for convenience.
|
||||||
|
ENV GRADLE_ROOT=${HOME}/opt/gradle
|
||||||
|
|
||||||
|
RUN mkdir -p ${GRADLE_ROOT}
|
||||||
|
RUN wget https://services.gradle.org/distributions/gradle-7.5.1-bin.zip -O gradle-7.5.1-bin.zip \
|
||||||
|
&& sha256sum gradle-7.5.1-bin.zip \
|
||||||
|
&& echo "f6b8596b10cce501591e92f229816aa4046424f3b24d771751b06779d58c8ec4 gradle-7.5.1-bin.zip" | sha256sum -c - \
|
||||||
|
&& unzip gradle-7.5.1-bin.zip -d ${GRADLE_ROOT} \
|
||||||
|
&& rm gradle-7.5.1-bin.zip
|
||||||
|
|
||||||
|
# Add the relevant directories to the $PATH.
|
||||||
|
ENV PATH=${PATH}:${GRADLE_ROOT}/gradle-7.5.1/bin
|
||||||
|
|
||||||
|
# Set the ${ANDROID_HOME} variable, so that the tools can find our installation.
|
||||||
|
# See https://developer.android.com/studio/command-line/variables#envar.
|
||||||
|
ENV ANDROID_HOME=${HOME}/opt/android-sdk
|
||||||
|
|
||||||
|
# Download and extract the command-line tools into ${ANDROID_HOME}.
|
||||||
|
RUN mkdir -p ${ANDROID_HOME}
|
||||||
|
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip \
|
||||||
|
-O commandlinetools-linux-8512546_latest.zip \
|
||||||
|
&& sha256sum commandlinetools-linux-8512546_latest.zip \
|
||||||
|
&& echo "2ccbda4302db862a28ada25aa7425d99dce9462046003c1714b059b5c47970d8 commandlinetools-linux-8512546_latest.zip" | sha256sum -c - \
|
||||||
|
&& unzip commandlinetools-linux-8512546_latest.zip -d ${ANDROID_HOME}/cmdline-tools \
|
||||||
|
&& rm commandlinetools-linux-8512546_latest.zip
|
||||||
|
|
||||||
|
# Add the relevant directories to the $PATH.
|
||||||
|
ENV PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/cmdline-tools/bin:${ANDROID_HOME}/platform-tools
|
||||||
|
|
||||||
|
RUN yes | sdkmanager --licenses \
|
||||||
|
&& sdkmanager --verbose \
|
||||||
|
"build-tools;30.0.3" \
|
||||||
|
"ndk;25.1.8937393" \
|
||||||
|
"platforms;android-33"
|
||||||
|
ENV NDK_HOME=${ANDROID_HOME}/ndk/25.1.8937393
|
||||||
|
|
||||||
|
# install rust tools
|
||||||
|
RUN curl https://sh.rustup.rs -sSf | \
|
||||||
|
sh -s -- --default-toolchain nightly -y
|
||||||
|
|
||||||
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
|
||||||
|
RUN rustup target add \
|
||||||
|
aarch64-linux-android \
|
||||||
|
armv7-linux-androideabi \
|
||||||
|
&& rustup toolchain install nightly \
|
||||||
|
&& rustup target add --toolchain nightly \
|
||||||
|
aarch64-linux-android \
|
||||||
|
armv7-linux-androideabi
|
||||||
|
|
||||||
|
ENV PATH="${PATH}:${NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin"
|
||||||
|
|
||||||
|
|
||||||
|
# install cargo tools
|
||||||
|
RUN cargo install cargo-ndk
|
||||||
|
|
||||||
|
COPY . /root
|
||||||
|
|
||||||
|
# Robonames
|
||||||
|
FROM base AS robonames
|
||||||
|
WORKDIR /root/robonames
|
||||||
|
|
||||||
|
# Robohash
|
||||||
|
FROM base AS robohash
|
||||||
|
WORKDIR /root/robohash
|
||||||
|
|
@ -3,3 +3,11 @@
|
|||||||
Crates to generate robot identities from a hex hash string. Implements the RoboSats nickname generator and the [RoboHash](https://github.com/e1ven/Robohash/) profile images by [e1ven](https://github.com/e1ven) and [kyco](https://github.com/kyco/robohash).
|
Crates to generate robot identities from a hex hash string. Implements the RoboSats nickname generator and the [RoboHash](https://github.com/e1ven/Robohash/) profile images by [e1ven](https://github.com/e1ven) and [kyco](https://github.com/kyco/robohash).
|
||||||
|
|
||||||
The goal is to build a compact WASM capable of generating robot avatars in the web frontend.
|
The goal is to build a compact WASM capable of generating robot avatars in the web frontend.
|
||||||
|
|
||||||
|
### 🛠️ Build libraries
|
||||||
|
|
||||||
|
```
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
Once the build process is done, you will find all libraries under the `./builds` folder.
|
26
docker-compose.yml
Normal file
26
docker-compose.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
version: '3.4'
|
||||||
|
|
||||||
|
services:
|
||||||
|
rust_wasm:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./robo-identities-wasm/Dockerfile
|
||||||
|
volumes:
|
||||||
|
- ./builds/wasm/:/app/robo-identities-wasm/pkg/:rw
|
||||||
|
command: wasm-pack build
|
||||||
|
rust_java_robonames:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./Dockerfile
|
||||||
|
target: robonames
|
||||||
|
volumes:
|
||||||
|
- ./builds/robonames/:/root/target/:rw
|
||||||
|
command: cargo ndk -t armeabi-v7a -t arm64-v8a -o ./target build --release
|
||||||
|
rust_java_robohash:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./Dockerfile
|
||||||
|
target: robohash
|
||||||
|
volumes:
|
||||||
|
- ./builds/robohash/:/root/target/:rw
|
||||||
|
command: cargo ndk -t armeabi-v7a -t arm64-v8a -o ./target build --release
|
22
robo-identities-wasm/Dockerfile
Normal file
22
robo-identities-wasm/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
FROM debian:testing-slim
|
||||||
|
|
||||||
|
# install common packages
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install --no-install-recommends -y \
|
||||||
|
ca-certificates curl file \
|
||||||
|
build-essential \
|
||||||
|
autoconf automake autotools-dev libtool xutils-dev && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# install Rust toolchain
|
||||||
|
RUN curl https://sh.rustup.rs -sSf | \
|
||||||
|
sh -s -- --default-toolchain nightly -y
|
||||||
|
|
||||||
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
|
||||||
|
# install depdendencies
|
||||||
|
RUN cargo install wasm-pack
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
WORKDIR /app/robo-identities-wasm
|
@ -29,6 +29,7 @@ strum = "0.25"
|
|||||||
strum_macros = "0.25"
|
strum_macros = "0.25"
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
imageproc = "0.23.0"
|
imageproc = "0.23.0"
|
||||||
|
prefer-dynamic = "0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
criterion = { version = "0.5.1", features = ["html_reports"] }
|
criterion = { version = "0.5.1", features = ["html_reports"] }
|
||||||
@ -36,3 +37,6 @@ criterion = { version = "0.5.1", features = ["html_reports"] }
|
|||||||
[[bench]]
|
[[bench]]
|
||||||
name = "benchmark"
|
name = "benchmark"
|
||||||
harness = false
|
harness = false
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["rlib", "dylib"]
|
||||||
|
@ -10,3 +10,7 @@ data-encoding = "2.4.0"
|
|||||||
num = "0.4.1"
|
num = "0.4.1"
|
||||||
ring = "0.16.20"
|
ring = "0.16.20"
|
||||||
sha2 = "0.10.1"
|
sha2 = "0.10.1"
|
||||||
|
prefer-dynamic = "0"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["rlib", "dylib"]
|
||||||
|
Reference in New Issue
Block a user