diff --git a/.gitignore b/.gitignore index b0876d7..a2517d8 100644 --- a/.gitignore +++ b/.gitignore @@ -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/** diff --git a/Glyph.csproj b/Glyph.csproj index b0278aa..319880a 100644 --- a/Glyph.csproj +++ b/Glyph.csproj @@ -6,7 +6,7 @@ enable glyph enable - 0.1.100 + 0.1.105 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5aba551 --- /dev/null +++ b/Makefile @@ -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 diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..0cb36bd --- /dev/null +++ b/install.sh @@ -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