about summary refs log tree commit diff
path: root/pkgs/by-name/co/comet-gog/package.nix
blob: 61552a8d5b00f448fa024dab1cf8346ee20e8d65 (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
{
  lib,
  stdenv,
  rustPlatform,
  fetchFromGitHub,
  protobuf,
  darwin,
}:

let
  inherit (darwin.apple_sdk.frameworks) CoreFoundation SystemConfiguration;
in
rustPlatform.buildRustPackage {
  pname = "comet-gog";
  version = "0-unstable-2024-05-25";

  src = fetchFromGitHub {
    owner = "imLinguin";
    repo = "comet";
    rev = "378ec2abdc2498e7c0c12aa50b71f6d94c3e8e3c";
    hash = "sha256-r7ZPpJLy2fZsyNijl0+uYWQN941TCbv+Guv3wzD83IQ=";
    fetchSubmodules = true;
  };

  cargoHash = "sha256-dXNAGMVayzgT96ETrph9eCbQv28EK/OOxIRV8ewpVvs=";

  # error: linker `aarch64-linux-gnu-gcc` not found
  postPatch = ''
    rm .cargo/config.toml
  '';

  env.PROTOC = lib.getExe' protobuf "protoc";

  buildInputs = lib.optionals stdenv.isDarwin [
    CoreFoundation
    SystemConfiguration
  ];

  meta = {
    description = "Open Source implementation of GOG Galaxy's Communication Service";
    homepage = "https://github.com/imLinguin/comet";
    license = lib.licenses.gpl3Plus;
    mainProgram = "comet";
    maintainers = with lib.maintainers; [ tomasajt ];
  };
}