pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

hashcat: fix the build for NetBSD



Module Name:	pkgsrc-wip
Committed By:	Pierre Pronchery <khorben%defora.org@localhost>
Pushed By:	khorben
Date:		Thu Jan 6 00:28:50 2022 +0100
Changeset:	4a1d0f8b7d2f0b94b4af2b2a287fb480a938bb44

Modified Files:
	hashcat/Makefile
	hashcat/PLIST
	hashcat/distinfo
	hashcat/patches/patch-include_sort__r.h
	hashcat/patches/patch-src_Makefile
Removed Files:
	hashcat/TODO

Log Message:
hashcat: fix the build for NetBSD

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=4a1d0f8b7d2f0b94b4af2b2a287fb480a938bb44

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 hashcat/Makefile                        |  3 +++
 hashcat/PLIST                           |  1 -
 hashcat/TODO                            |  1 -
 hashcat/distinfo                        |  4 ++--
 hashcat/patches/patch-include_sort__r.h | 16 +++++++++++++++-
 hashcat/patches/patch-src_Makefile      | 25 +++++++++++++++++++------
 6 files changed, 39 insertions(+), 11 deletions(-)

diffs:
diff --git a/hashcat/Makefile b/hashcat/Makefile
index 0e371dba5d..e902e55648 100644
--- a/hashcat/Makefile
+++ b/hashcat/Makefile
@@ -16,6 +16,9 @@ MAKE_ENV+=	SHARED=1
 MAKE_ENV+=	USE_SYSTEM_ZLIB=1
 MAKE_ENV+=	USE_SYSTEM_XXHASH=1
 
+post-install:
+	${RM} ${DESTDIR}${PREFIX}/include/hashcat/sort_r.h.orig
+
 .include "../../archivers/minizip/buildlink3.mk"
 .include "../../devel/xxhash/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
diff --git a/hashcat/PLIST b/hashcat/PLIST
index 439a3644be..ddafd897ba 100644
--- a/hashcat/PLIST
+++ b/hashcat/PLIST
@@ -78,7 +78,6 @@ include/hashcat/types.h
 include/hashcat/usage.h
 include/hashcat/user_options.h
 include/hashcat/wordlist.h
-lib/libhashcat.so
 lib/libhashcat.so.${PKGVERSION}
 share/doc/hashcat/charsets/DES_full.hcchr
 share/doc/hashcat/charsets/DES_special/DES_alpha.hcchr
diff --git a/hashcat/TODO b/hashcat/TODO
deleted file mode 100644
index 6cd91ae5e1..0000000000
--- a/hashcat/TODO
+++ /dev/null
@@ -1 +0,0 @@
-Does not build on NetBSD due to missing OpenCL support.
diff --git a/hashcat/distinfo b/hashcat/distinfo
index 0f9a78ea1e..ad1f8a0f77 100644
--- a/hashcat/distinfo
+++ b/hashcat/distinfo
@@ -3,8 +3,8 @@ $NetBSD$
 BLAKE2s (hashcat-6.2.5.tar.gz) = 425d720ca0bb48e585988dc0557a829b3906d697ad14722c68e34fb5b4f7ebaa
 SHA512 (hashcat-6.2.5.tar.gz) = 2b881146c625172c91cb74b33851473155dcde2421fba1b4acfba28116499b9cff832a62c4dbc24e16df06a827494f30699a7d0e5195d5ed107704f525255383
 Size (hashcat-6.2.5.tar.gz) = 6341872 bytes
-SHA1 (patch-include_sort__r.h) = 710a6866d1f1b0ba4c499e07897cdaaed5d2f2cb
-SHA1 (patch-src_Makefile) = 2781200f402b5cebaded0cce72023d6e1cda7ef9
+SHA1 (patch-include_sort__r.h) = b5418315b7abd50d95b9ec526964f94418c1aafd
+SHA1 (patch-src_Makefile) = 427c7d162ff8373d6b180718fff4845bdb119d1c
 SHA1 (patch-src_affinity.c) = 6054fea2478244292bd855bb8eb8d064aa0d81d1
 SHA1 (patch-src_folder.c) = dfac6b9c75ce0e6e694eb2f3e902a040226b2e6e
 SHA1 (patch-src_terminal.c) = 40b52cdb1f9030b9ad7649bf0a9a4cf17b1f52fe
diff --git a/hashcat/patches/patch-include_sort__r.h b/hashcat/patches/patch-include_sort__r.h
index 8949ffdcf8..2498e3c89c 100644
--- a/hashcat/patches/patch-include_sort__r.h
+++ b/hashcat/patches/patch-include_sort__r.h
@@ -1,6 +1,6 @@
 $NetBSD$
 
-Tentatively fix the build for NetBSD
+Fix the build for NetBSD
 
 --- include/sort_r.h.orig	2022-01-05 22:11:43.619407583 +0000
 +++ include/sort_r.h
@@ -13,3 +13,17 @@ Tentatively fix the build for NetBSD
  #  define _SORT_R_BSD
  #  define _SORT_R_INLINE inline
  #elif (defined __linux__) || defined (__CYGWIN__)
+@@ -202,7 +202,12 @@ static _SORT_R_INLINE void sort_r_simple
+       struct sort_r_data tmp;
+       tmp.arg = arg;
+       tmp.compar = compar;
+-      qsort_r(base, nel, width, &tmp, sort_r_arg_swap);
++
++      #if defined __NetBSD__
++        sort_r_simple(base, nel, width, compar, arg);
++      #else
++        qsort_r(base, nel, width, &tmp, sort_r_arg_swap);
++      #endif
+ 
+     #elif defined _SORT_R_WINDOWS
+ 
diff --git a/hashcat/patches/patch-src_Makefile b/hashcat/patches/patch-src_Makefile
index eaaeb8b3ab..ad6d785689 100644
--- a/hashcat/patches/patch-src_Makefile
+++ b/hashcat/patches/patch-src_Makefile
@@ -1,11 +1,11 @@
 $NetBSD$
 
 Set preferences.
-Add minimal NetBSD support.
+Add NetBSD support.
 Don't override CC nor optimisation flags in CFLAGS.
 Remove sed magic; we'll use nbsed.
 
---- src/Makefile.orig	2021-05-15 12:07:58.000000000 +0000
+--- src/Makefile.orig	2021-11-21 15:39:01.000000000 +0000
 +++ src/Makefile
 @@ -31,7 +31,7 @@ UNAME                   := $(patsubst MS
  UNAME                   := $(patsubst MINGW32_NT-%,MSYS2,$(UNAME))
@@ -16,7 +16,7 @@ Remove sed magic; we'll use nbsed.
  $(error "! Your Operating System ($(UNAME)) is not supported by this Makefile")
  endif
  
-@@ -59,8 +59,6 @@ MODULE_INTERFACE_VERSION := 620
+@@ -59,8 +59,6 @@ MODULE_INTERFACE_VERSION := 630
  ## Native compiler paths
  ##
  
@@ -46,7 +46,7 @@ Remove sed magic; we'll use nbsed.
  
  ##
  ## Version
-@@ -222,7 +209,6 @@ endif
+@@ -228,7 +215,6 @@ endif
  endif
  
  ifeq ($(DEBUG),0)
@@ -54,7 +54,7 @@ Remove sed magic; we'll use nbsed.
  ifneq ($(UNAME),Darwin)
  LFLAGS                  += -s
  endif
-@@ -306,6 +292,13 @@ LFLAGS_NATIVE           += -liconv
+@@ -312,6 +298,13 @@ LFLAGS_NATIVE           += -liconv
  endif
  endif # FreeBSD
  
@@ -68,7 +68,20 @@ Remove sed magic; we'll use nbsed.
  ifeq ($(UNAME),Darwin)
  export MACOSX_DEPLOYMENT_TARGET=10.9
  CFLAGS_NATIVE           := $(CFLAGS)
-@@ -630,8 +623,13 @@ endif
+@@ -456,10 +449,10 @@ distclean: clean
+ # allow (whitelist) "make install" only on unix-based systems (also disallow cygwin/msys)
+ 
+ ifneq ($(findstring install,$(MAKECMDGOALS)),)
+-  ifeq (,$(filter $(UNAME),Linux FreeBSD Darwin))
++  ifeq (,$(filter $(UNAME),Linux FreeBSD Darwin NetBSD))
+     define ERROR_INSTALL_DISALLOWED
+ ! The 'install' target is not allowed on this operating system ($(UNAME)). \
+-Only Linux, FreeBSD and Darwin can use the 'install' target
++Only Linux, FreeBSD, NetBSD and Darwin can use the 'install' target
+     endef
+ 
+     $(error $(ERROR_INSTALL_DISALLOWED))
+@@ -637,8 +630,13 @@ endif
  $(MODULES_DISABLE): ;
  
  ifeq ($(SHARED),1)


Home | Main Index | Thread Index | Old Index