thunderbird*: 128.5.*esr -> 128.5.2esr (#364288)
[NixPkgs.git] / pkgs / games / koboredux / default.nix
blob5f4d0a39a8a9bd4ae6c4dbdf10522d10b357fb34
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchpatch,
6   requireFile,
7   cmake,
8   pkg-config,
9   SDL2,
10   SDL2_image,
11   audiality2,
12   useProprietaryAssets ? true,
15 let
16   inherit (lib)
17     and
18     licenses
19     maintainers
20     optional
21     optionalString
22     platforms
23     ;
25   pname = "koboredux";
26   version = "0.7.5.1";
28   main_src = fetchFromGitHub {
29     owner = "olofson";
30     repo = pname;
31     rev = "v${version}";
32     sha256 = "09h9r65z8bar2z89s09j6px0gdq355kjf38rmd85xb2aqwnm6xig";
33   };
35   assets_src = requireFile {
36     name = "koboredux-${version}-Linux.tar.bz2";
37     sha256 = "11bmicx9i11m4c3dp19jsql0zy4rjf5a28x4hd2wl8h3bf8cdgav";
38     message = ''
39       Please purchase the game on https://olofson.itch.io/kobo-redux
40       and download the Linux build.
42       Once you have downloaded the file, please use the following command
43       and re-run the installation:
45       nix-prefetch-url file://\$PWD/koboredux-${version}-Linux.tar.bz2
47       Alternatively, install the "koboredux-free" package, which replaces the
48       proprietary assets with a placeholder theme.
49     '';
50   };
54 stdenv.mkDerivation rec {
55   inherit pname version;
57   src = [ main_src ] ++ optional useProprietaryAssets assets_src;
59   sourceRoot = main_src.name;
61   # Fix clang build
62   patches = [
63     (fetchpatch {
64       url = "https://github.com/olofson/koboredux/commit/cf92b8a61d002ccaa9fbcda7a96dab08a681dee4.patch";
65       sha256 = "0dwhvis7ghf3mgzjd2rwn8hk3ndlgfwwcqaq581yc5rwd73v6vw4";
66     })
67   ];
69   postPatch = optionalString useProprietaryAssets ''
70     cp -r ../koboredux-${version}-Linux/sfx/redux data/sfx/
71     cp -r ../koboredux-${version}-Linux/gfx/redux data/gfx/
72     cp -r ../koboredux-${version}-Linux/gfx/redux_fullscreen data/gfx/
73   '';
75   nativeBuildInputs = [
76     cmake
77     pkg-config
78   ];
80   buildInputs = [
81     SDL2
82     SDL2_image
83     audiality2
84   ];
86   meta = {
87     description =
88       "Frantic 80's style 2D shooter, similar to XKobo and Kobo Deluxe"
89       + optionalString (!useProprietaryAssets) " (built without proprietary assets)";
90     mainProgram = "kobord";
91     longDescription =
92       ''
93         Kobo Redux is a frantic 80's style 2D shooter, inspired by the look and
94         feel of 90's arcade cabinets. The gameplay is fast and unforgiving,
95         although with less of the frustrating quirkiness of the actual games
96         of the 80's. A true challenge in the spirit of the arcade era!
97       ''
98       + optionalString (!useProprietaryAssets) ''
100         This version replaces the official proprietary assets with placeholders.
101         For the full experience, consider installing "koboredux" instead.
102       '';
103     homepage = "https://olofson.itch.io/kobo-redux";
104     license = with licenses; if useProprietaryAssets then unfree else gpl2Plus;
105     platforms = platforms.all;
106     maintainers = with maintainers; [ fgaz ];
107   };