Skip to content

Commit

Permalink
cleaned up installer
Browse files Browse the repository at this point in the history
Former-commit-id: d05f36a
  • Loading branch information
oskarsh committed Feb 17, 2023
1 parent b2a9828 commit 1e7219e
Show file tree
Hide file tree
Showing 12 changed files with 184 additions and 15 deletions.
15 changes: 0 additions & 15 deletions Installer/GNU/temp/GnuInstaller.sh

This file was deleted.

Binary file removed Installer/icon.ico
Binary file not shown.
75 changes: 75 additions & 0 deletions Packaging/GNU/compileAndBuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# GNU BUILD SCRIPT

project=Reach
version=1.5
xmlFile=Reach
workspace=/home/iso/Development/Reach

build_standalone=0
build_plugin=1
build_installer=1

hise_path=/home/iso/Development/HISE/projects/standalone/Builds/LinuxMakefile/build/HISE\ Standalone
projucer_path=/home/iso/Development/HISE/tools/projucer/Projucer
makeself=/media/john/SHARED/makeself

#Create temp directory for packaging
package="$workspace"/Packaging/GNU/temp
mkdir -p "$package"

mkdir -p "$workspace"/Binaries
cd "$workspace"/Binaries

# STEP 1: BUILDING THE BINARIES
# ====================================================================
if (($build_standalone == 1 || $build_plugin == 1))
then

"$hise_path" set_project_folder -p:"$workspace"
"$hise_path" set_version -v:$version

echo Making the Projucer accessible for this project
chmod +x "$projucer_path"

if (($build_standalone==1))
then
echo Building the standalone app
"$hise_path" clean -p:"$workspace" --all
"$hise_path" export_ci XmlPresetBackups/$xmlFile.xml -t:standalone -a:x64
chmod +x "$workspace"/Binaries/batchCompileLinux.sh
sh "$workspace"/Binaries/batchCompileLinux.sh
cp "$workspace"/Binaries/Builds/LinuxMakefile/build/"$project" "$package"
fi

if (($build_plugin==1))
then
echo Building the plugins
"$hise_path" clean -p:"$workspace" --all
"$hise_path" export_ci XmlPresetBackups/$xmlFile.xml -t:instrument -p:VST -a:x64
chmod +x "$workspace"/Binaries/batchCompileLinux.sh
sh "$workspace"/Binaries/batchCompileLinux.sh
cp "$workspace"/Binaries/Builds/LinuxMakefile/build/"$project".so "$package"
fi
fi

# STEP 2: BUILDING INSTALLER
# ====================================================================

if (($build_installer==1))
then
echo "Build Installer"

mkdir -p "$workspace"/Installer
cp "$workspace"/License.txt "$package"
cp "$workspace"/Packaging/GNU/GNUInstaller.sh "$package"

#Run makeself
sh "$makeself"/makeself.sh --license "$workspace"/License.txt "$workspace"/Packaging/GNU/temp "$workspace"/Installer/"$project"\ $version.sh "$project" ./GNUInstaller.sh

else
echo "Skip Building Installer"
fi

echo Cleanup
cd "$workspace"
rm -rf "$workspace"/Packaging/GNU/temp
109 changes: 109 additions & 0 deletions Packaging/GNU/reach-installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!/bin/bash -eu

#
# Description: Installs Sinuslabs Plugins
# Author: Oskar Schachtschneider - [email protected]
#

if [ "$BASH_VERSION" = '' ]; then
echo "Please run the installer by using ./reach-installer.sh"
./reach-installer.sh
exit
fi

cat << "EOF"
##### ### # # # # ##### # # ###### #####
# # # ## # # # # # # # # # # # #
# # # # # # # # # # # # # #
##### # # # # # # ##### # # # ###### #####
# # # # # # # # # ####### # # #
# # # # ## # # # # # # # # # # #
##### ### # # ##### ##### ####### # # ###### #####
EOF

HOME=eval echo ~$USER &>/dev/null
PLUGIN_NAME="Reach"
PLUGIN="Reach.vst3"
PLUGIN_SO=$PLUGIN_NAME/Contents/x86_64-linux/Reach.so
DEFAULT_PLUGIN_PATH=$HOME/.vst3/

# installs the plugin into the provided path
# if the path does not exist it prompts to create it
copy_file_with_confirmation() {
local path=$1

if [ ! -d "$path" ]; then
read -p "Directory $path does not exist, create it? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
mkdir -p "$path"
else
return
fi
fi

cp -r "$PLUGIN" "$path"
if [ $? -eq 0 ]; then
echo "Sinuslabs data can be found unter $HOME/.config/Sinuslabs/ (created on first Plugin start)"
echo
echo "Successfully installed $PLUGIN into $path"
echo
echo SINUSLABS
echo "from Berlin with <3"
echo
else
echo
echo "Error while installing $PLUGIN_NAME"
echo
fi
}

check_compatibility() {
if ldd plugin.so 2>&1 | grep -q 'not found'; then
echo "Missing required dependencies"
exit 1
fi
if ! (ldconfig -p | grep -q 'libcurl.so.4'); then
echo "Missing libcurl4. Install it using your package manager and rerun the installer."
exit 1
fi
}

choose_installation() {
check_compatibility
echo
echo Please choose a installation method
echo "Default -> $DEFAULT_PLUGIN_PATH"
echo
select option in Default Custom Quit; do
case "$option" in
"Default")
echo
echo
copy_file_with_confirmation $DEFAULT_PLUGIN_PATH
break ;;
"Custom")
echo
read -p "Please enter a directory: " -i "$HOME/" -e custom_path
echo
copy_file_with_confirmation $custom_path
break ;;
"Quit") exit ;;
esac
done
}
cat license.txt
echo
echo
read -p "I have read and accept the terms and conditions? (y/n) " -n 1 -r
echo


if [[ $REPLY =~ ^[Yy]$ ]]; then
choose_installation
else
echo Exiting...
exit
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1e7219e

Please sign in to comment.