Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7691d57cd21a
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b0a571b54a94
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Mar 18, 2019

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    31e4f1d View commit details
  2. Merge pull request #55105 from peterhoeg/u/mpw

    mpw: point upgrade and minor cleanups
    peterhoeg authored Mar 18, 2019
    Copy the full SHA
    b0a571b View commit details
Showing with 42 additions and 19 deletions.
  1. +42 −19 pkgs/tools/security/mpw/default.nix
61 changes: 42 additions & 19 deletions pkgs/tools/security/mpw/default.nix
Original file line number Diff line number Diff line change
@@ -1,38 +1,61 @@
{ stdenv, cmake, fetchFromGitHub, ncurses, libsodium, json_c }:
{ stdenv, cmake, fetchFromGitLab
, json_c, libsodium, libxml2, ncurses }:

stdenv.mkDerivation rec {
name = "mpw-2.6-f8043ae";
let
rev = "22796663dcad81684ab24308d9db570f6781ba2c";

src = fetchFromGitHub {
owner = "Lyndir";
repo = "MasterPassword";
rev = "f8043ae16d73ddfb205aadd25c35cd9c5e95b228";
sha256 = "0hy02ri7y3sca85z3ff5i68crwav5cjd7rrdqj7jrnpp1bw4yapi";
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;
};

postUnpack = ''
sourceRoot+=/platform-independent/cli-c
'';
sourceRoot = "./source/platform-independent/c/cli";

preConfigure = ''
substituteInPlace CMakeLists.txt --replace curses ncurses
echo ${name} > VERSION
postPatch = ''
rm build
substituteInPlace mpw-cli-tests \
--replace '/usr/bin/env bash' ${stdenv.shell} \
--replace ./mpw ./build/mpw
'';

dontUseCmakeBuildDir = true;
cmakeFlags = [
"-Dmpw_version=${version}"
"-DBUILD_MPW_TESTS=ON"
];

nativeBuildInputs = [ cmake ];

buildInputs = [ ncurses libsodium json_c ];
buildInputs = [ json_c libxml2 libsodium ncurses ];

installPhase = ''
mkdir -p $out/bin
mv mpw $out/bin/mpw
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
'';

doCheck = true;

checkPhase = ''
runHook preCheck
../mpw-cli-tests
runHook postCheck
'';

meta = with stdenv.lib; {
homepage = https://masterpasswordapp.com/;
description = "A stateless password management solution";
homepage = https://masterpasswordapp.com/;
license = licenses.gpl3;
platforms = platforms.unix;
};