diff options
author | Guillaume Horel | 2023-06-12 16:21:56 -0400 |
---|---|---|
committer | Guillaume Horel | 2023-06-12 16:22:28 -0400 |
commit | fa082e14612fe60992c209f20a8a9e78671984bd (patch) | |
tree | 6ea562d08f294675f3f9a7b7dfa8c27bb29d1fbe | |
parent | e685f9d329a3d1f2aaf17ece9a49c50e8b508729 (diff) | |
download | aur-fa082e14612fe60992c209f20a8a9e78671984bd.tar.gz |
fix build
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 23 | ||||
-rw-r--r-- | namespace.patch | 88 |
3 files changed, 104 insertions, 12 deletions
@@ -1,14 +1,15 @@ pkgbase = farmhash pkgdesc = FarmHash is a family of hash functions pkgver = 1.1 - pkgrel = 1 + pkgrel = 2 url = https://github.com/google/farmhash arch = x86_64 license = MIT makedepends = git depends = gcc-libs source = git+https://github.com/google/farmhash.git + source = namespace.patch sha256sums = SKIP + sha256sums = e3f7e0c3a421e814305611395e4abf9734d4d96214815dfab384702a6772ba92 pkgname = farmhash - @@ -1,34 +1,37 @@ # Maintainer: Guillaume Horel <guillaume.horel@gmail.com> -pkgname='farmhash' -pkgver='1.1' -pkgrel=1 -pkgdesc="FarmHash is a family of hash functions" +pkgname=farmhash +pkgver=1.1 +pkgrel=2 +pkgdesc='FarmHash is a family of hash functions' url="https://github.com/google/farmhash" depends=('gcc-libs') makedepends=('git') checkdepends=() license=('MIT') arch=('x86_64') -source=("git+https://github.com/google/farmhash.git") -sha256sums=('SKIP') +source=("git+https://github.com/google/farmhash.git" + "namespace.patch") +sha256sums=('SKIP' + 'e3f7e0c3a421e814305611395e4abf9734d4d96214815dfab384702a6772ba92') prepare() { - cd "${srcdir}/${pkgname}" + cd "${pkgname}" + patch -p1 -i ../namespace.patch autoreconf -vif ./configure CXXFLAGS="-g -mavx -maes -O3" --prefix=/usr } build() { - cd "${srcdir}/${pkgname}" + cd "${pkgname}" make all } package() { - cd "${srcdir}/${pkgname}" + cd "${pkgname}" make DESTDIR="$pkgdir" install } check() { - cd "${srcdir}/${pkgname}" + cd "${pkgname}" make check } diff --git a/namespace.patch b/namespace.patch new file mode 100644 index 000000000000..819a212f5f5f --- /dev/null +++ b/namespace.patch @@ -0,0 +1,88 @@ +diff -urN farmhash-orig/src/farmhash.cc farmhash/src/farmhash.cc +--- farmhash-orig/src/farmhash.cc 2023-06-12 16:17:46.368276854 -0400 ++++ farmhash/src/farmhash.cc 2023-06-12 16:17:58.404968718 -0400 +@@ -412,7 +412,6 @@ + + } // namespace NAMESPACE_FOR_HASH_FUNCTIONS + +-using namespace std; + using namespace NAMESPACE_FOR_HASH_FUNCTIONS; + namespace farmhashna { + #undef Fetch +@@ -481,7 +480,7 @@ + + // Return a 16-byte hash for 48 bytes. Quick and dirty. + // Callers do best to use "random-looking" values for a and b. +-STATIC_INLINE pair<uint64_t, uint64_t> WeakHashLen32WithSeeds( ++STATIC_INLINE std::pair<uint64_t, uint64_t> WeakHashLen32WithSeeds( + uint64_t w, uint64_t x, uint64_t y, uint64_t z, uint64_t a, uint64_t b) { + a += w; + b = Rotate(b + a + z, 21); +@@ -489,11 +488,11 @@ + a += x; + a += y; + b += Rotate(a, 44); +- return make_pair(a + z, b + c); ++ return std::make_pair(a + z, b + c); + } + + // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty. +-STATIC_INLINE pair<uint64_t, uint64_t> WeakHashLen32WithSeeds( ++STATIC_INLINE std::pair<uint64_t, uint64_t> WeakHashLen32WithSeeds( + const char* s, uint64_t a, uint64_t b) { + return WeakHashLen32WithSeeds(Fetch(s), + Fetch(s + 8), +@@ -537,8 +536,8 @@ + uint64_t x = seed; + uint64_t y = seed * k1 + 113; + uint64_t z = ShiftMix(y * k2 + 113) * k2; +- pair<uint64_t, uint64_t> v = make_pair(0, 0); +- pair<uint64_t, uint64_t> w = make_pair(0, 0); ++ std::pair<uint64_t, uint64_t> v = std::make_pair(0, 0); ++ std::pair<uint64_t, uint64_t> w = std::make_pair(0, 0); + x = x * k2 + Fetch(s); + + // Set end so that after the loop we have 1 to 64 bytes left to process. +@@ -610,8 +609,8 @@ + uint64_t x = seed0; + uint64_t y = seed1 * k2 + 113; + uint64_t z = farmhashna::ShiftMix(y * k2) * k2; +- pair<uint64_t, uint64_t> v = make_pair(seed0, seed1); +- pair<uint64_t, uint64_t> w = make_pair(0, 0); ++ std::pair<uint64_t, uint64_t> v = std::make_pair(seed0, seed1); ++ std::pair<uint64_t, uint64_t> w = std::make_pair(0, 0); + uint64_t u = x - z; + x *= k2; + uint64_t mul = k2 + (u & 0x82); +@@ -1744,7 +1743,7 @@ + + // Return a 16-byte hash for 48 bytes. Quick and dirty. + // Callers do best to use "random-looking" values for a and b. +-STATIC_INLINE pair<uint64_t, uint64_t> WeakHashLen32WithSeeds( ++STATIC_INLINE std::pair<uint64_t, uint64_t> WeakHashLen32WithSeeds( + uint64_t w, uint64_t x, uint64_t y, uint64_t z, uint64_t a, uint64_t b) { + a += w; + b = Rotate(b + a + z, 21); +@@ -1752,11 +1751,11 @@ + a += x; + a += y; + b += Rotate(a, 44); +- return make_pair(a + z, b + c); ++ return std::make_pair(a + z, b + c); + } + + // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty. +-STATIC_INLINE pair<uint64_t, uint64_t> WeakHashLen32WithSeeds( ++STATIC_INLINE std::pair<uint64_t, uint64_t> WeakHashLen32WithSeeds( + const char* s, uint64_t a, uint64_t b) { + return WeakHashLen32WithSeeds(Fetch(s), + Fetch(s + 8), +@@ -1807,7 +1806,7 @@ + + // We expect len >= 128 to be the common case. Keep 56 bytes of state: + // v, w, x, y, and z. +- pair<uint64_t, uint64_t> v, w; ++ std::pair<uint64_t, uint64_t> v, w; + uint64_t x = Uint128Low64(seed); + uint64_t y = Uint128High64(seed); + uint64_t z = len * k1; |