git.iko.soy/typeable/nixpkgs
on master help sign in
mpw: point upgrade and minor cleanups
commit31e4f1dbf6ea58f581287cb875673415b7389b1f authorPeter Hoeg <peter@hoeg.com> dateFri 1 Feb 2019, 15:05 (8 years ago) parentda1a2b1
1 file changed+42−19
pkgs/tools/security/mpw/default.nix+42−19
pkgs/tools/security/mpw/default.nix+42−19
@@ -1,38 +1,61 @@
1−{ stdenv, cmake, fetchFromGitHub, ncurses, libsodium, json_c }:
1+{ stdenv, cmake, fetchFromGitLab
2+, json_c, libsodium, libxml2, ncurses }:
23
3−stdenv.mkDerivation rec {
4− name = "mpw-2.6-f8043ae";
4+let
5+ rev = "22796663dcad81684ab24308d9db570f6781ba2c";
56
6− src = fetchFromGitHub {
7− owner = "Lyndir";
8− repo = "MasterPassword";
9− rev = "f8043ae16d73ddfb205aadd25c35cd9c5e95b228";
10− sha256 = "0hy02ri7y3sca85z3ff5i68crwav5cjd7rrdqj7jrnpp1bw4yapi";
7+in stdenv.mkDerivation rec {
8+ name = "mpw-${version}-${builtins.substring 0 8 rev}";
9+ version = "2.6";
10+
11+ src = fetchFromGitLab {
12+ owner = "MasterPassword";
13+ repo = "MasterPassword";
14+ sha256 = "1f2vqacgbyam1mazawrfim8zwp38gnwf5v3xkkficsfnv789g6fw";
15+ inherit rev;
1116 };
1217
13− postUnpack = ''
14− sourceRoot+=/platform-independent/cli-c
15− '';
18+ sourceRoot = "./source/platform-independent/c/cli";
1619
17− preConfigure = ''
18− substituteInPlace CMakeLists.txt --replace curses ncurses
19− echo ${name} > VERSION
20+ postPatch = ''
21+ rm build
22+ substituteInPlace mpw-cli-tests \
23+ --replace '/usr/bin/env bash' ${stdenv.shell} \
24+ --replace ./mpw ./build/mpw
2025 '';
2126
22− dontUseCmakeBuildDir = true;
27+ cmakeFlags = [
28+ "-Dmpw_version=${version}"
29+ "-DBUILD_MPW_TESTS=ON"
30+ ];
2331
2432 nativeBuildInputs = [ cmake ];
2533
26− buildInputs = [ ncurses libsodium json_c ];
34+ buildInputs = [ json_c libxml2 libsodium ncurses ];
2735
2836 installPhase = ''
29− mkdir -p $out/bin
30− mv mpw $out/bin/mpw
37+ runHook preInstall
38+
39+ install -Dm755 mpw $out/bin/mpw
40+ install -Dm644 ../mpw.completion.bash $out/share/bash-completion/completions/_mpw
41+ install -Dm644 ../../../../README.md $out/share/doc/mpw/README.md
42+
43+ runHook postInstall
44+ '';
45+
46+ doCheck = true;
47+
48+ checkPhase = ''
49+ runHook preCheck
50+
51+ ../mpw-cli-tests
52+
53+ runHook postCheck
3154 '';
3255
3356 meta = with stdenv.lib; {
34− homepage = https://masterpasswordapp.com/;
3557 description = "A stateless password management solution";
58+ homepage = https://masterpasswordapp.com/;
3659 license = licenses.gpl3;
3760 platforms = platforms.unix;
3861 };