lol
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 ninja,
7 allegro5,
8 libglvnd,
9 surgescript,
10 physfs,
11 xorg,
12 versionCheckHook,
13 nix-update-script,
14}:
15
16stdenv.mkDerivation (finalAttrs: {
17 pname = "opensurge";
18 version = "0.6.1.2";
19
20 src = fetchFromGitHub {
21 owner = "alemart";
22 repo = "opensurge";
23 tag = "v${finalAttrs.version}";
24 hash = "sha256-HvpKZ62mYy7XkZOnIn7QRA2rFVREFnKO1NO83aCR76k=";
25 };
26
27 nativeBuildInputs = [
28 cmake
29 ninja
30 ];
31
32 buildInputs = [
33 allegro5
34 libglvnd
35 physfs
36 surgescript
37 xorg.libX11
38 ];
39
40 cmakeFlags = [
41 "-DGAME_BINDIR=${placeholder "out"}/bin"
42 "-DDESKTOP_ICON_PATH=${placeholder "out"}/share/pixmaps"
43 "-DDESKTOP_METAINFO_PATH=${placeholder "out"}/share/metainfo"
44 "-DDESKTOP_ENTRY_PATH=${placeholder "out"}/share/applications"
45 "-DWANT_BUILD_DATE=OFF"
46 ];
47
48 nativeInstallCheckInputs = [ versionCheckHook ];
49 # Darwin fails with "Critical error: required built-in appearance SystemAppearance not found"
50 doInstallCheck = !stdenv.hostPlatform.isDarwin;
51
52 passthru.updateScript = nix-update-script { };
53
54 meta = {
55 mainProgram = "opensurge";
56 description = "Fun 2D retro platformer inspired by Sonic games and a game creation system";
57 homepage = "https://opensurge2d.org/";
58 downloadPage = "https://github.com/alemart/opensurge";
59 changelog = "https://github.com/alemart/opensurge/blob/v${finalAttrs.version}/CHANGES.md";
60 license = lib.licenses.gpl3Only;
61 platforms = lib.platforms.all;
62 maintainers = with lib.maintainers; [ ];
63 };
64})