summary refs log tree commit diff
path: root/pkgs/applications/video/webtorrent_desktop
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2018-02-27 12:27:46 +0100
committerJörg Thalheim <Mic92@users.noreply.github.com>2018-02-27 11:27:46 +0000
commit168faeec7da4899add3a3b721b171725da445e88 (patch)
tree20a9fb2532728fdfc60ac7de1c0a495e2b5bfd29 /pkgs/applications/video/webtorrent_desktop
parent97c06d58871fcbe0eddc20643630c6b234447d51 (diff)
downloadnixpkgs-168faeec7da4899add3a3b721b171725da445e88.tar
nixpkgs-168faeec7da4899add3a3b721b171725da445e88.tar.gz
nixpkgs-168faeec7da4899add3a3b721b171725da445e88.tar.bz2
nixpkgs-168faeec7da4899add3a3b721b171725da445e88.tar.lz
nixpkgs-168faeec7da4899add3a3b721b171725da445e88.tar.xz
nixpkgs-168faeec7da4899add3a3b721b171725da445e88.tar.zst
nixpkgs-168faeec7da4899add3a3b721b171725da445e88.zip
webtorrent_desktop: init at 0.19.0 (#35840)
* webtorrent_desktop: init at 0.19.0

* webtorrent_desktop: fix meta attributes
Diffstat (limited to 'pkgs/applications/video/webtorrent_desktop')
-rw-r--r--pkgs/applications/video/webtorrent_desktop/default.nix88
1 files changed, 88 insertions, 0 deletions
diff --git a/pkgs/applications/video/webtorrent_desktop/default.nix b/pkgs/applications/video/webtorrent_desktop/default.nix
new file mode 100644
index 00000000000..bb519ef3dab
--- /dev/null
+++ b/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.19.0";
+
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = "https://github.com/webtorrent/webtorrent-desktop/releases/download/v0.19.0/webtorrent-desktop_${version}-1_amd64.deb";
+          sha256 = "0v4fgvf8qgxjwg5kz30pcxl71pi9rri0l3cy20pid07rdd6r4sgd";
+        }
+        else
+          throw "Webtorrent is not currently supported on ${stdenv.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/WebTorrent $out/bin/WebTorrent
+    '';
+
+    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"
+      ];
+    };
+  }