- Install script
This commit is contained in:
Tony Bark 2025-05-07 00:53:34 -04:00
parent 7ccd4a14ac
commit b01f83f93e
4 changed files with 63 additions and 2 deletions

3
.gitignore vendored
View file

@ -543,4 +543,5 @@ FodyWeavers.xsd
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
*.glb
*.glyb
dist/**

View file

@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>glyph</AssemblyName>
<Nullable>enable</Nullable>
<Version>0.1.100</Version>
<Version>0.1.105</Version>
</PropertyGroup>
<ItemGroup>

33
Makefile Normal file
View file

@ -0,0 +1,33 @@
# Makefile for building and packaging the Sims 2 .s2pk CLI tool
APP_NAME = glyph
CONFIGURATION = Release
RUNTIME_LINUX = linux-x64
RUNTIME_MAC = osx-x64
OUTPUT_DIR = ./dist
APPIMAGE_DIR = ./AppDir
.PHONY: all clean build-linux build-mac build-appimage package-linux package-mac package-appimage
all: build-linux build-mac package-linux package-mac
clean:
rm -rf bin obj $(OUTPUT_DIR)
build-linux:
dotnet publish -c $(CONFIGURATION) -r $(RUNTIME_LINUX) --self-contained true /p:PublishSingleFile=true -o $(OUTPUT_DIR)/$(APP_NAME)-linux
build-appimage:
dotnet publish -c $(CONFIGURATION) -r $(RUNTIME_LINUX) --self-contained true /p:PublishSingleFile=true -o $(APPIMAGE_DIR)/usr/bin
build-mac:
dotnet publish -c $(CONFIGURATION) -r $(RUNTIME_MAC) --self-contained true /p:PublishSingleFile=true -o $(OUTPUT_DIR)/$(APP_NAME)-mac
package-linux:
tar -czvf $(OUTPUT_DIR)/$(APP_NAME)-linux.tar.gz -C $(OUTPUT_DIR)/$(APP_NAME)-linux .
package-mac:
tar -czvf $(OUTPUT_DIR)/$(APP_NAME)-mac.tar.gz -C $(OUTPUT_DIR)/$(APP_NAME)-mac .
package-appimage:
appimage-builder

27
install.sh Normal file
View file

@ -0,0 +1,27 @@
#!/bin/bash
# Install glyph locally for current user (no sudo)
# Usage: ./install.sh ./dist/glyph-linux/glyph
set -e
SOURCE_BIN="$1"
INSTALL_DIR="$HOME/.local/bin"
TARGET="$INSTALL_DIR/glyph"
if [[ ! -x "$SOURCE_BIN" ]]; then
echo "❌ Error: Provide a valid built glyph binary as the first argument."
exit 1
fi
mkdir -p "$INSTALL_DIR"
cp "$SOURCE_BIN" "$TARGET"
chmod +x "$TARGET"
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
echo "⚠️ $INSTALL_DIR is not in your PATH. Consider adding this to your shell profile:"
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
else
echo "✅ Installed glyph to $TARGET"
echo "Run 'glyph --help' to get started."
fi