From e54912c831852f03995bbf2f888bed7ca238f7f9 Mon Sep 17 00:00:00 2001 From: Coral Pink Date: Tue, 26 Dec 2023 13:41:49 +0100 Subject: [PATCH] New package: fuzzylite-6.0 --- common/shlibs | 1 + .../00-set_unexpected_depracation_error.patch | 12 +++++ .../patches/01-sigstksz-not-const.patch | 31 ++++++++++++ .../patches/02-fix-tests-on-i686.patch | 23 +++++++++ srcpkgs/fuzzylite/template | 47 +++++++++++++++++++ srcpkgs/fuzzylite/update | 2 + srcpkgs/libfuzzylite | 1 + srcpkgs/libfuzzylite-devel | 1 + 8 files changed, 118 insertions(+) create mode 100644 srcpkgs/fuzzylite/patches/00-set_unexpected_depracation_error.patch create mode 100644 srcpkgs/fuzzylite/patches/01-sigstksz-not-const.patch create mode 100644 srcpkgs/fuzzylite/patches/02-fix-tests-on-i686.patch create mode 100644 srcpkgs/fuzzylite/template create mode 100644 srcpkgs/fuzzylite/update create mode 120000 srcpkgs/libfuzzylite create mode 120000 srcpkgs/libfuzzylite-devel diff --git a/common/shlibs b/common/shlibs index 9bcf0c5756b8fd..98c4a97cd5b52c 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4291,3 +4291,4 @@ libunicode_loader.so.0.4 libunicode-0.4.0_1 force-stage.so.0.1 void-force-stage-0.1_1 libliftoff.so.0 libliftoff-0.4.1_1 libscfg.so libscfg-0.1.1_1 +libfuzzylite.so.6.0 libfuzzylite-6.0_1 diff --git a/srcpkgs/fuzzylite/patches/00-set_unexpected_depracation_error.patch b/srcpkgs/fuzzylite/patches/00-set_unexpected_depracation_error.patch new file mode 100644 index 00000000000000..8a5670d9ef663b --- /dev/null +++ b/srcpkgs/fuzzylite/patches/00-set_unexpected_depracation_error.patch @@ -0,0 +1,12 @@ +diff --git a/fuzzylite/src/main.cpp b/fuzzylite/src/main.cpp +index 06ca139e..4465fbbe 100644 +--- a/fuzzylite/src/main.cpp ++++ b/fuzzylite/src/main.cpp +@@ -21,7 +21,6 @@ + + int main(int argc, const char* argv[]) { + std::set_terminate(fl::Exception::terminate); +- std::set_unexpected(fl::Exception::terminate); + ::signal(SIGSEGV, fl::Exception::signalHandler); + ::signal(SIGABRT, fl::Exception::signalHandler); + ::signal(SIGILL, fl::Exception::signalHandler); diff --git a/srcpkgs/fuzzylite/patches/01-sigstksz-not-const.patch b/srcpkgs/fuzzylite/patches/01-sigstksz-not-const.patch new file mode 100644 index 00000000000000..ffafec7e5faca8 --- /dev/null +++ b/srcpkgs/fuzzylite/patches/01-sigstksz-not-const.patch @@ -0,0 +1,31 @@ +diff --git a/fuzzylite/test/catch.hpp b/fuzzylite/test/catch.hpp +index 6f9334ba..0ef1af21 100644 +--- a/fuzzylite/test/catch.hpp ++++ b/fuzzylite/test/catch.hpp +@@ -6375,7 +6375,7 @@ namespace Catch { + static bool isSet; + static struct sigaction oldSigActions [sizeof(signalDefs)/sizeof(SignalDefs)]; + static stack_t oldSigStack; +- static char altStackMem[SIGSTKSZ]; ++ static char altStackMem[4096]; + + static void handleSignal( int sig ) { + std::string name = ""; +@@ -6395,7 +6395,7 @@ namespace Catch { + isSet = true; + stack_t sigStack; + sigStack.ss_sp = altStackMem; +- sigStack.ss_size = SIGSTKSZ; ++ sigStack.ss_size = 4096; + sigStack.ss_flags = 0; + sigaltstack(&sigStack, &oldSigStack); + struct sigaction sa = { 0 }; +@@ -6426,7 +6426,7 @@ namespace Catch { + bool FatalConditionHandler::isSet = false; + struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {}; + stack_t FatalConditionHandler::oldSigStack = {}; +- char FatalConditionHandler::altStackMem[SIGSTKSZ] = {}; ++ char FatalConditionHandler::altStackMem[4096] = {}; + + } // namespace Catch + diff --git a/srcpkgs/fuzzylite/patches/02-fix-tests-on-i686.patch b/srcpkgs/fuzzylite/patches/02-fix-tests-on-i686.patch new file mode 100644 index 00000000000000..7f390438349c3d --- /dev/null +++ b/srcpkgs/fuzzylite/patches/02-fix-tests-on-i686.patch @@ -0,0 +1,23 @@ +backported from https://github.com/fuzzylite/fuzzylite/commit/569eba9713e9991d5ed59189e58e047e958def29 + +diff --git a/fuzzylite/test/BenchmarkTest.cpp b/fuzzylite/test/BenchmarkTest.cpp +index f868ec2..0d87b62 100644 +--- a/fuzzylite/test/BenchmarkTest.cpp ++++ b/fuzzylite/test/BenchmarkTest.cpp +@@ -117,7 +117,14 @@ namespace fl { + CHECK(Op::isEq(1.0, Benchmark::convert(1000.0, Benchmark::MilliSeconds, Benchmark::Seconds))); + FL_LOG(Benchmark::convert(1000.0, Benchmark::MilliSeconds, Benchmark::Seconds)); + +- CHECK(Op::isEq(35e9, Benchmark::convert(35, Benchmark::Seconds, Benchmark::NanoSeconds))); ++ scalar eps = ++#ifndef __i386__ ++ fuzzylite::macheps(); ++#else ++ 1e-5; ++#endif ++ ++ CHECK(Op::isEq(35e9, Benchmark::convert(35, Benchmark::Seconds, Benchmark::NanoSeconds), eps)); + CHECK(Op::isEq(35, Benchmark::convert(35e9, Benchmark::NanoSeconds, Benchmark::Seconds))); + } + + diff --git a/srcpkgs/fuzzylite/template b/srcpkgs/fuzzylite/template new file mode 100644 index 00000000000000..72fc001d36d9f2 --- /dev/null +++ b/srcpkgs/fuzzylite/template @@ -0,0 +1,47 @@ +# Template file for 'fuzzylite' +pkgname=fuzzylite +version=6.0 +revision=1 + +maintainer='Coral Pink ' +short_desc='Fuzzy logic control library in C++' + +license='GPL-3.0-only' +homepage='https://fuzzylite.com/' + +distfiles="https://github.com/fuzzylite/fuzzylite/archive/refs/tags/v${version}.tar.gz" + +checksum='7e9f56deb9baf063de2232bfd8285f57ddccb651dae842fe3f587d0ac65ecdb0' + +build_style='cmake' +build_wrksrc='fuzzylite' + +configure_args='-Wno-dev' + +# musl doesn't provide required execinfo.h header +if [ "$XBPS_TARGET_LIBC" = 'musl' ]; then + configure_args+=' -DFL_BACKTRACE=OFF' +fi + +post_install() { + vman 'fuzzylite.1' + vlicense '../LICENSE' +} + +libfuzzylite_package() { + short_desc+=' - library' + pkg_install() { + vmove "usr/lib/*.so.*" + } +} + +libfuzzylite-devel_package() { + short_desc+=' - development files' + depends="libfuzzylite>=${version}_${revision}" + pkg_install() { + vmove "usr/lib/*.so" + vmove "usr/lib/*.a" + vmove 'usr/include' + vmove 'usr/lib/pkgconfig' + } +} diff --git a/srcpkgs/fuzzylite/update b/srcpkgs/fuzzylite/update new file mode 100644 index 00000000000000..ad90e464f9ad3c --- /dev/null +++ b/srcpkgs/fuzzylite/update @@ -0,0 +1,2 @@ +site='https://github.com/fuzzylite/fuzzylite/releases' +pattern='href="/fuzzylite/fuzzylite/releases/tag/v\K[\d.]+"' diff --git a/srcpkgs/libfuzzylite b/srcpkgs/libfuzzylite new file mode 120000 index 00000000000000..90c6648a573c5e --- /dev/null +++ b/srcpkgs/libfuzzylite @@ -0,0 +1 @@ +fuzzylite \ No newline at end of file diff --git a/srcpkgs/libfuzzylite-devel b/srcpkgs/libfuzzylite-devel new file mode 120000 index 00000000000000..90c6648a573c5e --- /dev/null +++ b/srcpkgs/libfuzzylite-devel @@ -0,0 +1 @@ +fuzzylite \ No newline at end of file