From 9ec3d89500e732a1daa6072e8883048d4b25e0a0 Mon Sep 17 00:00:00 2001 From: nikstur Date: Fri, 2 Feb 2024 16:49:13 +0100 Subject: [PATCH 1/2] tlmi-auth: improve overridability Use a recursive set instead of a let in before calling stdenv.mkDerivation. This allows to properly override the derivation with overrideAttrs. Do not re-use the pname in the fetcher function. Otherwise you cannot override the pname of a derivation while still fetching the same sources. However, this is something you sometimes want to do. --- pkgs/by-name/tl/tlmi-auth/package.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/tl/tlmi-auth/package.nix b/pkgs/by-name/tl/tlmi-auth/package.nix index a4640ab5850e..2cc32c0aea73 100644 --- a/pkgs/by-name/tl/tlmi-auth/package.nix +++ b/pkgs/by-name/tl/tlmi-auth/package.nix @@ -6,18 +6,15 @@ , ninja , openssl }: -let - name = "tlmi-auth"; + +stdenv.mkDerivation (finalAttrs: { + pname = "tlmi-auth"; version = "1.0.1"; -in -stdenv.mkDerivation { - pname = name; - version = version; src = fetchFromGitHub { owner = "lenovo"; - repo = name; - rev = "v${version}"; + repo = "tlmi-auth"; + rev = "v${finalAttrs.version}"; hash = "sha256-/juXQrb3MsQ6FxmrAa7E1f0vIMu1397tZ1pzLfr56M4="; }; @@ -32,8 +29,8 @@ stdenv.mkDerivation { homepage = "https://github.com/lenovo/tlmi-auth"; maintainers = with maintainers; [ snpschaaf ]; description = "Utility for creating signature strings needed for thinklmi certificate based authentication"; - mainProgram = name; + mainProgram = "tlmi-auth"; license = licenses.gpl2; platforms = platforms.linux; }; -} +}) From 52d2e90d45930a1bbb68a288e563b17306ad3846 Mon Sep 17 00:00:00 2001 From: nikstur Date: Sat, 3 Feb 2024 12:12:29 +0100 Subject: [PATCH 2/2] tlmi-auth: enable cross-compliation by correctly classifying dependencies --- pkgs/by-name/tl/tlmi-auth/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/tl/tlmi-auth/package.nix b/pkgs/by-name/tl/tlmi-auth/package.nix index 2cc32c0aea73..8ba738a97100 100644 --- a/pkgs/by-name/tl/tlmi-auth/package.nix +++ b/pkgs/by-name/tl/tlmi-auth/package.nix @@ -22,6 +22,9 @@ stdenv.mkDerivation (finalAttrs: { meson ninja pkg-config + ]; + + buildInputs = [ openssl ];