Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 stdenv,
3 fetchFromGitHub,
4 lib,
5 cmake,
6 pkg-config,
7 pcsclite,
8 curl,
9 withDrivers ? true,
10 withLibeuicc ? true,
11 nix-update-script,
12}:
13
14let
15 inherit (lib) optional;
16in
17stdenv.mkDerivation (finalAttrs: {
18
19 pname = "lpac";
20 version = "2.2.1";
21
22 src = fetchFromGitHub {
23 owner = "estkme-group";
24 repo = "lpac";
25 tag = "v${finalAttrs.version}";
26 hash = "sha256-dxoYuX3dNj4piXQBqU4w1ICeyOGid35c+6ZITQiN6wA=";
27 };
28
29 env.LPAC_VERSION = finalAttrs.version;
30
31 patches = [ ./lpac-version.patch ];
32
33 cmakeFlags =
34 optional withDrivers "-DLPAC_DYNAMIC_DRIVERS=on"
35 ++ optional withLibeuicc "-DLPAC_DYNAMIC_LIBEUICC=on";
36
37 nativeBuildInputs = [
38 cmake
39 pkg-config
40 ];
41
42 buildInputs = [
43 curl
44 pcsclite
45 ];
46
47 passthru = {
48 updateScript = nix-update-script { attrPath = finalAttrs.pname; };
49 };
50
51 meta = {
52 description = "C-based eUICC LPA";
53 homepage = "https://github.com/estkme-group/lpac";
54 mainProgram = "lpac";
55 license = [ lib.licenses.agpl3Plus ] ++ optional withLibeuicc lib.licenses.lgpl21Plus;
56 maintainers = with lib.maintainers; [ sarcasticadmin ];
57 platforms = lib.platforms.all;
58 };
59})