nixpkgs/pkgs/servers/jitsi-videobridge/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
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
2021-01-11 10:38:22 +01:00

54 lines
1.9 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper, dpkg, jre_headless, nixosTests }:
let
pname = "jitsi-videobridge2";
version = "2.1-273-g072dd44b";
src = fetchurl {
url = "https://download.jitsi.org/stable/${pname}_${version}-1_all.deb";
sha256 = "12l84wjn5iqnsg0816icgbx8jfcgyfnqclgyx303w4ncbvymlkv9";
};
in
stdenv.mkDerivation {
inherit pname version src;
dontBuild = true;
unpackCmd = "${dpkg}/bin/dpkg-deb -x $src debcontents";
buildInputs = [ makeWrapper ];
installPhase = ''
substituteInPlace usr/share/jitsi-videobridge/jvb.sh \
--replace "exec java" "exec ${jre_headless}/bin/java"
mkdir -p $out/{bin,share/jitsi-videobridge,etc/jitsi/videobridge}
mv etc/jitsi/videobridge/logging.properties $out/etc/jitsi/videobridge/
cp ${./logging.properties-journal} $out/etc/jitsi/videobridge/logging.properties-journal
mv usr/share/jitsi-videobridge/* $out/share/jitsi-videobridge/
ln -s $out/share/jitsi-videobridge/jvb.sh $out/bin/jitsi-videobridge
# work around https://github.com/jitsi/jitsi-videobridge/issues/1547
wrapProgram $out/bin/jitsi-videobridge \
--set VIDEOBRIDGE_GC_TYPE G1GC
'';
passthru.tests = {
single-host-smoke-test = nixosTests.jitsi-meet;
};
meta = with lib; {
description = "A WebRTC compatible video router";
longDescription = ''
Jitsi Videobridge is an XMPP server component that allows for multiuser video communication.
Unlike the expensive dedicated hardware videobridges, Jitsi Videobridge does not mix the video
channels into a composite video stream, but only relays the received video channels to all call
participants. Therefore, while it does need to run on a server with good network bandwidth,
CPU horsepower is not that critical for performance.
'';
homepage = "https://github.com/jitsi/jitsi-videobridge";
license = licenses.asl20;
maintainers = teams.jitsi.members;
platforms = platforms.linux;
};
}