summary refs log tree commit diff
path: root/pkgs/applications/misc/truecrypt/default.nix
blob: 5bb614ac68b1ce15b88b0b1c1b3898727cb94729 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
Requirements for Building TrueCrypt for Linux and macOS:
-----------------------------------------------------------

- GNU Make
- GNU C++ Compiler 4.0 or compatible
- Apple XCode (macOS only)
- pkg-config
- wxWidgets 2.8 library source code (available at http://www.wxwidgets.org)
- FUSE library (available at http://fuse.sourceforge.net and
  http://code.google.com/p/macfuse)


Instructions for Building TrueCrypt for Linux and macOS:
-----------------------------------------------------------

1) Change the current directory to the root of the TrueCrypt source code.

2) Run the following command to configure the wxWidgets library for TrueCrypt
   and to build it:

   $ make WX_ROOT=/usr/src/wxWidgets wxbuild

   The variable WX_ROOT must point to the location of the source code of the
   wxWidgets library. Output files will be placed in the './wxrelease/'
   directory.

3) To build TrueCrypt, run the following command:

   $ make

4) If successful, the TrueCrypt executable should be located in the directory
   'Main'.

By default, a universal executable supporting both graphical and text user
interface is built. To build a console-only executable, which requires no GUI
library, use the 'NOGUI' parameter:

   $ make NOGUI=1 WX_ROOT=/usr/src/wxWidgets wxbuild
   $ make NOGUI=1
*/

{ fetchurl, stdenv, pkgconfig, nasm, fuse, wxGTK, lvm2,
  wxGUI ? true
}:

stdenv.mkDerivation {
  name = "truecrypt-7.1a";

  patchPhase = "patch -p0 < ${./gcc6.patch}";

  preBuild = ''
    cp $pkcs11h pkcs11.h
    cp $pkcs11th pkcs11t.h
    cp $pkcs11fh pkcs11f.h
  '';

  makeFlags = [
    ''PKCS11_INC="`pwd`"''
    (if wxGUI then "" else "NOGUI=1")
  ];

  installPhase = ''
    install -D -t $out/bin Main/truecrypt
    install -D License.txt $out/share/$name/LICENSE
  '';

  src = fetchurl {
    url = https://fossies.org/linux/misc/old/TrueCrypt-7.1a-Source.tar.gz;
    sha256 = "e6214e911d0bbededba274a2f8f8d7b3f6f6951e20f1c3a598fc7a23af81c8dc";
  };

  pkcs11h = fetchurl {
    url = ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11.h;
    sha256 = "1563d877b6f8868b8eb8687358162bfb7f868104ed694beb35ae1c5cf1a58b9b";
  };

  pkcs11th = fetchurl {
    url = ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11t.h;
    sha256 = "8ce68616304684f92a7e267bcc8f486441e92a5cbdfcfd97e69ac9a0b436fb7b";
  };

  pkcs11fh = fetchurl {
    url = ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11f.h;
    sha256 = "5ae6a4f32ca737e02def3bf314c9842fb89be82bf00b6f4022a97d8d565522b8";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ fuse lvm2 wxGTK nasm ];

  meta = {
    description = "Free Open-Source filesystem on-the-fly encryption";
    homepage = http://www.truecrypt.org/;
    license = "TrueCrypt License Version 2.6";
    maintainers = with stdenv.lib.maintainers; [ ryantm ];
    platforms = with stdenv.lib.platforms; linux;
  };
}