Split installation and setup into separate scripts

This commit is contained in:
Alan O'Cull 2024-08-31 11:49:34 -04:00
parent d984752286
commit f767a7a363
3 changed files with 29 additions and 23 deletions

View File

@ -1,10 +1,14 @@
.PHONY: clean setup all .PHONY: clean install setup all
all: clean setup all: clean install setup
clean: clean:
@rm -rf workspace/ @rm -rf workspace/
install:
@mkdir -p workspace/
@./setup/install.sh Blender4.2 blender-4.2.1-linux-x64.tar.xz
setup: setup:
@mkdir -p workspace/ @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

20
setup/install.sh Executable file
View File

@ -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

View File

@ -1,27 +1,9 @@
TARBALL=$2
DIRECTORY="workspace/${TARBALL%.tar.xz}"
BINARY=$DIRECTORY/blender
SCRIPTS=$(pwd)/setup SCRIPTS=$(pwd)/setup
HOST=$3 HOST=$1
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
# Download the extension from Flamenco and install it # Download the extension from Flamenco and install it
wget $HOST/flamenco-addon.zip -O workspace/flamenco-addon.zip wget $HOST/flamenco-addon.zip -O workspace/flamenco-addon.zip
blender --command extension install-file -r user_default -e workspace/flamenco-addon.zip blender --command extension install-file -r user_default -e workspace/flamenco-addon.zip
# Finally, perform setup scripts # Finally, perform setup scripts
blender -b -P $SCRIPTS/setup.py blender -b -P $SCRIPTS/setup.py