diff options
author | Zhong Jianxin <azuwis@gmail.com> | 2024-05-12 20:02:44 +0800 |
---|---|---|
committer | Zhong Jianxin <azuwis@gmail.com> | 2024-05-12 20:02:44 +0800 |
commit | 4c0f9d5733b7efeed4d32cf2a071a3e0da867b66 (patch) | |
tree | a1c043d194a71dbb9678dffa880eaf2643404e1c /pkgs/by-name/du | |
parent | add7fad06c489f6cfa86906bd20df81b48407797 (diff) |
dualsensectl: migrate to pkgs/by-name and other enhancements
- Format using nixfmt-rfc-style - Switch to finalAttrs pattern - Add passthru.tests.version - Add passthru.updateScript - Add meta.changelog
Diffstat (limited to 'pkgs/by-name/du')
-rw-r--r-- | pkgs/by-name/du/dualsensectl/package.nix | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/by-name/du/dualsensectl/package.nix b/pkgs/by-name/du/dualsensectl/package.nix new file mode 100644 index 0000000000000..63eefab713dc6 --- /dev/null +++ b/pkgs/by-name/du/dualsensectl/package.nix @@ -0,0 +1,52 @@ +{ + lib, + stdenv, + fetchFromGitHub, + pkg-config, + dbus, + hidapi, + udev, + testers, + nix-update-script, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "dualsensectl"; + version = "0.5"; + + src = fetchFromGitHub { + owner = "nowrep"; + repo = "dualsensectl"; + rev = "v${finalAttrs.version}"; + hash = "sha256-+OSp9M0A0J4nm7ViDXG63yrUZuZxR7gyckwSCdy3qm0="; + }; + + postPatch = '' + substituteInPlace Makefile --replace "/usr/" "/" + ''; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ + dbus + hidapi + udev + ]; + + makeFlags = [ "DESTDIR=$(out)" ]; + + passthru = { + tests.version = testers.testVersion { package = finalAttrs.finalPackage; }; + updateScript = nix-update-script { }; + }; + + meta = with lib; { + changelog = "https://github.com/nowrep/dualsensectl/releases/tag/v${finalAttrs.version}"; + description = "Linux tool for controlling PS5 DualSense controller"; + homepage = "https://github.com/nowrep/dualsensectl"; + license = licenses.gpl2Only; + mainProgram = "dualsensectl"; + maintainers = with maintainers; [ azuwis ]; + platforms = platforms.linux; + }; +}) |