summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ti/tinycast/package.nix
blob: ba2bc43e39a4dbe22279004b14c8a55723396f44 (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
{
  lib,
  stdenvNoCC,
  fetchurl,
  _7zz,
}:

let
  sources = lib.importJSON ./sources.json;
in

stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "tinycast";
  inherit (sources) version;

  strictDeps = true;
  __structuredAttrs = true;

  src = fetchurl {
    url = "https://github.com/abue-ammar/tinycast/releases/download/${sources.tag}/Tinycast-${sources.version}.dmg";
    inherit (sources) hash;
  };

  dontPatch = true;
  dontConfigure = true;
  dontBuild = true;
  dontFixup = true;

  # Tinycast.dmg is APFS formatted, which is unsupported by undmg.
  nativeBuildInputs = [ _7zz ];

  sourceRoot = "Tinycast Beta.app";

  installPhase = ''
    runHook preInstall

    mkdir -p "$out/Applications/Tinycast Beta.app"
    cp -R . "$out/Applications/Tinycast Beta.app"

    runHook postInstall
  '';

  passthru.updateScript = ./update.sh;

  meta = {
    description = "Beta release of Tinycast, a native macOS launcher, hotkeys, and clipboard history";
    homepage = "https://github.com/abue-ammar/tinycast";
    changelog = "https://github.com/abue-ammar/tinycast/releases/tag/v${finalAttrs.version}";
    license = lib.licenses.agpl3Only;
    maintainers = with lib.maintainers; [ pwnwriter ];
    platforms = [
      "aarch64-darwin"
      "x86_64-darwin"
    ];
    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
  };
})