summaryrefslogtreecommitdiff
path: root/packages/lampray.nix
blob: e9caa1379d344a150c8dbf2e16fd848e3d79f1b3 (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
64
65
66
67
68
69
70
71
{
  SDL2,
  autoPatchelfHook,
  cmake,
  curl,
  fetchFromGitHub,
  lib,
  lz4,
  makeWrapper,
  ninja,
  p7zip,
  pkg-config,
  stdenv,
  zenity,
}:
stdenv.mkDerivation {
  pname = "lampray";
  version = "1.4.0-unstable-2024-05-25";

  src = fetchFromGitHub {
    owner = "CHollingworth";
    repo = "Lampray";
    rev = "c549fbfbd6ad18b2eca0a6d17b6066d1f74c54b7";
    hash = "sha256-tjFxHU2kFS5yX0itm4rGKLE7lm/NMgsRjTEGykJELv8=";
  };

  nativeBuildInputs = [
    autoPatchelfHook
    cmake
    makeWrapper
    ninja
    pkg-config
  ];

  buildInputs = [
    SDL2
    curl
    lz4
  ];

  postPatch = ''
    substituteInPlace Lampray/Control/lampConfig.cpp \
      --replace-fail '/usr/libexec/p7zip/7z.so' '${p7zip.lib}/lib/p7zip/7z.so'
  '';

  installPhase = ''
    runHook preInstall

    install -Dm755 Lampray $out/bin/lampray
    wrapProgram $out/bin/lampray \
      --prefix PATH : "${lib.makeBinPath [ zenity ]}"

    runHook postInstall
  '';

  meta = with lib; {
    description = "Mod manager for gaming on Linux";
    homepage = "https://github.com/CHollingworth/Lampray";
    license = with licenses; [
      unlicense
      mpl20 # bit7z
      mit # json & pugixml
      bsd2 # l4z
      gpl2Only # l4z
    ];
    platforms = [ "x86_64-linux" ];
    maintainers = with maintainers; [ azahi ];
    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
    mainProgram = "lampray";
  };
}