diff --git a/build/build_appimage.sh b/build/build_appimage.sh new file mode 100755 index 0000000..7414fd8 --- /dev/null +++ b/build/build_appimage.sh @@ -0,0 +1,65 @@ +#!/bin/bash +set -e + +echo "===== Building TrulyMEM AppImage =====" + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" +cd "$PROJECT_ROOT" +echo "Project root: $PROJECT_ROOT" + +APP_NAME="TrulyMEM" +APP_DIR="$PROJECT_ROOT/build/appimage-build" + +echo "Cleaning..." +rm -rf "$APP_DIR" dist/ build/trulymem/ 2>/dev/null || true + +# Step 1: Build with PyInstaller (uses icon from .spec) +echo "Step 1: PyInstaller build..." +python3 -m PyInstaller --clean build/trulymem.spec --noconfirm + +# Step 2: Prepare AppDir structure +echo "Step 2: Preparing AppDir..." +mkdir -p "$APP_DIR/usr/bin" +mkdir -p "$APP_DIR/usr/share/applications" +mkdir -p "$APP_DIR/usr/share/icons/hicolor/256x256/apps" + +cp "dist/$APP_NAME" "$APP_DIR/usr/bin/" +if [ -f "pic/image.png" ]; then + cp "pic/image.png" "$APP_DIR/usr/share/icons/hicolor/256x256/apps/${APP_NAME}.png" + cp "pic/image.png" "$APP_DIR/${APP_NAME}.png" +else + echo -n "" > "$APP_DIR/${APP_NAME}.png" +fi + +cat > "$APP_DIR/${APP_NAME}.desktop" < "$APP_DIR/AppRun" <<'APPRUN' +#!/bin/bash +HERE="$(dirname "$(readlink -f "$0")")" +exec "$HERE/usr/bin/TrulyMEM" "$@" +APPRUN +chmod +x "$APP_DIR/AppRun" + +# Step 3: Build AppImage (requires appimagetool) +echo "Step 3: Building AppImage..." +if command -v appimagetool &> /dev/null; then + appimagetool "$APP_DIR" "dist/${APP_NAME}.AppImage" + echo "AppImage: dist/${APP_NAME}.AppImage" + ls -la "dist/${APP_NAME}.AppImage" +else + echo "appimagetool not found. AppDir ready at: $APP_DIR" + echo "Install appimagetool and run: appimagetool '$APP_DIR' 'dist/${APP_NAME}.AppImage'" +fi + +echo "===== AppImage Build Complete =====" \ No newline at end of file diff --git a/build/build_linux.sh b/build/build_linux.sh new file mode 100755 index 0000000..86e035a --- /dev/null +++ b/build/build_linux.sh @@ -0,0 +1,37 @@ +#!/bin/bash +set -e + +echo "===== Building TrulyMEM for Linux =====" + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" +cd "$PROJECT_ROOT" +echo "Project root: $PROJECT_ROOT" + +if ! command -v python3 &> /dev/null; then + echo "Error: python3 not found"; exit 1 +fi + +VENV_DIR="$PROJECT_ROOT/.venv_build" +echo "Creating virtual environment: $VENV_DIR" +python3 -m venv "$VENV_DIR" +source "$VENV_DIR/bin/activate" +pip install --upgrade pip +pip install -r requirements.txt + +echo "Cleaning previous builds..." +rm -rf dist/ build/trulymem/ 2>/dev/null || true + +echo "================================" +echo "Building TrulyMEM (TUI + Web embedded)" +echo "================================" +python -m PyInstaller --clean build/trulymem.spec --noconfirm + +echo "================================" +echo "===== Build Complete =====" +echo "Binary: dist/TrulyMEM" +ls -la dist/ + +deactivate +rm -rf "$VENV_DIR" +echo "Build finished successfully!" \ No newline at end of file diff --git a/build/build_macos.sh b/build/build_macos.sh new file mode 100755 index 0000000..a1640fd --- /dev/null +++ b/build/build_macos.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -e + +echo "===== Building TrulyMEM for macOS =====" + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" +cd "$PROJECT_ROOT" +echo "Project root: $PROJECT_ROOT" + +if ! command -v python3 &> /dev/null; then + echo "Error: python3 not found"; exit 1 +fi + +VENV_DIR="$PROJECT_ROOT/.venv_build" +echo "Creating virtual environment: $VENV_DIR" +python3 -m venv "$VENV_DIR" +source "$VENV_DIR/bin/activate" +pip install --upgrade pip +pip install -r requirements.txt + +echo "Cleaning previous builds..." +rm -rf dist/ build/trulymem/ 2>/dev/null || true + +echo "================================" +echo "Building TrulyMEM (TUI + Web embedded)" +echo "================================" +python -m PyInstaller --clean build/trulymem.spec --noconfirm + +echo "================================" +echo "===== Build Complete =====" +echo "Binary: dist/TrulyMEM" +echo " -> run: open dist/TrulyMEM" +ls -la dist/ + +deactivate +rm -rf "$VENV_DIR" +echo "Build finished successfully!" \ No newline at end of file diff --git a/build/build_windows.bat b/build/build_windows.bat new file mode 100644 index 0000000..fa7b470 --- /dev/null +++ b/build/build_windows.bat @@ -0,0 +1,35 @@ +@echo off +setlocal enabledelayedexpansion + +echo ===== Building TrulyMEM for Windows ===== + +set "SCRIPT_DIR=%~dp0" +set "PROJECT_ROOT=%SCRIPT_DIR%.." +cd /d "%PROJECT_ROOT%" +echo Project root: %PROJECT_ROOT% + +echo Creating virtual environment: .venv_build +python -m venv .venv_build +call .venv_build\Scripts\activate.bat +pip install --upgrade pip +pip install -r requirements.txt + +echo Cleaning previous builds... +if exist dist rmdir /s /q dist +if exist build\trulymem rmdir /s /q build\trulymem + +echo ================================ +echo Building TrulyMEM (TUI + Web embedded) +echo ================================ +python -m PyInstaller --clean build\trulymem.spec --noconfirm + +echo ================================ +echo ===== Build Complete ===== +echo Binary: dist\TrulyMEM.exe +dir dist + +call .venv_build\Scripts\deactivate.bat +if exist .venv_build rmdir /s /q .venv_build + +echo Build finished successfully! +endlocal \ No newline at end of file diff --git a/build/trulymem.spec b/build/trulymem.spec index 72bc37d..0b7b050 100644 --- a/build/trulymem.spec +++ b/build/trulymem.spec @@ -83,6 +83,7 @@ exe = EXE( a.datas, [], name='TrulyMEM', + icon='pic/TrulyMEM.ico', debug=False, bootloader_ignore_signals=False, strip=False,