about summary refs log tree commit diff
path: root/pkgs/by-name/sc/screen-pipe/package.nix
blob: 141eca8d82c7fd893dde895c179118cda7b00816 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
  lib,
  rustPlatform,
  fetchFromGitHub,
  pkg-config,
  dbus,
  ffmpeg,
  oniguruma,
  openssl,
  sqlite,
  stdenv,
  darwin,
  alsa-lib,
  xorg,
}:
rustPlatform.buildRustPackage rec {
  pname = "screen-pipe";
  version = "0.1.48";

  src = fetchFromGitHub {
    owner = "louis030195";
    repo = "screen-pipe";
    rev = "v${version}";
    hash = "sha256-rWKRCqWFuPO84C52mMrrS4euD6XdJU8kqZsAz28+vWE=";
  };

  cargoLock = {
    lockFile = ./Cargo.lock;
    outputHashes = {
      "cpal-0.15.3" = "sha256-eKn3tS5QuqbMTwnRAEybvbPZOiKiid7ghGztAmrs9fw=";
      "rusty-tesseract-1.1.10" = "sha256-XT74zGn+DetEBUujHm4Soe2iorQcIoUeZbscTv+64hw=";
    };
  };

  postPatch = ''
    ln -s ${./Cargo.lock} Cargo.lock
  '';

  nativeBuildInputs = [
    pkg-config
    rustPlatform.bindgenHook
  ];

  buildInputs =
    [
      dbus
      ffmpeg
      oniguruma
      openssl
      sqlite
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin (
      with darwin.apple_sdk_12_3.frameworks;
      [
        CoreAudio
        AudioUnit
        CoreFoundation
        CoreGraphics
        CoreMedia
        IOKit
        Metal
        MetalPerformanceShaders
        Security
        ScreenCaptureKit
        SystemConfiguration
      ]
    )
    ++ lib.optionals stdenv.hostPlatform.isLinux [
      alsa-lib
      xorg.libxcb
    ];

  buildFeatures = lib.optional stdenv.hostPlatform.isDarwin "metal";

  env = {
    RUSTONIG_SYSTEM_LIBONIG = true;
  };

  doCheck = false; # Tests fail to build

  meta = with lib; {
    description = "Personalized AI powered by what you've seen, said, or heard";
    homepage = "https://github.com/louis030195/screen-pipe";
    license = licenses.mit;
    maintainers = with maintainers; [ dit7ya ];
    mainProgram = "screen-pipe";
  };
}