git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #28982 from ryantm/truecrypt

truecrypt: fix build with gcc6 patch

commitbafc53c7e9b14d4043acbcb092f9ac512738e448 authorJörg Thalheim <Mic92@users.noreply.github.com> dateFri 8 Sep 2017, 11:52 (9 years ago) parentc3a0c3c8b0de80
3 files changed+81−19
pkgs/applications/misc/truecrypt/builder.sh−15 pkgs/applications/misc/truecrypt/default.nix+20−4 pkgs/applications/misc/truecrypt/gcc6.patch+61
pkgs/applications/misc/truecrypt/builder.shdeleted−15
@@ -1,15 +0,0 @@
1−source $stdenv/setup
2−
3−tar xvfz $src
4−cd truecrypt-*
5−
6−cp $pkcs11h pkcs11.h
7−cp $pkcs11th pkcs11t.h
8−cp $pkcs11fh pkcs11f.h
9−
10−make PKCS11_INC="`pwd`"
11−
12−mkdir -p $out/bin
13−cp Main/truecrypt $out/bin
14−mkdir -p $out/share/$name
15−cp License.txt $out/share/$name/LICENSE
pkgs/applications/misc/truecrypt/default.nix+20−4
@@ -46,7 +46,24 @@ library, use the 'NOGUI' parameter:
4646
4747stdenv.mkDerivation {
4848 name = "truecrypt-7.1a";
49− builder = ./builder.sh;
49+
50+ patchPhase = "patch -p0 < ${./gcc6.patch}";
51+
52+ preBuild = ''
53+ cp $pkcs11h pkcs11.h
54+ cp $pkcs11th pkcs11t.h
55+ cp $pkcs11fh pkcs11f.h
56+ '';
57+
58+ makeFlags = [
59+ ''PKCS11_INC="`pwd`"''
60+ (if wxGUI then "" else "NOGUI=1")
61+ ];
62+
63+ installPhase = ''
64+ install -D -t $out/bin Main/truecrypt
65+ install -D License.txt $out/share/$name/LICENSE
66+ '';
5067
5168 src = fetchurl {
5269 url = https://fossies.org/linux/misc/old/TrueCrypt-7.1a-Source.tar.gz;
@@ -68,14 +85,13 @@ stdenv.mkDerivation {
6885 sha256 = "5ae6a4f32ca737e02def3bf314c9842fb89be82bf00b6f4022a97d8d565522b8";
6986 };
7087
71− buildInputs = [ pkgconfig fuse devicemapper wxGTK nasm ];
72− makeFlags = if wxGUI then "" else "NOGUI=1";
88+ buildInputs = [ pkgconfig fuse devicemapper wxGTK nasm ];
7389
7490 meta = {
7591 description = "Free Open-Source filesystem on-the-fly encryption";
7692 homepage = http://www.truecrypt.org/;
7793 license = "TrueCrypt License Version 2.6";
78− maintainers = with stdenv.lib.maintainers; [viric];
94+ maintainers = with stdenv.lib.maintainers; [ viric ryantm ];
7995 platforms = with stdenv.lib.platforms; linux;
8096 };
8197}
pkgs/applications/misc/truecrypt/gcc6.patchnew file+61
@@ -0,0 +1,61 @@
1+--- Main/Resources.cpp 2016-05-16 16:47:35.846462041 +0200
2++++ Main/Resources.cpp 2016-05-16 17:12:21.838202520 +0200
3+@@ -45,13 +45,13 @@
4+ strBuf.CopyFrom (res);
5+ return string (reinterpret_cast <char *> (strBuf.Ptr()));
6+ #else
7+- static const char LanguageXml[] =
8++ static byte LanguageXml[] =
9+ {
10+ # include "Common/Language.xml.h"
11+ , 0
12+ };
13+
14+- return string (LanguageXml);
15++ return string ((const char*) LanguageXml);
16+ #endif
17+ }
18+
19+@@ -64,13 +64,13 @@
20+ strBuf.CopyFrom (res);
21+ return string (reinterpret_cast <char *> (strBuf.Ptr()));
22+ #else
23+- static const char License[] =
24++ static byte License[] =
25+ {
26+ # include "License.txt.h"
27+ , 0
28+ };
29+
30+- return string (License);
31++ return string ((const char*) License);
32+ #endif
33+ }
34+
35+--- Main/Forms/PreferencesDialog.cpp 2016-05-16 17:14:47.704707908 +0200
36++++ Main/Forms/PreferencesDialog.cpp 2016-05-16 17:15:56.927964437 +0200
37+@@ -414,11 +414,11 @@
38+ libExtension = wxDynamicLibrary::CanonicalizeName (L"x");
39+
40+ #ifdef TC_MACOSX
41+- extensions.push_back (make_pair (L"dylib", LangString["DLL_FILES"]));
42++ extensions.push_back (make_pair (L"dylib", static_cast<const wchar_t*>(LangString["DLL_FILES"].wc_str())));
43+ #endif
44+ if (!libExtension.empty())
45+ {
46+- extensions.push_back (make_pair (libExtension.Mid (libExtension.find (L'.') + 1), LangString["DLL_FILES"]));
47++ extensions.push_back (make_pair (static_cast<const wchar_t*>(libExtension.Mid (libExtension.find (L'.') + 1).wc_str()), static_cast<const wchar_t*>(LangString["DLL_FILES"].wc_str())));
48+ extensions.push_back (make_pair (L"*", L""));
49+ }
50+
51+--- Main/GraphicUserInterface.cpp 2016-05-16 17:16:38.724591342 +0200
52++++ Main/GraphicUserInterface.cpp 2016-05-16 17:17:09.854562653 +0200
53+@@ -1445,7 +1445,7 @@
54+ FilePath GraphicUserInterface::SelectVolumeFile (wxWindow *parent, bool saveMode, const DirectoryPath &directory) const
55+ {
56+ list < pair <wstring, wstring> > extensions;
57+- extensions.push_back (make_pair (L"tc", LangString["TC_VOLUMES"]));
58++ extensions.push_back (make_pair (L"tc", static_cast<const wchar_t*>(LangString["TC_VOLUMES"].wc_str())));
59+
60+ FilePathList selFiles = Gui->SelectFiles (parent, LangString[saveMode ? "OPEN_NEW_VOLUME" : "OPEN_VOL_TITLE"], saveMode, false, extensions, directory);
61+