diff --git a/app-arch/lz4/lz4-r117.recipe b/app-arch/lz4/lz4-r117.recipe new file mode 100644 index 000000000..d515d5dac --- /dev/null +++ b/app-arch/lz4/lz4-r117.recipe @@ -0,0 +1,69 @@ +SUMMARY="lz4 data compression utilities and libraries" +DESCRIPTION=" +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. +" +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" +REVISION="1" +ARCHITECTURES="x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="x86 x86_gcc2" + +PATCHES="lz4-$portVersion.patchset" + +PROVIDES=" + lz4${secondaryArchSuffix} = $portVersion + lib:liblz4${secondaryArchSuffix} = 1.0.0 compat >= 1 + " + +if [ -z "$secondaryArchSuffix" ]; then +PROVIDES="$PROVIDES + cmd:lz4 = $portVersion + cmd:lz4c = $portVersion + cmd:lz4cat = $portVersion + " +fi + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + " +BUILD_PREREQUIRES=" + cmd:ar + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + " + +BUILD() +{ + make $jobArgs all +} + +INSTALL() +{ + make install LIBDIR=$libDir INCLUDEDIR=$includeDir \ + BINDIR=$binDir MANDIR=$manDir + prepareInstalledDevelLibs liblz4 + + packageEntries devel \ + $developDir +} + +# ----- devel package ------------------------------------------------------- + +PROVIDES_devel=" + lz4${secondaryArchSuffix}_devel = $portVersion + devel:liblz4$secondaryArchSuffix = 1.0.0 compat >= 1 + " +REQUIRES_devel=" + lz4${secondaryArchSuffix} == $portVersion base + " diff --git a/app-arch/lz4/patches/lz4-r117.patchset b/app-arch/lz4/patches/lz4-r117.patchset new file mode 100644 index 000000000..5d35fabec --- /dev/null +++ b/app-arch/lz4/patches/lz4-r117.patchset @@ -0,0 +1,114 @@ +From 7952c86f270994ebb54ba766f611a1b85ff05c7a Mon Sep 17 00:00:00 2001 +From: Jerome Duval +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 1bc6acd83324a60c2de33dacb134735a65dba2bc Mon Sep 17 00:00:00 2001 +From: Jerome Duval +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 ea21664533a79e4e3b58e0562a2c69233ec6fdc5 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +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 +