1{ stdenv
2, lib
3, fetchFromGitHub
4, fetchpatch
5, asciidoc
6, cmake
7, docbook_xsl
8, pkg-config
9, bash-completion
10, openssl
11, curl
12, libxml2
13, libxslt
14}:
15
16stdenv.mkDerivation rec {
17 pname = "lastpass-cli";
18 version = "1.3.6";
19
20 src = fetchFromGitHub {
21 owner = "lastpass";
22 repo = pname;
23 rev = "v${version}";
24 sha256 = "sha256-ntUBwZ0bVkkpvWK/jQBkLNpCYEDI14/ki0cLwYpEWXk=";
25 };
26
27 patches = [
28 # Pull fix pending upstream inclusion for -fno-common toolchains:
29 # https://github.com/lastpass/lastpass-cli/pull/576
30 (fetchpatch {
31 name = "fno-common.patch";
32 url = "https://github.com/lastpass/lastpass-cli/commit/e3311cebdb29a3267843cf656a32f01c5062897e.patch";
33 sha256 = "1yjx2p98nb3n8ywc9lhf2zal5fswawb5i6lgnicdin23zngff5l8";
34 })
35 ];
36
37 nativeBuildInputs = [ asciidoc cmake docbook_xsl pkg-config ];
38
39 buildInputs = [
40 bash-completion
41 curl
42 openssl
43 libxml2
44 libxslt
45 ];
46
47 installTargets = [ "install" "install-doc" ];
48
49 postInstall = ''
50 install -Dm644 -T ../contrib/lpass_zsh_completion $out/share/zsh/site-functions/_lpass
51 install -Dm644 -T ../contrib/completions-lpass.fish $out/share/fish/vendor_completions.d/lpass.fish
52 install -Dm755 -T ../contrib/examples/git-credential-lastpass $out/bin/git-credential-lastpass
53 '';
54
55 meta = with lib; {
56 description = "Stores, retrieves, generates, and synchronizes passwords securely";
57 homepage = "https://github.com/lastpass/lastpass-cli";
58 license = licenses.gpl2Plus;
59 platforms = platforms.unix;
60 maintainers = with maintainers; [ ];
61 };
62}