mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 17:14:33 +00:00
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
73 lines
1.8 KiB
Nix
73 lines
1.8 KiB
Nix
{ stdenv, lib, fetchurl, makeDesktopItem, unzip, ant, jdk8
|
|
# Optional, Jitsi still runs without, but you may pass null:
|
|
, alsaLib, dbus, gtk2, libpulseaudio, openssl, xorg
|
|
}:
|
|
|
|
let jdk = jdk8; in
|
|
stdenv.mkDerivation rec {
|
|
pname = "jitsi";
|
|
version = "2.10.5550";
|
|
|
|
src = fetchurl {
|
|
url = "https://download.jitsi.org/jitsi/src/jitsi-src-${version}.zip";
|
|
sha256 = "11vjchc3dnzj55x7c62wsm6masvwmij1ifkds917r1qvil1nzz6d";
|
|
};
|
|
|
|
patches = [ ./jitsi.patch ];
|
|
|
|
jitsiItem = makeDesktopItem {
|
|
name = "Jitsi";
|
|
exec = "jitsi";
|
|
comment = "VoIP and Instant Messaging client";
|
|
desktopName = "Jitsi";
|
|
genericName = "Instant Messaging";
|
|
categories = "Chat";
|
|
};
|
|
|
|
libPath = lib.makeLibraryPath ([
|
|
stdenv.cc.cc # For libstdc++.
|
|
alsaLib
|
|
dbus
|
|
gtk2
|
|
libpulseaudio
|
|
openssl
|
|
xorg.libX11
|
|
xorg.libXext
|
|
xorg.libXScrnSaver
|
|
xorg.libXv
|
|
]);
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
buildInputs = [ ant jdk ];
|
|
|
|
buildPhase = ''ant make'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -a lib $out/
|
|
rm -rf $out/lib/native/solaris
|
|
cp -a sc-bundles $out/
|
|
mkdir $out/bin
|
|
cp resources/install/generic/run.sh $out/bin/jitsi
|
|
chmod +x $out/bin/jitsi
|
|
substituteInPlace $out/bin/jitsi \
|
|
--subst-var-by JAVA ${jdk}/bin/java \
|
|
--subst-var-by EXTRALIBS ${gtk2.out}/lib
|
|
sed -e 's,^java\ ,${jdk}/bin/java ,' -i $out/bin/jitsi
|
|
patchShebangs $out
|
|
libPath="$libPath:${jdk.home}/lib/${jdk.architecture}"
|
|
find $out/ -type f -name '*.so' | while read file; do
|
|
patchelf --set-rpath "$libPath" "$file" && \
|
|
patchelf --shrink-rpath "$file"
|
|
done
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://jitsi.org/";
|
|
description = "Open Source Video Calls and Chat";
|
|
license = licenses.lgpl21Plus;
|
|
platforms = platforms.linux;
|
|
maintainers = teams.jitsi.members;
|
|
};
|
|
}
|