diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/applications/video/webtorrent_desktop | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/applications/video/webtorrent_desktop')
-rw-r--r-- | nixpkgs/pkgs/applications/video/webtorrent_desktop/default.nix | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/video/webtorrent_desktop/default.nix b/nixpkgs/pkgs/applications/video/webtorrent_desktop/default.nix new file mode 100644 index 000000000000..086190000ab4 --- /dev/null +++ b/nixpkgs/pkgs/applications/video/webtorrent_desktop/default.nix @@ -0,0 +1,88 @@ +{ + alsaLib, atk, cairo, cups, dbus, dpkg, expat, fetchurl, fontconfig, freetype, + gdk_pixbuf, glib, gnome2, libX11, libXScrnSaver, libXcomposite, libXcursor, + 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 + gdk_pixbuf + 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 { + name = "webtorrent-desktop-${version}"; + version = "0.20.0"; + + src = + if stdenv.hostPlatform.system == "x86_64-linux" then + fetchurl { + url = "https://github.com/webtorrent/webtorrent-desktop/releases/download/v0.20.0/webtorrent-desktop_${version}-1_amd64.deb"; + sha256 = "1kkrnbimiip5pn2nwpln35bbdda9gc3cgrjwphq4fqasbjf2781k"; + } + else + throw "Webtorrent is not currently supported on ${stdenv.hostPlatform.system}"; + 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 \ + --replace /opt/webtorrent-desktop $out/bin + ''; + + 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" + ]; + }; + } |