diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9c8dfb..ea5978c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,20 +22,22 @@ jobs: - name: Build project run: | # Test that the project builds correctly + cd gpl-release make clean || true - make all + make - name: Verify executables run: | # Check that executables were created - ls -la conquer conqrun - file conquer conqrun + cd gpl-release + ls -la conquer conqrun conqsort conqps + file conquer conqrun conqsort conqps - name: Basic functionality test run: | # Test that executables can run (help/version) - ./conquer -h || echo "conquer help test completed" - ./conqrun -h || echo "conqrun help test completed" + ./gpl-release/conquer -h || echo "conquer help test completed" + ./gpl-release/conqrun -h || echo "conqrun help test completed" package-apk: name: Build APK Package (Alpine/Melange) @@ -117,7 +119,7 @@ jobs: dpkg-deb --contents "$DEB_FILE" | head -20 fi - - name: Upload DEB artifacts + - name: Upload DEB atrifacts uses: actions/upload-artifact@v4 if: github.ref == 'refs/heads/master' with: diff --git a/README.md b/README.md index 90518ea..8669438 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,6 @@ **Conquer** is the classic multi-player strategy game originally created by Edward M. Barlow and Adam Bryant in the late 1980s. This repository preserves both the historical distribution and provides a modern GPL-licensed version for continued development. -## 🗺️ Special Recognition: Richard Caley's Map Utility - -This repository includes a significant historical contribution: **Richard Caley's map drawing utility** from 1989. Richard Caley, a researcher at the University of Edinburgh's Centre for Speech Technology Research and contributor to the Festival Speech Synthesis System, created a bitmap visualization tool for Conquer game worlds. - -His work represents an early example of game data visualization, created with the generous spirit typical of the late 1980s Unix computing community. Richard wrote: *"You may copy, distribute, modify or do what you will with this code"* - embodying the collaborative ethos that shaped early computer gaming. - -**📖 Learn more about Richard Caley's contributions**: See [`richard-caley-utilities/`](richard-caley-utilities/) for detailed biographical information, technical context, and links to his archived research and personal materials. - -*Richard Caley passed away in 2006. This code is preserved in his memory and as a testament to the early Unix gaming community's collaborative spirit.* - ## Relicensing Achievement This repository represents a successful **15-year relicensing effort** (2006-2025) that transformed Conquer from a restrictively licensed game into a modern GPL v3 project. All original copyright holders provided explicit written permission: @@ -61,6 +51,16 @@ This repository uses a dual-licensing approach to balance historical preservatio - **[`LICENSES/`](LICENSES/)** - All license texts for REUSE compliance - **[`LICENSE-NOTICE.md`](LICENSE-NOTICE.md)** - Comprehensive licensing framework explanation +## 🗺️ Special Recognition: Richard Caley's Map Utility + +This repository includes a significant historical contribution: **Richard Caley's map drawing utility** from 1989. Richard Caley, a researcher at the University of Edinburgh's Centre for Speech Technology Research and contributor to the Festival Speech Synthesis System, created a bitmap visualization tool for Conquer game worlds. + +His work represents an early example of game data visualization, created with the generous spirit typical of the late 1980s Unix computing community. Richard wrote: *"You may copy, distribute, modify or do what you will with this code"* - embodying the collaborative ethos that shaped early computer gaming. + +**📖 Learn more about Richard Caley's contributions**: See [`richard-caley-utilities/`](richard-caley-utilities/) for detailed biographical information, technical context, and links to his archived research and personal materials. + +*Richard Caley passed away in 2006. This code is preserved in his memory and as a testament to the early Unix gaming community's collaborative spirit.* + ## Quick Start ### Playing the Game @@ -138,4 +138,4 @@ The generous code-sharing philosophy of contributors like Richard Caley helped e **🎮 Ready to conquer?** Start with [`gpl-release/`](gpl-release/) for the modern experience, or explore [`original/`](original/) for historical gaming archaeology. -**📖 Learn about the people behind the code:** Visit [`richard-caley-utilities/`](richard-caley-utilities/) to discover the fascinating individuals who created this classic game. \ No newline at end of file +**📖 Learn about the people behind the code:** Visit [`richard-caley-utilities/`](richard-caley-utilities/) to discover the fascinating individuals who created this classic game. diff --git a/packaging/melange/melange.yaml b/packaging/melange/melange.yaml deleted file mode 100644 index a9a7ac9..0000000 --- a/packaging/melange/melange.yaml +++ /dev/null @@ -1,123 +0,0 @@ -package: - name: conquer - version: 4.12 - epoch: 0 - description: "Classic multi-player strategy game" - url: https://github.com/vejeta/conquer - copyright: - - license: GPL-3.0-or-later - paths: - - "*" - dependencies: - runtime: - - ncurses - - ncurses-terminfo-base - -environment: - contents: - repositories: - - https://dl-cdn.alpinelinux.org/alpine/edge/main - - https://dl-cdn.alpinelinux.org/alpine/edge/community - packages: - - alpine-baselayout-data - - busybox - - build-base - - ncurses-dev - - make - - sed - - coreutils - - pkgconfig - - gcc - - libc-dev - -pipeline: - - uses: git-checkout - with: - repository: https://github.com/vejeta/conquer - destination: /home/build/conquer - - - name: "Fix Makefile for correct paths" - runs: | - cd /home/build/conquer/gpl-release - echo "=== ConquerV5 Build Process (in gpl-release/) ===" - echo "=== Fixing Makefile paths ===" - - # Show current CDEFS - echo "Original CDEFS:" - grep -n "CDEFS" Makefile | head -3 - - # Create a backup - cp Makefile Makefile.backup - - # Fix the CDEFS line in the Makefile itself (more reliable than command line override) - sed -i 's|CDEFS = -DDEFAULTDIR=\\"$(DEFAULT)\\" -DEXEDIR=\\"$(EXEDIR)\\"|CDEFS = -DDEFAULTDIR=\\"/usr/lib/conquer\\" -DEXEDIR=\\"/usr/bin\\"|g' Makefile - - # Also ensure we don't have the comment line blocking this - sed -i 's|^#CDEFS = -DDEFAULTDIR=\\"$(DEFAULT)\\" -DEXEDIR=\\"$(EXEDIR)\\"|CDEFS = -DDEFAULTDIR=\\"/usr/lib/conquer\\" -DEXEDIR=\\"/usr/bin\\"|g' Makefile - - echo "Fixed CDEFS:" - grep -n "CDEFS.*usr/lib" Makefile - - - name: "Build with corrected Makefile" - runs: | - cd /home/build/conquer - echo "=== Building with Makefile's own CDEFS ===" - - export LEGACY_CFLAGS="-std=gnu99 -D_GNU_SOURCE -Wno-implicit-function-declaration -Wno-incompatible-pointer-types -Wno-implicit-int -Wno-return-type -Wno-old-style-definition -Wno-unused-variable -Wno-unused-function -Wno-format" - - make clean || true - - # Build using the Makefile's fixed CDEFS (don't override on command line) - make all OPTFLG="$LEGACY_CFLAGS" - - echo "=== Verifying paths in binaries ===" - for exe in conquer conqrun; do - if [ -x "./$exe" ]; then - echo "Built: $exe" - if strings $exe | grep -q "/usr/lib/conquer"; then - echo "✓ Correct runtime path found" - else - echo "⚠ Path check results:" - strings $exe | grep -E "(lib/conquer|home/build)" | head -2 - fi - else - echo "Failed to build: $exe" - exit 1 - fi - done - - - name: "Install Conquer" - runs: | - cd /home/build/conquer/gpl-release - - mkdir -p ${{targets.destdir}}/usr/bin - mkdir -p ${{targets.destdir}}/usr/lib/conquer - mkdir -p ${{targets.destdir}}/usr/share/licenses/conquer - - # Install executables - install -m 755 conquer ${{targets.destdir}}/usr/bin/ - install -m 755 conqrun ${{targets.destdir}}/usr/bin/ - - for exe in conqsort conqps; do - if [ -x "$exe" ]; then - install -m 755 "$exe" ${{targets.destdir}}/usr/bin/ - fi - done - - # Install help files - for i in 0 1 2 3 4 5; do - if [ -f "help$i" ]; then - install -m 644 "help$i" ${{targets.destdir}}/usr/lib/conquer/ - fi - done - - # Install game data files directly - install -m 644 nations ${{targets.destdir}}/usr/lib/conquer/nations - install -m 644 rules ${{targets.destdir}}/usr/lib/conquer/rules - - # Install license - if [ -f "COPYING" ]; then - install -m 644 COPYING ${{targets.destdir}}/usr/share/licenses/conquer/COPYING - fi - - - uses: strip diff --git a/packaging/melange/melange.yaml.template b/packaging/melange/melange.yaml.template new file mode 100644 index 0000000..9fdbd15 --- /dev/null +++ b/packaging/melange/melange.yaml.template @@ -0,0 +1,73 @@ +package: + name: conquer + version: PLACEHOLDER_VERSION + epoch: 0 + description: "Classic ncurses multiplayer fantasy war game" + url: https://github.com/vejeta/conquer + copyright: + - license: GPL-3.0-or-later + + dependencies: + runtime: + - ncurses + - ncurses-terminfo-base + +environment: + contents: + repositories: + - https://dl-cdn.alpinelinux.org/alpine/edge/main + - https://dl-cdn.alpinelinux.org/alpine/edge/community + packages: + - build-base + - ncurses-dev + - make + - sed + - coreutils + - pkgconfig + - gcc + - libc-dev + - alpine-baselayout-data + - busybox + +pipeline: + - uses: fetch + with: + uri: file:///staged/conquer.tar.gz + extract: true + expected-sha256: PLACEHOLDER_SHA256 + + - runs: | + echo "🗡️ Entering the battlefield… compiling Conquer!" + sed -i 's|CDEFS = -DDEFAULTDIR=\\"$(DEFAULT)\\"|CDEFS = -DDEFAULTDIR=\\"/usr/lib/conquer\\"|g' Makefile + make all OPTFLG="-std=gnu99 -D_GNU_SOURCE" + + mkdir -p ${{targets.destdir}}/usr/bin + mkdir -p ${{targets.destdir}}/usr/lib/conquer + mkdir -p ${{targets.destdir}}/usr/share/licenses/conquer + + install -m 755 conquer conqrun ${{targets.destdir}}/usr/bin/ + install -m 644 nations rules ${{targets.destdir}}/usr/lib/conquer/ + + for exe in conqsort conqps; do + if [ -x "$exe" ]; then + install -m 755 "$exe" ${{targets.destdir}}/usr/bin/ + fi + done + + for i in 0 1 2 3 4 5; do + [ -f "help$i" ] && install -m 644 "help$i" ${{targets.destdir}}/usr/lib/conquer/ + done + + # Install game data files directly + install -m 644 nations ${{targets.destdir}}/usr/lib/conquer/nations + install -m 644 rules ${{targets.destdir}}/usr/lib/conquer/rules + + # Install license + if [ -f "COPYING" ]; then + install -m 644 COPYING ${{targets.destdir}}/usr/share/licenses/conquer/COPYING + fi + + + echo "⚔️ Conquer compilation complete!" + + - uses: strip diff --git a/scripts/build-melange.sh b/scripts/build-melange.sh index f19a1c4..b9dc898 100755 --- a/scripts/build-melange.sh +++ b/scripts/build-melange.sh @@ -1,63 +1,87 @@ #!/bin/bash -# ConquerV5 Melange package build script - using local copy approach - set -e -# Get the directory containing this script +echo "🏰 Sir Chapi reporting for duty… preparing the Conquer build!" + SCRIPT_DIR="$(dirname "$0")" -# Get the repo root (parent of scripts directory) REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +cd "$REPO_ROOT" -echo "Script directory: $SCRIPT_DIR" -echo "Repository root: $REPO_ROOT" +# ------------------------- +# Configuration +# ------------------------- +VERSION=4.12 +BUILD_DIR="$REPO_ROOT/build" +TARBALL="$BUILD_DIR/conquer.tar.gz" +MELANGE_YAML="$BUILD_DIR/melange.yaml" +OUT_DIR="$PWD/packages/alpine/conquer-${VERSION}" -# Change to repo root directory -cd "$REPO_ROOT" +# Clean old build artifacts +rm -rf "$BUILD_DIR" +mkdir -p "$BUILD_DIR" -# Ensure we have the melange configuration -if [ ! -f "packaging/melange/melange.yaml" ]; then - echo "Error: melange.yaml not found in packaging/melange/" - exit 1 -fi +# ------------------------- +# Create tarball of source (content-only) +# ------------------------- +echo "📦 Packing source files into a tarball…" +tar -C "$REPO_ROOT/gpl-release" -czf "$TARBALL" . -# Verify gpl-release directory exists -if [ ! -d "gpl-release" ]; then - echo "Error: gpl-release directory not found in repo root" - echo "Contents of repo root:" - ls -la - exit 1 -fi +# ------------------------- +# Compute SHA256 +# ------------------------- +SHA256=$(sha256sum "$TARBALL" | awk '{print $1}') +echo "🔒 Calculated SHA256: $SHA256" -# Create packages directory -mkdir -p packages/alpine +# ------------------------- +# Generate final YAML +# ------------------------- +sed -e "s/PLACEHOLDER_SHA256/$SHA256/" \ + -e "s/PLACEHOLDER_VERSION/$VERSION/" \ + "$REPO_ROOT/packaging/melange/melange.yaml.template" > "$MELANGE_YAML" -echo "=== Building ConquerV5 APK package with Melange ===" +# ------------------------- +# Run Melange +# ------------------------- +echo "🏗️ Building Conquer ${VERSION}… sharpening swords and compiling code!" +docker run --privileged --rm \ + -v "$BUILD_DIR":/staged:ro \ + -v "$OUT_DIR":/out \ + cgr.dev/chainguard/melange build \ + --arch=x86_64 \ + --out-dir=/out \ + /staged/$(basename "$MELANGE_YAML") -# Install melange if not available -if ! command -v melange &> /dev/null; then - echo "Installing melange..." - # Using Docker with melange - docker run --privileged --rm -v "$PWD":/work -w /work \ - cgr.dev/chainguard/melange build packaging/melange/melange.yaml --arch x86_64 +# =============================== +# 🛡️ Generate Checksums +# =============================== +echo "🛡️ Generating checksums for artifacts…" +# Detect if running in GitHub Actions +if [ -n "$GITHUB_WORKSPACE" ]; then + # Safer location inside CI + CHECKSUM_DIR="$GITHUB_WORKSPACE/checksums" else - # Use local melange installation - melange build \ - --arch=x86_64 \ - --out-dir=packages/alpine \ - packaging/melange/melange.yaml + # Local builds: put checksums alongside packages + CHECKSUM_DIR="$OUT_DIR" fi -echo "=== APK package built successfully! ===" -echo "Package location: packages/alpine/" -ls -la packages/alpine/ +mkdir -p "$CHECKSUM_DIR" -# Verify the package was created -APK_COUNT=$(find packages/alpine/ -name "*.apk" | wc -l) -if [ "$APK_COUNT" -eq 0 ]; then - echo "ERROR: No APK packages were created!" - exit 1 -fi +# Generate checksums for all built APKs +find "$OUT_DIR" -type f -name "*.apk" -exec sha256sum {} \; > "$CHECKSUM_DIR/checksums.txt" + +echo "✅ Checksums written to: $CHECKSUM_DIR/checksums.txt" + + +# ------------------------- +# Cleanup temporary files +# ------------------------- +echo "🧹 Cleaning up temporary build files…" +rm -f "$MELANGE_YAML" "$TARBALL" -echo "✅ Found $APK_COUNT APK package(s)" -find packages/alpine/ -name "*.apk" -exec ls -lh {} \; +# ------------------------- +# Victory! +# ------------------------- +echo "🏁 Package built successfully in $OUT_DIR" +ls -la "$OUT_DIR" +echo "🎉 All glory to Sir Chapi!" diff --git a/scripts/test-alpine.sh b/scripts/test-alpine.sh index 33228fd..b2f6362 100755 --- a/scripts/test-alpine.sh +++ b/scripts/test-alpine.sh @@ -4,22 +4,22 @@ # Packages should be in packages/x86_64/ after running build-melange.sh # Check if package exists -if [ ! -f packages/x86_64/conquer-4.12-r0.apk ]; then - echo "Error: Package not found at packages/x86_64/conquer-4.12-r0.apk" +if [ ! -f packages/alpine/x86_64/conquer-4.12-r0.apk ]; then + echo "Error: Package not found at packages/alpine/x86_64/conquer-4.12-r0.apk" echo "Please run scripts/build-melange.sh first" echo "" echo "Available packages:" - ls -la packages/x86_64/ 2>/dev/null || echo "packages/x86_64/ directory doesn't exist" + ls -la packages/alpine/x86_64/ 2>/dev/null ||co echo "packages/alpine/x86_64/ directory doesn't exist" exit 1 fi -echo "Found package: packages/x86_64/conquer-4.12-r0.apk" +echo "Found package: packages/alpine/x86_64/conquer-4.12-r0.apk" # Start Alpine container with the APK available docker run --rm -it -v "$PWD":/work alpine:latest sh -c " # Install dependencies and the game apk add --no-cache ncurses-terminfo-base ncurses - apk add --allow-untrusted /work/packages/x86_64/conquer-4.12-r0.apk + apk add --allow-untrusted /work/packages/alpine/x86_64/conquer-4.12-r0.apk # Set up environment export TERM=xterm @@ -42,4 +42,4 @@ docker run --rm -it -v "$PWD":/work alpine:latest sh -c " # Drop into interactive shell /bin/sh -" \ No newline at end of file +"