summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/discrete-scroll/default.nix
blob: f38bf8d813229c40a82926e2ad39b14fa9bf5801 (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
{ stdenv, lib, fetchFromGitHub, Cocoa }:

## after launching for the first time, grant access for parent application (e.g. Terminal.app)
## from 'system preferences >> security & privacy >> accessibility'
## and then launch again

stdenv.mkDerivation rec {
  pname = "discrete-scroll";
  version = "0.1.1";

  src = fetchFromGitHub {
    owner = "emreyolcu";
    repo = "discrete-scroll";
    rev = "v${version}";
    sha256 = "0aqkp4kkwjlkll91xbqwf8asjww8ylsdgqvdk8d06bwdvg2cgvhg";
  };

  buildInputs = [ Cocoa ];

  buildPhase = ''
    cc -std=c99 -O3 -Wall -framework Cocoa -o dc DiscreteScroll/main.m
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp ./dc $out/bin/discretescroll
  '';

  meta = with lib; {
    description = "Fix for OS X's scroll wheel problem";
    homepage = "https://github.com/emreyolcu/discrete-scroll";
    platforms = platforms.darwin;
    license = licenses.mit;
    maintainers = with lib.maintainers; [ bb2020 ];
  };
}