Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
140 lines
3.7 KiB
Nix
140 lines
3.7 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
buildGoModule,
|
|
alsa-lib,
|
|
libGL,
|
|
libX11,
|
|
libXcursor,
|
|
libXext,
|
|
libXi,
|
|
libXinerama,
|
|
libXrandr,
|
|
libXxf86vm,
|
|
go-licenses,
|
|
pkg-config,
|
|
zip,
|
|
advancecomp,
|
|
makeWrapper,
|
|
nixosTests,
|
|
strip-nondeterminism,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "aaaaxy";
|
|
version = "1.6.288";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "divVerent";
|
|
repo = "aaaaxy";
|
|
tag = "v${version}";
|
|
hash = "sha256-8oWrQCj1B7o2kw0mbg9ynXpu/r85uqa+2UxRH44G8ZQ=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
vendorHash = "sha256-g37+5IquBaRMGw48V/pCsJaeKlGR5a2Hj3NFcrolQ7g=";
|
|
|
|
buildInputs = [
|
|
alsa-lib
|
|
libGL
|
|
libX11
|
|
libXcursor
|
|
libXext
|
|
libXi
|
|
libXinerama
|
|
libXrandr
|
|
libXxf86vm
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
go-licenses
|
|
pkg-config
|
|
zip
|
|
advancecomp
|
|
makeWrapper
|
|
strip-nondeterminism
|
|
];
|
|
|
|
outputs = [
|
|
"out"
|
|
"testing_infra"
|
|
];
|
|
|
|
postPatch = ''
|
|
# Without patching, "go run" fails with the error message:
|
|
# package github.com/google/go-licenses: no Go files in /build/source/vendor/github.com/google/go-licenses
|
|
substituteInPlace scripts/build-licenses.sh --replace-fail \
|
|
'$GO run ''${GO_FLAGS} github.com/google/go-licenses' 'go-licenses'
|
|
|
|
patchShebangs scripts/
|
|
substituteInPlace scripts/regression-test-demo.sh \
|
|
--replace-fail 'sh scripts/run-timedemo.sh' "$testing_infra/scripts/run-timedemo.sh"
|
|
|
|
substituteInPlace Makefile --replace-fail \
|
|
'CPPFLAGS ?= -DNDEBUG' \
|
|
'CPPFLAGS ?= -DNDEBUG -D_GLFW_GLX_LIBRARY=\"${lib.getLib libGL}/lib/libGL.so\" -D_GLFW_EGL_LIBRARY=\"${lib.getLib libGL}/lib/libEGL.so\"'
|
|
'';
|
|
|
|
overrideModAttrs = (
|
|
_: {
|
|
# We can't patch in the path to libGL directly because
|
|
# this is a fixed output derivation and when the path to libGL
|
|
# changes, the hash would change.
|
|
# To work around this, use environment variables.
|
|
postBuild = ''
|
|
substituteInPlace 'vendor/github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/opengl/gl/procaddr_linbsd.go' \
|
|
--replace-fail \
|
|
'import (' \
|
|
'import ("os"' \
|
|
--replace-fail \
|
|
'{"libGL.so", "libGL.so.2", "libGL.so.1", "libGL.so.0"}' \
|
|
'{os.Getenv("EBITENGINE_LIBGL")}' \
|
|
--replace-fail \
|
|
'{"libGLESv2.so", "libGLESv2.so.2", "libGLESv2.so.1", "libGLESv2.so.0"}' \
|
|
'{os.Getenv("EBITENGINE_LIBGLESv2")}'
|
|
'';
|
|
}
|
|
);
|
|
|
|
makeFlags = [
|
|
"BUILDTYPE=release"
|
|
];
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
AAAAXY_BUILD_USE_VERSION_FILE=true make $makeFlags
|
|
runHook postBuild
|
|
'';
|
|
|
|
postInstall = ''
|
|
install -Dm755 'aaaaxy' -t "$out/bin/"
|
|
install -Dm444 'aaaaxy.svg' -t "$out/share/icons/hicolor/scalable/apps/"
|
|
install -Dm644 'aaaaxy.png' -t "$out/share/icons/hicolor/128x128/apps/"
|
|
install -Dm644 'aaaaxy.desktop' -t "$out/share/applications/"
|
|
install -Dm644 'io.github.divverent.aaaaxy.metainfo.xml' -t "$out/share/metainfo/"
|
|
|
|
wrapProgram $out/bin/aaaaxy \
|
|
--set EBITENGINE_LIBGL '${lib.getLib libGL}/lib/libGL.so' \
|
|
--set EBITENGINE_LIBGLESv2 '${lib.getLib libGL}/lib/libGLESv2.so'
|
|
|
|
install -Dm755 'scripts/run-timedemo.sh' -t "$testing_infra/scripts/"
|
|
install -Dm755 'scripts/regression-test-demo.sh' -t "$testing_infra/scripts/"
|
|
install -Dm644 'assets/demos/benchmark.dem' -t "$testing_infra/assets/demos/"
|
|
'';
|
|
|
|
passthru.tests = {
|
|
aaaaxy = nixosTests.aaaaxy;
|
|
};
|
|
|
|
strictDeps = true;
|
|
|
|
meta = {
|
|
description = "Nonlinear 2D puzzle platformer taking place in impossible spaces";
|
|
mainProgram = "aaaaxy";
|
|
homepage = "https://divverent.github.io/aaaaxy/";
|
|
license = lib.licenses.asl20;
|
|
maintainers = with lib.maintainers; [ Luflosi ];
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
}
|