diff options
author | Jonas Heinrich <onny@project-insanity.org> | 2022-04-10 10:00:54 +0200 |
---|---|---|
committer | Yt <happysalada@proton.me> | 2022-09-20 23:05:08 -0400 |
commit | 490f918fe65e5f53c48e509582f489e1e2d522e7 (patch) | |
tree | d57d8009e04f56969d07903bf73f5762bed46cda /pkgs/applications/video/popcorntime | |
parent | 8e848152c37ff7ceb48cc46837467013ad1cb18d (diff) |
popcorntime: init at 0.4.9
Co-authored-by: VolodiaPG
Diffstat (limited to 'pkgs/applications/video/popcorntime')
-rw-r--r-- | pkgs/applications/video/popcorntime/default.nix | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/pkgs/applications/video/popcorntime/default.nix b/pkgs/applications/video/popcorntime/default.nix new file mode 100644 index 000000000000..33d42ca124aa --- /dev/null +++ b/pkgs/applications/video/popcorntime/default.nix @@ -0,0 +1,80 @@ +{ autoPatchelfHook +, fetchurl +, gcc-unwrapped +, gsettings-desktop-schemas +, gtk3 +, lib +, makeDesktopItem +, makeWrapper +, nwjs +, stdenv +, unzip +, udev +, wrapGAppsHook +, copyDesktopItems +}: + +stdenv.mkDerivation rec { + pname = "popcorntime"; + version = "0.4.9"; + + src = fetchurl { + url = "https://github.com/popcorn-official/popcorn-desktop/releases/download/v${version}/Popcorn-Time-${version}-linux64.zip"; + sha256 = "sha256-cbKL5bgweZD/yfi/8KS0L7Raha8PTHqIm4qSPFidjUc="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + makeWrapper + unzip + wrapGAppsHook + copyDesktopItems + ]; + + buildInputs = [ + gcc-unwrapped + gsettings-desktop-schemas + gtk3 + nwjs + udev + ]; + + sourceRoot = "."; + + dontWrapGApps = true; + dontUnpack = true; + + makeWrapperArgs = [ + "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gcc-unwrapped.lib gtk3 udev ]}" + "--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}" + ]; + + # Extract and copy executable in $out/bin + installPhase = '' + mkdir -p $out/share/applications $out/bin $out/opt/bin $out/share/icons/hicolor/scalable/apps/ + # we can't unzip it in $out/lib, because nw.js will start with + # an empty screen. Therefore it will be unzipped in a non-typical + # folder and symlinked. + unzip -q $src -d $out/opt/popcorntime + + ln -s $out/opt/popcorntime/Popcorn-Time $out/bin/popcorntime + + ln -s $out/opt/popcorntime/src/app/images/icon.png $out/share/icons/hicolor/scalable/apps/popcorntime.png + ''; + + # GSETTINGS_SCHEMAS_PATH is not set in installPhase + preFixup = '' + wrapProgram $out/bin/popcorntime \ + ''${makeWrapperArgs[@]} \ + ''${gappsWrapperArgs[@]} + ''; + + meta = with lib; { + homepage = "https://github.com/popcorn-official/popcorn-desktop"; + description = "An application that streams movies and TV shows from torrents"; + platforms = [ "x86_64-linux" ]; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.gpl3; + maintainers = with maintainers; [ onny ]; + }; +} |