From ec5881151cfe27e080d7a3e8f25672d83c0a1f44 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Wed, 25 Sep 2024 15:48:57 +0800 Subject: [PATCH 1/4] fprintd: nixfmt; move to by-name; fprintd-tod: nixfmt; move to by-name; libprint: nixfmt; move to by-name --- pkgs/by-name/fp/fprintd-tod/package.nix | 59 +++++++++++++++ .../fp/fprintd/package.nix} | 73 ++++++++++--------- ...skip-test-test_removal_during_enroll.patch | 0 .../li/libfprint/package.nix} | 53 ++++++++------ pkgs/tools/security/fprintd/tod.nix | 56 -------------- pkgs/top-level/all-packages.nix | 6 -- 6 files changed, 127 insertions(+), 120 deletions(-) create mode 100644 pkgs/by-name/fp/fprintd-tod/package.nix rename pkgs/{tools/security/fprintd/default.nix => by-name/fp/fprintd/package.nix} (76%) rename pkgs/{tools/security => by-name/fp}/fprintd/skip-test-test_removal_during_enroll.patch (100%) rename pkgs/{development/libraries/libfprint/default.nix => by-name/li/libfprint/package.nix} (74%) delete mode 100644 pkgs/tools/security/fprintd/tod.nix diff --git a/pkgs/by-name/fp/fprintd-tod/package.nix b/pkgs/by-name/fp/fprintd-tod/package.nix new file mode 100644 index 000000000000..78906bfd0815 --- /dev/null +++ b/pkgs/by-name/fp/fprintd-tod/package.nix @@ -0,0 +1,59 @@ +{ + lib, + fetchFromGitLab, + fetchpatch, + fprintd, + libfprint-tod, +}: + +(fprintd.override { libfprint = libfprint-tod; }).overrideAttrs (oldAttrs: finalAttrs:{ + pname = "fprintd-tod"; + version = "1.90.9"; + + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "libfprint"; + repo = "fprintd"; + rev = "v${finalAttrs.version}"; + sha256 = "sha256-rOTVThHOY/Q2IIu2RGiv26UE2V/JFfWWnfKZQfKl5Mg="; + }; + + patches = oldAttrs.patches or [ ] ++ [ + (fetchpatch { + name = "use-more-idiomatic-correct-embedded-shell-scripting"; + url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/f4256533d1ffdc203c3f8c6ee42e8dcde470a93f.patch"; + sha256 = "sha256-4uPrYEgJyXU4zx2V3gwKKLaD6ty0wylSriHlvKvOhek="; + }) + (fetchpatch { + name = "remove-pointless-copying-of-files-into-build-directory"; + url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/2c34cef5ef2004d8479475db5523c572eb409a6b.patch"; + sha256 = "sha256-2pZBbMF1xjoDKn/jCAIldbeR2JNEVduXB8bqUrj2Ih4="; + }) + (fetchpatch { + name = "build-Do-not-use-positional-arguments-in-i18n.merge_file"; + url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/50943b1bd4f18d103c35233f0446ce7a31d1817e.patch"; + sha256 = "sha256-ANkAq6fr0VRjkS0ckvf/ddVB2mH4b2uJRTI4H8vPPes="; + }) + (fetchpatch { + name = "tests-Fix-dbusmock-AddDevice-calls-to-include-option"; + url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/ae04fa989720279e5558c3b8ff9ebe1959b1cf36.patch"; + sha256 = "sha256-jW5vlzrbZQ1gUDLBf7G50GnZfZxhlnL2Eu+9Bghdwdw="; + }) + ]; + + postPatch = + oldAttrs.postPatch or "" + + '' + # part of "remove-pointless-copying-of-files-into-build-directory" but git-apply doesn't handle renaming + mv src/device.xml src/net.reactivated.Fprint.Device.xml + mv src/manager.xml src/net.reactivated.Fprint.Manager.xml + ''; + + meta = { + homepage = "https://fprint.freedesktop.org/"; + description = "fprintd built with libfprint-tod to support Touch OEM Drivers"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ hmenke ]; + }; +}) diff --git a/pkgs/tools/security/fprintd/default.nix b/pkgs/by-name/fp/fprintd/package.nix similarity index 76% rename from pkgs/tools/security/fprintd/default.nix rename to pkgs/by-name/fp/fprintd/package.nix index 71951b59a6db..aeddeebba167 100644 --- a/pkgs/tools/security/fprintd/default.nix +++ b/pkgs/by-name/fp/fprintd/package.nix @@ -1,37 +1,42 @@ -{ lib, stdenv -, fetchFromGitLab -, pkg-config -, gobject-introspection -, meson -, ninja -, perl -, gettext -, gtk-doc -, libxslt -, docbook-xsl-nons -, docbook_xml_dtd_412 -, glib -, gusb -, dbus -, polkit -, nss -, pam -, systemd -, libfprint -, python3 +{ + lib, + stdenv, + fetchFromGitLab, + pkg-config, + gobject-introspection, + meson, + ninja, + perl, + gettext, + gtk-doc, + libxslt, + docbook-xsl-nons, + docbook_xml_dtd_412, + glib, + gusb, + dbus, + polkit, + nss, + pam, + systemd, + libfprint, + python3, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "fprintd"; version = "1.94.4"; - outputs = [ "out" "devdoc" ]; + outputs = [ + "out" + "devdoc" + ]; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; owner = "libfprint"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-B2g2d29jSER30OUqCkdk3+Hv5T3DA4SUKoyiqHb8FeU="; + repo = "fprintd"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-B2g2d29jSER30OUqCkdk3+Hv5T3DA4SUKoyiqHb8FeU="; }; nativeBuildInputs = [ @@ -41,6 +46,7 @@ stdenv.mkDerivation rec { perl # for pod2man gettext gtk-doc + python3 libxslt dbus docbook-xsl-nons @@ -81,11 +87,10 @@ stdenv.mkDerivation rec { # FIXME: Ugly hack for tests to find libpam_wrapper.so LIBRARY_PATH = lib.makeLibraryPath [ python3.pkgs.pypamtest ]; - doCheck = true; - mesonCheckFlags = [ # PAM related checks are timing out - "--no-suite" "fprintd:TestPamFprintd" + "--no-suite" + "fprintd:TestPamFprintd" ]; patches = [ @@ -107,11 +112,11 @@ stdenv.mkDerivation rec { --replace "'G_DEBUG=fatal-criticals'," "" ''; - meta = with lib; { + meta = { homepage = "https://fprint.freedesktop.org/"; description = "D-Bus daemon that offers libfprint functionality over the D-Bus interprocess communication bus"; - license = licenses.gpl2Plus; - platforms = platforms.linux; - maintainers = with maintainers; [ abbradar ]; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ abbradar ]; }; -} +}) diff --git a/pkgs/tools/security/fprintd/skip-test-test_removal_during_enroll.patch b/pkgs/by-name/fp/fprintd/skip-test-test_removal_during_enroll.patch similarity index 100% rename from pkgs/tools/security/fprintd/skip-test-test_removal_during_enroll.patch rename to pkgs/by-name/fp/fprintd/skip-test-test_removal_during_enroll.patch diff --git a/pkgs/development/libraries/libfprint/default.nix b/pkgs/by-name/li/libfprint/package.nix similarity index 74% rename from pkgs/development/libraries/libfprint/default.nix rename to pkgs/by-name/li/libfprint/package.nix index 3c1b14eaf909..9ab0f0ebb4a1 100644 --- a/pkgs/development/libraries/libfprint/default.nix +++ b/pkgs/by-name/li/libfprint/package.nix @@ -1,31 +1,36 @@ -{ lib, stdenv -, fetchFromGitLab -, pkg-config -, meson -, python3 -, ninja -, gusb -, pixman -, glib -, nss -, gobject-introspection -, cairo -, libgudev -, gtk-doc -, docbook-xsl-nons -, docbook_xml_dtd_43 +{ + lib, + stdenv, + fetchFromGitLab, + pkg-config, + meson, + python3, + ninja, + gusb, + pixman, + glib, + nss, + gobject-introspection, + cairo, + libgudev, + gtk-doc, + docbook-xsl-nons, + docbook_xml_dtd_43, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs:{ pname = "libfprint"; version = "1.94.6"; - outputs = [ "out" "devdoc" ]; + outputs = [ + "out" + "devdoc" + ]; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; owner = "libfprint"; repo = pname; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-lDnAXWukBZSo8X6UEVR2nOMeVUi/ahnJgx2cP+vykZ8="; }; @@ -82,11 +87,11 @@ stdenv.mkDerivation rec { runHook postInstallCheck ''; - meta = with lib; { + meta = { homepage = "https://fprint.freedesktop.org/"; description = "Library designed to make it easy to add support for consumer fingerprint readers"; - license = licenses.lgpl21Only; - platforms = platforms.linux; - maintainers = with maintainers; [ abbradar ]; + license = lib.licenses.lgpl21Only; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ abbradar ]; }; -} +}) diff --git a/pkgs/tools/security/fprintd/tod.nix b/pkgs/tools/security/fprintd/tod.nix deleted file mode 100644 index 633985989b3a..000000000000 --- a/pkgs/tools/security/fprintd/tod.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ lib -, fetchFromGitLab -, fetchpatch -, fprintd -, libfprint-tod -}: - -(fprintd.override { libfprint = libfprint-tod; }).overrideAttrs (oldAttrs: rec { - pname = "fprintd-tod"; - version = "1.90.9"; - - src = fetchFromGitLab { - domain = "gitlab.freedesktop.org"; - owner = "libfprint"; - repo = "fprintd"; - rev = "v${version}"; - sha256 = "sha256-rOTVThHOY/Q2IIu2RGiv26UE2V/JFfWWnfKZQfKl5Mg="; - }; - - patches = oldAttrs.patches or [] ++ [ - (fetchpatch { - name = "use-more-idiomatic-correct-embedded-shell-scripting"; - url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/f4256533d1ffdc203c3f8c6ee42e8dcde470a93f.patch"; - sha256 = "sha256-4uPrYEgJyXU4zx2V3gwKKLaD6ty0wylSriHlvKvOhek="; - }) - (fetchpatch { - name = "remove-pointless-copying-of-files-into-build-directory"; - url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/2c34cef5ef2004d8479475db5523c572eb409a6b.patch"; - sha256 = "sha256-2pZBbMF1xjoDKn/jCAIldbeR2JNEVduXB8bqUrj2Ih4="; - }) - (fetchpatch { - name = "build-Do-not-use-positional-arguments-in-i18n.merge_file"; - url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/50943b1bd4f18d103c35233f0446ce7a31d1817e.patch"; - sha256 = "sha256-ANkAq6fr0VRjkS0ckvf/ddVB2mH4b2uJRTI4H8vPPes="; - }) - (fetchpatch { - name = "tests-Fix-dbusmock-AddDevice-calls-to-include-option"; - url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/ae04fa989720279e5558c3b8ff9ebe1959b1cf36.patch"; - sha256 = "sha256-jW5vlzrbZQ1gUDLBf7G50GnZfZxhlnL2Eu+9Bghdwdw="; - }) - ]; - - postPatch = oldAttrs.postPatch or "" + '' - # part of "remove-pointless-copying-of-files-into-build-directory" but git-apply doesn't handle renaming - mv src/device.xml src/net.reactivated.Fprint.Device.xml - mv src/manager.xml src/net.reactivated.Fprint.Manager.xml - ''; - - meta = { - homepage = "https://fprint.freedesktop.org/"; - description = "fprintd built with libfprint-tod to support Touch OEM Drivers"; - license = lib.licenses.gpl2Plus; - platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ hmenke ]; - }; - }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0f17b22d3023..cedda01f3494 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7586,10 +7586,6 @@ with pkgs; fpm = callPackage ../tools/package-management/fpm { }; - fprintd = callPackage ../tools/security/fprintd { }; - - fprintd-tod = callPackage ../tools/security/fprintd/tod.nix { }; - ferdium = callPackage ../applications/networking/instant-messengers/ferdium { mkFranzDerivation = callPackage ../applications/networking/instant-messengers/franz/generic.nix { }; }; @@ -20675,8 +20671,6 @@ with pkgs; extraOnly = true; }; - libfprint = callPackage ../development/libraries/libfprint { }; - libfprint-tod = callPackage ../development/libraries/libfprint-tod { }; libfprint-2-tod1-goodix = callPackage ../development/libraries/libfprint-2-tod1-goodix { }; From aec7ee7bc385a027ba656a357c20a6c5dad1850d Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Wed, 25 Sep 2024 16:04:31 +0800 Subject: [PATCH 2/4] libfprint: 1.94.6 -> 1.94.8 --- pkgs/by-name/li/libfprint/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/li/libfprint/package.nix b/pkgs/by-name/li/libfprint/package.nix index 9ab0f0ebb4a1..29e6ef700af2 100644 --- a/pkgs/by-name/li/libfprint/package.nix +++ b/pkgs/by-name/li/libfprint/package.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation (finalAttrs:{ pname = "libfprint"; - version = "1.94.6"; + version = "1.94.8"; outputs = [ "out" "devdoc" @@ -29,9 +29,9 @@ stdenv.mkDerivation (finalAttrs:{ src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; owner = "libfprint"; - repo = pname; + repo = "libfprint"; rev = "v${finalAttrs.version}"; - hash = "sha256-lDnAXWukBZSo8X6UEVR2nOMeVUi/ahnJgx2cP+vykZ8="; + hash = "sha256-PZr4ZeVnuCKYfI8CKvRqBwalxsz9Ka17kSuLflwl7mE="; }; postPatch = '' From fd4188aaa92789d4d3be11e6b0283264a8011b89 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Wed, 25 Sep 2024 16:10:35 +0800 Subject: [PATCH 3/4] fprint: 1.94.3 -> 1.94.4 --- pkgs/by-name/fp/fprintd-tod/package.nix | 96 +++++++++++++------------ pkgs/by-name/li/libfprint/package.nix | 2 +- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/pkgs/by-name/fp/fprintd-tod/package.nix b/pkgs/by-name/fp/fprintd-tod/package.nix index 78906bfd0815..3f8d369efa09 100644 --- a/pkgs/by-name/fp/fprintd-tod/package.nix +++ b/pkgs/by-name/fp/fprintd-tod/package.nix @@ -6,54 +6,56 @@ libfprint-tod, }: -(fprintd.override { libfprint = libfprint-tod; }).overrideAttrs (oldAttrs: finalAttrs:{ - pname = "fprintd-tod"; - version = "1.90.9"; +(fprintd.override { libfprint = libfprint-tod; }).overrideAttrs ( + finalAttrs: previousAttrs: { + pname = "fprintd-tod"; + version = "1.90.9"; - src = fetchFromGitLab { - domain = "gitlab.freedesktop.org"; - owner = "libfprint"; - repo = "fprintd"; - rev = "v${finalAttrs.version}"; - sha256 = "sha256-rOTVThHOY/Q2IIu2RGiv26UE2V/JFfWWnfKZQfKl5Mg="; - }; + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "libfprint"; + repo = "fprintd"; + rev = "v${finalAttrs.version}"; + sha256 = "sha256-rOTVThHOY/Q2IIu2RGiv26UE2V/JFfWWnfKZQfKl5Mg="; + }; - patches = oldAttrs.patches or [ ] ++ [ - (fetchpatch { - name = "use-more-idiomatic-correct-embedded-shell-scripting"; - url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/f4256533d1ffdc203c3f8c6ee42e8dcde470a93f.patch"; - sha256 = "sha256-4uPrYEgJyXU4zx2V3gwKKLaD6ty0wylSriHlvKvOhek="; - }) - (fetchpatch { - name = "remove-pointless-copying-of-files-into-build-directory"; - url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/2c34cef5ef2004d8479475db5523c572eb409a6b.patch"; - sha256 = "sha256-2pZBbMF1xjoDKn/jCAIldbeR2JNEVduXB8bqUrj2Ih4="; - }) - (fetchpatch { - name = "build-Do-not-use-positional-arguments-in-i18n.merge_file"; - url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/50943b1bd4f18d103c35233f0446ce7a31d1817e.patch"; - sha256 = "sha256-ANkAq6fr0VRjkS0ckvf/ddVB2mH4b2uJRTI4H8vPPes="; - }) - (fetchpatch { - name = "tests-Fix-dbusmock-AddDevice-calls-to-include-option"; - url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/ae04fa989720279e5558c3b8ff9ebe1959b1cf36.patch"; - sha256 = "sha256-jW5vlzrbZQ1gUDLBf7G50GnZfZxhlnL2Eu+9Bghdwdw="; - }) - ]; + patches = previousAttrs.patches or [ ] ++ [ + (fetchpatch { + name = "use-more-idiomatic-correct-embedded-shell-scripting"; + url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/f4256533d1ffdc203c3f8c6ee42e8dcde470a93f.patch"; + sha256 = "sha256-4uPrYEgJyXU4zx2V3gwKKLaD6ty0wylSriHlvKvOhek="; + }) + (fetchpatch { + name = "remove-pointless-copying-of-files-into-build-directory"; + url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/2c34cef5ef2004d8479475db5523c572eb409a6b.patch"; + sha256 = "sha256-2pZBbMF1xjoDKn/jCAIldbeR2JNEVduXB8bqUrj2Ih4="; + }) + (fetchpatch { + name = "build-Do-not-use-positional-arguments-in-i18n.merge_file"; + url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/50943b1bd4f18d103c35233f0446ce7a31d1817e.patch"; + sha256 = "sha256-ANkAq6fr0VRjkS0ckvf/ddVB2mH4b2uJRTI4H8vPPes="; + }) + (fetchpatch { + name = "tests-Fix-dbusmock-AddDevice-calls-to-include-option"; + url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/ae04fa989720279e5558c3b8ff9ebe1959b1cf36.patch"; + sha256 = "sha256-jW5vlzrbZQ1gUDLBf7G50GnZfZxhlnL2Eu+9Bghdwdw="; + }) + ]; - postPatch = - oldAttrs.postPatch or "" - + '' - # part of "remove-pointless-copying-of-files-into-build-directory" but git-apply doesn't handle renaming - mv src/device.xml src/net.reactivated.Fprint.Device.xml - mv src/manager.xml src/net.reactivated.Fprint.Manager.xml - ''; + postPatch = + previousAttrs.postPatch or "" + + '' + # part of "remove-pointless-copying-of-files-into-build-directory" but git-apply doesn't handle renaming + mv src/device.xml src/net.reactivated.Fprint.Device.xml + mv src/manager.xml src/net.reactivated.Fprint.Manager.xml + ''; - meta = { - homepage = "https://fprint.freedesktop.org/"; - description = "fprintd built with libfprint-tod to support Touch OEM Drivers"; - license = lib.licenses.gpl2Plus; - platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ hmenke ]; - }; -}) + meta = { + homepage = "https://fprint.freedesktop.org/"; + description = "fprintd built with libfprint-tod to support Touch OEM Drivers"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ hmenke ]; + }; + } +) diff --git a/pkgs/by-name/li/libfprint/package.nix b/pkgs/by-name/li/libfprint/package.nix index 29e6ef700af2..7e0894f6b97b 100644 --- a/pkgs/by-name/li/libfprint/package.nix +++ b/pkgs/by-name/li/libfprint/package.nix @@ -18,7 +18,7 @@ docbook_xml_dtd_43, }: -stdenv.mkDerivation (finalAttrs:{ +stdenv.mkDerivation (finalAttrs: { pname = "libfprint"; version = "1.94.8"; outputs = [ From 6e3333cf802f66442b2c91aefab92878ab4be2ef Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 29 Oct 2024 16:54:36 +0800 Subject: [PATCH 4/4] fprintd-tod: fix build --- pkgs/by-name/fp/fprintd-tod/package.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/by-name/fp/fprintd-tod/package.nix b/pkgs/by-name/fp/fprintd-tod/package.nix index 3f8d369efa09..bb34e1b88de2 100644 --- a/pkgs/by-name/fp/fprintd-tod/package.nix +++ b/pkgs/by-name/fp/fprintd-tod/package.nix @@ -2,8 +2,13 @@ lib, fetchFromGitLab, fetchpatch, + libxml2, fprintd, libfprint-tod, + python3Packages, + libpam-wrapper, + gusb, + gobject-introspection, }: (fprintd.override { libfprint = libfprint-tod; }).overrideAttrs ( @@ -19,6 +24,19 @@ sha256 = "sha256-rOTVThHOY/Q2IIu2RGiv26UE2V/JFfWWnfKZQfKl5Mg="; }; + nativeBuildInputs = previousAttrs.nativeBuildInputs or [ ] ++ [ + libpam-wrapper + python3Packages.python + python3Packages.pycairo + python3Packages.dbus-python + python3Packages.python-dbusmock + python3Packages.pygobject3 + gusb + python3Packages.pypamtest + gobject-introspection + libxml2 # for xmllint + ]; + patches = previousAttrs.patches or [ ] ++ [ (fetchpatch { name = "use-more-idiomatic-correct-embedded-shell-scripting";