Add custom packages
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m56s
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m56s
This commit is contained in:
74
pkgs/camera-streamer/package.nix
Normal file
74
pkgs/camera-streamer/package.nix
Normal file
@ -0,0 +1,74 @@
|
||||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
|
||||
, cmake
|
||||
, gnumake
|
||||
, pkg-config
|
||||
, xxd
|
||||
|
||||
, v4l-utils
|
||||
, nlohmann_json
|
||||
, ffmpegSupport ? true
|
||||
, ffmpeg
|
||||
, libcameraSupport ? true
|
||||
, libcamera
|
||||
, rtspSupport ? true
|
||||
, live555
|
||||
, webrtcSupport ? true
|
||||
, openssl
|
||||
|
||||
, lib
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "camera-streamer";
|
||||
version = "0.2.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ayufan";
|
||||
repo = "camera-streamer";
|
||||
rev = "refs/tags/v${finalAttrs.version}";
|
||||
hash = "sha256-8vV8BMFoDeh22I1/qxk6zttJROaD/lrThBxXHZSPpT4=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
# Second replacement fixes literal newline in generated version.h.
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace '/usr/local/bin' '/bin' \
|
||||
--replace 'echo "#define' 'echo -e "#define'
|
||||
'';
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = builtins.toString [
|
||||
"-Wno-error=stringop-overflow"
|
||||
"-Wno-error=format"
|
||||
"-Wno-format"
|
||||
"-Wno-format-security"
|
||||
"-Wno-error=unused-result"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
gnumake
|
||||
pkg-config
|
||||
xxd
|
||||
];
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
|
||||
buildInputs = [ nlohmann_json v4l-utils ]
|
||||
++ (lib.optional ffmpegSupport ffmpeg)
|
||||
++ (lib.optional libcameraSupport libcamera)
|
||||
++ (lib.optional rtspSupport live555)
|
||||
++ (lib.optional webrtcSupport openssl);
|
||||
|
||||
installFlags = [ "DESTDIR=${builtins.placeholder "out"}" ];
|
||||
preInstall = "mkdir -p $out/bin";
|
||||
|
||||
meta = with lib; {
|
||||
description = "High-performance low-latency camera streamer for Raspberry Pi's";
|
||||
website = "https://github.com/ayufan/camera-streamer";
|
||||
license = licenses.gpl3Only;
|
||||
};
|
||||
})
|
||||
|
58
pkgs/rpicam-apps/package.nix
Normal file
58
pkgs/rpicam-apps/package.nix
Normal file
@ -0,0 +1,58 @@
|
||||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, meson
|
||||
, ninja
|
||||
, pkg-config
|
||||
, boost
|
||||
, ffmpeg
|
||||
, libcamera
|
||||
, libdrm
|
||||
, libexif
|
||||
, libjpeg
|
||||
, libpng
|
||||
, libtiff
|
||||
, lib
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "rpicam-apps";
|
||||
version = "1.4.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "raspberrypi";
|
||||
repo = "rpicam-apps";
|
||||
rev = "v" + finalAttrs.version;
|
||||
hash = "sha256-3NG2ZE/Ub3lTbfne0LCXuDgLGTPaAAADRdElEbZwvls=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
ffmpeg
|
||||
libcamera
|
||||
libdrm
|
||||
libexif
|
||||
libjpeg
|
||||
libpng
|
||||
libtiff
|
||||
];
|
||||
|
||||
# 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";
|
||||
|
||||
meta = with lib; {
|
||||
description = ''
|
||||
libcamera-based applications to drive the cameras on a Raspberry Pi platform
|
||||
'';
|
||||
homepage = "https://github.com/raspberrypi/rpicam-apps";
|
||||
license = licenses.bsd2;
|
||||
};
|
||||
})
|
||||
|
Reference in New Issue
Block a user