diff options
author | fhajny <fhajny@pkgsrc.org> | 2014-08-06 10:41:33 +0000 |
---|---|---|
committer | fhajny <fhajny@pkgsrc.org> | 2014-08-06 10:41:33 +0000 |
commit | bbb4733598a4995294f95e207c017095d601480a (patch) | |
tree | f61dd1a49a7ba577564531ec76bc3b3b101b3781 /archivers/lz4 | |
parent | 6eff59ecfc74531368b38fb41fe5b8acf846e785 (diff) | |
download | pkgsrc-bbb4733598a4995294f95e207c017095d601480a.tar.gz |
Import lz4 as archivers/lz4.
LZ4 is a very fast lossless compression algorithm, providing
compression speed at 400 MB/s per core, scalable with multi-cores
CPU. It also features an extremely fast decoder, with speed in
multiple GB/s per core, typically reaching RAM speed limits on
multi-core systems.
Diffstat (limited to 'archivers/lz4')
-rw-r--r-- | archivers/lz4/DESCR | 5 | ||||
-rw-r--r-- | archivers/lz4/Makefile | 20 | ||||
-rw-r--r-- | archivers/lz4/PLIST | 14 | ||||
-rw-r--r-- | archivers/lz4/distinfo | 8 | ||||
-rw-r--r-- | archivers/lz4/patches/patch-Makefile | 65 | ||||
-rw-r--r-- | archivers/lz4/patches/patch-programs_Makefile | 52 | ||||
-rw-r--r-- | archivers/lz4/patches/patch-programs_fuzzer.c | 67 |
7 files changed, 231 insertions, 0 deletions
diff --git a/archivers/lz4/DESCR b/archivers/lz4/DESCR new file mode 100644 index 00000000000..a66fa447a01 --- /dev/null +++ b/archivers/lz4/DESCR @@ -0,0 +1,5 @@ +LZ4 is a very fast lossless compression algorithm, providing +compression speed at 400 MB/s per core, scalable with multi-cores +CPU. It also features an extremely fast decoder, with speed in +multiple GB/s per core, typically reaching RAM speed limits on +multi-core systems. diff --git a/archivers/lz4/Makefile b/archivers/lz4/Makefile new file mode 100644 index 00000000000..88266045af7 --- /dev/null +++ b/archivers/lz4/Makefile @@ -0,0 +1,20 @@ +# $NetBSD: Makefile,v 1.1 2014/08/06 10:41:33 fhajny Exp $ + +DISTNAME= lz4-r120 +PKGNAME= ${DISTNAME:S/-r/-/} +CATEGORIES= archivers +MASTER_SITES= -https://github.com/Cyan4973/lz4/archive/${DISTNAME:S/lz4-//}${EXTRACT_SUFX} + +MAINTAINER= filip@joyent.com +HOMEPAGE= http://code.google.com/p/lz4/ +COMMENT= Extremely Fast Compression algorithm +LICENSE= 2-clause-bsd + +USE_LANGUAGES= c c99 +USE_TOOLS+= gmake pkg-config + +CPPFLAGS.SunOS+= -D_XOPEN_SOURCE=600 + +PKGCONFIG_OVERRIDE+= liblz4.pc.in + +.include "../../mk/bsd.pkg.mk" diff --git a/archivers/lz4/PLIST b/archivers/lz4/PLIST new file mode 100644 index 00000000000..e07d7ed7ddf --- /dev/null +++ b/archivers/lz4/PLIST @@ -0,0 +1,14 @@ +@comment $NetBSD: PLIST,v 1.1 2014/08/06 10:41:33 fhajny Exp $ +bin/lz4 +bin/lz4c +bin/lz4cat +include/lz4.h +include/lz4hc.h +lib/liblz4.a +lib/liblz4.so +lib/liblz4.so.1 +lib/liblz4.so.1.3.0 +lib/pkgconfig/liblz4.pc +man/man1/lz4.1 +man/man1/lz4c.1 +man/man1/lz4cat.1 diff --git a/archivers/lz4/distinfo b/archivers/lz4/distinfo new file mode 100644 index 00000000000..9bb869d6607 --- /dev/null +++ b/archivers/lz4/distinfo @@ -0,0 +1,8 @@ +$NetBSD: distinfo,v 1.1 2014/08/06 10:41:33 fhajny Exp $ + +SHA1 (lz4-r120.tar.gz) = 6c657297eb9bd47f2f4de76fbc89204b652377c9 +RMD160 (lz4-r120.tar.gz) = fa76b7dff8a5bda1de370a28ca7d7719031ef7a6 +Size (lz4-r120.tar.gz) = 161950 bytes +SHA1 (patch-Makefile) = 30b138d69267c9d3b110165e2b709e8e1b01f552 +SHA1 (patch-programs_Makefile) = 8d633547c1bac2710d49c859be41463a32693408 +SHA1 (patch-programs_fuzzer.c) = fc7560d0257e8e90bcccf7ae8082061ff0d9ebf4 diff --git a/archivers/lz4/patches/patch-Makefile b/archivers/lz4/patches/patch-Makefile new file mode 100644 index 00000000000..cc3b2b71e94 --- /dev/null +++ b/archivers/lz4/patches/patch-Makefile @@ -0,0 +1,65 @@ +$NetBSD: patch-Makefile,v 1.1 2014/08/06 10:41:34 fhajny Exp $ + +Make portable, use pkgsrc install scripts. +--- Makefile.orig 2014-07-24 11:54:05.000000000 +0000 ++++ Makefile +@@ -33,13 +33,13 @@ + # Version numbers + VERSION=120 + export RELEASE=r$(VERSION) +-LIBVER_MAJOR=`sed -n '/LZ4_VERSION_MAJOR/s/.*\s\+\([0-9]\+\).*/\1/p' < lz4.h` +-LIBVER_MINOR=`sed -n '/LZ4_VERSION_MINOR/s/.*\s\+\([0-9]\+\).*/\1/p' < lz4.h` +-LIBVER_PATCH=`sed -n '/LZ4_VERSION_RELEASE/s/.*\s\+\([0-9]\+\).*/\1/p' < lz4.h` ++LIBVER_MAJOR=`awk '$$2=="LZ4_VERSION_MAJOR" {print $$3}' < lz4.h` ++LIBVER_MINOR=`awk '$$2=="LZ4_VERSION_MINOR" {print $$3}' < lz4.h` ++LIBVER_PATCH=`awk '$$2=="LZ4_VERSION_RELEASE" {print $$3}' < lz4.h` + LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH) + + DESTDIR= +-PREFIX = /usr ++PREFIX?= /usr + CC := $(CC) + CFLAGS?= -O3 + CFLAGS+= -I. -std=c99 -Wall -Wextra -Wundef -Wshadow -Wstrict-prototypes -DLZ4_VERSION=\"$(RELEASE)\" +@@ -111,24 +111,22 @@ clean: + #------------------------------------------------------------------------ + #make install option is designed for Linux & OSX targets only + +-ifneq (,$(filter $(shell uname),Linux Darwin)) +- + liblz4.pc: liblz4.pc.in Makefile +- sed -e 's|@PREFIX@|$(PREFIX)|' \ +- -e 's|@LIBDIR@|$(LIBDIR)|' \ +- -e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \ +- -e 's|@VERSION@|$(VERSION)|' \ ++ sed -e 's|@PREFIX@|$(PREFIX)|g' \ ++ -e 's|@LIBDIR@|$(LIBDIR)|g' \ ++ -e 's|@INCLUDEDIR@|$(INCLUDEDIR)|g' \ ++ -e 's|@VERSION@|$(VERSION)|g' \ + $< >$@ + + install: liblz4 liblz4.pc +- @install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/ +- @install -m 755 liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) +- @cp -a liblz4.$(SHARED_EXT_MAJOR) $(DESTDIR)$(LIBDIR) +- @cp -a liblz4.$(SHARED_EXT) $(DESTDIR)$(LIBDIR) +- @cp -a liblz4.pc $(DESTDIR)$(LIBDIR)/pkgconfig/ +- @install -m 644 liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a +- @install -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h +- @install -m 644 lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h ++ $(BSD_INSTALL_DATA_DIR) -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/ ++ $(BSD_INSTALL_LIB) -m 755 liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) ++ @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR) ++ @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT) ++ $(BSD_INSTALL_DATA) liblz4.pc $(DESTDIR)$(LIBDIR)/pkgconfig/ ++ $(BSD_INSTALL_LIB) -m 644 liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a ++ $(BSD_INSTALL_DATA) -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h ++ $(BSD_INSTALL_DATA) -m 644 lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h + @echo lz4 static and shared library installed + @cd $(PRGDIR); $(MAKE) -e install + +@@ -165,4 +163,3 @@ test: + test-travis: lz4programs + @cd $(PRGDIR); $(MAKE) -e $@ + +-endif diff --git a/archivers/lz4/patches/patch-programs_Makefile b/archivers/lz4/patches/patch-programs_Makefile new file mode 100644 index 00000000000..86d3dede5d7 --- /dev/null +++ b/archivers/lz4/patches/patch-programs_Makefile @@ -0,0 +1,52 @@ +$NetBSD: patch-programs_Makefile,v 1.1 2014/08/06 10:41:34 fhajny Exp $ + +Make portable, use pkgsrc install scripts. +--- programs/Makefile.orig 2014-07-24 11:54:05.000000000 +0000 ++++ programs/Makefile +@@ -32,14 +32,14 @@ + + RELEASE=r120 + DESTDIR= +-PREFIX=/usr ++PREFIX?=/usr + CC:=$(CC) + CFLAGS?= -O3 + CFLAGS+= -std=c99 -Wall -Wextra -Wundef -Wshadow -Wstrict-prototypes -DLZ4_VERSION=\"$(RELEASE)\" + FLAGS= -I.. $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + + BINDIR=$(PREFIX)/bin +-MANDIR=$(PREFIX)/share/man/man1 ++MANDIR=$(PREFIX)/$(PKGMANDIR)/man1 + LZ4DIR=.. + + TEST_FILES = COPYING +@@ -103,18 +103,16 @@ clean: + @echo Cleaning completed + + +-ifneq (,$(filter $(shell uname),Linux Darwin)) +- + install: lz4 lz4c + @echo Installing binaries +- @install -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/ +- @install -m 755 lz4 $(DESTDIR)$(BINDIR)/lz4 ++ $(BSD_INSTALL_PROGRAM_DIR) -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/ ++ $(BSD_INSTALL_PROGRAM) -m 755 lz4 $(DESTDIR)$(BINDIR)/lz4 + @ln -sf lz4 $(DESTDIR)$(BINDIR)/lz4cat +- @install -m 755 lz4c $(DESTDIR)$(BINDIR)/lz4c ++ $(BSD_INSTALL_PROGRAM) -m 755 lz4c $(DESTDIR)$(BINDIR)/lz4c + @echo Installing man pages +- @install -m 644 lz4.1 $(DESTDIR)$(MANDIR)/lz4.1 +- @install -m 644 lz4c.1 $(DESTDIR)$(MANDIR)/lz4c.1 +- @install -m 644 lz4cat.1 $(DESTDIR)$(MANDIR)/lz4cat.1 ++ $(BSD_INSTALL_MAN) -m 644 lz4.1 $(DESTDIR)$(MANDIR)/lz4.1 ++ $(BSD_INSTALL_MAN) -m 644 lz4c.1 $(DESTDIR)$(MANDIR)/lz4c.1 ++ $(BSD_INSTALL_MAN) -m 644 lz4cat.1 $(DESTDIR)$(MANDIR)/lz4cat.1 + @echo lz4 installation completed + + uninstall: +@@ -170,4 +168,3 @@ test-mem: lz4 datagen + test-mem32: lz4c32 datagen + # unfortunately, valgrind doesn't seem to work with non-native binary. If someone knows how to do a valgrind-test on a 32-bits exe with a 64-bits system... + +-endif diff --git a/archivers/lz4/patches/patch-programs_fuzzer.c b/archivers/lz4/patches/patch-programs_fuzzer.c new file mode 100644 index 00000000000..91a7bb4e2c1 --- /dev/null +++ b/archivers/lz4/patches/patch-programs_fuzzer.c @@ -0,0 +1,67 @@ +$NetBSD: patch-programs_fuzzer.c,v 1.1 2014/08/06 10:41:34 fhajny Exp $ + +Add portable code for ftime for NetBSD. + +Based on https://code.google.com/p/lz4/source/detail?r=81. +--- programs/fuzzer.c.orig 2014-07-24 11:54:05.000000000 +0000 ++++ programs/fuzzer.c +@@ -29,6 +29,7 @@ + #ifdef _MSC_VER /* Visual Studio */ + # pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ + # pragma warning(disable : 4146) /* disable: C4146: minus unsigned expression */ ++# define BMK_LEGACY_TIMER 1 + #endif + + +@@ -37,12 +38,17 @@ + **************************************/ + #include <stdlib.h> + #include <stdio.h> // fgets, sscanf +-#include <sys/timeb.h> // timeb + #include <string.h> // strcmp + #include "lz4.h" + #include "lz4hc.h" + #include "xxhash.h" + ++// Use ftime() if gettimeofday() is not available on your target ++#if defined(BMK_LEGACY_TIMER) ++# include <sys/timeb.h> // timeb, ftime ++#else ++# include <sys/time.h> // gettimeofday ++#endif + + /************************************** + Basic Types +@@ -103,8 +109,11 @@ static int displayLevel = 2; + /********************************************************* + Fuzzer functions + *********************************************************/ ++#if defined(BMK_LEGACY_TIMER) ++ + static int FUZ_GetMilliStart(void) + { ++ // Based on Legacy ftime() + struct timeb tb; + int nCount; + ftime( &tb ); +@@ -112,6 +121,20 @@ static int FUZ_GetMilliStart(void) + return nCount; + } + ++#else ++ ++static int FUZ_GetMilliStart() ++{ ++ // Based on newer gettimeofday() ++ // Use GetMilliSpan to correct for rollover ++ struct timeval tv; ++ int nCount; ++ gettimeofday(&tv, NULL); ++ nCount = (int) (tv.tv_usec/1000 + (tv.tv_sec & 0xfffff) * 1000); ++ return nCount; ++} ++ ++#endif + + static int FUZ_GetMilliSpan( int nTimeStart ) + { |