libcamera: fix IPA module signatures

Nix modifies binaries after they are installed, which results in the wrong
signature. There is no easy way to avoid these modifications, so the best fix
is to simply regenerate the signatures after the fixup phase.
This commit is contained in:
Ben Wolsieffer
2022-10-19 20:37:46 -04:00
parent 74553acb65
commit 2610d7dee3
@@ -85,6 +85,17 @@ stdenv.mkDerivation {
# Silence fontconfig warnings about missing config
FONTCONFIG_FILE = makeFontsConf { fontDirectories = []; };
# libcamera signs the IPA module libraries at install time, but they are then
# modified by stripping and RPATH fixup. Therefore, we need to generate the
# signatures again ourselves.
#
# If this is not done, libcamera will still try to load them, but it will
# isolate them in separate processes, which can cause crashes for IPA modules
# that are not designed for this (notably ipa_rpi.so).
postFixup = ''
../src/ipa/ipa-sign-install.sh src/ipa-priv-key.pem $out/lib/libcamera/ipa_*.so
'';
meta = with lib; {
description = "An open source camera stack and framework for Linux, Android, and ChromeOS";
homepage = "https://libcamera.org";