summaryrefslogtreecommitdiff
path: root/pkgs/papa/package.nix
blob: 4c98ec5a4c6a2e8de4716bf40795aa2838d8297c (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
{
  lib,
  fetchFromGitHub,
  installShellFiles,
  nix-update-script,
  openssl,
  papa,
  pkg-config,
  rustPlatform,
  testers,
}:

rustPlatform.buildRustPackage rec {
  pname = "papa";
  version = "4.1.0-rc.4";

  src = fetchFromGitHub {
    owner = "AnActualEmerald";
    repo = "papa";
    rev = "refs/tags/v${version}";
    hash = "sha256-XAYenoWLKeNzNozFRPz84WDeU0/y2hd/wgr3UeZLFS0=";
  };

  postUnpack = ''
    rmdir source/thermite
    ln -sf ${passthru.libthermite} source/thermite
  '';

  cargoHash = "sha256-t2c/eaQLEKLzJEvyY35Kithon5K5Bes3OWmQgExigzI=";

  nativeBuildInputs = [
    pkg-config
    installShellFiles
  ];

  buildInputs = [ openssl ];

  postInstall = ''
    installShellCompletion --cmd papa \
      --bash <($out/bin/papa complete bash) \
      --fish <($out/bin/papa complete fish) \
      --zsh <($out/bin/papa complete zsh)
  '';

  passthru = {
    libthermite = fetchFromGitHub {
      owner = "AnActualEmerald";
      repo = "thermite";
      rev = "8e6fc6af20e9bd2af4313fee65dfed05cfa1bbd5";
      hash = "sha256-7zkXW2G7cwyobYJO22o1QoJRs2O6sD7/S9frZ/+DNIQ=";
    };

    tests.version = testers.testVersion { package = papa; };

    updateScript = nix-update-script { };
  };

  meta = {
    description = "Mod manager for Northstar clients and servers";
    homepage = "https://github.com/AnActualEmerald/papa";
    changelog = "https://github.com/AnActualEmerald/papa/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ getchoo ];
    mainProgram = "papa";
    platforms = lib.platforms.unix;
  };
}