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