diff --git a/.circleci/config.yml b/.circleci/config.yml index 9bdaebc5..cd277247 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,7 @@ jobs: haxelib setup ~/haxelib haxelib list haxelib install hashlink - + - run: name: Compile zlib @@ -314,7 +314,7 @@ jobs: # path: ~/MBHaxe/MBHaxe-Platinum-Mac.zip build-win: - executor: + executor: name: win/server-2022 shell: bash.exe # executor type # Checkout the code as the first step. This is a dedicated CircleCI step. @@ -369,7 +369,7 @@ jobs: export PATH=$nekopath:"$PATH" haxelib setup ~/haxelib haxelib list - - run: + - run: name: Build Hashlink command: | mkdir ~/deps @@ -438,7 +438,7 @@ jobs: cp ~/deps/hashlink/x64/Release/datachannel.hdll . cp ~/deps/hashlink/x64/Release/uv.hdll . cp ~/deps/hashlink/include/sdl/lib/x64/SDL2.dll . - cp ~/deps/hashlink/include/openal/bin/Win64/soft_oal.dll ./OpenAL32.dll + cp ~/deps/hashlink/include/openal/bin/Win64/soft_oal.dll ./OpenAL32.dll - run: name: Zip bundle command: | @@ -452,6 +452,125 @@ jobs: # - store_artifacts: # path: ~/project/MBHaxe-Platinum-Win.zip + build-linux: + machine: # executor type + image: ubuntu-2204:current + environment: + #HOMEBREW_NO_AUTO_UPDATE: 1 + #NPROC: 4 + COMMIT_TAG: pipeline.git.tag + steps: + #- add_ssh_keys: + # fingerprints: + # - "82:42:56:a0:57:43:95:4e:00:c0:8c:c1:7f:70:74:47" + - checkout: + path: ~/MBHaxe + - run: + name: Install apt dependencies + command: | + sudo apt install cmake pkg-config + sudo apt-get install libpng-dev libturbojpeg-dev libvorbis-dev libopenal-dev libsdl2-dev libmbedtls-dev libuv1-dev libsqlite3-dev + + - run: + name: Install Haxe + command: | + set -eux + download_url="https://github.com/HaxeFoundation/haxe/releases/download/4.3.6/haxe-4.3.6-linux64.tar.gz" + echo "Downloading [$download_url]..." + mkdir ~/haxe + curl -fsSL --retry 3 --retry-delay 5 "$download_url" -o ~/haxe.tar.gz + tar xzvf ~/haxe.tar.gz -C ~/haxe --strip-components=1 + download_url="https://github.com/HaxeFoundation/neko/releases/download/v2-4-0/neko-2.4.0-linux64.tar.gz" + echo "Downloading [$download_url]..." + mkdir ~/neko + curl -fsSL --retry 3 --retry-delay 5 "$download_url" -o ~/neko.tar.gz + tar xzvf ~/neko.tar.gz -C ~/neko --strip-components=1 + export PATH=~/haxe/:"$PATH" + export HAXE_STD_PATH=~/haxe/std + export PATH=~/neko/:"$PATH" + export LD_LIBRARY_PATH=~/neko + sudo chmod +x ~/neko/neko + haxelib setup ~/haxelib + haxelib list + + - run: + name: Install hashlink + command: | + mkdir -p ~/deps + cd ~/deps + git clone --depth=1 https://github.com/RandomityGuy/hashlink + git clone --depth=1 https://github.com/RandomityGuy/hxDatachannel + cd hashlink + ln -s ~/deps/hxDatachannel/cpp libs/datachannel + echo -e "\nadd_subdirectory(datachannel)" >> libs/CMakeLists.txt + cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DWITH_SQLITE=OFF -DBUILD_TESTING=OFF -DHASHLINK_INCLUDE_DIR="~/deps/hashlink/src" -DHASHLINK_LIBRARY_DIR="/usr/local/lib/" + cmake --build build --config Release -j$NPROC + sudo cmake --install build + + - run: + name: Install haxe dependencies + command: | + export PATH=~/haxe/:"$PATH" + export HAXE_STD_PATH=~/haxe/std + export PATH=~/neko/:"$PATH" + export LD_LIBRARY_PATH=~/neko + haxelib dev hashlink ~/deps/hashlink/other/haxelib + haxelib git heaps https://github.com/RandomityGuy/heaps + haxelib dev hlopenal ~/deps/hashlink/libs/openal + haxelib dev hlsdl ~/deps/hashlink/libs/sdl + haxelib dev datachannel ~/deps/hxDatachannel + haxelib install colyseus-websocket + + - save_cache: + key: mbhaxe-deps-v1 + paths: + - /usr/local/lib/datachannel.hdll + - /usr/local/lib/fmt.hdll + - /usr/local/lib/openal.hdll + - /usr/local/lib/sdl.hdll + - /usr/local/lib/ssl.hdll + - /usr/local/lib/ui.hdll + - /usr/local/lib/uv.hdll + + - run: + name: Compile MBHaxe + command: | + export PATH=~/haxe/:"$PATH" + export HAXE_STD_PATH=~/haxe/std + export PATH=~/neko/:"$PATH" + export LD_LIBRARY_PATH=~/neko + cd ~/MBHaxe + haxe compile.hxml + haxe compile-linux.hxml + cd native + cp ~/deps/hashlink/src/hlc_main.c . + gcc -o marblegame -O2 -I . -L /usr/local/lib marblegame.c /usr/local/lib/{ui.hdll,openal.hdll,fmt.hdll,sdl.hdll,uv.hdll,ssl.hdll,datachannel.hdll} -lSDL2 -lhl -lm -luv + strip marblegame + + - run: + name: Package Bundle + command: | + mkdir -p ~/MBHaxe-Ultra-Linux + cd ~/MBHaxe-Ultra-Linux + cp ~/MBHaxe/marblegame.hl . + cp ~/MBHaxe/native/marblegame . + cp ~/MBHaxe/linux-dist/* . + cp -r ~/MBHaxe/data data + cp /usr/local/lib/{{fmt,openal,sdl,ssl,ui,uv,datachannel}.hdll,libhl.so.1.13.0} . + cp /usr/local/bin/hl . + ln -s libhl.so.1.13.0 libhl.so.1 + ln -s libhl.so.1 libhl.so + cd .. + tar -czvf MBHaxe-Ultra-Linux.tar.gz MBHaxe-Ultra-Linux + + #- run: + # name: Upload to Artifact Storage + # command: | + # scp -o StrictHostKeyChecking=no -i $KEYPATH -P $PORT ~/MBHaxe/macos-dist/MBHaxe-Ultra-Mac.dmg $REMOTEDIR/MBHaxe-Ultra-Mac.dmg + + - store_artifacts: + path: ~/MBHaxe-Ultra-Linux.tar.gz + # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows @@ -468,4 +587,11 @@ workflows: - build-win: filters: tags: - only: /^\d+.\d+.\d+$/ \ No newline at end of file + only: /^\d+.\d+.\d+$/ + + build-linux: + jobs: + - build-linux: + filters: + tags: + only: /^\d+.\d+.\d+$/ diff --git a/compile-linux.hxml b/compile-linux.hxml index bcea82ed..3d082e48 100644 --- a/compile-linux.hxml +++ b/compile-linux.hxml @@ -1,7 +1,10 @@ -cp src -lib heaps -lib hlsdl +-lib colyseus-websocket +-lib datachannel -D highDPI -D flow_border +-D analyzer-optimize -hl native/marblegame.c --main Main diff --git a/compile-linux.sh b/compile-linux.sh index 4aaad4ec..269828e2 100755 --- a/compile-linux.sh +++ b/compile-linux.sh @@ -2,5 +2,6 @@ haxe compile-linux.hxml cd native -gcc -o marblegame -g -I . -L /usr/local/lib marblegame.c /usr/local/lib/{ui.hdll,openal.hdll,fmt.hdll,sdl.hdll,uv.hdll,ssl.hdll} -lSDL2 -lhl -lm +gcc -o marblegame -O2 -I . -L /usr/local/lib marblegame.c /usr/local/lib/{ui.hdll,openal.hdll,fmt.hdll,sdl.hdll,uv.hdll,ssl.hdll,datachannel.hdll} -lSDL2 -lhl -lm -luv +strip marblegame cp marblegame .. diff --git a/linux-dist/run-marblegame-debug.sh b/linux-dist/run-marblegame-debug.sh new file mode 100755 index 00000000..565a2739 --- /dev/null +++ b/linux-dist/run-marblegame-debug.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +cd "$(dirname "$0")" +./hl marblegame.hl diff --git a/linux-dist/run-marblegame.sh b/linux-dist/run-marblegame.sh new file mode 100755 index 00000000..e6fe5fe4 --- /dev/null +++ b/linux-dist/run-marblegame.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +cd "$(dirname "$0")" + +# Add the current directory to the linker path so the .hdll files can be loaded +if [ "x$LD_LIBRARY_PATH" = "x" ]; then + export LD_LIBRARY_PATH=. +else + export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH" +fi + +./marblegame $@ diff --git a/src/gui/PresentsGui.hx b/src/gui/PresentsGui.hx index cd20573a..b831d2e1 100644 --- a/src/gui/PresentsGui.hx +++ b/src/gui/PresentsGui.hx @@ -14,7 +14,7 @@ class PresentsGui extends GuiImage { this.position = new Vector(); this.extent = new Vector(640, 480); - var ggLogo = new GuiImage(ResourceLoader.getResource('data/ui/GG_logo.png', ResourceLoader.getImage, this.imageResources).toTile()); + var ggLogo = new GuiImage(ResourceLoader.getResource('data/ui/GG_Logo.png', ResourceLoader.getImage, this.imageResources).toTile()); ggLogo.horizSizing = Center; ggLogo.vertSizing = Center; ggLogo.position = new Vector(69, 99);