about summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/dockutil/default.nix
blob: 5e4187f07280f38a05b3dd2398c7519c71fddfba (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
{ lib, stdenv, fetchurl, libarchive, p7zip }:
stdenv.mkDerivation rec {
  pname = "dockutil";
  version = "3.0.2";

  src = fetchurl {
    url =
      "https://github.com/kcrawford/dockutil/releases/download/${version}/dockutil-${version}.pkg";
    sha256 = "175137ea747e83ed221d60b18b712b256ed31531534cde84f679487d337668fd";
  };

  dontBuild = true;

  nativeBuildInputs = [ libarchive p7zip ];

  unpackPhase = ''
    7z x $src
    bsdtar -xf Payload~
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    mkdir -p $out/usr/local/bin
    install -Dm755 usr/local/bin/dockutil -t $out/usr/local/bin
    ln -rs $out/usr/local/bin/dockutil $out/bin/dockutil
    runHook postInstall
  '';

  meta = with lib; {
    description = "Tool for managing dock items";
    homepage = "https://github.com/kcrawford/dockutil";
    license = licenses.asl20;
    maintainers = with maintainers; [ tboerger ];
    platforms = platforms.darwin;
  };
}