From 40e650fa3d1e20cf8bd734558cc7abb6fc2e4963 Mon Sep 17 00:00:00 2001 From: Eduard Bachmakov Date: Sat, 13 Nov 2021 14:17:23 +0100 Subject: [PATCH] marktext: 0.16.2 -> 0.16.3 Add .desktop file, icons in the process. --- pkgs/applications/misc/marktext/default.nix | 25 ++++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/misc/marktext/default.nix b/pkgs/applications/misc/marktext/default.nix index c98d40ab2e14..1e71493e5fec 100644 --- a/pkgs/applications/misc/marktext/default.nix +++ b/pkgs/applications/misc/marktext/default.nix @@ -2,16 +2,21 @@ let pname = "marktext"; - version = "v0.16.2"; -in -appimageTools.wrapType2 rec { + version = "v0.16.3"; name = "${pname}-${version}-binary"; src = fetchurl { url = "https://github.com/marktext/marktext/releases/download/${version}/marktext-x86_64.AppImage"; - sha256 = "0ivf9lvv2jk7dvxmqprzcsxgya3617xmx5bppjvik44z14b5x8r7"; + sha256 = "0s93c79vy2vsi7b6xq4hvsvjjad8bdkhl1q135vp98zmbf7bvm9b"; }; + appimageContents = appimageTools.extractType2 { + inherit name src; + }; +in +appimageTools.wrapType2 rec { + inherit name src; + profile = '' export LC_ALL=C.UTF-8 '' @@ -28,8 +33,16 @@ appimageTools.wrapType2 rec { p.xorg.libxkbfile ]; - # Strip version from binary name. - extraInstallCommands = "mv $out/bin/${name} $out/bin/${pname}"; + extraInstallCommands = '' + # Strip version from binary name. + mv $out/bin/${name} $out/bin/${pname} + + install -m 444 -D ${appimageContents}/marktext.desktop $out/share/applications/marktext.desktop + substituteInPlace $out/share/applications/marktext.desktop \ + --replace "Exec=AppRun" "Exec=${pname} --" + + cp -r ${appimageContents}/usr/share/icons $out/share + ''; meta = with lib; { description = "A simple and elegant markdown editor, available for Linux, macOS and Windows";