about summary refs log tree commit diff
path: root/pkgs/by-name/ch/choose-gui/package.nix
blob: bbf1ff2a8578c17bee36f73cce0fce3a92eb32c3 (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
{
  lib,
  stdenv,
  fetchFromGitHub,
  xcbuild,
  darwin,
}:

stdenv.mkDerivation rec {
  pname = "choose-gui";
  version = "1.3.1";

  src = fetchFromGitHub {
    owner = "chipsenkbeil";
    repo = "choose";
    rev = version;
    hash = "sha256-oR0GgMinKcBHaZWdE7O+mdbiLKKjkweECKbi80bjW+c=";
  };

  nativeBuildInputs = [ xcbuild ];

  buildInputs = [ darwin.apple_sdk.frameworks.Cocoa ];

  buildPhase = ''
    runHook preBuild
    xcodebuild -arch ${stdenv.hostPlatform.darwinArch} -configuration Release SYMROOT="./output" build
    cp ./output/Release/choose choose
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    cp choose $out/bin/choose
    chmod +x $out/bin/choose
    runHook postInstall
  '';

  meta = {
    description = "Fuzzy matcher for OS X that uses both std{in,out} and a native GUI";
    homepage = "https://github.com/chipsenkbeil/choose";
    license = lib.licenses.mit;
    platforms = lib.platforms.darwin;
    changelog = "https://github.com/chipsenkbeil/choose/blob/${version}/CHANGELOG.md";
    maintainers = with lib.maintainers; [ heywoodlh ];
    mainProgram = "choose";
  };
}