From cf1a51ceefd0cca3809052304983d039daf25efa Mon Sep 17 00:00:00 2001 From: Riley Inman Date: Sun, 26 Apr 2020 08:56:27 -0400 Subject: [PATCH] streamlink-twitch-gui-bin: init at 1.10.0 --- .../video/streamlink-twitch-gui/bin.nix | 100 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 101 insertions(+) create mode 100644 pkgs/applications/video/streamlink-twitch-gui/bin.nix diff --git a/pkgs/applications/video/streamlink-twitch-gui/bin.nix b/pkgs/applications/video/streamlink-twitch-gui/bin.nix new file mode 100644 index 00000000000..251f495b7e1 --- /dev/null +++ b/pkgs/applications/video/streamlink-twitch-gui/bin.nix @@ -0,0 +1,100 @@ +{ autoPatchelfHook, fetchurl, lib, makeDesktopItem, makeWrapper, stdenv, wrapGAppsHook +, at-spi2-core, atk, alsaLib, cairo, cups, dbus, expat, gcc-unwrapped +, gdk-pixbuf, glib, gnome2, gtk3-x11, libudev0-shim, libuuid, nss, nspr, xorg +, streamlink }: + +let + basename = "streamlink-twitch-gui"; + runtimeLibs = lib.makeLibraryPath [ libudev0-shim ]; + arch = + if stdenv.hostPlatform.system == "x86_64-linux" + then + "linux64" + else + "linux32"; + +in +stdenv.mkDerivation rec { + pname = "${basename}-bin"; + version = "1.10.0"; + + src = fetchurl { + url = "https://github.com/streamlink/${basename}/releases/download/v${version}/${basename}-v${version}-${arch}.tar.gz"; + sha256 = + if arch == "linux64" + then + "17s9zbzj4pgz9mxxwjbp3788afkddc9s3p7xp28y5084z9wwzph2" + else + "1pww05hr48m6v0g1sz48g1c7p615lig3s12l21xgyz4gkjzmjy22"; + }; + + nativeBuildInputs = with xorg; [ + at-spi2-core + atk + alsaLib + autoPatchelfHook + cairo + cups.lib + dbus.daemon.lib + expat + gcc-unwrapped + gdk-pixbuf + glib + gnome2.pango + gtk3-x11 + nss + nspr + libuuid + libX11 + libxcb + libXcomposite + libXcursor + libXdamage + libXext + libXfixes + libXi + libXrandr + libXrender + libXScrnSaver + libXtst + makeWrapper + wrapGAppsHook + ]; + + buildInputs = [ streamlink ]; + + dontBuild = true; + dontConfigure = true; + + installPhase = '' + mkdir -p $out/{bin,opt/${basename},share} + + # Install all files, remove unnecessary ones + cp -a . $out/opt/${basename}/ + rm -r $out/opt/${basename}/{{add,remove}-menuitem.sh,credits.html,icons/} + + wrapProgram $out/opt/${basename}/${basename} --add-flags "--no-version-check" --prefix LD_LIBRARY_PATH : ${runtimeLibs} + + ln -s "$out/opt/${basename}/${basename}" $out/bin/ + ln -s "${desktopItem}/share/applications" $out/share/ + ''; + + desktopItem = makeDesktopItem { + name = basename; + exec = basename; + icon = basename; + desktopName = "Streamlink Twitch GUI"; + genericName = meta.description; + categories = "AudioVideo;Network;"; + }; + + meta = with stdenv.lib; { + description = "Twitch.tv browser for Streamlink"; + longDescription = "Browse Twitch.tv and watch streams in your videoplayer of choice"; + homepage = "https://streamlink.github.io/streamlink-twitch-gui/"; + downloadPage = https://github.com/streamlink/streamlink-twitch-gui/releases; + license = licenses.mit; + maintainers = with maintainers; [ rileyinman ]; + platforms = [ "x86_64-linux" "i686-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1a5ac3065d8..90ae5de7da9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14635,6 +14635,7 @@ in stlport = callPackage ../development/libraries/stlport { }; streamlink = callPackage ../applications/video/streamlink { pythonPackages = python3Packages; }; + streamlink-twitch-gui-bin = callPackage ../applications/video/streamlink-twitch-gui/bin.nix {}; strigi = callPackage ../development/libraries/strigi { clucene_core = clucene_core_2; };