diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-12 09:43:19 -0500 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-12 09:43:19 -0500 |
| commit | ebf97687fa206816495e99529ea81348cb87aa87 (patch) | |
| tree | 017c106afc3bcf5b72891a0ed041a39e4b0a5069 /.github | |
| parent | 55c95dbd7316d25852e0a36322924fa673af9074 (diff) | |
Add NixOS mobase build to CI for Python plugin compatibility
NixOS users can't load our Ubuntu-compiled mobase.so due to ABI
differences. Add a parallel CI job that builds mobase.so in a Nix
environment so NixOS users can download and drop it into plugins/libs/.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/ci.yml | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ce5cc2..612eed9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,3 +65,67 @@ jobs: path: build/fluorine-manager/ compression-level: 6 if-no-files-found: warn + + build-nixos-mobase: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Cache Nix store + uses: actions/cache@v4 + with: + path: /tmp/nix-cache + key: nix-mobase-${{ hashFiles('nix/mobase-shell.nix') }} + restore-keys: nix-mobase- + + - name: Build mobase.so for NixOS + run: | + nix-shell nix/mobase-shell.nix --run " + set -euo pipefail + + # Build libloot from source (not in nixpkgs) + git clone --depth 1 https://github.com/loot/libloot.git /tmp/libloot + cmake -S /tmp/libloot/cpp -B /tmp/libloot/build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=ON \ + -DLIBLOOT_INSTALL_DOCS=OFF \ + -DBUILD_TESTING=OFF \ + -DCMAKE_INSTALL_PREFIX=/tmp/libloot-install + cmake --build /tmp/libloot/build --parallel + cmake --install /tmp/libloot/build + + # Configure full project (disable Rust FFI — not needed for mobase) + PYBIND11_DIR=\$(python3 -c 'import pybind11; print(pybind11.get_cmake_dir())') + cmake -S . -B build-nix -G Ninja \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DPython_EXECUTABLE=\$(which python3) \ + -Dpybind11_DIR=\"\${PYBIND11_DIR}\" \ + -DBUILD_PLUGIN_PYTHON=ON \ + -DBUILD_NAK_FFI=OFF \ + -DBUILD_BSA_FFI=OFF \ + -DCMAKE_PREFIX_PATH=/tmp/libloot-install \ + -Dlibloot_DIR=/tmp/libloot-install + + # Build only mobase target + cmake --build build-nix --target mobase --parallel + + # Package it + mkdir -p nixos-mobase + cp build-nix/libs/plugin_python/src/mobase/mobase.cpython-*-linux-gnu.so nixos-mobase/ + echo 'NixOS-compatible mobase pybind11 module for Fluorine Manager.' > nixos-mobase/README.txt + echo 'Drop this .so into your plugins/libs/ directory, replacing the existing one.' >> nixos-mobase/README.txt + " + + - name: Upload NixOS mobase + uses: actions/upload-artifact@v4 + with: + name: mobase-nixos + path: nixos-mobase/ + compression-level: 6 + if-no-files-found: warn |
