1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils linux-info pax-utils toolchain-funcs wxwidgets
7 DESCRIPTION="Disk encryption with strong security based on TrueCrypt"
8 HOMEPAGE="https://www.veracrypt.fr/en/Home.html"
9 SRC_URI="https://github.com/${PN}/VeraCrypt/archive/VeraCrypt_1.24-Hotfix1.tar.gz -> ${P}.tar.gz"
11 # The modules not linked against in Linux include (but not limited to):
12 # libzip, chacha-xmm, chacha256, chachaRng, jitterentropy, rdrand, t1ha2
13 # Tested by actually removing the source files and performing a build
14 # For this reason, We don't have to worry about their licenses
15 LICENSE="Apache-2.0 truecrypt-3.0"
18 IUSE="+asm cpu_flags_x86_sse2 cpu_flags_x86_sse4_1 cpu_flags_x86_ssse3 doc X"
19 RESTRICT="bindist mirror"
26 x11-libs/wxGTK:${WX_GTK_VER}[X?]
28 dev-libs/pkcs11-helper
33 asm? ( dev-lang/yasm )
36 S="${WORKDIR}/VeraCrypt-VeraCrypt_1.24-Hotfix1/src"
39 local CONFIG_CHECK="~BLK_DEV_DM ~CRYPTO ~CRYPTO_XTS ~DM_CRYPT ~FUSE_FS"
46 eapply -p2 "${FILESDIR}"/${PN}-1.24-no-gui-fix.patch
51 local TC_EXTRA_CFLAGS="${CFLAGS}"
52 local TC_EXTRA_CXXFLAGS="${CXXFLAGS}"
60 RANLIB="$(tc-getRANLIB)"
61 TC_EXTRA_LFLAGS="${LDFLAGS}"
62 WX_CONFIG="${WX_CONFIG}"
63 $(usex X "" "NOGUI=1")
64 $(usex asm "" "NOASM=1")
65 $(usex cpu_flags_x86_sse2 "" "NOSSE2=1")
66 $(usex cpu_flags_x86_sse4_1 "SSE41=1" "")
67 $(usex cpu_flags_x86_ssse3 "SSSE3=1" "")
70 # We need to explicitly disable the GUI support when linking against
71 # wxwidgets, in case it was compiled with USE=X
73 TC_EXTRA_CFLAGS="${TC_EXTRA_CFLAGS} -DwxUSE_GUI=0"
74 TC_EXTRA_CXXFLAGS="${TC_EXTRA_CXXFLAGS} -DwxUSE_GUI=0"
78 TC_EXTRA_CFLAGS="${TC_EXTRA_CFLAGS}"
79 TC_EXTRA_CXXFLAGS="${TC_EXTRA_CXXFLAGS}"
82 emake "${myemakeargs[@]}"
86 "${S}/Main/veracrypt" --text --test || die "tests failed"
90 local DOCS=( Readme.txt )
95 DOCS+=( "${S}"/../doc/EFI-DCS )
96 docompress -x "/usr/share/doc/${PF}/EFI-DCS"
97 HTML_DOCS+=( "${S}"/../doc/html/. )
101 newinitd "${FILESDIR}/${PN}.init" ${PN}
105 for s in 16 48 128 256; do
106 newicon -s ${s} Resources/Icons/VeraCrypt-${s}x${s}.xpm veracrypt.xpm
108 make_desktop_entry ${PN} "VeraCrypt" ${PN} "Utility;Security"
111 pax-mark -m "${D%/}/usr/bin/veracrypt"
115 ewarn "VeraCrypt has a very restrictive license. Please be explicitly aware"
116 ewarn "of the limitations on redistribution of binaries or modified source."