sleek-todo: init at 2.0.14 (#347525)

sleek: init at 2.0.14

Co-authored-by: ByteSudoer <ByteSudoer@users.noreply.github.com>
This commit is contained in:
Soussi Mohamed Nour 2024-12-15 19:33:20 +01:00 committed by GitHub
parent 0567d2e33a
commit 45c7a57f8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,79 @@
{
lib,
stdenv,
fetchurl,
undmg,
appimageTools,
}:
let
pname = "sleek-todo";
version = "2.0.14";
src =
fetchurl
{
x86_64-darwin = {
url = "https://github.com/ransome1/sleek/releases/download/v${version}/sleek-2.0.14-mac-x64.dmg";
hash = "sha256-f5mMSRa+gAoakOy9TSZeALqCylGLd0nUJIh8o+LWAro=";
};
x86_64-linux = {
url = "https://github.com/ransome1/sleek/releases/download/v${version}/sleek-2.0.14.AppImage";
hash = "sha256-d2fLsCI7peuNBtjgHs1qumgPAF9eJeBYiIIffoSv9Jk=";
};
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.system}");
meta = {
description = "Todo manager based on todo.txt syntax";
homepage = "https://github.com/ransome1/sleek";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ByteSudoer ];
mainProgram = "sleek-todo";
platforms = [
"x86_64-linux"
"x86_64-darwin"
];
};
appimageContents = appimageTools.extract { inherit pname version src; };
in
if stdenv.hostPlatform.isDarwin then
stdenv.mkDerivation {
inherit
pname
version
src
meta
;
sourceRoot = ".";
nativeBuildInputs = [ undmg ];
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r *.app $out/Applications/
runHook postInstall
'';
}
else
appimageTools.wrapType2 {
inherit
pname
version
src
meta
;
extraInstallCommands = ''
mkdir -p $out/share/{applications,sleek}
cp -a ${appimageContents}/{locales,resources} $out/share/sleek
cp -a ${appimageContents}/usr/share/icons $out/share
install -Dm 444 ${appimageContents}/sleek.desktop $out/share/applications
substituteInPlace $out/share/applications/sleek.desktop \
--replace-warn 'Exec=AppRun' 'Exec=${pname}'
'';
}