make archivers/zstd build on SecBSD

This commit is contained in:
purplerain 2023-08-28 07:36:30 +00:00
parent 8b0e97a9ad
commit d38cfd2a27
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
10 changed files with 149 additions and 0 deletions

View file

@ -0,0 +1,12 @@
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -151,7 +151,7 @@ clean:
#------------------------------------------------------------------------------
# make install is validated only for Linux, macOS, Hurd and some BSD targets
#------------------------------------------------------------------------------
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku AIX))
+ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD SecBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku AIX))
HOST_OS = POSIX

View file

@ -0,0 +1,12 @@
Index: build/meson/tests/meson.build
--- build/meson/tests/meson.build.orig
+++ build/meson/tests/meson.build
@@ -11,7 +11,7 @@
zstd_rootdir = '../../..'
tests_supported_oses = [os_linux, 'gnu/kfreebsd', os_darwin, 'gnu', 'openbsd',
- os_freebsd, 'netbsd', 'dragonfly', os_sun]
+ os_freebsd, 'netbsd', 'dragonfly', 'secbsd', os_sun]
# =============================================================================
# Test flags

View file

@ -0,0 +1,12 @@
Index: lib/Makefile
--- lib/Makefile.orig
+++ lib/Makefile
@@ -249,7 +249,7 @@ clean:
#-----------------------------------------------------------------------------
# make install is validated only for below listed environments
#-----------------------------------------------------------------------------
-ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX))
+ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD SecBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX))
lib: libzstd.pc

View file

@ -12,3 +12,12 @@ Index: lib/libzstd.mk
-Wredundant-decls -Wmissing-prototypes -Wc++-compat -Wredundant-decls -Wmissing-prototypes -Wc++-compat
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
ASFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) $(CFLAGS) ASFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) $(CFLAGS)
@@ -197,6 +197,8 @@ else ifeq ($(UNAME), FreeBSD)
else ifeq ($(UNAME), NetBSD)
HASH ?= md5 -n
else ifeq ($(UNAME), OpenBSD)
+ HASH ?= md5
+else ifeq ($(UNAME), SecBSD)
HASH ?= md5
endif
HASH ?= md5sum

View file

@ -0,0 +1,21 @@
Index: programs/Makefile
--- programs/Makefile.orig
+++ programs/Makefile
@@ -346,7 +346,7 @@ include $(wildcard $(DEPFILES))
#-----------------------------------------------------------------------------
# make install is validated only for Linux, macOS, BSD, Hurd and Solaris targets
#-----------------------------------------------------------------------------
-ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX))
+ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD SecBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX))
HAVE_COLORNEVER = $(shell echo a | egrep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0)
EGREP_OPTIONS ?=
@@ -389,7 +389,7 @@ datarootdir ?= $(PREFIX)/share
mandir ?= $(datarootdir)/man
man1dir ?= $(mandir)/man1
-ifneq (,$(filter $(UNAME),OpenBSD FreeBSD NetBSD DragonFly SunOS))
+ifneq (,$(filter $(UNAME),OpenBSD SecBSD FreeBSD NetBSD DragonFly SunOS))
MANDIR ?= $(PREFIX)/man
MAN1DIR ?= $(MANDIR)/man1
else

View file

@ -0,0 +1,12 @@
Index: tests/Makefile
--- tests/Makefile.orig
+++ tests/Makefile
@@ -263,7 +263,7 @@ clean:
# valgrind tests validated only for some posix platforms
#----------------------------------------------------------------------------------
UNAME := $(shell uname)
-ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS AIX))
+ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD SecBSD FreeBSD NetBSD DragonFly SunOS AIX))
HOST_OS = POSIX
.PHONY: test-valgrind

View file

@ -0,0 +1,12 @@
Index: tests/cli-tests/common/mtime.sh
--- tests/cli-tests/common/mtime.sh.orig
+++ tests/cli-tests/common/mtime.sh
@@ -2,7 +2,7 @@
MTIME="stat -c %Y"
case "$UNAME" in
- Darwin | FreeBSD | OpenBSD | NetBSD) MTIME="stat -f %m" ;;
+ Darwin | FreeBSD | OpenBSD | NetBSD | SecBSD) MTIME="stat -f %m" ;;
esac
assertSameMTime() {

View file

@ -0,0 +1,12 @@
Index: tests/cli-tests/common/permissions.sh
--- tests/cli-tests/common/permissions.sh.orig
+++ tests/cli-tests/common/permissions.sh
@@ -2,7 +2,7 @@
GET_PERMS="stat -c %a"
case "$UNAME" in
- Darwin | FreeBSD | OpenBSD | NetBSD) GET_PERMS="stat -f %Lp" ;;
+ Darwin | FreeBSD | OpenBSD | NetBSD | SecBSD) GET_PERMS="stat -f %Lp" ;;
esac
assertFilePermissions() {

View file

@ -0,0 +1,11 @@
Index: tests/cli-tests/common/platform.sh
--- tests/cli-tests/common/platform.sh.orig
+++ tests/cli-tests/common/platform.sh
@@ -21,6 +21,7 @@ case "$UNAME" in
FreeBSD) MD5SUM="gmd5sum" ;;
NetBSD) MD5SUM="md5 -n" ;;
OpenBSD) MD5SUM="md5" ;;
+ SecBSD) MD5SUM="md5" ;;
*) MD5SUM="md5sum" ;;
esac

View file

@ -0,0 +1,36 @@
Index: tests/playTests.sh
--- tests/playTests.sh.orig
+++ tests/playTests.sh
@@ -119,12 +119,13 @@ case "$UNAME" in
FreeBSD) MD5SUM="gmd5sum" ;;
NetBSD) MD5SUM="md5 -n" ;;
OpenBSD) MD5SUM="md5" ;;
+ SecBSD) MD5SUM="md5" ;;
*) MD5SUM="md5sum" ;;
esac
MTIME="stat -c %Y"
case "$UNAME" in
- Darwin | FreeBSD | OpenBSD | NetBSD) MTIME="stat -f %m" ;;
+ Darwin | FreeBSD | OpenBSD | NetBSD | SecBSD) MTIME="stat -f %m" ;;
esac
assertSameMTime() {
@@ -136,7 +137,7 @@ assertSameMTime() {
GET_PERMS="stat -c %a"
case "$UNAME" in
- Darwin | FreeBSD | OpenBSD | NetBSD) GET_PERMS="stat -f %Lp" ;;
+ Darwin | FreeBSD | OpenBSD | NetBSD | SecBSD) GET_PERMS="stat -f %Lp" ;;
esac
assertFilePermissions() {
@@ -870,7 +871,7 @@ rm -f ./*.tmp ./*.zstd
println "frame concatenation tests completed"
-if [ "$isWindows" = false ] && [ "$UNAME" != 'SunOS' ] && [ "$UNAME" != "OpenBSD" ] && [ "$UNAME" != "AIX" ]; then
+if [ "$isWindows" = false ] && [ "$UNAME" != 'SunOS' ] && [ "$UNAME" != "OpenBSD" ] && [ "$UNAME" != "SecBSD" ] && [ "$UNAME" != "AIX" ]; then
println "\n**** flush write error test **** "
println "println foo | zstd > /dev/full"