From f767a7a3631d51448461b0602c8cff03f88d2712 Mon Sep 17 00:00:00 2001 From: Alan O'Cull Date: Sat, 31 Aug 2024 11:49:34 -0400 Subject: [PATCH] Split installation and setup into separate scripts --- Makefile | 10 +++++++--- setup/install.sh | 20 ++++++++++++++++++++ setup/setup.sh | 22 ++-------------------- 3 files changed, 29 insertions(+), 23 deletions(-) create mode 100755 setup/install.sh diff --git a/Makefile b/Makefile index 8078e86..eb91fde 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,14 @@ -.PHONY: clean setup all +.PHONY: clean install setup all -all: clean setup +all: clean install setup clean: @rm -rf workspace/ +install: + @mkdir -p workspace/ + @./setup/install.sh Blender4.2 blender-4.2.1-linux-x64.tar.xz + setup: @mkdir -p workspace/ - @./setup/setup.sh Blender4.2 blender-4.2.1-linux-x64.tar.xz http://localhost:8080 + @./setup/setup.sh http://localhost:8080 diff --git a/setup/install.sh b/setup/install.sh new file mode 100755 index 0000000..ae68d79 --- /dev/null +++ b/setup/install.sh @@ -0,0 +1,20 @@ +TARBALL=$2 +DIRECTORY="workspace/${TARBALL%.tar.xz}" +BINARY=$DIRECTORY/blender +SCRIPTS=$(pwd)/setup +echo $TARBALL - $DIRECTORY - $BINARY - $SCRIPTS + +# Create directory for writing +mkdir -p workspace/ +# Ensure blender workspace does not exist +rm -rf workspace/$DIRECTORY/ + +# Download blender from URL and write it to workspacem and extract the tarball +wget https://download.blender.org/release/$1/$TARBALL -O workspace/$TARBALL +echo "Extracting $TARBALL..." +tar -xf workspace/$TARBALL -C workspace/ + +# Export binary location +export blender=workspace/$BINARY +echo "--- Please add the following location to your PATH:" +echo | whereis blender diff --git a/setup/setup.sh b/setup/setup.sh index b415590..a540bd3 100755 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -1,27 +1,9 @@ -TARBALL=$2 -DIRECTORY="workspace/${TARBALL%.tar.xz}" -BINARY=$DIRECTORY/blender SCRIPTS=$(pwd)/setup -HOST=$3 -echo $TARBALL - $DIRECTORY - $BINARY - $SCRIPTS - $HOST - -# Create directory for writing -mkdir -p workspace/ -# Ensure blender workspace does not exist -rm -rf workspace/$DIRECTORY/ - -# Download blender from URL and write it to workspacem and extract the tarball -wget https://download.blender.org/release/$1/$TARBALL -O workspace/$TARBALL -echo "Extracting $TARBALL..." -tar -xf workspace/$TARBALL -C workspace/ - -# Export binary location -export blender=workspace/$BINARY -echo | whereis blender +HOST=$1 # Download the extension from Flamenco and install it wget $HOST/flamenco-addon.zip -O workspace/flamenco-addon.zip blender --command extension install-file -r user_default -e workspace/flamenco-addon.zip # Finally, perform setup scripts -blender -b -P $SCRIPTS/setup.py +blender -b -P $SCRIPTS/setup.py \ No newline at end of file