25 src = fetchFromGitHub {
29 hash = "sha256-VfF8bQP7pFaTezOJpda4N9KbCHr5ST/wCvdNRiojio0=";
30 fetchSubmodules = true;
33 vendorHash = "sha256-PBwI3S8ZvmVD57/ICALe+HvgtbPQpJKNPfkWo+uUeSo=";
38 libX11 libXcursor libXext libXi libXinerama libXrandr
50 outputs = [ "out" "testing_infra" ];
53 # Without patching, "go run" fails with the error message:
54 # package github.com/google/go-licenses: no Go files in /build/source/vendor/github.com/google/go-licenses
55 substituteInPlace scripts/build-licenses.sh --replace-fail \
56 '$GO run ''${GO_FLAGS} github.com/google/go-licenses' 'go-licenses'
58 patchShebangs scripts/
59 substituteInPlace scripts/regression-test-demo.sh \
60 --replace-fail 'sh scripts/run-timedemo.sh' "$testing_infra/scripts/run-timedemo.sh"
62 substituteInPlace Makefile --replace-fail \
63 'CPPFLAGS ?= -DNDEBUG' \
64 'CPPFLAGS ?= -DNDEBUG -D_GLFW_GLX_LIBRARY=\"${lib.getLib libGL}/lib/libGL.so\" -D_GLFW_EGL_LIBRARY=\"${lib.getLib libGL}/lib/libEGL.so\"'
67 overrideModAttrs = (_: {
68 # We can't patch in the path to libGL directly because
69 # this is a fixed output derivation and when the path to libGL
70 # changes, the hash would change.
71 # To work around this, use environment variables.
73 substituteInPlace 'vendor/github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/opengl/gl/procaddr_linbsd.go' \
78 '{"libGL.so", "libGL.so.2", "libGL.so.1", "libGL.so.0"}' \
79 '{os.Getenv("EBITENGINE_LIBGL")}' \
81 '{"libGLESv2.so", "libGLESv2.so.2", "libGLESv2.so.1", "libGLESv2.so.0"}' \
82 '{os.Getenv("EBITENGINE_LIBGLESv2")}'
92 AAAAXY_BUILD_USE_VERSION_FILE=true make $makeFlags
97 install -Dm755 'aaaaxy' -t "$out/bin/"
98 install -Dm444 'aaaaxy.svg' -t "$out/share/icons/hicolor/scalable/apps/"
99 install -Dm644 'aaaaxy.png' -t "$out/share/icons/hicolor/128x128/apps/"
100 install -Dm644 'aaaaxy.desktop' -t "$out/share/applications/"
101 install -Dm644 'io.github.divverent.aaaaxy.metainfo.xml' -t "$out/share/metainfo/"
103 wrapProgram $out/bin/aaaaxy \
104 --set EBITENGINE_LIBGL '${lib.getLib libGL}/lib/libGL.so' \
105 --set EBITENGINE_LIBGLESv2 '${lib.getLib libGL}/lib/libGLESv2.so'
107 install -Dm755 'scripts/run-timedemo.sh' -t "$testing_infra/scripts/"
108 install -Dm755 'scripts/regression-test-demo.sh' -t "$testing_infra/scripts/"
109 install -Dm644 'assets/demos/benchmark.dem' -t "$testing_infra/assets/demos/"
113 aaaaxy = nixosTests.aaaaxy;
119 description = "Nonlinear 2D puzzle platformer taking place in impossible spaces";
120 mainProgram = "aaaaxy";
121 homepage = "https://divverent.github.io/aaaaxy/";
122 license = licenses.asl20;
123 maintainers = with maintainers; [ Luflosi ];
124 platforms = platforms.linux;