lpac: init at 2.2.1

Co-authored-by: Lin Yinfeng <lin.yinfeng@outlook.com>
This commit is contained in:
Robert James Hernandez 2025-01-20 19:12:11 +00:00
parent ebc1014284
commit a2247e78d5
2 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,13 @@
diff --git a/cmake/git-version.cmake b/cmake/git-version.cmake
index be226fd..1451ff6 100644
--- a/cmake/git-version.cmake
+++ b/cmake/git-version.cmake
@@ -15,6 +15,8 @@ if(GIT_EXECUTABLE)
endif()
endif()
+set(LPAC_VERSION "$ENV{LPAC_VERSION}")
+
# Final fallback: Just use a bogus version string that is semantically older
# than anything else and spit out a warning to the developer.
if(NOT DEFINED LPAC_VERSION)

View File

@ -0,0 +1,59 @@
{
stdenv,
fetchFromGitHub,
lib,
cmake,
pkg-config,
pcsclite,
curl,
withDrivers ? true,
withLibeuicc ? true,
nix-update-script,
}:
let
inherit (lib) optional;
in
stdenv.mkDerivation (finalAttrs: {
pname = "lpac";
version = "2.2.1";
src = fetchFromGitHub {
owner = "estkme-group";
repo = "lpac";
tag = "v${finalAttrs.version}";
hash = "sha256-dxoYuX3dNj4piXQBqU4w1ICeyOGid35c+6ZITQiN6wA=";
};
env.LPAC_VERSION = finalAttrs.version;
patches = [ ./lpac-version.patch ];
cmakeFlags =
optional withDrivers "-DLPAC_DYNAMIC_DRIVERS=on"
++ optional withLibeuicc "-DLPAC_DYNAMIC_LIBEUICC=on";
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
curl
pcsclite
];
passthru = {
updateScript = nix-update-script { attrPath = finalAttrs.pname; };
};
meta = {
description = "C-based eUICC LPA";
homepage = "https://github.com/estkme-group/lpac";
mainProgram = "lpac";
license = [ lib.licenses.agpl3Plus ] ++ optional withLibeuicc lib.licenses.lgpl21Plus;
maintainers = with lib.maintainers; [ sarcasticadmin ];
platforms = lib.platforms.all;
};
})