Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
63 lines
1.9 KiB
Nix
63 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
fetchurl,
|
|
nixosTests,
|
|
}:
|
|
|
|
let
|
|
hlsJs = fetchurl {
|
|
url = "https://cdn.jsdelivr.net/npm/hls.js@v1.6.12/dist/hls.min.js";
|
|
hash = "sha256-z9adeEMx2bwAw7qDIPG+vRM/AQJ/zAJl0i4vaycHHaM=";
|
|
};
|
|
in
|
|
buildGoModule (finalAttrs: {
|
|
pname = "mediamtx";
|
|
# check for hls.js version updates in internal/servers/hls/hlsjsdownloader/VERSION
|
|
version = "1.15.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "bluenviron";
|
|
repo = "mediamtx";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-7RpuDn3pZl/noI0SlP7iL9dMqiPiBPQXOuq2U6FYPnM=";
|
|
};
|
|
|
|
vendorHash = "sha256-ZyHOn+n6RYeSd3stkozwJ1prCY7J9oTIxhJsxm/ORn0=";
|
|
|
|
postPatch = ''
|
|
cp ${hlsJs} internal/servers/hls/hls.min.js
|
|
echo "v${finalAttrs.version}" > internal/core/VERSION
|
|
|
|
# disable binary-only rpi camera support
|
|
substituteInPlace internal/staticsources/rpicamera/camera_other.go \
|
|
--replace-fail '!linux || (!arm && !arm64)' 'linux || !linux'
|
|
substituteInPlace internal/staticsources/rpicamera/{params_serialize,pipe}.go \
|
|
--replace-fail '(linux && arm) || (linux && arm64)' 'linux && !linux'
|
|
substituteInPlace internal/staticsources/rpicamera/camera_arm32_.go \
|
|
--replace-fail 'linux && arm' 'linux && !linux'
|
|
substituteInPlace internal/staticsources/rpicamera/camera_arm64_.go \
|
|
--replace-fail 'linux && arm64' 'linux && !linux'
|
|
substituteInPlace internal/staticsources/rpicamera/camera_arm_.go \
|
|
--replace-fail '(linux && arm) || (linux && arm64)' 'linux && !linux'
|
|
'';
|
|
|
|
subPackages = [ "." ];
|
|
|
|
# Tests need docker
|
|
doCheck = false;
|
|
|
|
passthru.tests = {
|
|
inherit (nixosTests) mediamtx;
|
|
};
|
|
|
|
meta = {
|
|
description = "SRT, WebRTC, RTSP, RTMP, LL-HLS media server and media proxy";
|
|
inherit (finalAttrs.src.meta) homepage;
|
|
license = lib.licenses.mit;
|
|
mainProgram = "mediamtx";
|
|
maintainers = with lib.maintainers; [ fpletz ];
|
|
};
|
|
})
|