-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rp3: build libcamera and rpicam-apps from the Raspberry Pi foundation
- Loading branch information
Showing
4 changed files
with
112 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
{ config, ... }: | ||
{ config, pkgs, ... }: | ||
|
||
{ } | ||
{ | ||
nixpkgs.overlays = [ (import ../overlays/libcamera.nix) ]; | ||
|
||
environment.systemPackages = with pkgs; [ | ||
(callPackage ../rpicam-apps.nix { }) | ||
libcamera | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
final: prev: { | ||
libcamera = prev.libcamera.overrideAttrs (old: { | ||
buildInputs = old.buildInputs ++ [ prev.boost prev.nlohmann_json ]; | ||
nativeBuildInputs = old.nativeBuildInputs ++ [ prev.python3Packages.pybind11 ]; | ||
|
||
BOOST_INCLUDEDIR = "${prev.lib.getDev prev.boost}/include"; | ||
BOOST_LIBRARYDIR = "${prev.lib.getLib prev.boost}/lib"; | ||
|
||
postPatch = old.postPatch + '' | ||
patchShebangs src/py/libcamera | ||
''; | ||
|
||
src = prev.fetchFromGitHub { | ||
owner = "raspberrypi"; | ||
repo = "libcamera"; | ||
rev = "6ddd79b5bdbedc1f61007aed35391f1559f9e29a"; | ||
sha256 = "eFIiYCsuukPuG6iqHZeKsXQYSuZ+9q5oLNwuJJ+bAhk="; | ||
|
||
nativeBuildInputs = [ prev.git ]; | ||
|
||
postFetch = '' | ||
cd "$out" | ||
export NIX_SSL_CERT_FILE=${prev.cacert}/etc/ssl/certs/ca-bundle.crt | ||
${prev.lib.getExe prev.meson} subprojects download \ | ||
libpisp | ||
find subprojects -type d -name .git -prune -execdir rm -r {} + | ||
''; | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ stdenv | ||
, fetchFromGitHub | ||
, lib | ||
, meson | ||
, ninja | ||
, pkg-config | ||
, boost | ||
, ffmpeg | ||
, libcamera | ||
, libdrm | ||
, libepoxy | ||
, libexif | ||
, libjpeg | ||
, libpng | ||
, libtiff | ||
, libX11 | ||
, qt5 | ||
}: | ||
|
||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "rpicam-apps"; | ||
version = "1.5.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "raspberrypi"; | ||
repo = "rpicam-apps"; | ||
rev = "v${finalAttrs.version}"; | ||
hash = "sha256-s4zJh6r3VhiquO54KWZ78dVCH1BmlphY9zEB9BidNyo="; | ||
}; | ||
|
||
buildInputs = [ | ||
boost | ||
ffmpeg | ||
libcamera | ||
libdrm | ||
libepoxy | ||
libexif | ||
libjpeg | ||
libpng | ||
libtiff | ||
libX11 | ||
qt5.qtbase | ||
]; | ||
|
||
nativeBuildInputs = [ | ||
meson | ||
ninja | ||
pkg-config | ||
qt5.wrapQtAppsHook | ||
]; | ||
|
||
# Meson is no longer able to pick up Boost automatically. | ||
# https://github.com/NixOS/nixpkgs/issues/86131 | ||
BOOST_INCLUDEDIR = "${lib.getDev boost}/include"; | ||
BOOST_LIBRARYDIR = "${lib.getLib boost}/lib"; | ||
|
||
mesonFlags = [ | ||
"-Denable_hailo=disabled" | ||
# maybe also disabled QT: "-Denable_qt=disabled" | ||
# See all options here: https://github.com/raspberrypi/rpicam-apps/blob/main/meson_options.txt | ||
]; | ||
|
||
meta = with lib; { | ||
description = "Small suite of libcamera-based apps that aim to copy the functionality of the existing 'raspicam' apps."; | ||
homepage = "https://github.com/raspberrypi/rpicam-apps"; | ||
license = licenses.bsd2; | ||
maintainers = with maintainers; [ jpds ]; | ||
platforms = platforms.linux; | ||
}; | ||
}) |