1{
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,
13}:
14
15let
16 inherit (lib)
17 and
18 licenses
19 maintainers
20 optional
21 optionalString
22 platforms
23 ;
24
25 pname = "koboredux";
26 version = "0.7.5.1";
27
28 main_src = fetchFromGitHub {
29 owner = "olofson";
30 repo = pname;
31 rev = "v${version}";
32 sha256 = "09h9r65z8bar2z89s09j6px0gdq355kjf38rmd85xb2aqwnm6xig";
33 };
34
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.
41
42 Once you have downloaded the file, please use the following command
43 and re-run the installation:
44
45 nix-prefetch-url file://\$PWD/koboredux-${version}-Linux.tar.bz2
46
47 Alternatively, install the "koboredux-free" package, which replaces the
48 proprietary assets with a placeholder theme.
49 '';
50 };
51
52in
53
54stdenv.mkDerivation rec {
55 inherit pname version;
56
57 src = [ main_src ] ++ optional useProprietaryAssets assets_src;
58
59 sourceRoot = main_src.name;
60
61 # Fix clang build
62 patches = [
63 (fetchpatch {
64 url = "https://github.com/olofson/koboredux/commit/cf92b8a61d002ccaa9fbcda7a96dab08a681dee4.patch";
65 sha256 = "0dwhvis7ghf3mgzjd2rwn8hk3ndlgfwwcqaq581yc5rwd73v6vw4";
66 })
67 ];
68
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 '';
74
75 nativeBuildInputs = [
76 cmake
77 pkg-config
78 ];
79
80 buildInputs = [
81 SDL2
82 SDL2_image
83 audiality2
84 ];
85
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 Kobo Redux is a frantic 80's style 2D shooter, inspired by the look and
93 feel of 90's arcade cabinets. The gameplay is fast and unforgiving,
94 although with less of the frustrating quirkiness of the actual games
95 of the 80's. A true challenge in the spirit of the arcade era!
96 ''
97 + optionalString (!useProprietaryAssets) ''
98
99 This version replaces the official proprietary assets with placeholders.
100 For the full experience, consider installing "koboredux" instead.
101 '';
102 homepage = "https://olofson.itch.io/kobo-redux";
103 license = with licenses; if useProprietaryAssets then unfree else gpl2Plus;
104 platforms = platforms.all;
105 maintainers = with maintainers; [ fgaz ];
106 };
107}