summaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-06-29 15:05:30 -0400
committerFreya Murphy <freya@freyacat.org>2025-06-29 15:05:30 -0400
commit7763871417518651e16924502982e57a8cab4dd1 (patch)
treeb9d58180ca682aeff411dad6faccb012c25802ad /pkgs
parentadd fingerprint to hyprlock (diff)
downloaddotfiles-nix-7763871417518651e16924502982e57a8cab4dd1.tar.gz
dotfiles-nix-7763871417518651e16924502982e57a8cab4dd1.tar.bz2
dotfiles-nix-7763871417518651e16924502982e57a8cab4dd1.zip
have fprint use tod vfs0090 driver
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/default.nix5
-rw-r--r--pkgs/libfprint-2-tod1-vfs0090/0001-vfs0090-add-missing-explicit-dependencies-in-meson.b.patch28
-rw-r--r--pkgs/libfprint-2-tod1-vfs0090/0002-vfs0090-add-missing-linux-limits.h-include.patch26
-rw-r--r--pkgs/libfprint-2-tod1-vfs0090/0003-vfs0090-fix-calls-to-fpi_ssm_next_state_delayed.patch34
-rw-r--r--pkgs/libfprint-2-tod1-vfs0090/default.nix72
5 files changed, 163 insertions, 2 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix
index d4235ba..453d37c 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -1,5 +1,6 @@
{pkgs, ...} @ inputs: {
- arcanist = import ./arcanist inputs;
- astal = import ./astal inputs;
+ arcanist = pkgs.callPackage ./arcanist inputs;
+ astal = pkgs.callPackage ./astal inputs;
+ libfprint-2-tod1-vfs0090 = pkgs.callPackage ./libfprint-2-tod1-vfs0090 inputs;
unofficial-homestuck-collection = pkgs.callPackage ./unofficial-homestuck-collection inputs;
}
diff --git a/pkgs/libfprint-2-tod1-vfs0090/0001-vfs0090-add-missing-explicit-dependencies-in-meson.b.patch b/pkgs/libfprint-2-tod1-vfs0090/0001-vfs0090-add-missing-explicit-dependencies-in-meson.b.patch
new file mode 100644
index 0000000..ac06e83
--- /dev/null
+++ b/pkgs/libfprint-2-tod1-vfs0090/0001-vfs0090-add-missing-explicit-dependencies-in-meson.b.patch
@@ -0,0 +1,28 @@
+From c02f2e040dd1e7664777c5a705272e4eb7bfb569 Mon Sep 17 00:00:00 2001
+From: Vincent Breitmoser <look@my.amazin.horse>
+Date: Thu, 10 Jun 2021 14:09:19 +0200
+Subject: [PATCH] vfs0090: add missing explicit dependencies in meson.build
+
+Make all dependencies explicit, so they can be found when building with Nix.
+
+---
+ meson.build | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 54a7ca4..88f8793 100644
+--- a/meson.build
++++ b/meson.build
+@@ -17,6 +17,9 @@ udev_dep = dependency('udev')
+ vfs009x_deps += libfprint_tod_dep
+ vfs009x_deps += dependency('nss')
+ vfs009x_deps += dependency('openssl')
++vfs009x_deps += dependency('gusb')
++vfs009x_deps += dependency('libfprint-2')
++vfs009x_deps += dependency('glib-2.0')
+
+ vfs0090_deps += dependency('pixman-1')
+
+--
+2.31.1
+
diff --git a/pkgs/libfprint-2-tod1-vfs0090/0002-vfs0090-add-missing-linux-limits.h-include.patch b/pkgs/libfprint-2-tod1-vfs0090/0002-vfs0090-add-missing-linux-limits.h-include.patch
new file mode 100644
index 0000000..6111cf0
--- /dev/null
+++ b/pkgs/libfprint-2-tod1-vfs0090/0002-vfs0090-add-missing-linux-limits.h-include.patch
@@ -0,0 +1,26 @@
+From 5405e02c629e689449e852424aed8cca217ed309 Mon Sep 17 00:00:00 2001
+From: Vincent Breitmoser <look@my.amazin.horse>
+Date: Thu, 10 Jun 2021 14:10:52 +0200
+Subject: [PATCH] vfs0090: add missing <linux/limits.h> include
+
+This header is needed for the NAME_MAX constant used in this file.
+
+---
+ vfs0090.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/vfs0090.c b/vfs0090.c
+index 8034faf..6070df7 100644
+--- a/vfs0090.c
++++ b/vfs0090.c
+@@ -24,6 +24,7 @@
+
+ #include <errno.h>
+ #include <ctype.h>
++#include <linux/limits.h>
+ #include <nss.h>
+ #include <pk11pub.h>
+ #include <sechash.h>
+--
+2.31.1
+
diff --git a/pkgs/libfprint-2-tod1-vfs0090/0003-vfs0090-fix-calls-to-fpi_ssm_next_state_delayed.patch b/pkgs/libfprint-2-tod1-vfs0090/0003-vfs0090-fix-calls-to-fpi_ssm_next_state_delayed.patch
new file mode 100644
index 0000000..7c21677
--- /dev/null
+++ b/pkgs/libfprint-2-tod1-vfs0090/0003-vfs0090-fix-calls-to-fpi_ssm_next_state_delayed.patch
@@ -0,0 +1,34 @@
+From 4796426bb964519fe18acb01b1c6651f574dbdfb Mon Sep 17 00:00:00 2001
+From: Freya Murphy <freya@freyacat.org>
+Date: Sun, 29 Jun 2025 14:50:10 -0400
+Subject: [PATCH 3/3] vfs0090: fix calls to fpi_ssm_next_state_delayed
+
+---
+ vfs0090.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vfs0090.c b/vfs0090.c
+index 6070df7..b18a5a9 100644
+--- a/vfs0090.c
++++ b/vfs0090.c
+@@ -1630,7 +1630,7 @@ led_blink_callback_with_ssm (FpiUsbTransfer *transfer, FpDevice *dev,
+
+ if (!error)
+ {
+- fpi_ssm_next_state_delayed (ssm, 200, NULL);
++ fpi_ssm_next_state_delayed (ssm, 200);
+ }
+ else
+ {
+@@ -2952,7 +2952,7 @@ reactivate_ssm (FpiSsm *ssm, FpDevice *dev)
+ switch (fpi_ssm_get_cur_state (ssm))
+ {
+ case REACTIVATE_STATE_WAIT:
+- fpi_ssm_next_state_delayed (ssm, 100, NULL);
++ fpi_ssm_next_state_delayed (ssm, 100);
+ break;
+
+ case REACTIVATE_STATE_DEACTIVATE:
+--
+2.49.0
+
diff --git a/pkgs/libfprint-2-tod1-vfs0090/default.nix b/pkgs/libfprint-2-tod1-vfs0090/default.nix
new file mode 100644
index 0000000..7770833
--- /dev/null
+++ b/pkgs/libfprint-2-tod1-vfs0090/default.nix
@@ -0,0 +1,72 @@
+{
+ stdenv,
+ lib,
+ fetchFromGitLab,
+ pkg-config,
+ libfprint,
+ libfprint-tod,
+ gusb,
+ udev,
+ nss,
+ openssl,
+ meson,
+ pixman,
+ ninja,
+ glib,
+ ...
+}:
+stdenv.mkDerivation {
+ pname = "libfprint-2-tod1-vfs0090";
+ version = "0.8.5";
+
+ src = fetchFromGitLab {
+ domain = "gitlab.freedesktop.org";
+ owner = "3v1n0";
+ repo = "libfprint-tod-vfs0090";
+ rev = "6084a1545589beec0c741200b18b0902cca225ba";
+ sha256 = "sha256-tSML/8USd/LuHF/YGLvNgykixF6VYtfE4SXzeV47840=";
+ };
+
+ patches = [
+ # TODO remove once https://gitlab.freedesktop.org/3v1n0/libfprint-tod-vfs0090/-/merge_requests/1 is merged
+ ./0001-vfs0090-add-missing-explicit-dependencies-in-meson.b.patch
+ # TODO remove once https://gitlab.freedesktop.org/3v1n0/libfprint-tod-vfs0090/-/merge_requests/2 is merged
+ ./0002-vfs0090-add-missing-linux-limits.h-include.patch
+ ./0003-vfs0090-fix-calls-to-fpi_ssm_next_state_delayed.patch
+ ];
+
+ nativeBuildInputs = [
+ pkg-config
+ meson
+ ninja
+ ];
+ buildInputs = [
+ libfprint
+ libfprint-tod
+ glib
+ gusb
+ udev
+ nss
+ openssl
+ pixman
+ ];
+
+ installPhase = ''
+ runHook preInstall
+
+ install -D -t "$out/lib/libfprint-2/tod-1/" libfprint-tod-vfs009x.so
+ install -D -t "$out/lib/udev/rules.d/" $src/60-libfprint-2-tod-vfs0090.rules
+
+ runHook postInstall
+ '';
+
+ passthru.driverPath = "/lib/libfprint-2/tod-1";
+
+ meta = with lib; {
+ description = "Libfprint-2-tod Touch OEM Driver for 2016 ThinkPad's fingerprint readers";
+ homepage = "https://gitlab.freedesktop.org/3v1n0/libfprint-tod-vfs0090";
+ license = licenses.lgpl21Plus;
+ platforms = platforms.linux;
+ maintainers = with maintainers; [ valodim ];
+ };
+}