diff --git a/pkgs/by-name/di/discrete-scroll/package.nix b/pkgs/by-name/di/discrete-scroll/package.nix new file mode 100644 index 0000000000000..f3b0f1c981091 --- /dev/null +++ b/pkgs/by-name/di/discrete-scroll/package.nix @@ -0,0 +1,37 @@ +{ + lib, + stdenv, + fetchFromGitHub, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "discrete-scroll"; + version = "1.2.1"; + + src = fetchFromGitHub { + owner = "emreyolcu"; + repo = "discrete-scroll"; + rev = "v${finalAttrs.version}"; + hash = "sha256-FYYtJUl1tvMu9yMK5VpHmMeM6otDIpoOvSGTjYNPBr0="; + }; + + buildPhase = '' + runHook preBuild + $CC -O3 -framework ApplicationServices DiscreteScroll/main.c + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + install -Dm755 a.out $out/bin/discretescroll + runHook postInstall + ''; + + meta = { + description = "Fix for OS X's scroll wheel problem"; + homepage = "https://github.com/emreyolcu/discrete-scroll"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ bb2020 ]; + platforms = lib.platforms.darwin; + }; +}) diff --git a/pkgs/os-specific/darwin/discrete-scroll/default.nix b/pkgs/os-specific/darwin/discrete-scroll/default.nix deleted file mode 100644 index f38bf8d813229..0000000000000 --- a/pkgs/os-specific/darwin/discrete-scroll/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ 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 ]; - }; -} diff --git a/pkgs/top-level/darwin-aliases.nix b/pkgs/top-level/darwin-aliases.nix index 6fafa5f487c45..768e908a361c9 100644 --- a/pkgs/top-level/darwin-aliases.nix +++ b/pkgs/top-level/darwin-aliases.nix @@ -59,6 +59,10 @@ mapAliases ({ cctools-llvm = pkgs.cctools; # added 2024-07-01 cctools-port = pkgs.cctools; # added 2024-07-17 + ### D ### + + discrete-scroll = pkgs.discrete-scroll; # added 2024-11-27 + ### I ### insert_dylib = throw "'darwin.insert_dylib' has been renamed to 'insert-dylib'"; # added 2024-04-04 diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index ab8d9c387b407..9c9cb90435910 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -239,8 +239,6 @@ impure-cmds // apple-source-packages // apple-source-headers // stubs // { ios-deploy = callPackage ../os-specific/darwin/ios-deploy {}; - discrete-scroll = callPackage ../os-specific/darwin/discrete-scroll { }; - # See doc/packages/darwin-builder.section.md linux-builder = lib.makeOverridable ({ modules }: let