Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 autoPatchelfHook, 3 fetchurl, 4 lib, 5 copyDesktopItems, 6 makeDesktopItem, 7 makeWrapper, 8 stdenv, 9 wrapGAppsHook3, 10 at-spi2-core, 11 atk, 12 alsa-lib, 13 cairo, 14 cups, 15 dbus, 16 expat, 17 gcc-unwrapped, 18 gdk-pixbuf, 19 glib, 20 pango, 21 gtk3-x11, 22 libudev0-shim, 23 libuuid, 24 libgbm, 25 nss, 26 nspr, 27 xorg, 28 streamlink, 29}: 30let 31 basename = "streamlink-twitch-gui"; 32 runtimeLibs = lib.makeLibraryPath [ 33 gtk3-x11 34 libudev0-shim 35 ]; 36 runtimeBins = lib.makeBinPath [ streamlink ]; 37 38in 39stdenv.mkDerivation rec { 40 pname = "${basename}-bin"; 41 version = "2.5.3"; 42 43 src = 44 { 45 x86_64-linux = fetchurl { 46 url = "https://github.com/streamlink/${basename}/releases/download/v${version}/${basename}-v${version}-linux64.tar.gz"; 47 hash = "sha256-ue5Ehj/dLOIJNJVq0Pd6EbA1hkVPz5m+3chVvEXaH6U="; 48 }; 49 i686-linux = fetchurl { 50 url = "https://github.com/streamlink/${basename}/releases/download/v${version}/${basename}-v${version}-linux32.tar.gz"; 51 hash = "sha256-y252QhVsRakngdApOHgegMMhs61KTxL9gfPjBjaSKOI="; 52 }; 53 } 54 .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); 55 56 nativeBuildInputs = with xorg; [ 57 at-spi2-core 58 atk 59 alsa-lib 60 autoPatchelfHook 61 cairo 62 copyDesktopItems 63 cups.lib 64 dbus.lib 65 expat 66 gcc-unwrapped 67 gdk-pixbuf 68 glib 69 pango 70 gtk3-x11 71 libgbm 72 nss 73 nspr 74 libuuid 75 libX11 76 libxcb 77 libXcomposite 78 libXcursor 79 libXdamage 80 libXext 81 libXfixes 82 libXi 83 libXrandr 84 libXrender 85 libXScrnSaver 86 libXtst 87 makeWrapper 88 wrapGAppsHook3 89 ]; 90 91 buildInputs = [ streamlink ]; 92 93 dontBuild = true; 94 dontConfigure = true; 95 96 installPhase = '' 97 runHook preInstall 98 mkdir -p $out/{bin,opt/${basename},share} 99 100 # Install all files, remove unnecessary ones 101 cp -a . $out/opt/${basename}/ 102 rm -r $out/opt/${basename}/{{add,remove}-menuitem.sh,credits.html,icons/} 103 ln -s $out/opt/${basename}/${basename} $out/bin/ 104 for res in 16 32 48 64 128 256; do 105 install -Dm644 \ 106 icons/icon-"$res".png \ 107 $out/share/icons/hicolor/"$res"x"$res"/apps/${basename}.png 108 done 109 runHook postInstall 110 ''; 111 112 preFixup = '' 113 gappsWrapperArgs+=( 114 --add-flags "--no-version-check" \ 115 --prefix LD_LIBRARY_PATH : ${runtimeLibs} \ 116 --prefix PATH : ${runtimeBins} 117 ) 118 ''; 119 120 desktopItems = [ 121 (makeDesktopItem { 122 name = basename; 123 exec = basename; 124 icon = basename; 125 desktopName = "Streamlink Twitch GUI"; 126 genericName = meta.description; 127 categories = [ 128 "AudioVideo" 129 "Network" 130 ]; 131 }) 132 ]; 133 134 meta = with lib; { 135 description = "Twitch.tv browser for Streamlink"; 136 longDescription = "Browse Twitch.tv and watch streams in your videoplayer of choice"; 137 homepage = "https://streamlink.github.io/streamlink-twitch-gui/"; 138 downloadPage = "https://github.com/streamlink/streamlink-twitch-gui/releases"; 139 sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 140 license = licenses.mit; 141 mainProgram = "streamlink-twitch-gui"; 142 maintainers = with maintainers; [ rileyinman ]; 143 platforms = [ 144 "x86_64-linux" 145 "i686-linux" 146 ]; 147 }; 148}