commit: 9f5e6867ae196a665a4af24f4f3c51ce737f10f2 Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com> AuthorDate: Tue Jul 15 09:53:02 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Tue Jul 15 10:38:22 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f5e6867
app-crypt/johntheripper-jumbo: add 1.9.0_p20250703 with performance/completions fixes Build flags were massively inoptimal (comparing to simple ./configure && make): removal of -march=native, then adding -mno-avx effectively downgraded performance to SSE2 level. It was done as a workaround for https://bugs.gentoo.org/729422 in 2020 (before jumbo split), but seems to be not needed now. custom-cflags is also not needed: it works fine with sane CFLAGS (including LTO, including Clang). New ebuild adds bash/zsh completions. The list of executable files and symlinks was recreated from scratch: old symlinks did not work as intended, many symlinks were replaced with standalone elf executables. Bug: https://bugs.gentoo.org/729422 Closes: https://bugs.gentoo.org/954819 Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/43012 Closes: https://github.com/gentoo/gentoo/pull/43012 Signed-off-by: Sam James <sam <AT> gentoo.org> app-crypt/johntheripper-jumbo/Manifest | 1 + ... johntheripper-jumbo-1.9.0_p20250216-r1.ebuild} | 4 +- ... => johntheripper-jumbo-1.9.0_p20250703.ebuild} | 105 +++++++++++++-------- .../johntheripper-jumbo-9999.ebuild | 105 +++++++++++++-------- 4 files changed, 131 insertions(+), 84 deletions(-) diff --git a/app-crypt/johntheripper-jumbo/Manifest b/app-crypt/johntheripper-jumbo/Manifest index 6fa975aaf750..b2433d7aeb94 100644 --- a/app-crypt/johntheripper-jumbo/Manifest +++ b/app-crypt/johntheripper-jumbo/Manifest @@ -1,2 +1,3 @@ DIST johntheripper-jumbo-1.9.0_p20240102.tar.gz 55727974 BLAKE2B 10238f549b8d1d52d7858d0a0df080ae1e92a7026b3b31f4e19d00c2bf06df5ad1fe298291d5421a0f685786fca2ad954a5ed3b2adc23d80464ec1966db9c968 SHA512 c66898d12799d88d42e6a930768e27b4110362b6384a47957ab61300b8254af051d3a2821e54f12a90ded8a20c855b8a2f044942dba1605447ae355e2f7ecbaf DIST johntheripper-jumbo-1.9.0_p20250216.tar.gz 56239660 BLAKE2B 8d2da0b6634acc9ac78e5561e1afe4d07bc26776371d124c66d95e07164473421394c72aa6557ebd9db95c2d68754104b7dd7ba2fb36b1a193d094e13d9a4629 SHA512 27869c16977ca3c19b1f2247049dca8347b08af7bd1b626ccc549061385ed2e1617593115b6655113aa4999c3a7df5ab37c2ed9f901ed80ecd90d5e4cae9f5b5 +DIST johntheripper-jumbo-1.9.0_p20250703.tar.gz 56275211 BLAKE2B 5caea60f269fe51a3d86f0c351739c8d348dbf05735339dac925aba9b49bd0d226ad0581e6514af1ea47ad979ee7a3ae639e1ee4bf9808a40d567ef623089964 SHA512 3fa3e29976d38cdec885663b943f74a089e5a1d95de5a2ee5c54d381ee28a1a9b2bbfa95a42c07d786831bfa83724f7204b7a93dfc6c74b408df57b116b18704 diff --git a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250216.ebuild b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250216-r1.ebuild similarity index 98% copy from app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250216.ebuild copy to app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250216-r1.ebuild index 3dd5924681e1..a7501b5935d6 100644 --- a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250216.ebuild +++ b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250216-r1.ebuild @@ -156,6 +156,6 @@ src_install() { doins -r run/rules run/ztex # Documentation - rm -f doc/README || die - dodoc -r README.md doc/* + rm -f doc/README doc/LICENSE || die + dodoc -r README.md LICENSE doc/* } diff --git a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250216.ebuild b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250703.ebuild similarity index 58% rename from app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250216.ebuild rename to app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250703.ebuild index 3dd5924681e1..5804aa6ecf70 100644 --- a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250216.ebuild +++ b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250703.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit autotools flag-o-matic toolchain-funcs pax-utils +inherit autotools shell-completion toolchain-funcs pax-utils DESCRIPTION="Fast password cracker, community enhanced version" HOMEPAGE="http://www.openwall.com/john/" @@ -13,7 +13,7 @@ if [[ ${PV} == "9999" ]] ; then EGIT_BRANCH="bleeding-jumbo" inherit git-r3 else - HASH_COMMIT="8a72b12fe6e1626ef6014e5a190b9d1f69a9edde" + HASH_COMMIT="b27f951a8e191210685c8421c90ca610cdd39dce" SRC_URI="https://github.com/openwall/john/archive/${HASH_COMMIT}.tar.gz -> ${P}.tar.gz" S="${WORKDIR}/john-${HASH_COMMIT}" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" @@ -21,7 +21,25 @@ fi LICENSE="GPL-2" SLOT="0" -IUSE="custom-cflags kerberos mpi opencl openmp pcap" + +# First matching flag will be used +CPU_FEATURES_MAP=( + cpu_flags_x86_avx512bw:avx512bw + cpu_flags_x86_avx512f:avx512f + cpu_flags_x86_avx2:avx2 + cpu_flags_x86_xop:xop + cpu_flags_x86_avx:avx + cpu_flags_x86_sse4_2:sse4.2 + cpu_flags_x86_sse4_1:sse4.1 + cpu_flags_x86_ssse3:ssse3 + cpu_flags_x86_sse2:sse2 + + cpu_flags_ppc_altivec:altivec + + cpu_flags_arm_neon:neon +) + +IUSE="custom-cflags kerberos mpi opencl openmp pcap test ${CPU_FEATURES_MAP[*]%:*}" DEPEND=">=dev-libs/openssl-1.0.1:= virtual/libcrypt:= @@ -43,7 +61,7 @@ RDEPEND="${DEPEND} dev-perl/Digest-SHA3 dev-perl/Digest-GOST !app-crypt/johntheripper" -RESTRICT="test" +RESTRICT="!test? ( test )" pkg_pretend() { [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp @@ -62,17 +80,18 @@ src_prepare() { sed -i 's#$prefix/share/john#/etc/john#' configure || die } +get_enable_simd() { + for i in "${CPU_FEATURES_MAP[@]}" ; do + if use "${i%:*}"; then + echo "--enable-simd=${i#*:}" + break + fi + done +} + src_configure() { cd src || die - if ! use custom-cflags ; then - strip-flags - - # Nasty (and incomplete) workaround for bug #729422 - filter-flags '-march=native' - append-flags $(test-flags-CC '-mno-avx') - fi - econf \ --enable-pkg-config \ --disable-native-march \ @@ -83,7 +102,8 @@ src_configure() { $(use_enable mpi) \ $(use_enable opencl) \ $(use_enable openmp) \ - $(use_enable pcap) + $(use_enable pcap) \ + $(get_enable_simd) } src_compile() { @@ -95,67 +115,70 @@ src_compile() { src_test() { pax-mark -mr run/john - # this probably causes the following failure: - # Testing: as400-des, AS/400 DES [DES 32/64]... PASS - # Error, Invalid signature line trying to link to dynamic format. - # Original format=as400-ssha1 - sed '/.include /d' run/john.conf > run/john-test.conf if use opencl; then # GPU tests fail in portage, so run cpu only tests - ./run/john --config=run/john-test.conf --device=cpu --test=0 --verbosity=2 || die + ./run/john --config=run/john.conf --device=cpu --test=0 --verbosity=2 || die else # Weak tests - ./run/john --config=run/john-test.conf --test=0 --verbosity=2 || die + ./run/john --config=run/john.conf --test=0 --verbosity=2 || die # Strong tests #./run/john --test=1 --verbosity=2 || die fi - - rm john-test.conf || die } src_install() { + cd run || die + # Executables - dosbin run/john - newsbin run/mailer john-mailer + dosbin john + newsbin mailer john-mailer pax-mark -mr "${ED}/usr/sbin/john" - # grep '$(LN)' Makefile.in | head -n-3 | tail -n+2 | cut -d' ' -f3 | cut -d/ -f3 local s - for s in \ - unshadow unafs undrop unique ssh2john putty2john pfx2john keepass2john keyring2john \ - zip2john gpg2john rar2john racf2john keychain2john kwallet2john pwsafe2john dmg2john \ - hccap2john base64conv truecrypt_volume2john keystore2john + # find . -maxdepth 1 -type l -lname 'john' + for s in base64conv gpg2john rar2john unafs undrop unique unshadow zip2john do dosym john /usr/sbin/${s} done + # find . -maxdepth 1 -type f -executable -name '*2john' + for s in racf2john hccap2john uaf2john putty2john dmg2john wpapcap2john bitlocker2john keepass2john + do + dosbin ${s} + done + # Scripts exeinto /usr/share/john - doexe run/*.pl - doexe run/*.py + doexe ./*.pl ./*.py insinto /usr/share/john - doins -r run/lib - cd run || die + doins -r lib + doins ./*.lua local s for s in *.pl *.py; do - dosym ../share/john/${s} /usr/bin/${s} + dosym "../share/john/${s}" "/usr/bin/${s}" done - cd .. || die if use opencl; then insinto /etc/john - doins -r run/opencl + doins -r opencl fi # Config files insinto /etc/john - doins run/*.chr run/password.lst - doins run/*.conf - doins -r run/rules run/ztex + doins ./*.chr password.lst + doins ./*.conf + doins -r rules ztex + + # Completions + newbashcomp john.bash_completion john + bashcomp_alias john unique + newzshcomp john.zsh_completion _john + + cd .. || die # Documentation - rm -f doc/README || die - dodoc -r README.md doc/* + rm -f doc/README doc/LICENSE || die + dodoc -r README.md LICENSE doc/* } diff --git a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild index 3dd5924681e1..5804aa6ecf70 100644 --- a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild +++ b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit autotools flag-o-matic toolchain-funcs pax-utils +inherit autotools shell-completion toolchain-funcs pax-utils DESCRIPTION="Fast password cracker, community enhanced version" HOMEPAGE="http://www.openwall.com/john/" @@ -13,7 +13,7 @@ if [[ ${PV} == "9999" ]] ; then EGIT_BRANCH="bleeding-jumbo" inherit git-r3 else - HASH_COMMIT="8a72b12fe6e1626ef6014e5a190b9d1f69a9edde" + HASH_COMMIT="b27f951a8e191210685c8421c90ca610cdd39dce" SRC_URI="https://github.com/openwall/john/archive/${HASH_COMMIT}.tar.gz -> ${P}.tar.gz" S="${WORKDIR}/john-${HASH_COMMIT}" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" @@ -21,7 +21,25 @@ fi LICENSE="GPL-2" SLOT="0" -IUSE="custom-cflags kerberos mpi opencl openmp pcap" + +# First matching flag will be used +CPU_FEATURES_MAP=( + cpu_flags_x86_avx512bw:avx512bw + cpu_flags_x86_avx512f:avx512f + cpu_flags_x86_avx2:avx2 + cpu_flags_x86_xop:xop + cpu_flags_x86_avx:avx + cpu_flags_x86_sse4_2:sse4.2 + cpu_flags_x86_sse4_1:sse4.1 + cpu_flags_x86_ssse3:ssse3 + cpu_flags_x86_sse2:sse2 + + cpu_flags_ppc_altivec:altivec + + cpu_flags_arm_neon:neon +) + +IUSE="custom-cflags kerberos mpi opencl openmp pcap test ${CPU_FEATURES_MAP[*]%:*}" DEPEND=">=dev-libs/openssl-1.0.1:= virtual/libcrypt:= @@ -43,7 +61,7 @@ RDEPEND="${DEPEND} dev-perl/Digest-SHA3 dev-perl/Digest-GOST !app-crypt/johntheripper" -RESTRICT="test" +RESTRICT="!test? ( test )" pkg_pretend() { [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp @@ -62,17 +80,18 @@ src_prepare() { sed -i 's#$prefix/share/john#/etc/john#' configure || die } +get_enable_simd() { + for i in "${CPU_FEATURES_MAP[@]}" ; do + if use "${i%:*}"; then + echo "--enable-simd=${i#*:}" + break + fi + done +} + src_configure() { cd src || die - if ! use custom-cflags ; then - strip-flags - - # Nasty (and incomplete) workaround for bug #729422 - filter-flags '-march=native' - append-flags $(test-flags-CC '-mno-avx') - fi - econf \ --enable-pkg-config \ --disable-native-march \ @@ -83,7 +102,8 @@ src_configure() { $(use_enable mpi) \ $(use_enable opencl) \ $(use_enable openmp) \ - $(use_enable pcap) + $(use_enable pcap) \ + $(get_enable_simd) } src_compile() { @@ -95,67 +115,70 @@ src_compile() { src_test() { pax-mark -mr run/john - # this probably causes the following failure: - # Testing: as400-des, AS/400 DES [DES 32/64]... PASS - # Error, Invalid signature line trying to link to dynamic format. - # Original format=as400-ssha1 - sed '/.include /d' run/john.conf > run/john-test.conf if use opencl; then # GPU tests fail in portage, so run cpu only tests - ./run/john --config=run/john-test.conf --device=cpu --test=0 --verbosity=2 || die + ./run/john --config=run/john.conf --device=cpu --test=0 --verbosity=2 || die else # Weak tests - ./run/john --config=run/john-test.conf --test=0 --verbosity=2 || die + ./run/john --config=run/john.conf --test=0 --verbosity=2 || die # Strong tests #./run/john --test=1 --verbosity=2 || die fi - - rm john-test.conf || die } src_install() { + cd run || die + # Executables - dosbin run/john - newsbin run/mailer john-mailer + dosbin john + newsbin mailer john-mailer pax-mark -mr "${ED}/usr/sbin/john" - # grep '$(LN)' Makefile.in | head -n-3 | tail -n+2 | cut -d' ' -f3 | cut -d/ -f3 local s - for s in \ - unshadow unafs undrop unique ssh2john putty2john pfx2john keepass2john keyring2john \ - zip2john gpg2john rar2john racf2john keychain2john kwallet2john pwsafe2john dmg2john \ - hccap2john base64conv truecrypt_volume2john keystore2john + # find . -maxdepth 1 -type l -lname 'john' + for s in base64conv gpg2john rar2john unafs undrop unique unshadow zip2john do dosym john /usr/sbin/${s} done + # find . -maxdepth 1 -type f -executable -name '*2john' + for s in racf2john hccap2john uaf2john putty2john dmg2john wpapcap2john bitlocker2john keepass2john + do + dosbin ${s} + done + # Scripts exeinto /usr/share/john - doexe run/*.pl - doexe run/*.py + doexe ./*.pl ./*.py insinto /usr/share/john - doins -r run/lib - cd run || die + doins -r lib + doins ./*.lua local s for s in *.pl *.py; do - dosym ../share/john/${s} /usr/bin/${s} + dosym "../share/john/${s}" "/usr/bin/${s}" done - cd .. || die if use opencl; then insinto /etc/john - doins -r run/opencl + doins -r opencl fi # Config files insinto /etc/john - doins run/*.chr run/password.lst - doins run/*.conf - doins -r run/rules run/ztex + doins ./*.chr password.lst + doins ./*.conf + doins -r rules ztex + + # Completions + newbashcomp john.bash_completion john + bashcomp_alias john unique + newzshcomp john.zsh_completion _john + + cd .. || die # Documentation - rm -f doc/README || die - dodoc -r README.md doc/* + rm -f doc/README doc/LICENSE || die + dodoc -r README.md LICENSE doc/* }
