3
0
Fork 0
forked from mirrors/nixpkgs

pocket-casts: build from source

This commit is contained in:
P. R. d. O 2023-02-07 13:48:25 -06:00
parent 5fd6d7fbe7
commit 4f6e190002
No known key found for this signature in database
GPG key ID: 7B0FF33FF90110C7
2 changed files with 37 additions and 33 deletions

View file

@ -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=";
};
nativeBuildInputs = [
dpkg
autoPatchelfHook
makeWrapper
desktopItems = [
(makeDesktopItem {
name = pname;
desktopName = "Pocket Casts";
genericName = "Podcasts Listener";
exec = "pocket-casts";
icon = "pocket-casts";
comment = meta.description;
})
];
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;
'';
nativeBuildInputs = [
copyDesktopItems
makeWrapper
];
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
makeWrapper ${electron}/bin/electron $out/bin/pocket-casts \
--add-flags $out/opt/pocket-casts/main.js
runHook postInstall
'';
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
'';
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;
};
}

View file

@ -5378,7 +5378,9 @@ with pkgs;
pn = callPackage ../tools/text/pn { };
pocket-casts = callPackage ../applications/audio/pocket-casts { };
pocket-casts = callPackage ../applications/audio/pocket-casts {
electron = electron_22;
};
pouf = callPackage ../tools/misc/pouf { };