forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
75 lines
2.3 KiB
Nix
75 lines
2.3 KiB
Nix
{ lib, stdenv, makeWrapper, fetchurl, which, pkgconfig
|
|
, ocamlPackages
|
|
, libao, portaudio, alsaLib, libpulseaudio, libjack2
|
|
, libsamplerate, libmad, taglib, lame, libogg
|
|
, libvorbis, speex, libtheora, libopus
|
|
, faad2, flac, ladspaH, ffmpeg, frei0r, dssi
|
|
}:
|
|
|
|
let
|
|
pname = "liquidsoap";
|
|
version = "1.4.2";
|
|
|
|
ocaml-ffmpeg = fetchurl {
|
|
url = "https://github.com/savonet/ocaml-ffmpeg/releases/download/v0.4.2/ocaml-ffmpeg-0.4.2.tar.gz";
|
|
sha256 = "1lx5s1avds9fsh77828ifn71r2g89rxakhs8pp995a675phm9viw";
|
|
};
|
|
|
|
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/v${version}/${pname}-${version}-full.tar.gz";
|
|
sha256 = "0wkwnzj1a0vizv7sr1blwk5gzm2qi0n02ndijnq1i50cwrgxs1a4";
|
|
};
|
|
|
|
# Use ocaml-srt and ocaml-fdkaac from nixpkgs
|
|
# Use ocaml-ffmpeg at 0.4.2 for compatibility with ffmpeg 4.3
|
|
prePatch = ''
|
|
rm -rf ocaml-srt*/ ocaml-fdkaac*/ ocaml-ffmpeg*/
|
|
tar xzf ${ocaml-ffmpeg}
|
|
'';
|
|
|
|
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
|
|
faad2 flac ladspaH ffmpeg frei0r dssi
|
|
ocamlPackages.xmlm ocamlPackages.ocaml_pcre
|
|
ocamlPackages.camomile
|
|
ocamlPackages.fdkaac
|
|
ocamlPackages.srt ocamlPackages.sedlex_2 ocamlPackages.menhir
|
|
];
|
|
|
|
hardeningDisable = [ "format" "fortify" ];
|
|
|
|
meta = with 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 [];
|
|
};
|
|
}
|