summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/trash/default.nix
blob: e1606383c0dcc32e9d06b7473597b67bbb86a556 (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
{ stdenv, fetchFromGitHub, perl, cf-private, AppKit, Cocoa, ScriptingBridge }:

stdenv.mkDerivation rec {
  version = "0.9.1";
  name = "trash-${version}";

  src = fetchFromGitHub {
    owner = "ali-rantakari";
    repo = "trash";
    rev = "v${version}";
    sha256 = "0ylkf7jxfy1pj7i1s48w28kzqjdfd57m2pw0jycsgcj5bkzwll41";
  };

  buildInputs = [
    perl
    Cocoa AppKit ScriptingBridge
    # Neded for OBJC_CLASS_$_NSMutableArray symbols.
    cf-private
  ];

  patches = [ ./trash.diff ];

  buildPhase = ''make all docs'';

  installPhase = ''
    mkdir -p $out/bin
    mkdir -p $out/share/man/man1
    install -m 0755 trash $out/bin
    install -m 0444 trash.1 $out/share/man/man1
  '';

  meta = {
    homepage = https://github.com/ali-rantakari/trash;
    description = "Small command-line program for OS X that moves files or
    folders to the trash.";
    platforms = stdenv.lib.platforms.darwin;
    license = stdenv.lib.licenses.mit;
  };
}