1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils pax-utils multilib
8 DESCRIPTION="World's fastest and most advanced password recovery utility"
9 HOMEPAGE="https://github.com/hashcat/hashcat"
10 SRC_URI="https://github.com/hashcat/hashcat/archive/v${PV}.tar.gz -> ${P}.tar.gz"
15 IUSE="video_cards_nvidia"
16 DEPEND="virtual/opencl
18 video_cards_nvidia? ( >x11-drivers/nvidia-drivers-367.0 )"
23 sed -i "/LFLAGS += -s/d" src/Makefile
24 #do not add random CFLAGS
25 sed -i "s/-O2//" src/Makefile || die
26 sed -i "#LZMA_SDK_INCLUDE#d" src/Makefile || die
28 export LIBRARY_FOLDER="/usr/$(get_libdir)"
29 export DOCUMENT_FOLDER="/usr/share/doc/${P}"
34 emake SHARED=1 PRODUCTION=1 ENABLE_BRAIN=0 SYSTEM_LZMA_SDK=0
39 if use video_cards_nvidia; then
41 addwrite /dev/nvidiactl
42 addwrite /dev/nvidia-uvm
43 if [ ! -w /dev/nvidia0 ]; then
44 einfo "To run these tests, portage likely must be in the video group."
45 einfo "Please run \"gpasswd -a portage video\" if the tests will fail"
47 #elif use vidia_cards_fglrx; then
50 #this always exits with 255 despite success
51 #./hashcat -b -m 2500 || die "Test failed"
52 LD_PRELOAD=./libhashcat.so.${PV} ./hashcat -a 3 -m 1500 nQCk49SiErOgk || die "Test failed"
56 emake DESTDIR="${ED}" SHARED=1 PRODUCTION=1 ENABLE_BRAIN=0 SYSTEM_LZMA_SDK=0 install