From a674674f509a01a24e53972604945cc3a7b5af0c Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 5 May 2023 09:39:18 -0400 Subject: [PATCH] backports/rapidfuzz: new aport --- backports/rapidfuzz/APKBUILD | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 backports/rapidfuzz/APKBUILD diff --git a/backports/rapidfuzz/APKBUILD b/backports/rapidfuzz/APKBUILD new file mode 100644 index 0000000..5a7b45a --- /dev/null +++ b/backports/rapidfuzz/APKBUILD @@ -0,0 +1,42 @@ +# Maintainer: psykose +pkgname=rapidfuzz +pkgver=1.10.4 +pkgrel=0 +pkgdesc="Rapid fuzzy string matching in C++ using the Levenshtein Distance" +url="https://github.com/maxbachmann/rapidfuzz-cpp" +arch="all" +license="MIT" +makedepends=" + cmake + samurai + " +checkdepends="catch2-3" +source="$pkgname-$pkgver.tar.gz::https://github.com/maxbachmann/rapidfuzz-cpp/archive/refs/tags/v$pkgver.tar.gz" +builddir="$srcdir/rapidfuzz-cpp-$pkgver" + +case "$CARCH" in +x86) + # float rounding + options="!check" + ;; +esac + +build() { + cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DRAPIDFUZZ_BUILD_TESTING="$(want_check && echo ON || echo OFF)" + cmake --build build +} + +check() { + ctest --test-dir build --output-on-failure +} + +package() { + DESTDIR="$pkgdir" cmake --install build +} + +sha512sums=" +11dfd3b5f869eaf11edcb2c075709416645c89ab6057dbcaf12eb5defd609c33e792265b131942f22e3e2661f8c00a653e23a83eb2ba4bd8c82a7d16960d3b3b rapidfuzz-1.10.4.tar.gz +"