nixpkgs/pkgs/development/libraries/libcamera/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

111 lines
2.3 KiB
Nix
Raw Normal View History

2021-07-04 21:40:21 +00:00
{ stdenv
, fetchgit
, lib
, meson
, ninja
, pkg-config
2022-01-05 23:32:44 +00:00
, makeFontsConf
2021-07-04 21:40:21 +00:00
, openssl
2022-01-05 23:32:44 +00:00
, libdrm
2021-07-04 21:40:21 +00:00
, libevent
, libyaml
2021-07-04 21:40:21 +00:00
, lttng-ust
, gst_all_1
, gtest
, graphviz
, doxygen
, python3
, python3Packages
2022-01-05 23:32:44 +00:00
, systemd # for libudev
2021-07-04 21:40:21 +00:00
}:
stdenv.mkDerivation rec {
2021-07-04 21:40:21 +00:00
pname = "libcamera";
2023-05-17 10:57:32 +00:00
version = "0.0.5";
2021-07-04 21:40:21 +00:00
src = fetchgit {
url = "https://git.libcamera.org/libcamera/libcamera.git";
rev = "v${version}";
2023-05-17 10:57:32 +00:00
hash = "sha256-rd1YIEosg4+H/FJBYCoxdQlV9F0evU5fckHJrSdVPOE=";
2021-07-04 21:40:21 +00:00
};
outputs = [ "out" "dev" "doc" ];
2021-07-04 21:40:21 +00:00
postPatch = ''
patchShebangs utils/
'';
2021-11-29 08:17:05 +00:00
strictDeps = true;
2021-07-04 21:40:21 +00:00
buildInputs = [
# IPA and signing
openssl
2021-07-04 21:40:21 +00:00
# gstreamer integration
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
# cam integration
libevent
2022-01-05 23:32:44 +00:00
libdrm
# hotplugging
systemd
2021-07-04 21:40:21 +00:00
# lttng tracing
lttng-ust
2021-11-29 08:17:05 +00:00
# yamlparser
libyaml
2021-11-29 08:17:05 +00:00
gtest
2021-07-04 21:40:21 +00:00
];
nativeBuildInputs = [
meson
ninja
pkg-config
python3
python3Packages.jinja2
python3Packages.pyyaml
python3Packages.ply
python3Packages.sphinx
graphviz
doxygen
2021-11-29 08:17:05 +00:00
openssl
2021-07-04 21:40:21 +00:00
];
2022-01-05 23:32:44 +00:00
mesonFlags = [
"-Dv4l2=true"
"-Dqcam=disabled"
"-Dlc-compliance=disabled" # tries unconditionally to download gtest when enabled
# Avoid blanket -Werror to evade build failures on less
# tested compilers.
"-Dwerror=false"
2022-01-05 23:32:44 +00:00
];
2021-07-04 21:40:21 +00:00
# Fixes error on a deprecated declaration
env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
2021-07-04 21:40:21 +00:00
2022-01-05 23:32:44 +00:00
# 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
'';
2021-07-04 21:40:21 +00:00
meta = with lib; {
description = "An open source camera stack and framework for Linux, Android, and ChromeOS";
homepage = "https://libcamera.org";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ citadelcore ];
};
}