nixpkgs/pkgs/applications/misc/keeweb/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
2.2 KiB
Nix
Raw Normal View History

2021-03-09 20:33:10 +01:00
{ lib, stdenv, fetchurl, appimageTools, undmg, libsecret, libxshmfence }:
2020-05-25 17:44:29 +02:00
let
pname = "keeweb";
2022-09-13 18:15:30 +02:00
version = "1.18.7";
2020-05-25 17:44:29 +02:00
name = "${pname}-${version}";
2021-05-16 14:05:57 +02:00
srcs = {
x86_64-linux = fetchurl {
url = "https://github.com/keeweb/keeweb/releases/download/v${version}/KeeWeb-${version}.linux.AppImage";
2022-09-13 18:15:30 +02:00
hash = "sha256-W3Dfo7YZfLObodAS7ZN3jqnYzLNAnjJIfJC6il5THwY=";
2021-05-16 14:05:57 +02:00
};
x86_64-darwin = fetchurl {
url = "https://github.com/keeweb/keeweb/releases/download/v${version}/KeeWeb-${version}.mac.x64.dmg";
2022-09-13 18:15:30 +02:00
hash = "sha256-+ZFGrrw0tZ7F6lb/3iBIyGD+tp1puVhkPv10hfp6ATU=";
2021-05-16 14:05:57 +02:00
};
aarch64-darwin = fetchurl {
url = "https://github.com/keeweb/keeweb/releases/download/v${version}/KeeWeb-${version}.mac.arm64.dmg";
2022-09-13 18:15:30 +02:00
hash = "sha256-bkhwsWYLkec16vMOfXUce7jfrmI9W2xHiZvU1asebK4=";
2021-05-16 14:05:57 +02:00
};
2020-05-25 17:44:29 +02:00
};
2021-05-16 14:05:57 +02:00
src = srcs.${stdenv.hostPlatform.system};
2020-05-25 17:44:29 +02:00
appimageContents = appimageTools.extract {
inherit name src;
};
meta = with lib; {
2020-05-25 17:44:29 +02:00
description = "Free cross-platform password manager compatible with KeePass";
homepage = "https://keeweb.info/";
2021-03-09 20:33:10 +01:00
changelog = "https://github.com/keeweb/keeweb/blob/v${version}/release-notes.md";
2022-09-13 18:15:30 +02:00
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2020-05-25 17:44:29 +02:00
license = licenses.mit;
maintainers = with maintainers; [ sikmir ];
2021-05-16 14:05:57 +02:00
platforms = builtins.attrNames srcs;
2020-05-25 17:44:29 +02:00
};
linux = appimageTools.wrapType2 rec {
inherit name src meta;
2021-03-09 20:33:10 +01:00
extraPkgs = pkgs: with pkgs; [ libsecret libxshmfence ];
2020-05-25 17:44:29 +02:00
extraInstallCommands = ''
mv $out/bin/{${name},${pname}}
install -Dm644 ${appimageContents}/keeweb.desktop -t $out/share/applications
install -Dm644 ${appimageContents}/keeweb.png -t $out/share/icons/hicolor/256x256/apps
install -Dm644 ${appimageContents}/usr/share/mime/keeweb.xml -t $out/share/mime
substituteInPlace $out/share/applications/keeweb.desktop \
2022-09-13 18:15:30 +02:00
--replace "Exec=AppRun" "Exec=$out/bin/${pname}"
2020-05-25 17:44:29 +02:00
'';
};
darwin = stdenv.mkDerivation {
inherit pname version src meta;
nativeBuildInputs = [ undmg ];
2021-03-09 20:33:10 +01:00
sourceRoot = ".";
2020-05-25 17:44:29 +02:00
installPhase = ''
2021-03-09 20:33:10 +01:00
mkdir -p $out/Applications
cp -r *.app $out/Applications
2020-05-25 17:44:29 +02:00
'';
};
in
if stdenv.isDarwin
then darwin
else linux