2021-01-05 21:45:51 +01:00
|
|
|
{ autoPatchelfHook
|
|
|
|
, fetchurl
|
|
|
|
, lib
|
|
|
|
, makeDesktopItem
|
|
|
|
, makeWrapper
|
|
|
|
, stdenv
|
|
|
|
, wrapGAppsHook
|
|
|
|
, at-spi2-core
|
|
|
|
, atk
|
2021-06-10 04:57:09 +02:00
|
|
|
, alsa-lib
|
2021-01-05 21:45:51 +01:00
|
|
|
, cairo
|
|
|
|
, cups
|
|
|
|
, dbus
|
|
|
|
, expat
|
|
|
|
, gcc-unwrapped
|
|
|
|
, gdk-pixbuf
|
|
|
|
, glib
|
|
|
|
, pango
|
|
|
|
, gtk3-x11
|
|
|
|
, libudev0-shim
|
|
|
|
, libuuid
|
2021-04-09 13:35:26 +02:00
|
|
|
, mesa
|
2021-01-05 21:45:51 +01:00
|
|
|
, nss
|
|
|
|
, nspr
|
|
|
|
, xorg
|
|
|
|
, streamlink
|
|
|
|
}:
|
2020-04-26 14:56:27 +02:00
|
|
|
let
|
|
|
|
basename = "streamlink-twitch-gui";
|
|
|
|
runtimeLibs = lib.makeLibraryPath [ libudev0-shim ];
|
2021-08-12 03:39:53 +02:00
|
|
|
runtimeBins = lib.makeBinPath [ streamlink ];
|
2020-04-26 14:56:27 +02:00
|
|
|
arch =
|
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux"
|
|
|
|
then
|
|
|
|
"linux64"
|
|
|
|
else
|
|
|
|
"linux32";
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "${basename}-bin";
|
2021-01-05 21:45:51 +01:00
|
|
|
version = "1.11.0";
|
2020-04-26 14:56:27 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/streamlink/${basename}/releases/download/v${version}/${basename}-v${version}-${arch}.tar.gz";
|
|
|
|
sha256 =
|
|
|
|
if arch == "linux64"
|
|
|
|
then
|
2021-01-05 21:45:51 +01:00
|
|
|
"0y96nziavvpdvrpn58p6a175kaa8cgadp19rnbm250x9cypn1d9y"
|
2020-04-26 14:56:27 +02:00
|
|
|
else
|
2021-01-05 21:45:51 +01:00
|
|
|
"0sfmhqf55w7wavqy4idsqpkf5p7l8sapjxap6xvyzpz4z5z6xr7y";
|
2020-04-26 14:56:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with xorg; [
|
|
|
|
at-spi2-core
|
|
|
|
atk
|
2021-06-10 04:57:09 +02:00
|
|
|
alsa-lib
|
2020-04-26 14:56:27 +02:00
|
|
|
autoPatchelfHook
|
|
|
|
cairo
|
|
|
|
cups.lib
|
|
|
|
dbus.daemon.lib
|
|
|
|
expat
|
|
|
|
gcc-unwrapped
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
2020-10-25 20:38:25 +01:00
|
|
|
pango
|
2020-04-26 14:56:27 +02:00
|
|
|
gtk3-x11
|
2021-04-09 13:35:26 +02:00
|
|
|
mesa
|
2020-04-26 14:56:27 +02:00
|
|
|
nss
|
|
|
|
nspr
|
|
|
|
libuuid
|
|
|
|
libX11
|
|
|
|
libxcb
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXScrnSaver
|
|
|
|
libXtst
|
|
|
|
makeWrapper
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ streamlink ];
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-08-12 03:39:53 +02:00
|
|
|
runHook preInstall
|
2020-04-26 14:56:27 +02:00
|
|
|
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/}
|
|
|
|
ln -s "$out/opt/${basename}/${basename}" $out/bin/
|
2021-08-12 03:39:53 +02:00
|
|
|
cp -r "${desktopItem}/share/applications" $out/share/
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
--add-flags "--no-version-check" \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${runtimeLibs} \
|
|
|
|
--prefix PATH : ${runtimeBins}
|
|
|
|
)
|
2020-04-26 14:56:27 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = basename;
|
|
|
|
exec = basename;
|
|
|
|
icon = basename;
|
|
|
|
desktopName = "Streamlink Twitch GUI";
|
|
|
|
genericName = meta.description;
|
|
|
|
categories = "AudioVideo;Network;";
|
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-26 14:56:27 +02:00
|
|
|
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/";
|
2021-08-12 03:39:53 +02:00
|
|
|
downloadPage = "https://github.com/streamlink/streamlink-twitch-gui/releases";
|
2020-04-26 14:56:27 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ rileyinman ];
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
};
|
|
|
|
}
|