18 , systemd # for libudev
19 , withTracing ? lib.meta.availableOn stdenv.hostPlatform lttng-ust
20 , lttng-ust # withTracing
26 stdenv.mkDerivation rec {
31 url = "https://git.libcamera.org/libcamera/libcamera.git";
33 hash = "sha256-rW1BG5blozQKA73P5vH5dGkwQG5JJzxdOU2GCB3xIns=";
36 outputs = [ "out" "dev" ];
39 patchShebangs src/py/ utils/
42 # libcamera signs the IPA module libraries at install time, but they are then
43 # modified by stripping and RPATH fixup. Therefore, we need to generate the
44 # signatures again ourselves. For reproducibility, we use a static private key.
46 # If this is not done, libcamera will still try to load them, but it will
47 # isolate them in separate processes, which can cause crashes for IPA modules
48 # that are not designed for this (notably ipa_rpi.so).
50 ninja src/ipa-priv-key.pem
51 install -D ${./ipa-priv-key.pem} src/ipa-priv-key.pem
60 # gstreamer integration
62 gst_all_1.gst-plugins-base
72 python3Packages.pybind11
78 ] ++ lib.optionals withTracing [ lttng-ust ]
79 ++ lib.optionals withQcam [ libtiff qt6.qtbase qt6.qttools ];
86 python3Packages.jinja2
87 python3Packages.pyyaml
89 python3Packages.sphinx
93 ] ++ lib.optional withQcam qt6.wrapQtAppsHook;
97 (lib.mesonEnable "tracing" withTracing)
98 (lib.mesonEnable "qcam" withQcam)
99 "-Dlc-compliance=disabled" # tries unconditionally to download gtest when enabled
100 # Avoid blanket -Werror to evade build failures on less
103 # Documentation breaks binary compatibility.
104 # Given that upstream also provides public documentation,
105 # we can disable it here.
106 "-Ddocumentation=disabled"
109 # Fixes error on a deprecated declaration
110 env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
112 # Silence fontconfig warnings about missing config
113 FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };
116 description = "Open source camera stack and framework for Linux, Android, and ChromeOS";
117 homepage = "https://libcamera.org";
118 changelog = "https://git.libcamera.org/libcamera/libcamera.git/tag/?h=${src.rev}";
119 license = licenses.lgpl2Plus;
120 maintainers = with maintainers; [ citadelcore ];
122 # Mandatory shared libraries.
123 lib.systems.inspect.platformPatterns.isStatic