summaryrefslogtreecommitdiff
path: root/pkgs/by-name/mu/mupen64plus/package.nix
blob: 9b9230e0ec06aebbb6aa0d2bdea885b13e881817 (about) (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
{
  lib,
  stdenv,
  fetchurl,
  boost,
  dash,
  freetype,
  libpng,
  libGLU,
  pkg-config,
  SDL2,
  which,
  zlib,
  nasm,
  vulkan-loader,
}:

stdenv.mkDerivation rec {
  pname = "mupen64plus";
  version = "2.6.0";

  src = fetchurl {
    url = "https://github.com/mupen64plus/mupen64plus-core/releases/download/${version}/mupen64plus-bundle-src-${version}.tar.gz";
    sha256 = "sha256-KX4XGAzXanuOqAnRob4smO1cc1LccWllqA3rWYsh4TE=";
  };

  patches = [
    # Remove unused SDL2 header that erroneously adds libX11 dependency
    ./remove-unused-header.patch
  ];

  nativeBuildInputs = [
    pkg-config
    nasm
  ];
  buildInputs = [
    boost
    dash
    freetype
    libpng
    libGLU
    SDL2
    which
    zlib
    vulkan-loader
  ];

  buildPhase = ''
    dash m64p_build.sh PREFIX="$out" COREDIR="$out/lib/" PLUGINDIR="$out/lib/mupen64plus" SHAREDIR="$out/share/mupen64plus"
  '';
  installPhase = ''
    dash m64p_install.sh DESTDIR="$out" PREFIX=""
  '';

  meta = with lib; {
    description = "Nintendo 64 Emulator";
    license = licenses.gpl2Plus;
    homepage = "http://www.mupen64plus.org/";
    maintainers = [ maintainers.sander ];
    platforms = [ "x86_64-linux" ];
    mainProgram = "mupen64plus";
  };
}