1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
{
lib,
stdenv,
fetchFromGitHub,
cmake,
makeWrapper,
pkg-config,
which,
xxd,
ffmpeg,
libcamera,
live555,
openssl,
v4l-utils,
}:
stdenv.mkDerivation rec {
pname = "camera-streamer";
version = "0.4.2";
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "ayufan";
repo = "camera-streamer";
tag = "v${version}";
hash = "sha256-umU8Rp8+wUvQCNK8OpgND/6gPD013SB6sdXSLy5UGAQ=";
fetchSubmodules = true;
};
# not sure why the -Werror isn't being an issue for the project maintainer
# my best guess is it's because the project README specifies
# "Debian Bookworm" as a requirement which provides gcc12 by default
postPatch = ''
sed -i 's|git submodule update.*||' Makefile
substituteInPlace Makefile --replace-warn "-Werror" ""
'';
strictDeps = true;
nativeBuildInputs = [
cmake
makeWrapper
pkg-config
which
xxd
];
buildInputs = [
ffmpeg
libcamera
live555
openssl
];
dontUseCmakeConfigure = true;
makeFlags = [
"GIT_VERSION=${src.tag}"
"GIT_REVISION=${src.rev}"
];
installPhase = ''
runHook preInstall
install -D camera-streamer $out/bin/camera-streamer
wrapProgram $out/bin/camera-streamer --prefix PATH : ${lib.makeBinPath [ v4l-utils ]}
runHook postInstall
'';
meta = {
homepage = "https://github.com/ayufan/camera-streamer";
changelog = "https://github.com/ayufan/camera-streamer/releases/tag/v${version}";
description = "High-performance low-latency camera streamer for Raspberry PI's";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ _30350n ];
platforms = lib.platforms.linux;
mainProgram = "camera-streamer";
};
}
|