Merge pull request #55105 from peterhoeg/u/mpw

mpw: point upgrade and minor cleanups
This commit is contained in:
Peter Hoeg 2019-03-18 12:26:33 +08:00 committed by GitHub
commit b0a571b54a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,38 +1,61 @@
{ stdenv, cmake, fetchFromGitHub, ncurses, libsodium, json_c }: { stdenv, cmake, fetchFromGitLab
, json_c, libsodium, libxml2, ncurses }:
stdenv.mkDerivation rec { let
name = "mpw-2.6-f8043ae"; rev = "22796663dcad81684ab24308d9db570f6781ba2c";
src = fetchFromGitHub { in stdenv.mkDerivation rec {
owner = "Lyndir"; name = "mpw-${version}-${builtins.substring 0 8 rev}";
repo = "MasterPassword"; version = "2.6";
rev = "f8043ae16d73ddfb205aadd25c35cd9c5e95b228";
sha256 = "0hy02ri7y3sca85z3ff5i68crwav5cjd7rrdqj7jrnpp1bw4yapi"; src = fetchFromGitLab {
owner = "MasterPassword";
repo = "MasterPassword";
sha256 = "1f2vqacgbyam1mazawrfim8zwp38gnwf5v3xkkficsfnv789g6fw";
inherit rev;
}; };
postUnpack = '' sourceRoot = "./source/platform-independent/c/cli";
sourceRoot+=/platform-independent/cli-c
postPatch = ''
rm build
substituteInPlace mpw-cli-tests \
--replace '/usr/bin/env bash' ${stdenv.shell} \
--replace ./mpw ./build/mpw
''; '';
preConfigure = '' cmakeFlags = [
substituteInPlace CMakeLists.txt --replace curses ncurses "-Dmpw_version=${version}"
echo ${name} > VERSION "-DBUILD_MPW_TESTS=ON"
''; ];
dontUseCmakeBuildDir = true;
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
buildInputs = [ ncurses libsodium json_c ]; buildInputs = [ json_c libxml2 libsodium ncurses ];
installPhase = '' installPhase = ''
mkdir -p $out/bin runHook preInstall
mv mpw $out/bin/mpw
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
'';
doCheck = true;
checkPhase = ''
runHook preCheck
../mpw-cli-tests
runHook postCheck
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = https://masterpasswordapp.com/;
description = "A stateless password management solution"; description = "A stateless password management solution";
homepage = https://masterpasswordapp.com/;
license = licenses.gpl3; license = licenses.gpl3;
platforms = platforms.unix; platforms = platforms.unix;
}; };