add new port archivers/zstd

Zstd, short for Zstandard, is a real-time compression algorithm providing
high compression ratios.  It offers a very wide range of compression vs.
speed trade-offs while being backed by a very fast decoder.  It offers
a special mode for small data called "dictionary compression" and it can
create dictionaries from any sample set.  Zstd is BSD-licensed.

Using Izbench on the Silesia compression corpus, zstd ranked at the
top with a compression ratio of 2.877, a compression rate of 325 Mb/s,
and a decompression rate of 325.  Zlib followed at 2.730, 95 Mb/s (C)
and 360 Mb/s (D).  See WWW page for the full benchmark results.
This commit is contained in:
John Marino 2016-07-30 23:51:50 +00:00
parent 87239031bc
commit 6de175fd41
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=419337
8 changed files with 123 additions and 0 deletions

View file

@ -240,6 +240,7 @@
SUBDIR += zipper
SUBDIR += zoo
SUBDIR += zopfli
SUBDIR += zstd
SUBDIR += zutils
.include <bsd.port.subdir.mk>

24
archivers/zstd/Makefile Normal file
View file

@ -0,0 +1,24 @@
# Created by: John Marino <marino@FreeBSD.org>
# $FreeBSD$
PORTNAME= zstd
PORTVERSION= 0.7.4
DISTVERSIONPREFIX= v
CATEGORIES= archivers
MAINTAINER= marino@FreeBSD.org
COMMENT= Zstandard - Fast real-time compression algorithm
LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/lib/LICENSE
USES= gmake
USE_GITHUB= yes
GH_ACCOUNT= Cyan4973
ALL_TARGET= default
MAKE_ARGS= MANDIR="${PREFIX}/man/man1" \
LIBDIR="${PREFIX}/lib" \
INCLUDEDIR="${PREFIX}/include"
.include <bsd.port.mk>

3
archivers/zstd/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1469858423
SHA256 (Cyan4973-zstd-v0.7.4_GH0.tar.gz) = 35ab3a5084d0194e9ff08e702edb6f507eab1bfb8c09c913639241cec852e2b7
SIZE (Cyan4973-zstd-v0.7.4_GH0.tar.gz) = 567830

View file

@ -0,0 +1,11 @@
--- Makefile.orig 2016-07-16 18:17:53 UTC
+++ Makefile
@@ -73,7 +73,7 @@ clean:
#------------------------------------------------------------------------
#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets
#------------------------------------------------------------------------
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU))
+ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly))
HOST_OS = POSIX
install:
$(MAKE) -C $(ZSTDDIR) $@

View file

@ -0,0 +1,36 @@
--- lib/Makefile.orig 2016-07-16 18:17:53 UTC
+++ lib/Makefile
@@ -99,7 +99,7 @@ clean:
#------------------------------------------------------------------------
#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU))
+ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly))
libzstd.pc:
libzstd.pc: libzstd.pc.in
@@ -111,15 +111,15 @@ libzstd.pc: libzstd.pc.in
$< >$@
install: libzstd libzstd.pc
- @install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/
- @install -m 755 libzstd.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_VER)
- @cp -a libzstd.$(SHARED_EXT_MAJOR) $(DESTDIR)$(LIBDIR)
- @cp -a libzstd.$(SHARED_EXT) $(DESTDIR)$(LIBDIR)
- @cp -a libzstd.pc $(DESTDIR)$(LIBDIR)/pkgconfig/
- @install -m 644 libzstd.a $(DESTDIR)$(LIBDIR)/libzstd.a
- @install -m 644 common/zstd.h $(DESTDIR)$(INCLUDEDIR)/zstd.h
- @install -m 644 common/zbuff.h $(DESTDIR)$(INCLUDEDIR)/zbuff.h
- @install -m 644 dictBuilder/zdict.h $(DESTDIR)$(INCLUDEDIR)/zdict.h
+ @install -d -m 755 $(DESTDIR)$(PREFIX)/libdata/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/
+ @$(BSD_INSTALL_LIB) libzstd.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_VER)
+ @ln -sf libzstd.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
+ @ln -sf libzstd.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT)
+ @$(BSD_INSTALL_DATA) libzstd.pc $(DESTDIR)$(PREFIX)/libdata/pkgconfig/
+ @$(BSD_INSTALL_LIB) libzstd.a $(DESTDIR)$(LIBDIR)/libzstd.a
+ @$(BSD_INSTALL_DATA) common/zstd.h $(DESTDIR)$(INCLUDEDIR)/zstd.h
+ @$(BSD_INSTALL_DATA) common/zbuff.h $(DESTDIR)$(INCLUDEDIR)/zbuff.h
+ @$(BSD_INSTALL_DATA) dictBuilder/zdict.h $(DESTDIR)$(INCLUDEDIR)/zdict.h
@echo zstd static and shared library installed
uninstall:

View file

@ -0,0 +1,22 @@
--- programs/Makefile.orig 2016-07-16 18:17:53 UTC
+++ programs/Makefile
@@ -157,16 +157,16 @@ clean:
#---------------------------------------------------------------------------------
#make install is validated only for Linux, OSX, kFreeBSD, Hurd and OpenBSD targets
#---------------------------------------------------------------------------------
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD))
+ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly))
HOST_OS = POSIX
install: zstd
@echo Installing binaries
@install -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
- @install -m 755 zstd$(EXT) $(DESTDIR)$(BINDIR)/zstd$(EXT)
+ @$(BSD_INSTALL_PROGRAM) zstd$(EXT) $(DESTDIR)$(BINDIR)/zstd$(EXT)
@ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/zstdcat
@ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/unzstd
@echo Installing man pages
- @install -m 644 zstd.1 $(DESTDIR)$(MANDIR)/zstd.1
+ @$(BSD_INSTALL_MAN) zstd.1 $(DESTDIR)$(MANDIR)/zstd.1
@ln -sf zstd.1 $(DESTDIR)$(MANDIR)/zstdcat.1
@ln -sf zstd.1 $(DESTDIR)$(MANDIR)/unzstd.1
@echo zstd installation completed

12
archivers/zstd/pkg-descr Normal file
View file

@ -0,0 +1,12 @@
Zstd, short for Zstandard, is a real-time compression algorithm providing
high compression ratios. It offers a very wide range of compression vs.
speed trade-offs while being backed by a very fast decoder. It offers
a special mode for small data called "dictionary compression" and it can
create dictionaries from any sample set. Zstd is BSD-licensed.
Using Izbench on the Silesia compression corpus, zstd ranked at the
top with a compression ratio of 2.877, a compression rate of 325 Mb/s,
and a decompression rate of 325. Zlib followed at 2.730, 95 Mb/s (C)
and 360 Mb/s (D). See WWW page for the full benchmark results.
WWW: http://cyan4973.github.io/zstd/

14
archivers/zstd/pkg-plist Normal file
View file

@ -0,0 +1,14 @@
bin/unzstd
bin/zstd
bin/zstdcat
include/zbuff.h
include/zdict.h
include/zstd.h
lib/libzstd.a
lib/libzstd.so
lib/libzstd.so.0
lib/libzstd.so.0.7.4
libdata/pkgconfig/libzstd.pc
man/man1/unzstd.1.gz
man/man1/zstd.1.gz
man/man1/zstdcat.1.gz