mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 12:10:06 +02:00
libdeflate, new recipe (#6765)
This commit is contained in:
75
app-arch/libdeflate/libdeflate-1.10.recipe
Normal file
75
app-arch/libdeflate/libdeflate-1.10.recipe
Normal file
@@ -0,0 +1,75 @@
|
||||
SUMMARY="A library for fast, whole-buffer DEFLATE-based (de)compression"
|
||||
DESCRIPTION="libdeflate is a library for fast, whole-buffer DEFLATE-based compression and \
|
||||
decompression.
|
||||
|
||||
The supported formats are:
|
||||
- DEFLATE (raw)
|
||||
- zlib (a.k.a. DEFLATE with a zlib wrapper)
|
||||
- gzip (a.k.a. DEFLATE with a gzip wrapper)
|
||||
|
||||
libdeflate is heavily optimized. It is significantly faster than the zlib library, both for \
|
||||
compression and decompression, and especially on x86 processors.
|
||||
In addition, libdeflate provides optional high compression modes that provide a better \
|
||||
compression ratio than the zlib's level 9."
|
||||
HOMEPAGE="https://github.com/ebiggers/libdeflate"
|
||||
COPYRIGHT="2016-2022 Eric Biggers
|
||||
2017 Jun He"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
SOURCE_URI="$HOMEPAGE/libdeflate/archive/refs/tags/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="5c1f75c285cd87202226f4de49985dcb75732f527eefba2b3ddd70a8865f2533"
|
||||
PATCHES="libdeflate-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
libdeflate$secondaryArchSuffix = $portVersion
|
||||
cmd:libdeflate_gunzip = $portVersion
|
||||
cmd:libdeflate_gzip = $portVersion
|
||||
lib:libdeflate$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
libdeflate${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libdeflate$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES_devel="
|
||||
libdeflate$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:make
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
"
|
||||
|
||||
TEST_REQUIRES="
|
||||
devel:libz$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make PREFIX=$prefix INCDIR=$includeDir LIBDIR=$libDir install
|
||||
|
||||
prepareInstalledDevelLib libdeflate
|
||||
fixPkgconfig
|
||||
|
||||
packageEntries devel \
|
||||
$developDir
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
make check
|
||||
}
|
||||
42
app-arch/libdeflate/patches/libdeflate-1.10.patchset
Normal file
42
app-arch/libdeflate/patches/libdeflate-1.10.patchset
Normal file
@@ -0,0 +1,42 @@
|
||||
From 938d29c6cc09f2c5fdb42e2ad5179d697b39dbb5 Mon Sep 17 00:00:00 2001
|
||||
From: begasus <begasus@gmail.com>
|
||||
Date: Sat, 26 Mar 2022 12:16:07 +0000
|
||||
Subject: Haiku doesn't support hard links
|
||||
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 0e8b008..75501a2 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -128,6 +128,14 @@ else ifneq ($(findstring -android,$(TARGET_MACHINE)),)
|
||||
SHARED_LIB_CFLAGS := -fPIC
|
||||
SHARED_LIB_LDFLAGS := -Wl,-soname=$(SHARED_LIB)
|
||||
|
||||
+# Compiling for Haiku
|
||||
+else ifneq ($(findstring -haiku,$(TARGET_MACHINE)),)
|
||||
+ SHARED_LIB := libdeflate.so.$(SOVERSION)
|
||||
+ SHARED_LIB_SYMLINK := libdeflate.so
|
||||
+ SHARED_LIB_CFLAGS := -fPIC
|
||||
+ SHARED_LIB_LDFLAGS := -Wl,-soname=$(SHARED_LIB)
|
||||
+ HARD_LINKS :=
|
||||
+
|
||||
# Compiling for Linux, FreeBSD, etc.
|
||||
else
|
||||
SHARED_LIB := libdeflate.so.$(SOVERSION)
|
||||
@@ -342,8 +350,13 @@ install:all $(PKGCONFBASE)
|
||||
install -m644 libdeflate.h $(DESTDIR)$(INCDIR)
|
||||
install -m755 gzip$(PROG_SUFFIX) \
|
||||
$(DESTDIR)$(BINDIR)/libdeflate-gzip$(PROG_SUFFIX)
|
||||
+ifneq ($(findstring -haiku,$(TARGET_MACHINE)),)
|
||||
+ cp -f $(DESTDIR)$(BINDIR)/libdeflate-gzip$(PROG_SUFFIX) \
|
||||
+ $(DESTDIR)$(BINDIR)/libdeflate-gunzip$(PROG_SUFFIX)
|
||||
+else
|
||||
ln -f $(DESTDIR)$(BINDIR)/libdeflate-gzip$(PROG_SUFFIX) \
|
||||
$(DESTDIR)$(BINDIR)/libdeflate-gunzip$(PROG_SUFFIX)
|
||||
+endif
|
||||
if [ -n "$(SHARED_LIB_SYMLINK)" ]; then \
|
||||
ln -sf $(SHARED_LIB) \
|
||||
$(DESTDIR)$(LIBDIR)/$(SHARED_LIB_SYMLINK); \
|
||||
--
|
||||
2.30.2
|
||||
|
||||
Reference in New Issue
Block a user