Farmhash: new recipe (#1755)

This commit is contained in:
miqlas
2017-10-29 12:49:37 +01:00
committed by waddlesplash
parent ad7c34cde8
commit d46843cba1
2 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
SUMMARY="A family of hash functions"
DESCRIPTION="FarmHash provides hash functions for strings and other data."
HOMEPAGE="https://github.com/google/farmhash/"
COPYRIGHT="2014 Google, Inc."
LICENSE="MIT"
REVISION="1"
srcGitRev="816a4ae622e964763ca0862d9dbd19324a1eaf45"
SOURCE_URI="https://github.com/google/farmhash/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="6560547c63e4af82b0f202cb710ceabb3f21347a4b996db565a411da5b17aba0"
SOURCE_FILENAME="$portVersionedName.tar.gz"
SOURCE_DIR="farmhash-$srcGitRev"
PATCHES="farmhash-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
farmhash$secondaryArchSuffix = $portVersion compat >= 0
lib:libfarmhash$secondaryArchSuffix = 0.0.0 compat >= 0
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
farmhash${secondaryArchSuffix}_devel = $portVersion
devel:libfarmhash$secondaryArchSuffix = 0.0.0 compat >= 0
"
REQUIRES_devel="
farmhash$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
"
BUILD()
{
export CXXFLAGS="-D_BSD_SOURCE"
libtoolize --force --copy --install
aclocal -I conftools -I m4
autoconf
automake --add-missing
runConfigure ./configure
make $jobArgs
}
INSTALL()
{
make install
rm $libDir/libfarmhash.la
# prepare develop/lib
prepareInstalledDevelLib libfarmhash
fixPkgconfig
# devel package
packageEntries devel \
$developDir
}
TEST()
{
make check
}

View File

@@ -0,0 +1,29 @@
From a21a95e4dec574181067ced2dde97e581b9efcc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sun, 29 Oct 2017 09:35:03 +0100
Subject: Haiku support
diff --git a/src/farmhash.cc b/src/farmhash.cc
index cfd4a47..f2b99ff 100644
--- a/src/farmhash.cc
+++ b/src/farmhash.cc
@@ -165,6 +165,15 @@
#define bswap_64(x) bswap64(x)
#endif
+#elif defined(__HAIKU__)
+
+#define _BSD_SOURCE
+#include <bsd/endian.h>
+#undef bswap_32
+#undef bswap_64
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
+
#else
#undef bswap_32
--
2.14.2