diff --git a/cryptoki-sys/Containerfile b/cryptoki-sys/Containerfile new file mode 100644 index 00000000..0add10a7 --- /dev/null +++ b/cryptoki-sys/Containerfile @@ -0,0 +1,17 @@ +# Simple ubuntu container that can be used to regenerate bindings with the provided script +# when one does not use ubuntu +# +# Instructions: +# $ podman build -t rust-cryptoki . +# $ podman run -v $PWD:/src:z rust-cryptoki +# +FROM ubuntu:latest +RUN export DEBIAN_FRONTEND=noninteractive; \ + export DEBCONF_NONINTERACTIVE_SEEN=true; \ + echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \ + echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \ + apt-get update -q && apt-get install -y rustup clang && rustup default stable + +WORKDIR /src +ENV CARGO_TARGET_DIR /src/target +CMD [ "/bin/bash", "regenerate_bindings.sh" ] diff --git a/cryptoki-sys/README.md b/cryptoki-sys/README.md index 083c5dff..b0c5de90 100644 --- a/cryptoki-sys/README.md +++ b/cryptoki-sys/README.md @@ -20,4 +20,22 @@ available, feel free to raise a Pull Request to add it or to use build-time generation of bindings. All the committed bindings **MUST** be generated from the library version found under the `vendor` submodule. +## Generate bindings in container + +To simplify generating bindings, we provide a simple container that ca be +executed regardless of the operating system in use from the `cryptoki-sys` +directory. + +To generate the bindings in container, just build the container from the +`Containerfile` in this directory: +``` +$ podman build -t rust-cryptoki . +``` +And then run it with the current working directory mounted in the container: +``` +$ podman run -v $PWD:/src:z rust-cryptoki +``` +It will download all the rust dependencies and regenerate all the binding +tiplets. + *Copyright 2021 Contributors to the Parsec project.*