summaryrefslogtreecommitdiff
path: root/pkgs/by-name/to/tone/package.nix
blob: 4ac8a62707a2356212e1ab9240d0e462623707e9 (about) (plain)
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
{
  lib,
  fetchFromGitHub,
  buildDotnetModule,
  ffmpeg-full,
  dotnetCorePackages,
  versionCheckHook,
  nix-update-script,
}:

buildDotnetModule rec {
  pname = "tone";
  version = "0.2.5";

  src = fetchFromGitHub {
    owner = "sandreas";
    repo = "tone";
    tag = "v${version}";
    hash = "sha256-yqcxqwlCfVDTv5jkcneimlS5EgnDlB7ZvxPt53t9jbQ=";
  };

  patchPhase = ''
    substituteInPlace tone/Program.cs \
      --replace-fail "@package_version@" ${version}
  '';

  projectFile = "tone/tone.csproj";
  executables = [ "tone" ];
  nugetDeps = ./deps.json;

  dotnetInstallFlags = [
    "-p:PublishSingleFile=false"
  ];

  dotnet-sdk = dotnetCorePackages.sdk_8_0;
  dotnet-runtime = dotnetCorePackages.sdk_8_0;
  runtimeDeps = [ ffmpeg-full ];

  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];

  passthru.updateScript = nix-update-script { };

  meta = {
    homepage = "https://github.com/sandreas/tone";
    description = "Cross platform utility to dump and modify audio metadata for a wide variety of formats";
    changelog = "https://github.com/sandreas/tone/releases/tag/v${version}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [
      jvanbruegge
      jwillikers
    ];
    platforms = with lib.platforms; linux ++ darwin ++ windows;
    mainProgram = "tone";
  };
}