nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 pkg-config,
5 ffmpeg,
6 rustPlatform,
7 glib,
8 installShellFiles,
9 asciidoc,
10 versionCheckHook,
11}:
12rustPlatform.buildRustPackage (finalAttrs: {
13 pname = "metadata";
14 version = "0.1.12";
15
16 src = fetchFromGitHub {
17 owner = "zmwangx";
18 repo = "metadata";
19 tag = "v${finalAttrs.version}";
20 hash = "sha256-gDOYqPwrWUfUTCx+p+ZpwsP8XxUufDCGem/WzW5cQPc=";
21 };
22
23 cargoHash = "sha256-tUVaseaavm746sxaA2A3ua4ZxzoKSnRQ4rJRBeO9t1U=";
24
25 nativeBuildInputs = [
26 pkg-config
27 asciidoc
28 installShellFiles
29 rustPlatform.bindgenHook
30 ];
31
32 postBuild = ''
33 a2x --doctype manpage --format manpage man/metadata.1.adoc
34 '';
35 postInstall = ''
36 installManPage man/metadata.1
37 '';
38
39 buildInputs = [
40 ffmpeg
41 glib
42 ];
43
44 env.FFMPEG_DIR = ffmpeg.dev;
45
46 checkFlags = [
47 # "AAC (HE-AAC v2)" is reported as "AAC (LC)" in newer ffmpeg
48 # https://github.com/zmwangx/metadata/issues/13
49 "--skip=aac_he_aac"
50 ];
51
52 nativeInstallCheckInputs = [ versionCheckHook ];
53 doInstallCheck = true;
54
55 meta = {
56 description = "Media metadata parser and formatter designed for human consumption, powered by FFmpeg";
57 maintainers = [ ];
58 license = lib.licenses.mit;
59 homepage = "https://github.com/zmwangx/metadata";
60 mainProgram = "metadata";
61 };
62})