about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/feishin/darwin.nix
blob: fb8a27abdc417289d904f22b9952812508c71d40 (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
{ stdenv
, lib
, meta
, fetchurl
, unzip
, mpv
, electron_24
, makeDesktopItem
, makeWrapper
, pname
, appname
, version
}:

stdenv.mkDerivation {
  inherit pname version;

  src = fetchurl {
    url = "https://github.com/jeffvli/feishin/releases/download/v${version}/${appname}-${version}-mac-x64.zip";
    hash = "sha256-J5LB4uR/NJ6ykiTqBY1VepcLujprgqwpxy7sGD0NtZw=";
  };

  nativeBuildInputs = [ makeWrapper unzip ];

  # Installs mpv as a requirement
  propagatedBuildInputs = [ mpv ];

  installPhase = ''
    runHook preInstall
    mkdir -p $out/{Applications/${appname}.app,bin}
    cp -R . $out/Applications/${appname}.app
    makeWrapper $out/Applications/${appname}.app/Contents/MacOS/${appname} $out/bin/${pname}
    runHook postInstall
  '';

  shellHook = ''
    set -x
    export LD_LIBRARY_PATH=${mpv}/lib
    set +x
  '';
}