github-copilot-cli: improve dependency handling

Add glib and libsecret as dependencies for builds that might need them.
Replace `autoPatchelfIgnoreMissingDeps = true` with an explicit list of
the dependencies we're deliberately ignoring.

GitHub Copilot CLI isn't an open source tool and the documentation isn't
clear on what each possible dependency is used for.  I expect some
dependencies are only used in rare scenarios or would never be used by
the CLI tool and are just inhereted from some of the desktop Copilot
applications.  That means there's a bit of a guessing game in balancing
(a) the desire to provide all the tools Copilot might use and (b) not
growing the package closure for no real benefit.

I've added glib and libsecret as I don't think they significantly expand
the closure and are relatively likely to be useful.  I've left out the
tools that seem most useful for GUI and media interfaces as they're
bulky and seem likely to be included because they're common with
GUI-based Copilot tools rather than because they're needed for GitHub
Copilot CLI.

Assisted-by: GitHub Copilot CLI (claude-sonnet-4.6)
This commit is contained in:
Adam Dinwoodie
2026-05-21 10:42:29 +01:00
parent 4a29d733e8
commit e171111cc1
+19 -4
View File
@@ -4,6 +4,8 @@
autoPatchelfHook,
cacert,
fetchurl,
glib,
libsecret,
makeBinaryWrapper,
bash,
nodejs,
@@ -28,12 +30,25 @@ stdenv.mkDerivation (finalAttrs: {
makeBinaryWrapper
]
++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ stdenv.cc.cc.lib ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
stdenv.cc.cc.lib
glib
libsecret
];
sourceRoot = "package";
dontStrip = true;
# keytar.node and computer.node have optional system-library deps not provided
# here; ignore missing deps rather than fail the build.
autoPatchelfIgnoreMissingDeps = true;
# computer.node requires GUI/media libraries (X11, pipewire, libei, libjpeg,
# libpng) for screen-capture and input-simulation features that are not
# relevant for CLI use; ignore those missing deps rather than fail the build
# or pull in heavy dependencies.
autoPatchelfIgnoreMissingDeps = [
"libX11.so.6"
"libXtst.so.6"
"libjpeg.so.8"
"libpng16.so.16"
"libpipewire-0.3.so.0"
"libei.so.1"
];
installPhase = ''
runHook preInstall