nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenvNoCC,
4 rustPlatform,
5 fetchFromGitHub,
6 makeWrapper,
7 bento4,
8 protobuf,
9 ffmpeg,
10 gpac,
11 libxslt,
12 shaka-packager,
13 nix-update-script,
14 runCommand,
15}:
16
17let
18 # dash-mpd-cli looks for a binary named `shaka-packager`, while
19 # shaka-packager provides `packager`.
20 shaka-packager-wrapped = runCommand "shaka-packager-wrapped" { } ''
21 mkdir -p $out/bin
22 ln -s ${lib.getExe shaka-packager} $out/bin/shaka-packager
23 '';
24in
25rustPlatform.buildRustPackage (finalAttrs: {
26 pname = "dash-mpd-cli";
27 version = "0.2.30";
28
29 src = fetchFromGitHub {
30 owner = "emarsden";
31 repo = "dash-mpd-cli";
32 tag = "v${finalAttrs.version}";
33 hash = "sha256-wFVBHexL0I8eeqWs7V6nS6WFtBVGXQdxuWDCMhFNMJA=";
34 };
35
36 cargoHash = "sha256-CrSlXfMfJnZBqLqHa4KK/q4eH6TyaayCOBQEhjQClbo=";
37
38 nativeBuildInputs = [
39 makeWrapper
40 protobuf
41 ];
42
43 # The tests depend on network access.
44 doCheck = false;
45
46 postInstall = ''
47 wrapProgram $out/bin/dash-mpd-cli \
48 --prefix PATH : ${
49 lib.makeBinPath [
50 bento4
51 ffmpeg
52 gpac
53 libxslt
54 shaka-packager-wrapped
55 ]
56 }
57 '';
58
59 passthru.updateScript = nix-update-script { };
60
61 meta = {
62 description = "Download media content from a DASH-MPEG or DASH-WebM MPD manifest";
63 longDescription = ''
64 A commandline application for downloading media content from a DASH MPD
65 file, as used for on-demand replay of TV content and video streaming
66 services.
67 '';
68 homepage = "https://emarsden.github.io/dash-mpd-cli/";
69 downloadPage = "https://github.com/emarsden/dash-mpd-cli/releases";
70 changelog = "https://github.com/emarsden/dash-mpd-cli/blob/main/CHANGELOG.md";
71 license = lib.licenses.mit;
72 maintainers = with lib.maintainers; [ al3xtjames ];
73 mainProgram = "dash-mpd-cli";
74 };
75})