diff --git a/README.md b/README.md index 3b53363..85f1097 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# raspi demo for oled(ssd1306) - -in rust +# raspi demo for oled ssd1306 display ## Quick start -> docker pull ragnaroek/rust-raspberry:1.39.0 +> nix-shell > -> ./build.sh +> rustup target add arm-unknown-linux-musleabihf +> +> cargo build --release --target arm-unknown-linux-musleabihf Then scp the release file to your raspi. diff --git a/build.sh b/build.sh deleted file mode 100755 index 8b8ff6e..0000000 --- a/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/sh -docker run \ - --volume $PWD:/home/cross/project \ - --volume $HOME/.cargo/registry:/home/cross/.cargo/registry \ - ragnaroek/rust-raspberry:1.39.0 \ - build --release diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..eb954d4 --- /dev/null +++ b/shell.nix @@ -0,0 +1,7 @@ +with (import {}); +mkShell { + nativeBuildInputs = [ + pkgsCross.muslpi.stdenv.cc + ]; + CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER = "${pkgsCross.muslpi.stdenv.cc}/bin/armv6l-unknown-linux-musleabihf-ld"; +}