summary refs log tree commit diff
path: root/pkgs/misc/emulators/blastem/default.nix
blob: a2dc86449d9e4bebf0dd028be72468d08fb0955c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib, stdenv, fetchurl, fetchFromGitHub, pkg-config, SDL2, glew, xcftools, python, pillow, makeWrapper }:

let
  vasm =
    stdenv.mkDerivation {
      pname = "vasm";
      version = "1.8c";
      src = fetchFromGitHub {
        owner = "mbitsnbites";
        repo = "vasm";
        rev = "244f8bbbdf64ae603f9f6c09a3067943837459ec";
        sha256 = "0x4y5q7ygxfjfy2wxijkps9khsjjfb169sbda410vaw0m88wqj5p";
      };
      makeFlags = [ "CPU=m68k" "SYNTAX=mot" ];
      installPhase = ''
        mkdir -p $out/bin
        cp vasmm68k_mot $out/bin
      '';
    };
in
stdenv.mkDerivation {
  pname = "blastem";
  version = "0.5.1";
  src = fetchurl {
    url = "https://www.retrodev.com/repos/blastem/archive/3d48cb0c28be.tar.gz";
    sha256 = "07wzbmzp0y8mh59jxg81q17gqagz3psxigxh8dmzsipgg68y6a8r";
  };
  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ pkg-config SDL2 glew xcftools python pillow vasm ];
  preBuild = ''
    patchShebangs img2tiles.py
  '';
  postBuild = ''
    make menu.bin
  '';
  installPhase = ''
    mkdir -p $out/bin $out/share/blastem
    cp -r {blastem,menu.bin,default.cfg,rom.db,shaders} $out/share/blastem/
    makeWrapper $out/share/blastem/blastem $out/bin/blastem
  '';

  meta = {
    homepage = "https://www.retrodev.com/blastem/";
    description = "The fast and accurate Genesis emulator";
    maintainers = with lib.maintainers; [ puffnfresh ];
    license = lib.licenses.gpl3;
    platforms = lib.platforms.linux;
    # Makefile:140: *** aarch64 is not a supported architecture.  Stop.
    badPlatforms = [ "aarch64-linux" ];
  };
}