diff --git a/srcpkgs/hashcat/patches/musl.patch b/srcpkgs/hashcat/patches/musl.patch new file mode 100644 index 00000000000..c80a696c7d0 --- /dev/null +++ b/srcpkgs/hashcat/patches/musl.patch @@ -0,0 +1,21 @@ +diff --git src/hashcat-cli.c src/hashcat-cli.c +index 8c9c951..c2b53ed 100644 +--- src/hashcat-cli.c ++++ src/hashcat-cli.c +@@ -17,7 +17,7 @@ + + // for interactive status prompt + #ifdef POSIX +-#ifndef OSX ++#ifdef __GLIBC__ + + #include + +@@ -25,6 +25,7 @@ + + #include + #include ++#define termios termio + + #endif + #endif diff --git a/srcpkgs/hashcat/template b/srcpkgs/hashcat/template new file mode 100644 index 00000000000..9318fff1de8 --- /dev/null +++ b/srcpkgs/hashcat/template @@ -0,0 +1,39 @@ +# Template file for 'hashcat' +pkgname=hashcat +version=2.00 +revision=1 +makedepends="gmp-devel" +short_desc="Advanced CPU-based password recovery utility" +maintainer="Duncaen " +license="MIT" +homepage="https://hashcat.net/hashcat/" +distfiles="https://github.com/hashcat/hashcat/archive/${version}.tar.gz" +checksum=6325e6d75a4df3485adec00f74e5887326809c15ed31bfe74a12b62943245444 +only_for_archs="x86_64 i686 x86_64-musl i686-musl" + +do_build() { + CFLAGS+=" -Iinclude/ -fomit-frame-pointer -funroll-loops -s" + case "$XBPS_TARGET_MACHINE" in + x86_64*) target="posix64" ;; + i686*) target="posix32" ;; + esac + make CC_POSIX32="$CC" CC_POSIX64="$CC" \ + CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \ + LIBGMP_POSIX32="${XBPS_CROSS_TRIPLET}/usr" \ + LIBGMP_POSIX64="${XBPS_CROSS_TRIPLET}/usr" \ + "$target" +} + +do_install() { + case "$XBPS_TARGET_MACHINE" in + x86_64*) vbin hashcat-cli64.bin hashcat ;; + i686*) vbin hashcat-cli32.bin hashcat ;; + esac + + vmkdir etc/hashcat + for d in salts rules tables; do + vcopy "$d" etc/hashcat + done + + vlicense docs/license.txt +}