From c92ee02f5073291db1658e750ab9d950cff06ef2 Mon Sep 17 00:00:00 2001 From: nikolaszimmermann <37702173+nikolaszimmermann@users.noreply.github.com> Date: Tue, 27 Mar 2018 00:53:18 +0200 Subject: [PATCH] xxhash: add recipe (#2369) --- dev-libs/xxhash/patches/xxHash-0.6.4.patch | 11 +++ dev-libs/xxhash/xxhash-0.6.4.recipe | 108 +++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 dev-libs/xxhash/patches/xxHash-0.6.4.patch create mode 100644 dev-libs/xxhash/xxhash-0.6.4.recipe diff --git a/dev-libs/xxhash/patches/xxHash-0.6.4.patch b/dev-libs/xxhash/patches/xxHash-0.6.4.patch new file mode 100644 index 000000000..0118be7df --- /dev/null +++ b/dev-libs/xxhash/patches/xxHash-0.6.4.patch @@ -0,0 +1,11 @@ +--- a/Makefile 2017-12-22 12:07:37.019660800 +0000 ++++ b/Makefile 2018-03-25 14:32:28.139722752 +0000 +@@ -210,7 +210,7 @@ + #----------------------------------------------------------------------------- + # make install is validated only for the following targets + #----------------------------------------------------------------------------- +-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS)) ++ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku)) + + DESTDIR ?= + # directory variables : GNU conventions prefer lowercase diff --git a/dev-libs/xxhash/xxhash-0.6.4.recipe b/dev-libs/xxhash/xxhash-0.6.4.recipe new file mode 100644 index 000000000..882ec8924 --- /dev/null +++ b/dev-libs/xxhash/xxhash-0.6.4.recipe @@ -0,0 +1,108 @@ +SUMMARY="A fast non-cryptographic hash algorithm" +DESCRIPTION="xxHash is an extremely fast non-cryptographic hash algorithm, \ +working at speeds close to RAM limits." +HOMEPAGE="https://cyan4973.github.io/xxHash/ + http://www.xxhash.com/" +COPYRIGHT="2014-2017 Yann Collet" +LICENSE="BSD (2-clause)" +REVISION="1" +SOURCE_URI="http://github.com/Cyan4973/xxHash/archive/v$portVersion.tar.gz" +CHECKSUM_SHA256="4570ccd111df6b6386502791397906bf69b7371eb209af7d41debc2f074cdb22" +SOURCE_FILENAME="xxHash-$portVersion.tar.gz" +SOURCE_DIR="xxHash-$portVersion" +PATCHES="xxHash-$portVersion.patch" + +ARCHITECTURES="?x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="?x86_gcc2 x86" + +# Provide cmd:xxhash on all primary architectures except x86_gcc2, +# as well as on x86 secondary arch if the primary arch is x86_gcc2. +commandBinDir="$binDir" +provideRuntime=yes +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandBinDir="$prefix"/bin +else + if [ -n "$secondaryArchSuffix" ]; then + provideRuntime=no + fi +fi +if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then + provideRuntime=no +fi + +libVersion="$portVersion" +libVersionCompat="$portVersion compat >= ${portVersion%%.*}" + +PROVIDES=" + xxhash$secondaryArchSuffix = $portVersion + lib:libxxhash$secondaryArchSuffix = $libVersionCompat + " +if [ "$provideRuntime" = yes ]; then +PROVIDES="$PROVIDES + cmd:xxh32sum = $portVersion + cmd:xxh64sum = $portVersion + cmd:xxhsum = $portVersion + " +fi +REQUIRES=" + haiku$secondaryArchSuffix + " + +PROVIDES_devel=" + xxhash${secondaryArchSuffix}_devel = $portVersion + devel:libxxhash$secondaryArchSuffix = $libVersionCompat + " +REQUIRES_devel=" + xxhash$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:make + " + +debugList=( + "$libDir"/libxxhash.so.$libVersion + ) +if [ "$provideRuntime" = yes ]; then + debugList+=("$commandBinDir"/xxhsum) +fi +defineDebugInfoPackage xxhash$secondaryArchSuffix "${debugList[@]}" + +PATCH() +{ + if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then + sed -i \ + -e "s/ -Wextra//" \ + -e "s/ -Wstrict-aliasing=1//" \ + -e "s/ -Wswitch-enum//" \ + -e "s/ -Wdeclaration-after-statement//" \ + Makefile + fi +} + +BUILD() +{ + make $jobArgs +} + +INSTALL() +{ + make BINDIR="$commandBinDir" INCLUDEDIR="$includeDir" LIBDIR="$libDir" \ + MANDIR="$manDir/man1" install + + if [ "$provideRuntime" != yes ]; then + rm -rf "$commandBinDir" "$manDir" + fi + + prepareInstalledDevelLib libxxhash + packageEntries devel "$developDir" +} + +TEST() +{ + make test-all +}