You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
2.7 KiB
108 lines
2.7 KiB
4 years ago
|
# Copyright 1999-2021 Gentoo Authors
|
||
6 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
4 years ago
|
EAPI=7
|
||
6 years ago
|
|
||
3 years ago
|
inherit pax-utils toolchain-funcs
|
||
6 years ago
|
|
||
|
DESCRIPTION="World's fastest and most advanced password recovery utility"
|
||
|
HOMEPAGE="https://github.com/hashcat/hashcat"
|
||
|
LICENSE="MIT"
|
||
|
SLOT="0"
|
||
4 years ago
|
if [ "${PV}" = "9999" ]; then
|
||
|
inherit git-r3
|
||
|
EGIT_REPO_URI="https://github.com/hashcat/hashcat.git"
|
||
|
else
|
||
4 years ago
|
KEYWORDS="~amd64"
|
||
4 years ago
|
SRC_URI="https://github.com/hashcat/hashcat/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||
|
fi
|
||
6 years ago
|
|
||
4 years ago
|
IUSE="brain video_cards_nvidia"
|
||
4 years ago
|
DEPEND="
|
||
6 years ago
|
app-arch/lzma
|
||
3 years ago
|
app-arch/unrar
|
||
|
sys-libs/zlib[minizip]
|
||
4 years ago
|
brain? ( dev-libs/xxhash )
|
||
4 years ago
|
video_cards_nvidia? ( >x11-drivers/nvidia-drivers-440.64
|
||
|
|| ( dev-util/nvidia-cuda-toolkit
|
||
|
virtual/opencl )
|
||
|
)
|
||
|
!video_cards_nvidia? ( virtual/opencl )"
|
||
6 years ago
|
RDEPEND="${DEPEND}"
|
||
|
|
||
|
src_prepare() {
|
||
3 years ago
|
# remove bundled stuff
|
||
4 years ago
|
rm -r deps/OpenCL-Headers || die "Failed to remove bundled OpenCL Headers"
|
||
|
rm -r deps/xxHash || die "Failed to remove bundled xxHash"
|
||
3 years ago
|
# TODO: Gentoo's app-arch/lzma doesn't install the needed files
|
||
4 years ago
|
#rm -r deps/LZMA-SDK || die "Failed to remove bundled LZMA-SDK"
|
||
|
#rm -r deps || die "Failed to remove bundled deps"
|
||
3 years ago
|
|
||
|
# do not strip
|
||
6 years ago
|
sed -i "/LFLAGS += -s/d" src/Makefile
|
||
3 years ago
|
# do not add random CFLAGS
|
||
6 years ago
|
sed -i "s/-O2//" src/Makefile || die
|
||
3 years ago
|
#sed -i "#LZMA_SDK_INCLUDE#d" src/Makefile || die
|
||
|
# respect CC, CXX, AR
|
||
|
sed -i \
|
||
|
-e 's/:= gcc/:= $(CC)/' \
|
||
|
-e 's/:= g++/:= $(CXX)/' \
|
||
|
-e 's/:= ar/:= $(AR)/' \
|
||
|
src/Makefile || die
|
||
|
|
||
|
export PREFIX="${EPREFIX}"/usr
|
||
6 years ago
|
export LIBRARY_FOLDER="/usr/$(get_libdir)"
|
||
3 years ago
|
export DOCUMENT_FOLDER="/usr/share/doc/${PF}"
|
||
|
|
||
4 years ago
|
default
|
||
6 years ago
|
}
|
||
|
|
||
|
src_compile() {
|
||
3 years ago
|
tc-export CC CXX AR
|
||
|
|
||
|
emake \
|
||
|
SHARED=1 \
|
||
|
PRODUCTION=1 \
|
||
|
ENABLE_BRAIN=$(usex brain 1 0) \
|
||
|
USE_SYSTEM_LZMA=0 \
|
||
|
USE_SYSTEM_OPENCL=1 \
|
||
|
USE_SYSTEM_UNRAR=1 \
|
||
|
USE_SYSTEM_ZLIB=1 \
|
||
|
USE_SYSTEM_XXHASH=1 \
|
||
|
VERSION_PURE="${PV}"
|
||
|
|
||
6 years ago
|
pax-mark -mr hashcat
|
||
|
}
|
||
|
|
||
|
src_test() {
|
||
|
if use video_cards_nvidia; then
|
||
|
addwrite /dev/nvidia0
|
||
|
addwrite /dev/nvidiactl
|
||
|
addwrite /dev/nvidia-uvm
|
||
|
if [ ! -w /dev/nvidia0 ]; then
|
||
|
einfo "To run these tests, portage likely must be in the video group."
|
||
|
einfo "Please run \"gpasswd -a portage video\" if the tests will fail"
|
||
|
fi
|
||
|
#elif use vidia_cards_fglrx; then
|
||
|
# addwrite /dev/ati
|
||
|
fi
|
||
|
#this always exits with 255 despite success
|
||
|
#./hashcat -b -m 2500 || die "Test failed"
|
||
|
LD_PRELOAD=./libhashcat.so.${PV} ./hashcat -a 3 -m 1500 nQCk49SiErOgk || die "Test failed"
|
||
|
}
|
||
|
|
||
|
src_install() {
|
||
3 years ago
|
emake \
|
||
|
DESTDIR="${ED}" \
|
||
|
SHARED=1 \
|
||
|
PRODUCTION=1 \
|
||
|
ENABLE_BRAIN=$(usex brain 1 0) \
|
||
|
USE_SYSTEM_LZMA=0 \
|
||
|
USE_SYSTEM_OPENCL=1 \
|
||
|
USE_SYSTEM_UNRAR=1 \
|
||
|
USE_SYSTEM_ZLIB=1 \
|
||
|
USE_SYSTEM_XXHASH=1 \
|
||
|
VERSION_PURE="${PV}" \
|
||
|
install
|
||
6 years ago
|
}
|