nixpkgs/pkgs/servers/mediamtx/default.nix

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

51 lines
1.2 KiB
Nix
Raw Normal View History

{ lib
2020-10-16 09:03:31 +00:00
, fetchFromGitHub
2024-04-15 05:18:46 +00:00
, fetchurl
2020-10-16 09:03:31 +00:00
, buildGoModule
2023-08-10 18:43:26 +00:00
, nixosTests
2020-10-16 09:03:31 +00:00
}:
2024-04-15 05:18:46 +00:00
let
hlsJs = fetchurl {
url = "https://cdn.jsdelivr.net/npm/hls.js@v1.5.8/dist/hls.min.js";
hash = "sha256-KG8Cm0dAsFbrBHuMi9c+bMocpSvWWK4c9aWH9LGfDY4=";
};
in
2020-10-16 09:03:31 +00:00
buildGoModule rec {
pname = "mediamtx";
2024-04-15 05:18:46 +00:00
# check for hls.js version updates in internal/servers/hls/hlsjsdownloader/VERSION
2024-04-22 01:14:46 +00:00
version = "1.8.0";
2020-10-16 09:03:31 +00:00
src = fetchFromGitHub {
2023-08-10 18:14:57 +00:00
owner = "bluenviron";
2020-10-16 09:03:31 +00:00
repo = pname;
rev = "v${version}";
2024-04-22 01:14:46 +00:00
hash = "sha256-IIm+ZJYHGEfT+mvyq84L5hnkUPX784gjJUMzkE5kbaE=";
2020-10-16 09:03:31 +00:00
};
2024-04-22 01:14:46 +00:00
vendorHash = "sha256-GGyacAN9Vs0SsLO7ZfyfOXznTJZg1V13DJucfzUGA/Q=";
2024-04-15 05:18:46 +00:00
postPatch = ''
cp ${hlsJs} internal/servers/hls/hls.min.js
'';
2020-10-16 09:03:31 +00:00
# Tests need docker
doCheck = false;
2021-08-26 06:45:51 +00:00
ldflags = [
2023-05-22 21:19:41 +00:00
"-X github.com/bluenviron/mediamtx/internal/core.version=v${version}"
2020-10-16 09:03:31 +00:00
];
2023-08-10 18:43:26 +00:00
passthru.tests = { inherit (nixosTests) mediamtx; };
meta = with lib; {
2020-10-16 09:03:31 +00:00
description =
"Ready-to-use RTSP server and RTSP proxy that allows to read and publish video and audio streams"
;
inherit (src.meta) homepage;
license = licenses.mit;
2023-08-10 18:14:57 +00:00
mainProgram = "mediamtx";
maintainers = with maintainers; [ fpletz ];
2020-10-16 09:03:31 +00:00
};
}