From 06913a521765c510419a1080ad19a8529008322b Mon Sep 17 00:00:00 2001 From: bdnugget Date: Sun, 19 Jan 2025 22:50:50 +0100 Subject: [PATCH] Update buildscript and readme --- README.md | 55 ++++++++++++++++++++++++++++++++++++++---------- scripts/build.sh | 7 +----- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 2b3db5a..9f9a03d 100644 --- a/README.md +++ b/README.md @@ -16,24 +16,57 @@ A multiplayer isometric game inspired by Oldschool RuneScape, built with Go and ## Prerequisites - Go 1.23 or higher +- GCC (for CGO/SQLite support) +- OpenGL development libraries - Raylib dependencies (see [raylib-go](https://github.com/gen2brain/raylib-go#requirements)) ## Installation -1. Clone the repository: +### Pre-built Binaries +The easiest way to get started is to download the latest release from: +``` +https://gitea.boner.be/bdnugget/goonscape/releases +``` +Choose the appropriate zip file for your platform: +- Windows: `goonscape-windows-amd64-v1.1.0.zip` +- Linux: `goonscape-linux-amd64-v1.1.0.zip` + +Extract the zip and run the executable. + +### Quick Start +For development: +```bash +# Run directly (recommended for development) +go run main.go + +# Run with local server +go run main.go -local +``` + +### Server Setup +The server requires CGO for SQLite support: +```bash +# Enable CGO +go env -w CGO_ENABLED=1 + +# Clone and build server +git clone https://gitea.boner.be/bdnugget/goonserver.git +cd goonserver +go build +``` + +### Client Installation +Then install or build: +```bash +# Install the client +go install gitea.boner.be/bdnugget/goonscape@latest +``` + +Or build from source: ```bash git clone https://gitea.boner.be/bdnugget/goonscape.git cd goonscape -``` - -2. Install dependencies: -```bash -go mod tidy -``` - -3. Build and run: -```bash -go run main.go +go build ``` ## Controls diff --git a/scripts/build.sh b/scripts/build.sh index 6174784..4d028a8 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -6,12 +6,7 @@ build() { local arch=$2 local output=$3 - # Set CGO flags for static linking - export CGO_ENABLED=1 - export GOOS=$os - export GOARCH=$arch - - # Platform specific flags + if [ "$os" = "windows" ]; then export CC=x86_64-w64-mingw32-gcc export CXX=x86_64-w64-mingw32-g++