From f13c7066dc22b50bd614927e92bc262bd0ccbbbf Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 19 Apr 2026 12:21:50 +0100 Subject: [PATCH 1/4] lpac: fix darwin build Build with libmbim and libqmi only on linux, as these fail to evaluate. pcsclite is provided by apple framework, similar to #459045. We also need to set CMAKE_OSX_ARCHITECTURES to avoid trying to build for both architectures, which fails. This requires pulling in a patch that's already accepted upstream, but not yet in a release. --- pkgs/by-name/lp/lpac/package.nix | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/lp/lpac/package.nix b/pkgs/by-name/lp/lpac/package.nix index dec353ca3f32..db7098155ea7 100644 --- a/pkgs/by-name/lp/lpac/package.nix +++ b/pkgs/by-name/lp/lpac/package.nix @@ -1,6 +1,7 @@ { stdenv, fetchFromGitHub, + fetchpatch, lib, cmake, pkg-config, @@ -10,8 +11,8 @@ libqmi, withDrivers ? true, withLibeuicc ? true, - withMbim ? true, - withQmi ? true, + withMbim ? stdenv.hostPlatform.isLinux, + withQmi ? stdenv.hostPlatform.isLinux, nix-update-script, }: @@ -32,13 +33,25 @@ stdenv.mkDerivation (finalAttrs: { env.LPAC_VERSION = finalAttrs.version; - patches = [ ./lpac-version.patch ]; + patches = [ + ./lpac-version.patch + + # CMAKE_OSX_ARCHITECTURES is set to "arm64;x86_64", and not overridable without this fix. + # https://github.com/estkme-group/lpac/pull/346 + (fetchpatch { + url = "https://github.com/estkme-group/lpac/commit/be86645e596ee34f6d85cd0f3e039d5b31f35856.patch"; + hash = "sha256-Y3tL9A1uKjX0x1O2WrQQ9k88Zu+Lpc+MNV9DRYePwgs="; + }) + ]; cmakeFlags = [ (lib.cmakeBool "LPAC_DYNAMIC_DRIVERS" withDrivers) (lib.cmakeBool "LPAC_DYNAMIC_LIBEUICC" withLibeuicc) (lib.cmakeBool "LPAC_WITH_APDU_MBIM" withMbim) (lib.cmakeBool "LPAC_WITH_APDU_QMI" withQmi) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeFeature "CMAKE_OSX_ARCHITECTURES" stdenv.hostPlatform.darwinArch) ]; nativeBuildInputs = [ @@ -48,6 +61,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ curl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pcsclite ] ++ optional withMbim libmbim From 38edd9a367b5207789d7ba00e53c430dc0085154 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 26 Apr 2026 13:43:26 +0300 Subject: [PATCH 2/4] easylpac: remove linux restriction lpac now builds for darwin too! --- pkgs/by-name/ea/easylpac/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ea/easylpac/package.nix b/pkgs/by-name/ea/easylpac/package.nix index da85d65a62f2..138c47d8a1f2 100644 --- a/pkgs/by-name/ea/easylpac/package.nix +++ b/pkgs/by-name/ea/easylpac/package.nix @@ -79,6 +79,6 @@ buildGoModule rec { license = lib.licenses.mit; maintainers = with lib.maintainers; [ stargate01 ]; mainProgram = "EasyLPAC"; - platforms = lib.platforms.linux; + platforms = lib.platforms.unix; }; } From f2fcde71fc8eed6a673f685881a31cb5d4611537 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 26 Apr 2026 13:59:14 +0300 Subject: [PATCH 3/4] easylpac: lookup lpac in $PATH on darwin, too --- pkgs/by-name/ea/easylpac/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/ea/easylpac/package.nix b/pkgs/by-name/ea/easylpac/package.nix index 138c47d8a1f2..b425ea736555 100644 --- a/pkgs/by-name/ea/easylpac/package.nix +++ b/pkgs/by-name/ea/easylpac/package.nix @@ -31,6 +31,12 @@ buildGoModule rec { vendorHash = "sha256-52I8hlnoHPhygwr0dxDP50X2A7Gsh0v/0SGQFH3FG/8="; + # also include $PATH lookup logic for `lpac` in the darwin case. + postPatch = '' + substituteInPlace config.go --replace-fail \ + 'case "linux":' 'case "linux", "darwin":' + ''; + nativeBuildInputs = [ copyDesktopItems pkg-config From 560218b4271d061e90f28e6231c2b752aaf97ef7 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 26 Apr 2026 20:57:32 +0000 Subject: [PATCH 4/4] easylpac: 0.8.0.2 -> 0.8.0.3 The $PATH lookup logic got merged upstream, so we can just bump the latest version and not patch. --- pkgs/by-name/ea/easylpac/package.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/ea/easylpac/package.nix b/pkgs/by-name/ea/easylpac/package.nix index b425ea736555..3157980dad45 100644 --- a/pkgs/by-name/ea/easylpac/package.nix +++ b/pkgs/by-name/ea/easylpac/package.nix @@ -20,23 +20,17 @@ buildGoModule rec { pname = "easylpac"; - version = "0.8.0.2"; + version = "0.8.0.3"; src = fetchFromGitHub { owner = "creamlike1024"; repo = "EasyLPAC"; tag = version; - hash = "sha256-GxcaMyEaPIGf+/wzmmycmFssTkP5Praj4GCYbxbJU28="; + hash = "sha256-q76p0BqrG8opuTClYKLfmM5hdziJIrZCwQmg2NkzW/E="; }; vendorHash = "sha256-52I8hlnoHPhygwr0dxDP50X2A7Gsh0v/0SGQFH3FG/8="; - # also include $PATH lookup logic for `lpac` in the darwin case. - postPatch = '' - substituteInPlace config.go --replace-fail \ - 'case "linux":' 'case "linux", "darwin":' - ''; - nativeBuildInputs = [ copyDesktopItems pkg-config