2018-02-27 12:27:46 +01:00
|
|
|
{
|
|
|
|
alsaLib, atk, cairo, cups, dbus, dpkg, expat, fetchurl, fontconfig, freetype,
|
2019-05-22 13:03:39 +02:00
|
|
|
gdk-pixbuf, glib, gnome2, libX11, libXScrnSaver, libXcomposite, libXcursor,
|
2018-02-27 12:27:46 +01:00
|
|
|
libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst,
|
|
|
|
libxcb, nspr, nss, stdenv, udev
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
rpath = stdenv.lib.makeLibraryPath ([
|
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2019-05-22 13:03:39 +02:00
|
|
|
gdk-pixbuf
|
2018-02-27 12:27:46 +01:00
|
|
|
glib
|
|
|
|
gnome2.GConf
|
|
|
|
gnome2.gtk
|
|
|
|
gnome2.pango
|
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libxcb
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
stdenv.cc.cc
|
|
|
|
udev
|
|
|
|
]);
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "webtorrent-desktop";
|
2018-05-02 17:34:48 +02:00
|
|
|
version = "0.20.0";
|
2018-02-27 12:27:46 +01:00
|
|
|
|
|
|
|
src =
|
2018-08-20 21:11:29 +02:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
2018-02-27 12:27:46 +01:00
|
|
|
fetchurl {
|
2018-05-02 17:34:48 +02:00
|
|
|
url = "https://github.com/webtorrent/webtorrent-desktop/releases/download/v0.20.0/webtorrent-desktop_${version}-1_amd64.deb";
|
|
|
|
sha256 = "1kkrnbimiip5pn2nwpln35bbdda9gc3cgrjwphq4fqasbjf2781k";
|
2018-02-27 12:27:46 +01:00
|
|
|
}
|
|
|
|
else
|
2018-08-20 21:11:29 +02:00
|
|
|
throw "Webtorrent is not currently supported on ${stdenv.hostPlatform.system}";
|
2018-02-27 12:27:46 +01:00
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
|
|
nativeBuildInputs = [ dpkg ];
|
|
|
|
unpackPhase = "dpkg-deb -x $src .";
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R opt $out
|
|
|
|
|
|
|
|
mv ./usr/share $out/share
|
|
|
|
mv $out/opt/webtorrent-desktop $out/libexec
|
|
|
|
chmod +x $out/libexec/WebTorrent
|
|
|
|
rmdir $out/opt
|
|
|
|
|
|
|
|
chmod -R g-w $out
|
|
|
|
|
|
|
|
# Patch WebTorrent
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath ${rpath}:$out/libexec $out/libexec/WebTorrent
|
|
|
|
|
|
|
|
# Symlink to bin
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s $out/libexec/WebTorrent $out/bin/WebTorrent
|
|
|
|
|
|
|
|
# Fix the desktop link
|
|
|
|
substituteInPlace $out/share/applications/webtorrent-desktop.desktop \
|
2018-08-22 23:32:10 +02:00
|
|
|
--replace /opt/webtorrent-desktop $out/bin
|
2018-02-27 12:27:46 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Streaming torrent app for Mac, Windows, and Linux.";
|
|
|
|
homepage = https://webtorrent.io/desktop;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.flokli ];
|
|
|
|
platforms = [
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|