From 78511812307280d9601cc434d859c3efa0fa8591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 8 Feb 2026 16:56:26 -0300 Subject: [PATCH] Add Haiku ecode nightly (not tested!). --- .github/workflows/ecode-nightly.yml | 35 ++++++++++++++++++++++++ projects/haiku/ecode/build.app.sh | 42 ++++++++++++++++++++++++++--- 2 files changed, 74 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ecode-nightly.yml b/.github/workflows/ecode-nightly.yml index 8efccf2ee..4fdd6d704 100644 --- a/.github/workflows/ecode-nightly.yml +++ b/.github/workflows/ecode-nightly.yml @@ -425,6 +425,41 @@ jobs: files: | projects/freebsd/ecode/ecode-freebsd-${{ env.INSTALL_REF }}-x86_64.tar.gz + build_haiku_x86_64: + name: Haiku x86_64 Nightly + needs: release + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: { fetch-depth: 0, submodules: 'recursive' } + - name: Set Environment Variables + run: | + echo "INSTALL_REF=${{ needs.release.outputs.version }}" >> "$GITHUB_ENV" + echo "RARCH=$(uname -m)" >> "$GITHUB_ENV" + - uses: vmactions/haiku-vm@v1 + env: + INSTALL_REF: ${{ needs.release.outputs.version }} + with: + envs: 'INSTALL_REF' + usesh: true + mem: 8192 + disable-cache: true + prepare: | + pkgman install -y libsdl2 libsdl2-devel git gcc + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + bash projects/scripts/patch_commit_number.sh + sh projects/haiku/ecode/build.app.sh --version ${{ env.INSTALL_REF }} + - name: Upload Files + uses: softprops/action-gh-release@v2.2.2 + with: + tag_name: ${{ needs.release.outputs.version }} + draft: false + prerelease: true + files: | + projects/haiku/ecode/ecode-haiku-${{ env.INSTALL_REF }}-x86_64.tar.gz + build_windows_msvc: name: Windows x86_64 MSVC Nightly needs: release diff --git a/projects/haiku/ecode/build.app.sh b/projects/haiku/ecode/build.app.sh index 77eced5a3..1125a5f8a 100755 --- a/projects/haiku/ecode/build.app.sh +++ b/projects/haiku/ecode/build.app.sh @@ -3,23 +3,59 @@ CANONPATH=$(readlink -f "$0") DIRPATH="$(dirname "$CANONPATH")" cd "$DIRPATH" || exit cd ../../../ || exit +VERSION= +ARCH="$(uname -m)" + +while [ $# -gt 0 ]; do + case "$1" in + --version) + if [ -n "$2" ]; then + VERSION="$2" + shift + else + echo "Error: --version requires an argument." >&2 + exit 1 + fi + ;; + --) + shift + break + ;; + -*) + echo "Unknown option: $1" >&2 + exit 1 + ;; + *) + break + ;; + esac + shift +done + premake5 gmake cd make/haiku || exit -make -j"$(nproc)" config=release_x86_64 ecode +make -j"$(nproc)" config=release_"$ARCH" ecode cd "$DIRPATH" || exit bash ../../scripts/copy_ecode_assets.sh ../../bin ecode.app || exit mkdir -p ecode.app/lib cp ../../../bin/assets/icon/ecode.png ecode.app/ecode.png -cp ../../../libs/haiku/x86_64/libeepp.so ecode.app/lib/ +cp ../../../libs/haiku/"$ARCH"/libeepp.so ecode.app/lib/ cp ../../../bin/ecode ecode.app/ cp -L /boot/system/lib/libSDL2-2.0.so.0 ecode.app/lib/ strip ecode.app/lib/libSDL2-2.0.so.0 +if [ -n "$VERSION" ]; +then +ECODE_VERSION="$VERSION" +else VERSIONPATH=../../../src/tools/ecode/version.hpp ECODE_MAJOR_VERSION=$(grep "define ECODE_MAJOR_VERSION" $VERSIONPATH | awk '{print $3}') ECODE_MINOR_VERSION=$(grep "define ECODE_MINOR_VERSION" $VERSIONPATH | awk '{print $3}') ECODE_PATCH_LEVEL=$(grep "define ECODE_PATCH_LEVEL" $VERSIONPATH | awk '{print $3}') -ECODE_NAME=ecode-haiku-"$ECODE_MAJOR_VERSION"."$ECODE_MINOR_VERSION"."$ECODE_PATCH_LEVEL"-"$(uname -m)" +ECODE_VERSION="$ECODE_MAJOR_VERSION"."$ECODE_MINOR_VERSION"."$ECODE_PATCH_LEVEL" +fi + +ECODE_NAME=ecode-haiku-"$ECODE_VERSION"-"$ARCH" mv ecode.app ecode tar -czf "$ECODE_NAME".tar.gz ecode