1 { lib, stdenv, fetchFromGitHub, cmake, SDL2, libGLU, luajit, curl, curlpp }:
4 # Newer versions of sdl-gpu don't work with Riko4 (corrupted graphics),
5 # and this library does not have a proper release version, so let the
6 # derivation for this stay next to the Riko4 derivation for now.
7 sdl-gpu = stdenv.mkDerivation {
9 version = "2018-11-01";
10 src = fetchFromGitHub {
13 rev = "a4ff1ab02410f154b004c29ec46e07b22890fa1f";
14 sha256 = "1wdwg331s7r4dhq1l8w4dvlqf4iywskpdrscgbwrz9j0c6nqqi3v";
16 buildInputs = [ SDL2 libGLU ];
17 nativeBuildInputs = [ cmake ];
20 homepage = "https://github.com/grimfang4/sdl-gpu";
21 description = "Library for high-performance, modern 2D graphics with SDL written in C";
22 license = licenses.mit;
23 maintainers = with maintainers; [ CrazedProgrammer ];
28 stdenv.mkDerivation rec {
31 src = fetchFromGitHub {
35 sha256 = "008i9991sn616dji96jfwq6gszrspbx4x7cynxb1cjw66phyy5zp";
38 buildInputs = [ SDL2 luajit sdl-gpu curl curlpp ];
39 nativeBuildInputs = [ cmake ];
41 hardeningDisable = [ "fortify" ];
42 cmakeFlags = [ "-DSDL2_gpu_INCLUDE_DIR=\"${sdl-gpu}/include\"" ];
44 # Riko4 needs the data/ and scripts/ directories to be in its PWD.
46 install -Dm0755 riko4 $out/bin/.riko4-unwrapped
47 mkdir -p $out/lib/riko4
48 cp -r ../data $out/lib/riko4
49 cp -r ../scripts $out/lib/riko4
50 cat > $out/bin/riko4 <<EOF
52 pushd $out/lib/riko4 > /dev/null
53 exec $out/bin/.riko4-unwrapped "\$@"
56 chmod +x $out/bin/riko4
60 homepage = "https://github.com/incinirate/Riko4";
61 description = "Fantasy console for pixel art game development";
62 mainProgram = "riko4";
63 license = licenses.mit;
64 maintainers = with maintainers; [ CrazedProgrammer ];