summary refs log tree commit diff
path: root/pkgs/tools/audio/liquidsoap/full.nix
blob: f69e60117ce358de564828f6f8caddd36b4be2ec (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
{ stdenv, makeWrapper, fetchurl, which, pkgconfig
, ocamlPackages
, libao, portaudio, alsaLib, libpulseaudio, libjack2
, libsamplerate, libmad, taglib, lame, libogg
, libvorbis, speex, libtheora, libopus, fdk_aac
, faad2, flac, ladspaH, ffmpeg, frei0r, dssi
}:

let
  pname = "liquidsoap";
  version = "1.3.4";

  packageFilters = map (p: "-e '/ocaml-${p}/d'" )
    [ "gstreamer" "shine" "aacplus" "schroedinger"
      "voaacenc" "soundtouch" "gavl" "lo"
    ];
in
stdenv.mkDerivation {
  name = "${pname}-full-${version}";

  src = fetchurl {
    url = "https://github.com/savonet/${pname}/releases/download/${version}/${pname}-${version}-full.tar.bz2";
    sha256 = "11l1h42sljfxcdhddc8klya4bk99j7a1pndwnzvscb04pvmfmlk0";
  };

  preConfigure = /* we prefer system-wide libs */ ''
    sed -i "s|gsed|sed|" Makefile
    make bootstrap
    # autoreconf -vi # use system libraries

    sed ${toString packageFilters} PACKAGES.default > PACKAGES
  '';

  postFixup = ''
    wrapProgram $out/bin/liquidsoap --set LIQ_LADSPA_PATH /run/current-system/sw/lib/ladspa
  '';

  configureFlags = [ "--localstatedir=/var" ];

  nativeBuildInputs = [ makeWrapper pkgconfig ];
  buildInputs =
    [ which ocamlPackages.ocaml ocamlPackages.findlib
      libao portaudio alsaLib libpulseaudio libjack2
      libsamplerate libmad taglib lame libogg
      libvorbis speex libtheora libopus fdk_aac
      faad2 flac ladspaH ffmpeg frei0r dssi
      ocamlPackages.xmlm ocamlPackages.ocaml_pcre
      ocamlPackages.camomile
    ];

  hardeningDisable = [ "format" "fortify" ];

  meta = with stdenv.lib; {
    description = "Swiss-army knife for multimedia streaming";
    homepage = https://www.liquidsoap.info/;
    maintainers = with maintainers; [ ehmry ];
    license = licenses.gpl2;
    platforms = ocamlPackages.ocaml.meta.platforms or [];
  };
}