about summary refs log tree commit diff
path: root/nixpkgs/pkgs/misc/emulators/ppsspp/default.nix
blob: a15347715501313cc126a24b56ffe2a271d1c637 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{ SDL2
, cmake
, fetchFromGitHub
, ffmpeg_3
, glew
, lib
, libzip
, mkDerivation
, pkgconfig
, python3
, qtbase
, qtmultimedia
, snappy
, zlib
}:

mkDerivation rec {
  pname = "ppsspp";
  version = "1.9.4";

  src = fetchFromGitHub {
    owner = "hrydgard";
    repo = "ppsspp";
    rev = "v${version}";
    fetchSubmodules = true;
    sha256 = "0ivi0dcfxwa4nz19amki80qacnjhqr42f0ihyby1scxafl3nq55c";
  };

  postPatch = ''
    substituteInPlace git-version.cmake \
      --replace unknown ${src.rev}
    substituteInPlace UI/NativeApp.cpp \
      --replace /usr/share $out/share
  '';

  nativeBuildInputs = [ cmake pkgconfig python3 ];

  buildInputs = [
    SDL2
    ffmpeg_3
    glew
    libzip
    qtbase
    qtmultimedia
    snappy
    zlib
  ];

  cmakeFlags = [
    "-DOpenGL_GL_PREFERENCE=GLVND"
    "-DUSE_SYSTEM_FFMPEG=ON"
    "-DUSE_SYSTEM_LIBZIP=ON"
    "-DUSE_SYSTEM_SNAPPY=ON"
    "-DUSING_QT_UI=ON"
  ];

  installPhase = ''
    mkdir -p $out/share/ppsspp
    install -Dm555 PPSSPPQt $out/bin/ppsspp
    mv assets $out/share/ppsspp
  '';

  meta = with lib; {
    description = "A PSP emulator for Android, Windows, Mac and Linux, written in C++";
    homepage = "https://www.ppsspp.org/";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ AndersonTorres ];
  };
}