lz4: updated recipe and patch to r127

This commit is contained in:
Jerome Duval
2015-03-05 22:09:59 +00:00
parent 28a3d5fc0b
commit 4132e7deec
3 changed files with 102 additions and 181 deletions

View File

@@ -8,9 +8,9 @@ reaching RAM speed limits on multi-core systems.
HOMEPAGE="https://code.google.com/p/lz4/"
LICENSE="BSD (2-clause)"
COPYRIGHT="2011-2014, Yann Collet"
SRC_URI="https://github.com/Cyan4973/lz4/archive/r117.tar.gz"
SRC_FILENAME="$portVersionedName.tar.gz"
CHECKSUM_SHA256="c4ca70bf6711021d5ae64e79469a619a4e5899a4c7e07e665f3eb3a517cd029d"
SRC_URI="https://github.com/Cyan4973/lz4/archive/$portVersion.tar.gz"
SRC_FILENAME="lz4-$portVersion.tar.gz"
CHECKSUM_SHA256="5209bf7a2231b41222b0cea4229700bae459b523bc13db488f0e1279405e6b43"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86 x86_gcc2"
@@ -19,7 +19,7 @@ PATCHES="lz4-$portVersion.patchset"
PROVIDES="
lz4${secondaryArchSuffix} = $portVersion
lib:liblz4${secondaryArchSuffix} = 1.0.0 compat >= 1
lib:liblz4${secondaryArchSuffix} = 1.5.0 compat >= 1
"
if [ -z "$secondaryArchSuffix" ]; then
@@ -31,10 +31,10 @@ PROVIDES="$PROVIDES
fi
REQUIRES="
haiku$secondaryArchSuffix
haiku$secondaryArchSuffix >= $haikuVersion
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
haiku${secondaryArchSuffix}_devel >= $haikuVersion
"
BUILD_PREREQUIRES="
cmd:ar
@@ -51,8 +51,9 @@ BUILD()
INSTALL()
{
make install LIBDIR=$libDir INCLUDEDIR=$includeDir \
BINDIR=$binDir MANDIR=$manDir
BINDIR=$binDir MANDIR=$manDir/man1
prepareInstalledDevelLibs liblz4
fixPkgconfig
packageEntries devel \
$developDir
@@ -62,7 +63,7 @@ INSTALL()
PROVIDES_devel="
lz4${secondaryArchSuffix}_devel = $portVersion
devel:liblz4$secondaryArchSuffix = 1.0.0 compat >= 1
devel:liblz4$secondaryArchSuffix = 1.5.0 compat >= 1
"
REQUIRES_devel="
lz4${secondaryArchSuffix} == $portVersion base

View File

@@ -1,173 +0,0 @@
From 9c137ea48247801d309d867244820833685e2477 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 May 2014 16:14:06 +0000
Subject: undef _PACKED (defined in Bebuild.h)
diff --git a/lz4.c b/lz4.c
index fd229ef..9284bbf 100644
--- a/lz4.c
+++ b/lz4.c
@@ -188,6 +188,7 @@
typedef unsigned long long U64;
#endif
+#undef _PACKED
#if defined(__GNUC__) && !defined(LZ4_FORCE_UNALIGNED_ACCESS)
# define _PACKED __attribute__ ((packed))
#else
diff --git a/lz4hc.c b/lz4hc.c
index e84de2b..cb72ef8 100644
--- a/lz4hc.c
+++ b/lz4hc.c
@@ -158,6 +158,7 @@
typedef unsigned long long U64;
#endif
+#undef _PACKED
#if defined(__GNUC__) && !defined(LZ4_FORCE_UNALIGNED_ACCESS)
# define _PACKED __attribute__ ((packed))
#else
diff --git a/programs/xxhash.c b/programs/xxhash.c
index 8304ec2..d4aa50e 100644
--- a/programs/xxhash.c
+++ b/programs/xxhash.c
@@ -110,6 +110,7 @@ FORCE_INLINE void* XXH_memcpy(void* dest, const void* src, size_t size) { return
typedef unsigned long long U64;
#endif
+#undef _PACKED
#if defined(__GNUC__) && !defined(XXH_USE_UNALIGNED_ACCESS)
# define _PACKED __attribute__ ((packed))
#else
--
1.8.3.4
From 83f35b4005aa62773f52a843d3f515854baaf787 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 May 2014 16:18:40 +0000
Subject: PAGE_SIZE is already defined on Haiku
diff --git a/programs/fuzzer.c b/programs/fuzzer.c
index ba4f960..fa84aec 100644
--- a/programs/fuzzer.c
+++ b/programs/fuzzer.c
@@ -53,6 +53,7 @@
#define SEQ_MSK ((NUM_SEQ) - 1)
#define MOD_SEQ(x) ((((x) >> 8) & 255) == 0)
#define NEW_SEQ(x) ((((x) >> 10) %10) == 0)
+#undef PAGE_SIZE
#define PAGE_SIZE 4096
#define ROUND_PAGE(x) (((x) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
#define PRIME1 2654435761U
--
1.8.3.4
From fbc8cf911a39fa5d64db09f5a3cf3d54f8614a24 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 May 2014 16:20:36 +0000
Subject: Haiku install support
diff --git a/Makefile b/Makefile
index e5797c7..c976c95 100644
--- a/Makefile
+++ b/Makefile
@@ -106,7 +106,7 @@ clean:
#make install option is reserved to Linux & OSX targets
-ifneq (,$(filter $(shell uname),Linux Darwin))
+ifneq (,$(filter $(shell uname),Linux Darwin Haiku))
install: liblz4
@install -d -m 755 $(DESTDIR)$(LIBDIR)/ $(DESTDIR)$(INCLUDEDIR)/
diff --git a/programs/Makefile b/programs/Makefile
index 8ec0b85..aa5926b 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -37,8 +37,8 @@ CC:=$(CC)
CFLAGS+= -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
FLAGS= -I.. $(CFLAGS)
-BINDIR=$(PREFIX)/bin
-MANDIR=$(PREFIX)/share/man/man1
+#BINDIR=$(PREFIX)/bin
+#MANDIR=$(PREFIX)/share/man/man1
LZ4DIR=..
TEST_FILES = COPYING
@@ -83,7 +83,7 @@ clean:
@echo Cleaning completed
-ifneq (,$(filter $(shell uname),Linux Darwin))
+ifneq (,$(filter $(shell uname),Linux Darwin, Haiku))
install: lz4 lz4c
@echo Installing binaries
--
1.8.3.4
From 52f22e57e55cc5f4dbaab5dc9acae3491916b306 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 16 May 2014 14:16:07 +0000
Subject: gcc2 doesn't know std=c99
diff --git a/Makefile b/Makefile
index c976c95..4964a59 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH)
DESTDIR=
PREFIX=/usr
CC:=$(CC)
-CFLAGS+= -I. -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
+CFLAGS+= -I. -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
LIBDIR=$(PREFIX)/lib
INCLUDEDIR=$(PREFIX)/include
diff --git a/programs/Makefile b/programs/Makefile
index aa5926b..e380c35 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -34,7 +34,7 @@ RELEASE=r116
DESTDIR=
PREFIX=/usr
CC:=$(CC)
-CFLAGS+= -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
+CFLAGS+= -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
FLAGS= -I.. $(CFLAGS)
#BINDIR=$(PREFIX)/bin
--
1.8.3.4
From bf73e35f83ed099523193493e77dd3b342937d89 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 16 May 2014 14:20:25 +0000
Subject: we don't want 32-bit versions
diff --git a/programs/Makefile b/programs/Makefile
index e380c35..b89410f 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -53,7 +53,7 @@ endif
default: lz4 lz4c
-all: lz4 lz4c lz4c32 fuzzer fuzzer32 fullbench fullbench32
+all: lz4 lz4c fuzzer fullbench
lz4: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c bench.c xxhash.c lz4io.c lz4cli.c
$(CC) $(FLAGS) -DDISABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT)
--
1.8.3.4

View File

@@ -0,0 +1,93 @@
From 5457d98c559c63e5243ab98ab3c96f0f611e4c0c Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 5 Aug 2014 17:14:07 +0000
Subject: haiku patch
diff --git a/Makefile b/Makefile
index c486239..fd2e870 100644
--- a/Makefile
+++ b/Makefile
@@ -88,7 +88,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 Haiku))
install:
@cd $(LZ4DIR); $(MAKE) -e install
diff --git a/lib/Makefile b/lib/Makefile
index faffb39..ddb9d3a 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -41,7 +41,7 @@ LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH)
DESTDIR?=
PREFIX ?= /usr
CFLAGS ?= -O3
-CFLAGS += -I. -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -pedantic
+CFLAGS += -I. -Wall -Wundef -Wshadow -Wstrict-prototypes -pedantic
LIBDIR?= $(PREFIX)/lib
INCLUDEDIR=$(PREFIX)/include
@@ -82,7 +82,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 Haiku))
liblz4.pc: liblz4.pc.in Makefile
@echo creating pkgconfig
diff --git a/lib/xxhash.c b/lib/xxhash.c
index 093564c..ad6083a 100644
--- a/lib/xxhash.c
+++ b/lib/xxhash.c
@@ -118,6 +118,7 @@ typedef signed int S32;
typedef unsigned long long U64;
#endif
+#undef _PACKED
#if defined(__GNUC__) && !defined(XXH_USE_UNALIGNED_ACCESS)
# define _PACKED __attribute__ ((packed))
#else
diff --git a/programs/Makefile b/programs/Makefile
index 543eb7c..4f0cf3e 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -36,11 +36,11 @@ RELEASE?= r126
DESTDIR?=
PREFIX ?= /usr
CFLAGS ?= -O3
-CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"$(RELEASE)\"
+CFLAGS += -Wall -Wundef -Wshadow -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"$(RELEASE)\"
FLAGS = -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
-BINDIR=$(PREFIX)/bin
-MANDIR=$(PREFIX)/share/man/man1
+#BINDIR=$(PREFIX)/bin
+#MANDIR=$(PREFIX)/share/man/man1
LZ4DIR=../lib
TEST_FILES = COPYING
@@ -63,7 +63,7 @@ TRAVIS_TARGET=$(LZ4_TRAVIS_CI_ENV)
default: lz4 lz4c
-all: lz4 lz4c lz4c32 fullbench fullbench32 fuzzer fuzzer32 frametest frametest32 datagen
+all: lz4 lz4c fullbench fuzzer frametest datagen
lz4: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c
$(CC) $(FLAGS) $^ -o $@$(EXT)
@@ -108,7 +108,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 Haiku))
install: lz4 lz4c
@echo Installing binaries
--
1.8.3.4