1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 inherit desktop flag-o-matic linux-info pax-utils toolchain-funcs wxwidgets
9 DESCRIPTION="Disk encryption with strong security based on TrueCrypt"
10 HOMEPAGE="https://www.veracrypt.fr/en/Home.html"
11 SRC_URI="https://github.com/${PN}/VeraCrypt/archive/VeraCrypt_${PV}.tar.gz -> ${P}.tar.gz"
12 S="${WORKDIR}/VeraCrypt-VeraCrypt_${PV}/src"
14 # The modules not linked against in Linux include (but not limited to):
15 # libzip, chacha-xmm, chacha256, chachaRng, rdrand, t1ha2
16 # Tested by actually removing the source files and performing a build
17 # For this reason, we don't have to worry about their licenses
18 LICENSE="Apache-2.0 BSD RSA truecrypt-3.0"
21 IUSE="+asm cpu_flags_x86_sse2 cpu_flags_x86_sse4_1 cpu_flags_x86_ssse3 doc X"
22 RESTRICT="bindist mirror"
29 x11-libs/wxGTK:${WX_GTK_VER}[X?]"
32 asm? ( dev-lang/yasm )
35 CONFIG_CHECK="~BLK_DEV_DM ~CRYPTO ~CRYPTO_XTS ~DM_CRYPT ~FUSE_FS"
40 # https://bugs.gentoo.org/786741
41 # std::byte clashes with src/Common/Tcdefs.h typedef
42 append-cxxflags -std=c++14
53 RANLIB="$(tc-getRANLIB)"
54 TC_EXTRA_CFLAGS="${CFLAGS}"
55 TC_EXTRA_CXXFLAGS="${CXXFLAGS}"
56 TC_EXTRA_LFLAGS="${LDFLAGS}"
57 WX_CONFIG="${WX_CONFIG}"
58 $(usex X "" "NOGUI=1")
59 $(usex asm "" "NOASM=1")
60 $(usex cpu_flags_x86_sse2 "" "NOSSE2=1")
61 $(usex cpu_flags_x86_sse4_1 "SSE41=1" "")
62 $(usex cpu_flags_x86_ssse3 "SSSE3=1" "")
65 emake "${myemakeargs[@]}"
69 ./Main/veracrypt --text --test || die "tests failed"
73 local DOCS=( Readme.txt )
77 DOCS+=( "${S}"/../doc/EFI-DCS )
78 docompress -x /usr/share/doc/${PF}/EFI-DCS
79 HTML_DOCS=( "${S}"/../doc/html/. )
83 newinitd "${FILESDIR}"/veracrypt.init veracrypt
87 for s in 16 48 128 256; do
88 newicon -s ${s} Resources/Icons/VeraCrypt-${s}x${s}.xpm veracrypt.xpm
90 make_desktop_entry veracrypt "VeraCrypt" veracrypt "Utility;Security"
93 pax-mark -m "${ED}"/usr/bin/veracrypt
99 ewarn "VeraCrypt has a very restrictive license. Please be explicitly aware"
100 ewarn "of the limitations on redistribution of binaries or modified source."
102 # Remove this when we remove veracrypt-1.25.9.ebuild from the tree.
103 for version in ${REPLACING_VERSIONS}; do
104 if ver_test "${version}" -lt "1.26.7"; then
105 ewarn "Starting with 1.26.7, TrueCrypt volumes are no longer supported."
106 ewarn "Please explore alternatives such as dm-crypt to mount truecrypt volumes."
107 ewarn "Moreover, support for RIPEMD160 and GOST89 is dropped."
108 ewarn "Volumes using these algoritms will no longer mount."