1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/vaultwarden_ynh.git synced 2024-09-03 18:26:31 +02:00

Merge pull request #11 from YunoHost-Apps/testing

Fix two rust toolchain
This commit is contained in:
yalh76 2019-08-23 20:27:18 +02:00 committed by GitHub
commit 501bf18eaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 7 deletions

View file

@ -6,7 +6,7 @@
"en": "Open source password management solutions.", "en": "Open source password management solutions.",
"fr": "Solutions de gestion de mots de passe open source." "fr": "Solutions de gestion de mots de passe open source."
}, },
"version": "1.9.1~ynh2", "version": "1.9.1~ynh3",
"url": "https://github.com/dani-garcia/bitwarden_rs", "url": "https://github.com/dani-garcia/bitwarden_rs",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"maintainer": { "maintainer": {

View file

@ -84,8 +84,11 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Setting up source files..." --weight=3 ynh_script_progression --message="Setting up source files..." --weight=3
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
# Download, check integrity, uncompress the source of bitwarden_rs from app.src to his build directory
ynh_setup_source --dest_dir="$final_path/build/" --source_id=app ynh_setup_source --dest_dir="$final_path/build/" --source_id=app
# Download, check integrity, uncompress and patch the source from web.src
ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id=web ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id=web
#================================================= #=================================================
@ -114,19 +117,22 @@ ynh_script_progression --message="Making install..." --weight=780
# Set right permissions # Set right permissions
chown -R "$app":"$app" $final_path chown -R "$app":"$app" $final_path
# Install # Install rustup with the toolchain needed by bitwarden_rs
pushd $final_path pushd $final_path
sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=nightly' sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=$(cat build/rust-toolchain)'
popd popd
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
# Compile bitwarden_rs
pushd $final_path/build pushd $final_path/build
sudo -u "$app" env PATH=$PATH cargo build --release sudo -u "$app" env PATH=$PATH cargo build --release
popd popd
# Install bitwarden_rs
cp -a $final_path/build/target/release/. $final_path/live/. cp -a $final_path/build/target/release/. $final_path/live/.
# Remove build files and rustup
ynh_secure_remove --file="$final_path/build" ynh_secure_remove --file="$final_path/build"
ynh_secure_remove --file="$final_path/.cargo" ynh_secure_remove --file="$final_path/.cargo"
ynh_secure_remove --file="$final_path/.rustup" ynh_secure_remove --file="$final_path/.rustup"

View file

@ -84,8 +84,10 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=6 ynh_script_progression --message="Upgrading source files..." --weight=6
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress the source of bitwarden_rs from app.src to his build directory
ynh_setup_source --dest_dir="$final_path/build/" --source_id=app ynh_setup_source --dest_dir="$final_path/build/" --source_id=app
# Download, check integrity, uncompress and patch the source from web.src
ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id=web ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id=web
fi fi
@ -124,19 +126,22 @@ chown -R "$app":"$app" $final_path
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
# Install # Install rustup with the toolchain needed by bitwarden_rs
pushd $final_path pushd $final_path
sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=nightly' sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=$(cat build/rust-toolchain)'
popd popd
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
# Compile bitwarden_rs
pushd $final_path/build pushd $final_path/build
sudo -u "$app" env PATH=$PATH cargo build --release sudo -u "$app" env PATH=$PATH cargo build --release
popd popd
# Install bitwarden_rs
cp -a $final_path/build/target/release/. $final_path/live/. cp -a $final_path/build/target/release/. $final_path/live/.
# Remove build files and rustup
ynh_secure_remove --file="$final_path/build" ynh_secure_remove --file="$final_path/build"
ynh_secure_remove --file="$final_path/.cargo" ynh_secure_remove --file="$final_path/.cargo"
ynh_secure_remove --file="$final_path/.rustup" ynh_secure_remove --file="$final_path/.rustup"