about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/audacious/qt-5.nix
blob: 45525571a646b5856e33532e8ca3c53a9e1e47f1 (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
{
  mkDerivation, lib, fetchurl, fetchpatch,
  gettext, pkgconfig,
  qtbase,
  alsaLib, curl, faad2, ffmpeg, flac, fluidsynth, gdk-pixbuf, lame, libbs2b,
  libcddb, libcdio, libcue, libjack2, libmad, libmms, libmodplug,
  libmowgli, libnotify, libogg, libpulseaudio, libsamplerate, libsidplayfp,
  libsndfile, libvorbis, libxml2, lirc, mpg123, neon, qtmultimedia, soxr,
  wavpack
}:

let
  version = "3.9";
  sources = {
    "audacious-${version}" = fetchurl {
      url = "http://distfiles.audacious-media-player.org/audacious-${version}.tar.bz2";
      sha256 = "0pmhrhsjhqnrq3zh4rhfys5jas53ph5ijkq010dxg1n779kl901d";
    };

    "audacious-plugins-${version}" = fetchurl {
      url = "http://distfiles.audacious-media-player.org/audacious-plugins-${version}.tar.bz2";
      sha256 = "1f17r7ar0mngcf7z41s6xh073vjafw3i7iy9ijb0cd6bi48g5xwb";
    };
  };

  qt510_plugins_patch = fetchpatch {
    url = "https://github.com/audacious-media-player/audacious-plugins/commit/971f7ff7c3d8a0b9b420bf4fd19ab97755607637.patch";
    sha256 = "15fy37syj9ygl2ibkkz3g3b9wd22vk9bjfmvqhhkpxphry2zwb17";
  };
in

mkDerivation {
  inherit version;
  name = "audacious-qt5-${version}";

  sourceFiles = lib.attrValues sources;
  sourceRoots = lib.attrNames sources;

  nativeBuildInputs = [ gettext pkgconfig ];

  inherit qt510_plugins_patch;

  buildInputs = [
    # Core dependencies
    qtbase

    # Plugin dependencies
    alsaLib curl faad2 ffmpeg flac fluidsynth gdk-pixbuf lame libbs2b libcddb
    libcdio libcue libjack2 libmad libmms libmodplug libmowgli
    libnotify libogg libpulseaudio libsamplerate libsidplayfp libsndfile
    libvorbis libxml2 lirc mpg123 neon qtmultimedia soxr wavpack
  ];

  configureFlags = [ "--enable-qt" "--disable-gtk" ];

  # Here we build both audacious and audacious-plugins in one
  # derivations, since they really expect to be in the same prefix.
  # This is slighly tricky.
  builder = builtins.toFile "builder.sh" ''
    sourceFiles=( $sourceFiles )
    sourceRoots=( $sourceRoots )
    for (( i=0 ; i < ''${#sourceFiles[*]} ; i++ )); do

      (
        # only patch the plugins
        if [ "$i" -eq "1" ]; then
          patches=( $qt510_plugins_patch )
        fi
        src=''${sourceFiles[$i]}
        sourceRoot=''${sourceRoots[$i]}
        source $stdenv/setup
        genericBuild
      )

      if [ $i == 0 ]; then
        nativeBuildInputs="$out $nativeBuildInputs"
      fi

    done
  '';

  meta = with lib; {
    description = "Audio player";
    homepage = "https://audacious-media-player.org/";
    maintainers = with maintainers; [ ttuegel ];
    platforms = with platforms; linux;
    license = with licenses; [
      bsd2 bsd3 #https://github.com/audacious-media-player/audacious/blob/master/COPYING
      gpl2 gpl3 lgpl2Plus #http://redmine.audacious-media-player.org/issues/46
    ];
  };
}