From 76c8907a4cac4ef1eb04acd343bf156356aa2aa3 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Fri, 15 Nov 2019 22:39:07 +0100 Subject: bitwarden_rs now builds. Hopefully just need to configure it now. --- mkosi.build | 57 +++++++++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 30 deletions(-) (limited to 'mkosi.build') diff --git a/mkosi.build b/mkosi.build index fce9cb7..347966e 100755 --- a/mkosi.build +++ b/mkosi.build @@ -1,46 +1,43 @@ #!/bin/sh -export RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.39.0 - DB=sqlite +export RUSTUP_HOME=/root/.rustup \ + CARGO_HOME=/root/.cargo \ + PATH=/root/.cargo/bin:$PATH \ + RUST_VERSION=1.39.0 \ + DB=postgresql \ VAULT_VERSION=v2.12.0 + +mkdir /root/src && cd /root/src git clone https://github.com/dani-garcia/bitwarden_rs.git -## build vault ## + + +## get vault ## mkdir /root/src/bitwarden_rs/web-vault cd /root/src/bitwarden_rs/web-vault curl -L https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz | tar xz -ls cd /root/src/bitwarden_rs + + ## Setting up rust for build ## -url="https://static.rust-lang.org/rustup/archive/1.20.2/x86_64-unknown-linux-gnu/rustup-init"; \ -wget "$url"; \ -echo "e68f193542c68ce83c449809d2cad262cc2bbb99640eb47c58fc1dc58cc30add *rustup-init" | sha256sum -c -; \ -chmod +x rustup-init; \ -./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION; \ -rm rustup-init; \ -chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ -rustup --version; \ -cargo --version; \ -rustc --version; \ -## building bitwarden_rs ## +wget "https://static.rust-lang.org/rustup/archive/1.20.2/x86_64-unknown-linux-gnu/rustup-init" +echo "e68f193542c68ce83c449809d2cad262cc2bbb99640eb47c58fc1dc58cc30add *rustup-init" | sha256sum -c - +chmod +x rustup-init +./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION +rm rustup-init +chmod -R a+w $RUSTUP_HOME $CARGO_HOME +rustup --version +cargo --version +rustc --version -cargo new --bin app -cd app -cp -r /root/src/bitwarden_rs/Cargo.* /root/src/bitwarden_rs/rust-toolchain /root/src/bitwarden_rs/build.rs . -cargo build --features $DB --release -#find . -not -path "./target*" -delete -touch src/main.rs -#cargo build --features $DB --release +## building bitwarden_rs ## + +cargo build --features postgresql --release -mkdir /root/src/bitwarden_built -cp /root/src/bitwarden_rs/Rocket.toml /root/src/bitwarden_built/. -cp -r /root/src/bitwarden_rs/web-vault /root/src/bitwarden_built/. -cp -r /root/src/bitwarden_rs/app /root/src/bitwarden_built/. -rm -rf /root/src/bitwarden_rs +## move stuff ## +mv web-vault ${DESTDIR}/ +mv target/release ${DESTDIR}/bitwarden_rs -- cgit v1.2.3