about summary refs log tree commit diff
path: root/pkgs/applications/misc/pwsafe/default.nix
blob: a1538c69932e9c260a7f17d60222123ca89da53b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ stdenv, fetchurl, wxGTK, libuuid, xercesc, zip , libXt, libXtst
, libXi, xextproto, gettext, perl, pkgconfig, libyubikey, ykpers
}:

stdenv.mkDerivation rec {
  name = "pwsafe-${version}";
  version = "0.95";

  src = fetchurl {
    url = "mirror://sourceforge/passwordsafe/pwsafe-${version}BETA-src.tgz";
    sha256 = "f0b081bc358fee97fce20f352e360960d2813989023b837102b90ba6ed787d46";
  };

  makefile = "Makefile.linux";
  makeFlags = "YBPERS_LIBPATH=${ykpers}/lib";

  buildFlags = "unicoderelease";
  buildInputs = [ wxGTK libuuid gettext perl zip
                  xercesc libXt libXtst libXi xextproto
                  pkgconfig libyubikey ykpers ];

  postPatch = ''
    # Fix perl scripts used during the build.
    for f in `find . -type f -name '*.pl'`; do
      patchShebangs $f
    done

    # Fix hard coded paths.
    for f in `grep -Rl /usr/share/ src`; do
      substituteInPlace $f --replace /usr/share/ $out/share/
    done

    for f in `grep -Rl /usr/bin/ .`; do
      substituteInPlace $f --replace /usr/bin/ ""
    done
  '';

  installPhase = ''
    mkdir -p $out/bin \
             $out/share/applications \
             $out/share/pwsafe/xml \
             $out/share/icons/hicolor/48x48/apps \
             $out/share/doc/passwordsafe/help \
             $out/share/man/man1 \
             $out/share/locale

    (cd help && make -f Makefile.linux)
    cp help/help.zip $out/share/doc/passwordsafe/help

    (cd src/ui/wxWidgets/I18N && make mos)
    cp -dr src/ui/wxWidgets/I18N/mos/* $out/share/locale/
    # */

    cp README.txt docs/ReleaseNotes.txt docs/ChangeLog.txt \
      LICENSE install/copyright $out/share/doc/passwordsafe

    cp src/ui/wxWidgets/GCCUnicodeRelease/pwsafe $out/bin/
    cp install/graphics/pwsafe.png $out/share/icons/hicolor/48x48/apps
    cp docs/pwsafe.1 $out/share/man/man1
    cp xml/* $out/share/pwsafe/xml
    #  */
  '';

  meta = with stdenv.lib; {
    description = "Password Safe is a password database utility";

    longDescription = ''
      Password Safe is a password database utility. Like many other
      such products, commercial and otherwise, it stores your
      passwords in an encrypted file, allowing you to remember only
      one password (the "safe combination"), instead of all the
      username/password combinations that you use.
    '';

    homepage = http://passwordsafe.sourceforge.net/;
    maintainers = with maintainers; [ pjones ];
    platforms = platforms.linux;
    license = licenses.artistic2;
  };
}