tmuxPlugins.catppucin: unstable-2024-05-16 -> 2.1.2 (#379030)
[NixPkgs.git] / pkgs / by-name / ev / everspace / package.nix
blobf3657f1189c76b5874c413c6f11024bd736c9aa3
2   # Packaging Dependencies
3   lib,
4   stdenv,
5   requireFile,
6   autoPatchelfHook,
7   unzip,
8   copyDesktopItems,
9   makeDesktopItem,
11   # Everspace Dependencies
12   cairo,
13   gdk-pixbuf,
14   pango,
15   gtk2-x11,
16   libGL,
17   openal,
19   # Unreal Engine 4 Dependencies
20   xorg,
23 # Known issues:
24 # - Video playback (upon starting a new game) does not work (screen is black)
25 stdenv.mkDerivation rec {
26   pname = "everspace";
27   version = "1.3.5.3655";
29   src = requireFile {
30     name = "everspace_1_3_5_3655_32896.sh";
31     url = "https://www.gog.com/";
32     sha256 = "0jlvxq14k1pxmbr08y8kar0ijlqxcnkfqlvw883j96v9zr34ynj3";
33   };
35   nativeBuildInputs = [
36     autoPatchelfHook
37     copyDesktopItems
38     unzip
39   ];
41   buildInputs = [
42     cairo
43     gdk-pixbuf
44     pango
45     gtk2-x11
46     openal
47     (lib.getLib stdenv.cc.cc)
48   ];
50   runtimeDependencies = [
51     libGL
53     # ue4
54     xorg.libX11
55     xorg.libXScrnSaver
56     xorg.libXau
57     xorg.libXcursor
58     xorg.libXext
59     xorg.libXfixes
60     xorg.libXi
61     xorg.libXrandr
62     xorg.libXrender
63     xorg.libXxf86vm
64     xorg.libxcb
65   ];
67   unpackPhase = ''
68     runHook preUnpack
70     # The shell script contains a zip file. Unzipping it works but will result
71     # in some error output and an error exit code.
72     unzip "$src" || true
74     runHook postUnpack
75   '';
77   postPatch = ''
78     ## Remove Bundled Libs ##
80     # vlc libs
81     #
82     # TODO: This is probably what breaks video playback. It would be cleaner
83     #   to remove the bundled libs and replace them with system libs but there
84     #   are so many. Copy-pasting the list from the vlc package is a good start
85     #   but still leaves us with many unresolved dependencies.
86     rm -rf ./data/noarch/game/RSG/Plugins/VlcMedia
88     # openal
89     rm -rf ./data/noarch/game/Engine/Binaries/ThirdParty/OpenAL
90   '';
92   dontConfigure = true;
93   dontBuild = true;
95   installPhase = ''
96     runHook preInstall
98     mkdir -p "$out/opt"
99     cp -r "./data/noarch" "$out/opt/everspace"
101     mkdir -p "$out/bin"
102     ln -s "$out/opt/everspace/game/RSG/Binaries/Linux/RSG-Linux-Shipping" "$out/bin/everspace"
104     mkdir -p "$out/share/pixmaps"
105     ln -s "$out/opt/everspace/support/icon.png" "$out/share/pixmaps/everspace-gog.png"
107     runHook postInstall
108   '';
110   desktopItems = [
111     (makeDesktopItem {
112       type = "Application";
113       name = "everspace-gog";
114       desktopName = "EVERSPACEā„¢";
115       comment = meta.description;
116       exec = "everspace";
117       icon = "everspace-gog";
118       categories = [ "Game" ];
119     })
120   ];
122   meta = with lib; {
123     description = "Action-focused single-player space shooter with roguelike elements";
124     homepage = "https://classic.everspace-game.com/";
125     license = licenses.unfree;
126     maintainers = with maintainers; [ jtrees ];
127     platforms = [ "x86_64-linux" ];
128     sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
129   };