joplin-desktop: joplin.desktop+icon from AppImage

This commit is contained in:
Christian Mainka 2020-06-30 11:09:29 +02:00
parent 0d5aa4a75e
commit 02d82b5ac4

View File

@ -3,19 +3,18 @@
let
pname = "joplin-desktop";
version = "1.0.224";
desktopItem = makeDesktopItem {
name = "Joplin";
exec = "joplin-desktop";
type = "Application";
desktopName = "Joplin";
};
in appimageTools.wrapType2 rec {
name = "${pname}-${version}";
src = fetchurl {
url = "https://github.com/laurent22/joplin/releases/download/v${version}/Joplin-${version}.AppImage";
sha256 = "098x8dj4zwh0q991v013mjrmcdnzqwgs5xkrqnkk1b7vsqqfklgk";
};
appimageContents = appimageTools.extractType2 {
inherit name src;
};
in appimageTools.wrapType2 rec {
inherit name src;
profile = ''
export LC_ALL=C.UTF-8
@ -25,9 +24,12 @@ in appimageTools.wrapType2 rec {
multiPkgs = null; # no 32bit needed
extraPkgs = appimageTools.defaultFhsEnvArgs.multiPkgs;
extraInstallCommands = ''
mkdir -p $out/share/applications
ln -s ${desktopItem}/share/applications/* $out/share/applications
mv $out/bin/{${name},${pname}}
install -m 444 -D ${appimageContents}/joplin.desktop $out/share/applications/joplin.desktop
install -m 444 -D ${appimageContents}/joplin.png \
$out/share/pixmaps/joplin.png
substituteInPlace $out/share/applications/joplin.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
'';