2018-02-27 11:27:46 +00:00
|
|
|
{
|
2021-06-10 03:57:09 +01:00
|
|
|
alsa-lib, atk, cairo, cups, dbus, dpkg, expat, fetchurl, fetchzip, fontconfig, freetype,
|
2021-03-16 21:00:50 +00:00
|
|
|
gdk-pixbuf, glib, gtk3, libX11, libXScrnSaver, libXcomposite, libXcursor,
|
2018-02-27 11:27:46 +00:00
|
|
|
libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst,
|
2021-01-11 07:54:33 +00:00
|
|
|
libxcb, nspr, nss, lib, stdenv, udev, libuuid, pango, at-spi2-atk, at-spi2-core
|
2018-02-27 11:27:46 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-01-15 05:42:41 +00:00
|
|
|
rpath = lib.makeLibraryPath ([
|
2021-06-10 03:57:09 +01:00
|
|
|
alsa-lib
|
2018-02-27 11:27:46 +00:00
|
|
|
atk
|
2020-01-16 22:50:40 +00:00
|
|
|
at-spi2-core
|
|
|
|
at-spi2-atk
|
2018-02-27 11:27:46 +00:00
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2019-05-22 12:03:39 +01:00
|
|
|
gdk-pixbuf
|
2018-02-27 11:27:46 +00:00
|
|
|
glib
|
2021-03-16 21:00:50 +00:00
|
|
|
gtk3
|
2020-01-16 22:50:40 +00:00
|
|
|
pango
|
|
|
|
libuuid
|
2018-02-27 11:27:46 +00:00
|
|
|
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 13:41:18 +01:00
|
|
|
pname = "webtorrent-desktop";
|
2020-01-16 22:50:40 +00:00
|
|
|
version = "0.21.0";
|
2018-02-27 11:27:46 +00:00
|
|
|
|
|
|
|
src =
|
2018-08-20 20:11:29 +01:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
2020-01-16 22:50:40 +00:00
|
|
|
fetchzip {
|
|
|
|
url = "https://github.com/webtorrent/webtorrent-desktop/releases/download/v${version}/WebTorrent-v${version}-linux.zip";
|
|
|
|
sha256 = "13gd8isq2l10kibsc1bsc15dbgpnwa7nw4cwcamycgx6pfz9a852";
|
2018-02-27 11:27:46 +00:00
|
|
|
}
|
|
|
|
else
|
2018-08-20 20:11:29 +01:00
|
|
|
throw "Webtorrent is not currently supported on ${stdenv.hostPlatform.system}";
|
2020-01-16 22:50:40 +00:00
|
|
|
desktopFile = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/webtorrent/webtorrent-desktop/v${version}/static/linux/share/applications/webtorrent-desktop.desktop";
|
|
|
|
sha256 = "1v16dqbxqds3cqg3xkzxsa5fyd8ssddvjhy9g3i3lz90n47916ca";
|
|
|
|
};
|
|
|
|
icon256File = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/webtorrent/webtorrent-desktop/v${version}/static/linux/share/icons/hicolor/256x256/apps/webtorrent-desktop.png";
|
|
|
|
sha256 = "1dapxvvp7cx52zhyaby4bxm4rll9xc7x3wk8k0il4g3mc7zzn3yk";
|
|
|
|
};
|
|
|
|
icon48File = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/webtorrent/webtorrent-desktop/v${version}/static/linux/share/icons/hicolor/48x48/apps/webtorrent-desktop.png";
|
|
|
|
sha256 = "00y96w9shbbrdbf6xcjlahqd08154kkrxmqraik7qshiwcqpw7p4";
|
|
|
|
};
|
2018-02-27 11:27:46 +00:00
|
|
|
nativeBuildInputs = [ dpkg ];
|
|
|
|
installPhase = ''
|
2020-01-16 22:50:40 +00:00
|
|
|
mkdir -p $out/share/{applications,icons/hicolor/{48x48,256x256}/apps}
|
|
|
|
cp -R . $out/libexec
|
2018-02-27 11:27:46 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2020-01-16 22:50:40 +00:00
|
|
|
cp $icon48File $out/share/icons/hicolor/48x48/apps/webtorrent-desktop.png
|
|
|
|
cp $icon256File $out/share/icons/hicolor/256x256/apps/webtorrent-desktop.png
|
|
|
|
## Fix the desktop link
|
|
|
|
substitute $desktopFile $out/share/applications/webtorrent-desktop.desktop \
|
|
|
|
--replace /opt/webtorrent-desktop $out/libexec
|
2018-02-27 11:27:46 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-10-11 06:55:05 +01:00
|
|
|
description = "Streaming torrent app for Mac, Windows, and Linux";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://webtorrent.io/desktop";
|
2018-02-27 11:27:46 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.flokli ];
|
|
|
|
platforms = [
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|