Skip to content

Port ArrowVortex to Linux - #281

Open
uvcat7 wants to merge 82 commits into
betafrom
linux
Open

Port ArrowVortex to Linux#281
uvcat7 wants to merge 82 commits into
betafrom
linux

Conversation

@uvcat7

@uvcat7 uvcat7 commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Finally, we're ready for multiplatform support.
This PR was only tested on Windows WSL so far. I'll test more during the review process but this seems to work well enough for now.
The following changes were made:

  • GCC did not handle Vortex::Vector properly and would throw runtime exceptions, so Vortex::Vector was ported to std::vector (this was a big change, as a lot of ArrowVortex's vector iteration did out-of-array access for position checking).
  • min and max are part of MSVC so they were replaced with std::min/std::max/std::clamp as appropriate.
  • ArrowVortex now behaves properly with Visual Studio 2026's clang-tidy (apparently 2022 was missing some files/checks?)
  • Similarly, CMake Settings are deprecated in VS2026 and are not multiplatform, so CMakeSettings.json was converted to CMakePresets.json.
  • I had so many problems with Visual Studio/CMake caching that I modified the CMakeLists.txt to work even when not called with the proper environment variables. In theory, this should make user presets easier to use, but still, it's CMake.
  • Linux's clang-format gave some mutually exclusive results against Windows' clang-format, so the format checking runs only on Windows.
  • A menu bar was written in OpenGL (Editor/Menubar.cpp, System/Menu.cpp) to behave the same as the Windows menu bar for Linux builds in lieu of messing with Wayland/X11. Note that to prevent rewriting all the rendering logic, the menu bar is rendered with negative coordinates and the rendering offset with glTranslated(). This can be revisited when SDL adds support for integrated menu bars.
image
  • windows.yml has been renamed to release.yml and an entry for Linux builds on Ubuntu added.
  • Of course, making C++ code that plays nicely with both GCC and MSVC deserves a special mention. Did you know that MSVC still doesn't implement std::aligned_alloc?

I would like some review of the CMakeLists.txt for any simplifications/optimizations.

For testing builds you may need to install all the packages listed in release.yml with your distro's package manager:

          sudo apt-get install -qq -y mono-devel nasm libltdl-dev \
            autoconf autoconf-archive automake libtool \
            libx11-dev libxft-dev libxext-dev \
            libwayland-dev libxkbcommon-dev libegl1-mesa-dev \
            libibus-1.0-dev zenity clang-tidy clang-format build-essential git \
            pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
            libaudio-dev libjack-dev libsndio-dev libusb-1.0-0-dev libx11-dev libxext-dev \
            libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \
            libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
            libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev fcitx-libs-dev \
            libasound2-dev libdecor-0-dev

uvcat7 and others added 30 commits August 27, 2025 15:04
@uvcat7
uvcat7 requested a review from Psycast June 10, 2026 19:15
@uvcat7
uvcat7 requested a review from convextriangle June 10, 2026 21:40
@uvcat7

uvcat7 commented Jun 11, 2026

Copy link
Copy Markdown
Owner Author

I added build documentation for Linux as well.

Comment thread BUILDING.md
### With CMake CLI
In the terminal at the root folder of this project run:
```
cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-linux -DPRESET_NAME={linux-debug | linux-release}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be $VCPKG_ROOT, iirc $env:<something> is a powershell thing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and -Bbuild seems to not be working; CMake presets seem to force -Bout/build/linux-debug? (same for the cmake --build command)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using

cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-linux -DPRESET_NAME=linux-release -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DCMAKE_MAKE_PROGRAM="ninja"

Comment thread BUILDING.md
### Build Packages
For Ubuntu/Debian install:
```
sudo apt-get install build-essential git \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python3-jinja2 might be missing on some debian installs

Comment thread src/Core/Texture.h
@@ -1 +1 @@
#pragma once

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include <vector> seems to be missing in this header? seems to cause build errors at least on my machine

Comment thread BUILDING.md
cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-linux -DPRESET_NAME={linux-debug | linux-release}
cmake --build build
```
The resulting binary will be located at `out\install\{linux-debug | linux-release}\bin\ArrowVortex`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be located in out/build/linux-debug/src/System/ArrowVortex, maybe this is for the installation, not building?

Comment thread src/System/System.cpp
float getScaleFactor() const override { return myScale; }

bool getWindowState() const override {
auto temp = SDL_GetWindowFlags(window);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the temp variable required?

@sukibaby

Copy link
Copy Markdown
Collaborator

I'm finally getting around to testing this on my Linux workstation... unfortunately I'm getting blocked atm by libsystemd failing to build its x64-linux-dbg build via ninja or make.

Will update if I make further progress here.

@LetalexAlex

Copy link
Copy Markdown

@sukibaby Check out my automated compile script I made to compile the latest commit from the linux branch. https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=arrowvortex-linux-git

I had to patch vcpkg's libsystemd with -Wno-error=override-init on the meson file

My script although janky compiles on any ArchLinux machine i've tried with no errors, including clean roots.

Anyone feel free to use it as reference if you want.

@sukibaby

Copy link
Copy Markdown
Collaborator

@sukibaby Check out my automated compile script I made to compile the latest commit from the linux branch. https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=arrowvortex-linux-git

I had to patch vcpkg's libsystemd with -Wno-error=override-init on the meson file

My script although janky compiles on any ArchLinux machine i've tried with no errors, including clean roots.

Anyone feel free to use it as reference if you want.

ahhh, very nice, thanks. this does build fine. 👍 very much appreciated.

there is some room for optimization in the build, it takes 18m 50s even on a 18 core that usually crushes thru c++ lol.

given that this works, i'll compare it to the the version in this PR.

i think i've found a few bugs not present in the release 1.0.1 (pump noteskin not loading correctly by default for example) but i'll add an issue for anything i confirm is a bug vs the latest release. for now this is so great to have. ty @uvcat7 !

@sukibaby

sukibaby commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

@uvcat7 can you try this and lmk if it still builds as expected on windows? splitting the sdl3 built via vcpkg to windows only seems to help, as it then uses the system sdl3 libraries on linux rather than needing to build them from source. i built on cachyos using system libraries this way and it works as expected.

03c2a61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants