2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, cmake, fetchFromGitLab
|
2019-02-01 07:05:03 +00:00
|
|
|
, json_c, libsodium, libxml2, ncurses }:
|
2015-09-30 00:56:32 +00:00
|
|
|
|
2019-02-01 07:05:03 +00:00
|
|
|
let
|
|
|
|
rev = "22796663dcad81684ab24308d9db570f6781ba2c";
|
2015-09-30 00:56:32 +00:00
|
|
|
|
2019-02-01 07:05:03 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "mpw-${version}-${builtins.substring 0 8 rev}";
|
|
|
|
version = "2.6";
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "MasterPassword";
|
|
|
|
repo = "MasterPassword";
|
|
|
|
sha256 = "1f2vqacgbyam1mazawrfim8zwp38gnwf5v3xkkficsfnv789g6fw";
|
|
|
|
inherit rev;
|
2016-10-30 11:15:26 +00:00
|
|
|
};
|
2015-09-30 00:56:32 +00:00
|
|
|
|
2019-02-01 07:05:03 +00:00
|
|
|
sourceRoot = "./source/platform-independent/c/cli";
|
2015-09-30 00:56:32 +00:00
|
|
|
|
2019-02-01 07:05:03 +00:00
|
|
|
postPatch = ''
|
|
|
|
rm build
|
|
|
|
substituteInPlace mpw-cli-tests \
|
|
|
|
--replace '/usr/bin/env bash' ${stdenv.shell} \
|
|
|
|
--replace ./mpw ./build/mpw
|
2015-09-30 00:56:32 +00:00
|
|
|
'';
|
|
|
|
|
2019-02-01 07:05:03 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-Dmpw_version=${version}"
|
|
|
|
"-DBUILD_MPW_TESTS=ON"
|
|
|
|
];
|
2015-09-30 00:56:32 +00:00
|
|
|
|
2017-11-07 18:12:48 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2015-09-30 00:56:32 +00:00
|
|
|
|
2019-02-01 07:05:03 +00:00
|
|
|
buildInputs = [ json_c libxml2 libsodium ncurses ];
|
2015-09-30 00:56:32 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2019-02-01 07:05:03 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 mpw $out/bin/mpw
|
|
|
|
install -Dm644 ../mpw.completion.bash $out/share/bash-completion/completions/_mpw
|
|
|
|
install -Dm644 ../../../../README.md $out/share/doc/mpw/README.md
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-11-10 22:46:12 +00:00
|
|
|
# Some tests are expected to fail on ARM64
|
|
|
|
# See: https://gitlab.com/spectre.app/cli/-/issues/27#note_962950844 (mpw is a predecessor to spectre-cli and this issue is relevant to mpw as well)
|
|
|
|
doCheck = !(stdenv.isLinux && stdenv.isAarch64);
|
2019-02-01 07:05:03 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
../mpw-cli-tests
|
|
|
|
|
|
|
|
runHook postCheck
|
2015-09-30 00:56:32 +00:00
|
|
|
'';
|
2016-08-02 16:06:29 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-11-07 18:12:48 +00:00
|
|
|
description = "A stateless password management solution";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://masterpasswordapp.com/";
|
2017-11-07 18:12:48 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.unix;
|
2016-08-02 16:06:29 +00:00
|
|
|
};
|
2015-09-30 00:56:32 +00:00
|
|
|
}
|