pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/archivers/zstd Import zstd-1.0.0 as archivers/zstd.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7cf20794c565
branches:  trunk
changeset: 352026:7cf20794c565
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Sep 04 12:36:59 2016 +0000

description:
Import zstd-1.0.0 as archivers/zstd.

Zstd, short for Zstandard, is a fast lossless compression algorithm,
targeting real-time compression scenarios at zlib-level and better
compression ratios.

diffstat:

 archivers/zstd/DESCR                             |    3 +
 archivers/zstd/Makefile                          |   18 +++
 archivers/zstd/PLIST                             |   15 ++
 archivers/zstd/distinfo                          |   11 +
 archivers/zstd/patches/patch-Makefile            |   15 ++
 archivers/zstd/patches/patch-lib_Makefile        |   15 ++
 archivers/zstd/patches/patch-programs_Makefile   |   15 ++
 archivers/zstd/patches/patch-tests_zbufftest.c   |  121 +++++++++++++++++++++
 archivers/zstd/patches/patch-tests_zstreamtest.c |  129 +++++++++++++++++++++++
 9 files changed, 342 insertions(+), 0 deletions(-)

diffs (truncated from 378 to 300 lines):

diff -r 7950aa23fd77 -r 7cf20794c565 archivers/zstd/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/archivers/zstd/DESCR      Sun Sep 04 12:36:59 2016 +0000
@@ -0,0 +1,3 @@
+Zstd, short for Zstandard, is a fast lossless compression algorithm,
+targeting real-time compression scenarios at zlib-level and better
+compression ratios.
diff -r 7950aa23fd77 -r 7cf20794c565 archivers/zstd/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/archivers/zstd/Makefile   Sun Sep 04 12:36:59 2016 +0000
@@ -0,0 +1,18 @@
+# $NetBSD: Makefile,v 1.1 2016/09/04 12:36:59 wiz Exp $
+
+DISTNAME=      zstd-1.0.0
+CATEGORIES=    archivers
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=facebook/}
+GITHUB_TAG=    v${PKGVERSION_NOREV}
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      http://www.zstd.net/
+COMMENT=       Fast real-time compression algorithm
+LICENSE=       modified-bsd
+
+USE_TOOLS+=    gmake pkg-config
+MAKE_FLAGS=    MANDIR=${PREFIX}/${PKGMANDIR}/man1
+
+PKGCONFIG_OVERRIDE+=   lib/libzstd.pc.in
+
+.include "../../mk/bsd.pkg.mk"
diff -r 7950aa23fd77 -r 7cf20794c565 archivers/zstd/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/archivers/zstd/PLIST      Sun Sep 04 12:36:59 2016 +0000
@@ -0,0 +1,15 @@
+@comment $NetBSD: PLIST,v 1.1 2016/09/04 12:36:59 wiz Exp $
+bin/unzstd
+bin/zstd
+bin/zstdcat
+include/zbuff.h
+include/zdict.h
+include/zstd.h
+lib/libzstd.a
+lib/libzstd.so
+lib/libzstd.so.1
+lib/libzstd.so.${PKGVERSION}
+lib/pkgconfig/libzstd.pc
+man/man1/unzstd.1
+man/man1/zstd.1
+man/man1/zstdcat.1
diff -r 7950aa23fd77 -r 7cf20794c565 archivers/zstd/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/archivers/zstd/distinfo   Sun Sep 04 12:36:59 2016 +0000
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1 2016/09/04 12:36:59 wiz Exp $
+
+SHA1 (zstd-1.0.0.tar.gz) = 4865e52b308fccbf8cabf704f63cadbeccb1b6d9
+RMD160 (zstd-1.0.0.tar.gz) = 37abd266b75dc62eea83e75f6868bfd7dc53a648
+SHA512 (zstd-1.0.0.tar.gz) = ba7b1c993656fa220dd8d4c8cd6b7999b0d7b59b4290d7767063f6c4bfbb81e04b9d9890dea4d223d48082ab253159209d6187dc7b42cafc28ebc738bfa17ace
+Size (zstd-1.0.0.tar.gz) = 593430 bytes
+SHA1 (patch-Makefile) = 6cb92b591d2daa236218714c50a85ad2d13516c4
+SHA1 (patch-lib_Makefile) = 1b4136bc1580547a129cc0ba2965fda9ebf90e3c
+SHA1 (patch-programs_Makefile) = 74d1c393e2918d4da27f18e915d9424965a68e5d
+SHA1 (patch-tests_zbufftest.c) = 68a796958aea6256ecd5ac18fc4c96d753ebbec2
+SHA1 (patch-tests_zstreamtest.c) = 31c0d6c661cc21119871d1ad3650d9842cbd59c1
diff -r 7950aa23fd77 -r 7cf20794c565 archivers/zstd/patches/patch-Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/archivers/zstd/patches/patch-Makefile     Sun Sep 04 12:36:59 2016 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-Makefile,v 1.1 2016/09/04 12:36:59 wiz Exp $
+
+Enable install target for NetBSD.
+
+--- Makefile.orig      2016-09-04 12:01:55.355932317 +0000
++++ Makefile
+@@ -51,7 +51,7 @@ clean:
+ #----------------------------------------------------------------------------------
+ #make install is validated only for Linux, OSX, kFreeBSD, Hurd and some BSD targets
+ #----------------------------------------------------------------------------------
+-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly))
++ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD))
+ HOST_OS = POSIX
+ install:
+       $(MAKE) -C $(ZSTDDIR) $@
diff -r 7950aa23fd77 -r 7cf20794c565 archivers/zstd/patches/patch-lib_Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/archivers/zstd/patches/patch-lib_Makefile Sun Sep 04 12:36:59 2016 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_Makefile,v 1.1 2016/09/04 12:36:59 wiz Exp $
+
+Enable install target for NetBSD.
+
+--- lib/Makefile.orig  2016-08-31 16:09:10.000000000 +0000
++++ lib/Makefile
+@@ -78,7 +78,7 @@ clean:
+ 
+ #------------------------------------------------------------------------
+ #make install is validated only for Linux, OSX, kFreeBSD, Hurd and some BSD targets
+-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly))
++ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD))
+ 
+ libzstd.pc:
+ libzstd.pc: libzstd.pc.in
diff -r 7950aa23fd77 -r 7cf20794c565 archivers/zstd/patches/patch-programs_Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/archivers/zstd/patches/patch-programs_Makefile    Sun Sep 04 12:36:59 2016 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-programs_Makefile,v 1.1 2016/09/04 12:36:59 wiz Exp $
+
+Enable install target for NetBSD.
+
+--- programs/Makefile.orig     2016-08-31 16:09:10.000000000 +0000
++++ programs/Makefile
+@@ -125,7 +125,7 @@ clean:
+ #----------------------------------------------------------------------------------
+ #make install is validated only for Linux, OSX, kFreeBSD, Hurd and some BSD targets
+ #----------------------------------------------------------------------------------
+-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly))
++ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD))
+ install: zstd
+       @echo Installing binaries
+       @install -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
diff -r 7950aa23fd77 -r 7cf20794c565 archivers/zstd/patches/patch-tests_zbufftest.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/archivers/zstd/patches/patch-tests_zbufftest.c    Sun Sep 04 12:36:59 2016 +0000
@@ -0,0 +1,121 @@
+$NetBSD: patch-tests_zbufftest.c,v 1.1 2016/09/04 12:36:59 wiz Exp $
+
+https://github.com/facebook/zstd/commit/5153a084f3065229bdcc689dd0cb2d90396b51c2
+
+--- tests/zbufftest.c.orig     2016-08-31 16:09:10.000000000 +0000
++++ tests/zbufftest.c
+@@ -23,7 +23,7 @@
+ **************************************/
+ #include <stdlib.h>       /* free */
+ #include <stdio.h>        /* fgets, sscanf */
+-#include <sys/timeb.h>    /* timeb */
++#include <time.h>         /* clock_t, clock() */
+ #include <string.h>       /* strcmp */
+ #include "mem.h"
+ #define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_maxCLevel */
+@@ -58,13 +58,13 @@ static const U32 prime2 = 2246822519U;
+ static U32 g_displayLevel = 2;
+ 
+ #define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
+-            if ((FUZ_GetMilliSpan(g_displayTime) > g_refreshRate) || (g_displayLevel>=4)) \
+-            { g_displayTime = FUZ_GetMilliStart(); DISPLAY(__VA_ARGS__); \
++            if ((FUZ_GetClockSpan(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \
++            { g_displayClock = clock(); DISPLAY(__VA_ARGS__); \
+             if (g_displayLevel>=4) fflush(stdout); } }
+-static const U32 g_refreshRate = 150;
+-static U32 g_displayTime = 0;
++static const clock_t g_refreshRate = CLOCKS_PER_SEC * 15 / 100;
++static clock_t g_displayClock = 0;
+ 
+-static U32 g_testTime = 0;
++static clock_t g_clockTime = 0;
+ 
+ 
+ /*-*******************************************************
+@@ -72,23 +72,9 @@ static U32 g_testTime = 0;
+ *********************************************************/
+ #define MAX(a,b) ((a)>(b)?(a):(b))
+ 
+-static U32 FUZ_GetMilliStart(void)
++static clock_t FUZ_GetClockSpan(clock_t clockStart)
+ {
+-    struct timeb tb;
+-    U32 nCount;
+-    ftime( &tb );
+-    nCount = (U32) (((tb.time & 0xFFFFF) * 1000) +  tb.millitm);
+-    return nCount;
+-}
+-
+-
+-static U32 FUZ_GetMilliSpan(U32 nTimeStart)
+-{
+-    U32 const nCurrent = FUZ_GetMilliStart();
+-    U32 nSpan = nCurrent - nTimeStart;
+-    if (nTimeStart > nCurrent)
+-        nSpan += 0x100000 * 1000;
+-    return nSpan;
++    return clock() - clockStart;  /* works even when overflow. Max span ~ 30 mn */
+ }
+ 
+ /*! FUZ_rand() :
+@@ -291,7 +277,7 @@ static int fuzzerTests(U32 seed, U32 nbT
+     U32 coreSeed = seed;
+     ZBUFF_CCtx* zc;
+     ZBUFF_DCtx* zd;
+-    U32 startTime = FUZ_GetMilliStart();
++    clock_t startClock = clock();
+ 
+     /* allocations */
+     zc = ZBUFF_createCCtx();
+@@ -321,7 +307,7 @@ static int fuzzerTests(U32 seed, U32 nbT
+         FUZ_rand(&coreSeed);
+ 
+     /* test loop */
+-    for ( ; (testNb <= nbTests) || (FUZ_GetMilliSpan(startTime) < g_testTime) ; testNb++ ) {
++    for ( ; (testNb <= nbTests) || (FUZ_GetClockSpan(startClock) < g_clockTime) ; testNb++ ) {
+         U32 lseed;
+         const BYTE* srcBuffer;
+         const BYTE* dict;
+@@ -543,7 +529,7 @@ int main(int argc, const char** argv)
+ 
+                 case 'i':
+                     argument++;
+-                    nbTests=0; g_testTime=0;
++                    nbTests=0; g_clockTime=0;
+                     while ((*argument>='0') && (*argument<='9')) {
+                         nbTests *= 10;
+                         nbTests += *argument - '0';
+@@ -553,15 +539,15 @@ int main(int argc, const char** argv)
+ 
+                 case 'T':
+                     argument++;
+-                    nbTests=0; g_testTime=0;
++                    nbTests=0; g_clockTime=0;
+                     while ((*argument>='0') && (*argument<='9')) {
+-                        g_testTime *= 10;
+-                        g_testTime += *argument - '0';
++                        g_clockTime *= 10;
++                        g_clockTime += *argument - '0';
+                         argument++;
+                     }
+-                    if (*argument=='m') g_testTime *=60, argument++;
++                    if (*argument=='m') g_clockTime *=60, argument++;
+                     if (*argument=='n') argument++;
+-                    g_testTime *= 1000;
++                    g_clockTime *= CLOCKS_PER_SEC;
+                     break;
+ 
+                 case 's':
+@@ -605,7 +591,11 @@ int main(int argc, const char** argv)
+     /* Get Seed */
+     DISPLAY("Starting zstd_buffered tester (%i-bits, %s)\n", (int)(sizeof(size_t)*8), ZSTD_VERSION_STRING);
+ 
+-    if (!seedset) seed = FUZ_GetMilliStart() % 10000;
++    if (!seedset) {
++        time_t const t = time(NULL);
++        U32 const h = XXH32(&t, sizeof(t), 1);
++        seed = h % 10000;
++    }
+     DISPLAY("Seed = %u\n", seed);
+     if (proba!=FUZ_COMPRESSIBILITY_DEFAULT) DISPLAY("Compressibility : %i%%\n", proba);
+ 
diff -r 7950aa23fd77 -r 7cf20794c565 archivers/zstd/patches/patch-tests_zstreamtest.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/archivers/zstd/patches/patch-tests_zstreamtest.c  Sun Sep 04 12:36:59 2016 +0000
@@ -0,0 +1,129 @@
+$NetBSD: patch-tests_zstreamtest.c,v 1.1 2016/09/04 12:36:59 wiz Exp $
+
+https://github.com/facebook/zstd/commit/ef9999f0b9762003f96a3e5bddb7e60dace458bc
+
+--- tests/zstreamtest.c.orig   2016-08-31 16:09:10.000000000 +0000
++++ tests/zstreamtest.c
+@@ -23,13 +23,13 @@
+ **************************************/
+ #include <stdlib.h>       /* free */
+ #include <stdio.h>        /* fgets, sscanf */
+-#include <sys/timeb.h>    /* timeb */
++#include <time.h>         /* clock_t, clock() */
+ #include <string.h>       /* strcmp */
+ #include "mem.h"
+-#define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_maxCLevel */
++#define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_maxCLevel, ZSTD_customMem */
+ #include "zstd.h"         /* ZSTD_compressBound */
+ #include "datagen.h"      /* RDG_genBuffer */
+-#define XXH_STATIC_LINKING_ONLY
++#define XXH_STATIC_LINKING_ONLY   /* XXH64_state_t */
+ #include "xxhash.h"       /* XXH64_* */
+ 
+ 
+@@ -55,13 +55,13 @@ static const U32 prime2 = 2246822519U;
+ static U32 g_displayLevel = 2;
+ 
+ #define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
+-            if ((FUZ_GetMilliSpan(g_displayTime) > g_refreshRate) || (g_displayLevel>=4)) \
+-            { g_displayTime = FUZ_GetMilliStart(); DISPLAY(__VA_ARGS__); \
++            if ((FUZ_GetClockSpan(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \
++            { g_displayClock = clock(); DISPLAY(__VA_ARGS__); \
+             if (g_displayLevel>=4) fflush(stdout); } }
+-static const U32 g_refreshRate = 150;
+-static U32 g_displayTime = 0;
++static const clock_t g_refreshRate = CLOCKS_PER_SEC * 15 / 100;
++static clock_t g_displayClock = 0;
+ 
+-static U32 g_testTime = 0;
++static clock_t g_clockTime = 0;
+ 
+ 
+ /*-*******************************************************
+@@ -69,22 +69,9 @@ static U32 g_testTime = 0;
+ *********************************************************/
+ #define MAX(a,b) ((a)>(b)?(a):(b))
+ 
+-static U32 FUZ_GetMilliStart(void)
++static clock_t FUZ_GetClockSpan(clock_t clockStart)
+ {
+-    struct timeb tb;
+-    U32 nCount;



Home | Main Index | Thread Index | Old Index