From d46843cba125dbcb3562b8a24c3e7d3619bbce85 Mon Sep 17 00:00:00 2001 From: miqlas Date: Sun, 29 Oct 2017 12:49:37 +0100 Subject: [PATCH] Farmhash: new recipe (#1755) --- dev-libs/farmhash/farmhash-1.2~git.recipe | 74 +++++++++++++++++++ .../patches/farmhash-1.2~git.patchset | 29 ++++++++ 2 files changed, 103 insertions(+) create mode 100644 dev-libs/farmhash/farmhash-1.2~git.recipe create mode 100644 dev-libs/farmhash/patches/farmhash-1.2~git.patchset diff --git a/dev-libs/farmhash/farmhash-1.2~git.recipe b/dev-libs/farmhash/farmhash-1.2~git.recipe new file mode 100644 index 000000000..e29f721ab --- /dev/null +++ b/dev-libs/farmhash/farmhash-1.2~git.recipe @@ -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 +} diff --git a/dev-libs/farmhash/patches/farmhash-1.2~git.patchset b/dev-libs/farmhash/patches/farmhash-1.2~git.patchset new file mode 100644 index 000000000..10c1f046f --- /dev/null +++ b/dev-libs/farmhash/patches/farmhash-1.2~git.patchset @@ -0,0 +1,29 @@ +From a21a95e4dec574181067ced2dde97e581b9efcc6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +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 ++#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 +