diff --git a/pkgs/applications/misc/truecrypt/builder.sh b/pkgs/applications/misc/truecrypt/builder.sh deleted file mode 100644 index 88820d4cad21..000000000000 --- a/pkgs/applications/misc/truecrypt/builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -source $stdenv/setup - -tar xvfz $src -cd truecrypt-* - -cp $pkcs11h pkcs11.h -cp $pkcs11th pkcs11t.h -cp $pkcs11fh pkcs11f.h - -make PKCS11_INC="`pwd`" - -mkdir -p $out/bin -cp Main/truecrypt $out/bin -mkdir -p $out/share/$name -cp License.txt $out/share/$name/LICENSE diff --git a/pkgs/applications/misc/truecrypt/default.nix b/pkgs/applications/misc/truecrypt/default.nix index 2b66dd41a2a8..4787516cedd0 100644 --- a/pkgs/applications/misc/truecrypt/default.nix +++ b/pkgs/applications/misc/truecrypt/default.nix @@ -46,7 +46,24 @@ library, use the 'NOGUI' parameter: stdenv.mkDerivation { name = "truecrypt-7.1a"; - builder = ./builder.sh; + + 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; @@ -68,14 +85,13 @@ stdenv.mkDerivation { sha256 = "5ae6a4f32ca737e02def3bf314c9842fb89be82bf00b6f4022a97d8d565522b8"; }; - buildInputs = [ pkgconfig fuse devicemapper wxGTK nasm ]; - makeFlags = if wxGUI then "" else "NOGUI=1"; + buildInputs = [ pkgconfig fuse devicemapper 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; [viric]; + maintainers = with stdenv.lib.maintainers; [ viric ryantm ]; platforms = with stdenv.lib.platforms; linux; }; } diff --git a/pkgs/applications/misc/truecrypt/gcc6.patch b/pkgs/applications/misc/truecrypt/gcc6.patch new file mode 100644 index 000000000000..6e8c7da69e87 --- /dev/null +++ b/pkgs/applications/misc/truecrypt/gcc6.patch @@ -0,0 +1,61 @@ +--- Main/Resources.cpp 2016-05-16 16:47:35.846462041 +0200 ++++ Main/Resources.cpp 2016-05-16 17:12:21.838202520 +0200 +@@ -45,13 +45,13 @@ + strBuf.CopyFrom (res); + return string (reinterpret_cast (strBuf.Ptr())); + #else +- static const char LanguageXml[] = ++ static byte LanguageXml[] = + { + # include "Common/Language.xml.h" + , 0 + }; + +- return string (LanguageXml); ++ return string ((const char*) LanguageXml); + #endif + } + +@@ -64,13 +64,13 @@ + strBuf.CopyFrom (res); + return string (reinterpret_cast (strBuf.Ptr())); + #else +- static const char License[] = ++ static byte License[] = + { + # include "License.txt.h" + , 0 + }; + +- return string (License); ++ return string ((const char*) License); + #endif + } + +--- Main/Forms/PreferencesDialog.cpp 2016-05-16 17:14:47.704707908 +0200 ++++ Main/Forms/PreferencesDialog.cpp 2016-05-16 17:15:56.927964437 +0200 +@@ -414,11 +414,11 @@ + libExtension = wxDynamicLibrary::CanonicalizeName (L"x"); + + #ifdef TC_MACOSX +- extensions.push_back (make_pair (L"dylib", LangString["DLL_FILES"])); ++ extensions.push_back (make_pair (L"dylib", static_cast(LangString["DLL_FILES"].wc_str()))); + #endif + if (!libExtension.empty()) + { +- extensions.push_back (make_pair (libExtension.Mid (libExtension.find (L'.') + 1), LangString["DLL_FILES"])); ++ extensions.push_back (make_pair (static_cast(libExtension.Mid (libExtension.find (L'.') + 1).wc_str()), static_cast(LangString["DLL_FILES"].wc_str()))); + extensions.push_back (make_pair (L"*", L"")); + } + +--- Main/GraphicUserInterface.cpp 2016-05-16 17:16:38.724591342 +0200 ++++ Main/GraphicUserInterface.cpp 2016-05-16 17:17:09.854562653 +0200 +@@ -1445,7 +1445,7 @@ + FilePath GraphicUserInterface::SelectVolumeFile (wxWindow *parent, bool saveMode, const DirectoryPath &directory) const + { + list < pair > extensions; +- extensions.push_back (make_pair (L"tc", LangString["TC_VOLUMES"])); ++ extensions.push_back (make_pair (L"tc", static_cast(LangString["TC_VOLUMES"].wc_str()))); + + FilePathList selFiles = Gui->SelectFiles (parent, LangString[saveMode ? "OPEN_NEW_VOLUME" : "OPEN_VOL_TITLE"], saveMode, false, extensions, directory); +