Initial project scaffold for Dimma

This commit is contained in:
2026-06-10 20:53:30 +02:00
commit 64f55c81b0
17 changed files with 702 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
# Cross-platform build script for Dimma (PowerShell)
# Builds Odin app + Go updater for all platforms
$ErrorActionPreference = "Stop"
$PROJECT_DIR = Resolve-Path (Split-Path $PSScriptRoot -Parent)
$BUILD_DIR = "$PROJECT_DIR\build"
$ODIN_DIR = "$PROJECT_DIR\odin"
$GO_DIR = "$PROJECT_DIR\go"
New-Item -ItemType Directory -Force -Path $BUILD_DIR | Out-Null
# Build Go updater for all platforms
$GO_PLATFORMS = @(
@("linux", "amd64"),
@("linux", "arm64"),
@("darwin", "amd64"),
@("darwin", "arm64"),
@("windows", "amd64")
)
foreach ($platform in $GO_PLATFORMS) {
$os = $platform[0]
$arch = $platform[1]
Write-Host "Building Go updater for $os/$arch..."
Push-Location $GO_DIR
$env:GOOS = $os
$env:GOARCH = $arch
.\build.ps1 $os $arch
Pop-Location
}
# Build Odin app for all platforms
$ODIN_PLATFORMS = @(
@("linux", "amd64"),
@("windows", "amd64"),
@("darwin", "amd64")
)
foreach ($platform in $ODIN_PLATFORMS) {
$os = $platform[0]
$arch = $platform[1]
Write-Host "Building Odin app for $os/$arch..."
# odin build $ODIN_DIR\main.odin `
# -out:`$BUILD_DIR\dimma-$os-$arch.exe `
# -build-mode:exe `
# -target:. `
# -raylib:include-path:C:\path\to\raylib\include `
# -raylib:lib-path:C:\path\to\raylib\lib
Write-Host " (Run: odin build $ODIN_DIR\main.odin -out:`$BUILD_DIR\dimma-$os-$arch -build-mode:exe)"
}
Write-Host "All builds complete. Output in $BUILD_DIR"
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
# Cross-platform build script for Dimma
# Builds Odin app + Go updater for all platforms
set -e
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BUILD_DIR="$PROJECT_DIR/build"
ODIN_DIR="$PROJECT_DIR/odin"
GO_DIR="$PROJECT_DIR/go"
mkdir -p "$BUILD_DIR"
# Build Go updater for all platforms
GO_PLATFORMS=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64" "windows/amd64")
for platform in "${GO_PLATFORMS[@]}"; do
IFS='/' read -r os arch <<< "$platform"
echo "Building Go updater for $os/$arch..."
(cd "$GO_DIR" && GOOS=$os GOARCH=$arch ./build.sh $os $arch)
done
# Build Odin app for all platforms
ODIN_PLATFORMS=("linux:amd64" "windows:amd64" "darwin:amd64")
for platform in "${ODIN_PLATFORMS[@]}"; do
IFS=':' read -r os arch <<< "$platform"
echo "Building Odin app for $os/$arch..."
# odin build $ODIN_DIR/main.odin \
# -out:$BUILD_DIR/dimma-$os-$arch \
# -build-mode:exe \
# -target:. \
# -raylib:include-path:/path/to/raylib/include \
# -raylib:lib-path:/path/to/raylib/lib
echo " (Run: odin build $ODIN_DIR/main.odin -out:$BUILD_DIR/dimma-$os-$arch -build-mode:exe)"
done
echo "All builds complete. Output in $BUILD_DIR/"
+26
View File
@@ -0,0 +1,26 @@
# Run script for Dimma (PowerShell)
# Usage: .\run.ps1 [platform] [arch]
# Platform can be: linux, windows, darwin
# Default: auto-detects current platform
$PROJECT_DIR = Resolve-Path (Split-Path $PSScriptRoot -Parent)
$BUILD_DIR = "$PROJECT_DIR\build"
$PLATFORM = if ($args.Count -gt 0) { $args[0] } else { $env:GOOS }
$ARCH = if ($args.Count -gt 1) { $args[1] } else { $env:GOARCH }
if ($PLATFORM -eq "") { $PLATFORM = $IsWindows -as [string] ? "windows" : ($IsLinux -as [string] ? "linux" : "darwin") }
if ($ARCH -eq "") { $ARCH = $env:PROCESSOR_ARCHITEW6432 -replace "AMD64", "amd64" -replace "ARM64", "arm64" }
$BINARY = "$BUILD_DIR\dimma-$PLATFORM-$ARCH"
if ($PLATFORM -eq "windows") { $BINARY = "$BINARY.exe" }
if (-not (Test-Path $BINARY)) {
Write-Host "Binary not found: $BINARY"
Write-Host "Available binaries in $BUILD_DIR:"
Get-ChildItem $BUILD_DIR
exit 1
}
Write-Host "Running: $BINARY"
& $BINARY
Executable
+44
View File
@@ -0,0 +1,44 @@
#!/bin/bash
# Run script for Dimma
# Usage: ./run.sh [platform]
# Platform can be: linux, windows, darwin
# Default: auto-detects current platform
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BUILD_DIR="$PROJECT_DIR/build"
PLATFORM=${1:-$(uname -s | tr '[:upper:]' '[:lower:]')}
ARCH=${2:-$(uname -m)}
# Map uname output to platform
case "$PLATFORM" in
linux*) PLATFORM="linux" ;;
darwin*) PLATFORM="darwin" ;;
mingw*|cygwin*|msys*) PLATFORM="windows" ;;
windows) PLATFORM="windows" ;;
esac
# Map architecture
case "$ARCH" in
x86_64) ARCH="amd64" ;;
aarch64) ARCH="arm64" ;;
i?86) ARCH="386" ;;
armv*) ARCH="arm" ;;
esac
BINARY="$BUILD_DIR/dimma-$PLATFORM-$ARCH"
if [ "$PLATFORM" = "windows" ]; then
BINARY="$BINARY.exe"
fi
if [ ! -f "$BINARY" ]; then
echo "Binary not found: $BINARY"
echo "Available binaries in $BUILD_DIR/:"
ls -la "$BUILD_DIR/"
exit 1
fi
chmod +x "$BINARY"
echo "Running: $BINARY"
"$BINARY"