diff options
Diffstat (limited to 'pkgs/applications/audio')
-rw-r--r-- | pkgs/applications/audio/pocket-casts/default.nix | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/pkgs/applications/audio/pocket-casts/default.nix b/pkgs/applications/audio/pocket-casts/default.nix index 528cc18cbe46c..576124d968449 100644 --- a/pkgs/applications/audio/pocket-casts/default.nix +++ b/pkgs/applications/audio/pocket-casts/default.nix @@ -1,57 +1,59 @@ -{ lib, stdenv, fetchurl, dpkg, autoPatchelfHook, makeWrapper, electron -, alsa-lib, gtk3, libXScrnSaver, libXtst, mesa, nss }: +{ lib +, stdenv +, fetchFromGitHub +, electron +, copyDesktopItems +, makeDesktopItem +, makeWrapper +}: stdenv.mkDerivation rec { pname = "pocket-casts"; version = "0.6.0"; - src = fetchurl { - url = "https://github.com/felicianotech/pocket-casts-desktop-app/releases/download/v${version}/${pname}_${version}_amd64.deb"; - sha256 = "sha256-nHdF9RDOkM9HwwmK/axiIPM4nmKrWp/FHNC/EI1vTTc="; + src = fetchFromGitHub { + owner = "felicianotech"; + repo = "pocket-casts-desktop-app"; + rev = "v${version}"; + sha256 = "sha256-WMv2G4b7kYnWy0pz8YyI2eTdefs1mtWau+HQLiRygjE="; }; + desktopItems = [ + (makeDesktopItem { + name = pname; + desktopName = "Pocket Casts"; + genericName = "Podcasts Listener"; + exec = "pocket-casts"; + icon = "pocket-casts"; + comment = meta.description; + }) + ]; + nativeBuildInputs = [ - dpkg - autoPatchelfHook + copyDesktopItems makeWrapper ]; - buildInputs = [ alsa-lib gtk3 libXScrnSaver libXtst mesa nss ]; - - unpackCmd = '' - # If unpacking using -x option, there is a permission error - dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner; - ''; - installPhase = '' runHook preInstall - mkdir -p $out - mv bin $out - mv lib $out - mv share $out + mkdir -p $out/bin $out/opt/pocket-casts $out/share/pixmaps - cp $out/lib/pocket-casts/resources/app/icon.png $out/share/pixmaps/pocket-casts.png + cp -r main.js tray-icon.png LICENSE $out/opt/pocket-casts + install -Dm644 icon.png $out/share/pixmaps/pocket-casts.png + install -Dm644 icon-x360.png $out/share/pixmaps/pocket-casts-x360.png - runHook postInstall - ''; + makeWrapper ${electron}/bin/electron $out/bin/pocket-casts \ + --add-flags $out/opt/pocket-casts/main.js - postFixup = '' - substituteInPlace $out/share/applications/pocket-casts.desktop \ - --replace Name=pocket-casts "Name=Pocket Casts" \ - --replace GenericName=pocket-casts "GenericName=Podcasts App" \ - --replace Exec=pocket-casts Exec=$out/bin/pocket-casts - makeWrapper ${electron}/bin/electron \ - $out/bin/pocket-casts \ - --add-flags $out/lib/pocket-casts/resources/app/main.js + runHook postInstall ''; meta = with lib; { description = "Pocket Casts webapp, packaged for the Linux Desktop"; homepage = "https://github.com/felicianotech/pocket-casts-desktop-app"; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; license = licenses.mit; maintainers = with maintainers; [ wolfangaukang ]; - platforms = [ "x86_64-linux" ]; + platforms = platforms.linux; }; } |