19 systemd, # for libudev
20 withTracing ? lib.meta.availableOn stdenv.hostPlatform lttng-ust,
21 lttng-ust, # withTracing
27 stdenv.mkDerivation rec {
32 url = "https://git.libcamera.org/libcamera/libcamera.git";
34 hash = "sha256-m55SojGt5v5AEatBZiVqQA3xP9eeRWqHa+C3JsTiErQ=";
43 patchShebangs src/py/ utils/
46 # libcamera signs the IPA module libraries at install time, but they are then
47 # modified by stripping and RPATH fixup. Therefore, we need to generate the
48 # signatures again ourselves. For reproducibility, we use a static private key.
50 # If this is not done, libcamera will still try to load them, but it will
51 # isolate them in separate processes, which can cause crashes for IPA modules
52 # that are not designed for this (notably ipa_rpi.so).
54 ninja src/ipa-priv-key.pem
55 install -D ${./ipa-priv-key.pem} src/ipa-priv-key.pem
59 ../src/ipa/ipa-sign-install.sh src/ipa-priv-key.pem $out/lib/libcamera/ipa_*.so
69 # gstreamer integration
71 gst_all_1.gst-plugins-base
81 python3Packages.pybind11
88 ++ lib.optionals withTracing [ lttng-ust ]
89 ++ lib.optionals withQcam [
100 python3Packages.jinja2
101 python3Packages.pyyaml
103 python3Packages.sphinx
107 ] ++ lib.optional withQcam qt6.wrapQtAppsHook;
111 (lib.mesonEnable "tracing" withTracing)
112 (lib.mesonEnable "qcam" withQcam)
113 "-Dlc-compliance=disabled" # tries unconditionally to download gtest when enabled
114 # Avoid blanket -Werror to evade build failures on less
117 # Documentation breaks binary compatibility.
118 # Given that upstream also provides public documentation,
119 # we can disable it here.
120 "-Ddocumentation=disabled"
123 # Fixes error on a deprecated declaration
124 env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
126 # Silence fontconfig warnings about missing config
127 FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };
130 description = "Open source camera stack and framework for Linux, Android, and ChromeOS";
131 homepage = "https://libcamera.org";
132 changelog = "https://git.libcamera.org/libcamera/libcamera.git/tag/?h=${src.rev}";
133 license = licenses.lgpl2Plus;
134 maintainers = with maintainers; [ citadelcore ];
136 # Mandatory shared libraries.
137 lib.systems.inspect.platformPatterns.isStatic