about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/soundkonverter/default.nix
blob: b044db5fab828673ce9f9ac07a6b1023cdf70f6b (plain) (blame)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# currently needs to be installed into an environment and needs a `kbuildsycoca5` run afterwards for plugin discovery
{
  mkDerivation, fetchFromGitHub, fetchpatch, lib, makeWrapper,
  cmake, extra-cmake-modules, pkg-config,
  libkcddb, kconfig, kconfigwidgets, ki18n, kdelibs4support, kio, solid, kwidgetsaddons, kxmlgui,
  qtbase, phonon,
  taglib,
  # optional backends
  withCD ? true, cdparanoia,
  withFlac ? true, flac,
  withMidi ? true, fluidsynth, timidity,
  withSpeex ? false, speex,
  withVorbis ? true, vorbis-tools, vorbisgain,
  withMp3 ? true, lame, mp3gain,
  withAac ? true, faad2, aacgain,
  withUnfreeAac ? false, faac,
  withFfmpeg ? true, ffmpeg-full,
  withMplayer ? false, mplayer,
  withSox ? true, sox,
  withOpus ? true, opusTools,
  withTwolame ? false, twolame,
  withApe ? false, mac,
  withWavpack ? false, wavpack
}:

assert withAac -> withFfmpeg || withUnfreeAac;
assert withUnfreeAac -> withAac;

let runtimeDeps = []
    ++ lib.optional withCD cdparanoia
    ++ lib.optional withFlac flac
    ++ lib.optional withSpeex speex
    ++ lib.optional withFfmpeg ffmpeg-full
    ++ lib.optional withMplayer mplayer
    ++ lib.optional withSox sox
    ++ lib.optional withOpus opusTools
    ++ lib.optional withTwolame twolame
    ++ lib.optional withApe mac
    ++ lib.optional withWavpack wavpack
    ++ lib.optional withUnfreeAac faac
    ++ lib.optionals withMidi [ fluidsynth timidity ]
    ++ lib.optionals withVorbis [ vorbis-tools vorbisgain ]
    ++ lib.optionals withMp3 [ lame mp3gain ]
    ++ lib.optionals withAac [  faad2 aacgain ];

in
mkDerivation rec {
  pname = "soundkonverter";
  version = "3.0.1";
  src = fetchFromGitHub {
    owner = "dfaust";
    repo = "soundkonverter";
    rev = "v" + version;
    sha256 = "1g2khdsjmsi4zzynkq8chd11cbdhjzmi37r9jhpal0b730nq9x7l";
  };
  patches = [
    # already merged into master, so it can go during the next release
    (fetchpatch {
      url = "https://patch-diff.githubusercontent.com/raw/dfaust/soundkonverter/pull/87.patch";
      sha256 = "sha256-XIpD4ZMTZVcu+F27OtpRy51H+uQgpd5l22IZ6XsD64w=";
      name = "soundkonverter_taglib.patch";
      stripLen = 1;
    })
  ];

  nativeBuildInputs = [ cmake extra-cmake-modules pkg-config kdelibs4support makeWrapper ];
  propagatedBuildInputs = [ libkcddb kconfig kconfigwidgets ki18n kdelibs4support kio solid kwidgetsaddons kxmlgui qtbase phonon];
  buildInputs = [ taglib ] ++ runtimeDeps;
  # encoder plugins go to ${out}/lib so they're found by kbuildsycoca5
  cmakeFlags = [ "-DCMAKE_INSTALL_PREFIX=$out" ];
  sourceRoot = "${src.name}/src";
  # add runt-time deps to PATH
  postInstall = ''
    wrapProgram $out/bin/soundkonverter --prefix PATH : ${lib.makeBinPath runtimeDeps }
    '';
  meta = {
    homepage = "https://github.com/dfaust/soundkonverter";
    license = lib.licenses.gpl2;
    maintainers = [ lib.maintainers.schmittlauch ];
    description = "Audio file converter, CD ripper and Replay Gain tool";
    longDescription = ''
      soundKonverter is a frontend to various audio converters.

      The key features are:
      - Audio file conversion
      - Replay Gain calculation
      - CD ripping

      soundKonverter supports reading and writing tags and covers for many formats, so they are preserved when converting files.

      It is extendable by plugins and supports many backends including:

      - Audio file conversion
        Backends: faac, faad, ffmpeg, flac, lame, mplayer, neroaac, timidity, fluidsynth, vorbistools, opustools, sox, twolame,
        flake, mac, shorten, wavpack and speex
        Formats: ogg vorbis, mp3, flac, wma, aac, ac3, opus, alac, mp2, als, amr nb, amr wb, ape, speex, m4a, mp1, musepack shorten,
        tta, wavpack, ra, midi, mod, 3gp, rm, avi, mkv, ogv, mpeg, mov, mp4, flv, wmv and rv

      - Replay Gain calculation
        Backends: aacgain, metaflac, mp3gain, vorbisgain, wvgain, mpcgain
        Formats: aac, mp3, flac, ogg vorbis, wavpack, musepack

      - CD ripping
        Backends: cdparanoia
      '';
  };
}