about summary refs log tree commit diff
path: root/pkgs/by-name/ra
diff options
context:
space:
mode:
authorLennart <lennarteichhorn@googlemail.com>2022-12-21 19:02:30 +0000
committerZebreus <lennarteichhorn@googlemail.com>2024-03-26 05:13:35 +0100
commit0fcfddef3b3da273aaf25eb156aad01746ec7855 (patch)
tree23f0f5ed8eaee407b7725a2df77ae2e4d7ff831f /pkgs/by-name/ra
parent8aa81f34981add12aecada6c702ddbbd0375ca36 (diff)
ratslap: init at 0.4.1
Diffstat (limited to 'pkgs/by-name/ra')
-rw-r--r--pkgs/by-name/ra/ratslap/package.nix70
1 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/by-name/ra/ratslap/package.nix b/pkgs/by-name/ra/ratslap/package.nix
new file mode 100644
index 0000000000000..6ea5cc191652c
--- /dev/null
+++ b/pkgs/by-name/ra/ratslap/package.nix
@@ -0,0 +1,70 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, libusb1
+, pkg-config
+, installShellFiles
+, git
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ratslap";
+  version = "0.4.1";
+
+  src = fetchFromGitHub {
+    owner = "krayon";
+    repo = "ratslap";
+    rev = version;
+    sha256 = "sha256-PO/79tTiO4TBtojrEtkSf5W6zuG+Ml2iJGAtYHDwHEY=";
+    leaveDotGit = true;
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    installShellFiles
+    git
+  ];
+
+  buildInputs = [
+    libusb1
+  ];
+
+  preBuild = ''
+    makeFlagsArray+=(
+      "-W gitup"
+      "VDIRTY="
+      "MAJVER=${version}"
+      "APPBRANCH=main"
+      "BINNAME=${pname}"
+      "MARKDOWN_GEN="
+      "BUILD_DATE=$(git show -s --date=format:'%Y-%m-%d %H:%M:%S%z' --format=%cd)"
+      "BUILD_MONTH=$(git show -s --date=format:'%B' --format=%cd)"
+      "BUILD_YEAR=$(git show -s --date=format:'%Y' --format=%cd)"
+    )
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    cp ratslap $out/bin
+
+    mv manpage.1 ${pname}.1
+    installManPage ${pname}.1
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Configure G300 and G300s Logitech mice";
+    longDescription = ''
+      A tool to configure Logitech mice on Linux. Supports remapping
+      all buttons and configuring modes, DPI settings and the LED.
+    '';
+    homepage = "https://github.com/krayon/ratslap";
+    changelog = "https://github.com/krayon/ratslap/releases/tag/${version}";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ zebreus ];
+    platforms = platforms.all;
+  };
+}