From patchwork Sun May 14 19:50:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vagrant Cascadian X-Patchwork-Id: 50008 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0DA5827BBE9; Sun, 14 May 2023 20:51:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CF19027BBE2 for ; Sun, 14 May 2023 20:51:09 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pyHkG-0002r2-Fp; Sun, 14 May 2023 15:51:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pyHkE-0002qs-OE for guix-patches@gnu.org; Sun, 14 May 2023 15:51:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pyHkE-0003Lb-Fr for guix-patches@gnu.org; Sun, 14 May 2023 15:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pyHkE-0005VQ-C0 for guix-patches@gnu.org; Sun, 14 May 2023 15:51:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63435] Add vcmi 1.2.1 to games.scm Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 May 2023 19:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63435 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Liliana Marie Prikler , 63435@debbugs.gnu.org Cc: iyzsong@envs.net Received: via spool by 63435-submit@debbugs.gnu.org id=B63435.168409383921006 (code B ref 63435); Sun, 14 May 2023 19:51:02 +0000 Received: (at 63435) by debbugs.gnu.org; 14 May 2023 19:50:39 +0000 Received: from localhost ([127.0.0.1]:41628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyHjq-0005Se-03 for submit@debbugs.gnu.org; Sun, 14 May 2023 15:50:39 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]:52770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyHjn-0005Ru-0q for 63435@debbugs.gnu.org; Sun, 14 May 2023 15:50:36 -0400 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:7:77:0:50]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 8A5DB1ACF1; Sun, 14 May 2023 12:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; s=1.vagrant.user; t=1684093825; bh=dJ+caHkDPz+iuYeAmc5rmqO1v1nDNRPr9RGaNNNELFk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=GAdkn41eS3WYkof32u8g4mgvpxfxnWMyvzo3a7uqLcmFaPbYQ7AzM4jtnJB9iZvNN fGAG7vnNEEofxd0ZP4ilSLfnefc1j3dch060UzhXLMDcr4ijXvHdAvRsIacZYAoc/f Q1ydNOe464vMX9wYo+G44+QQEi97c4z1aXwPszR8qshGQzMN+Dc6Gx4I5+o3FNeuSR DfCcgq6j31mrsUa4cU7r8+kRX76CvTzRbLapCiewtjUCAABd+dKhGUDiczVCc3VSmE 1CVFKz3OW3a1Njnoq9spTLt5JTvUkaKVf6thhl/qsWOqTzV3t/uF10eGk/7iiBNJHW C61V/Kx4ZlaLg== From: Vagrant Cascadian In-Reply-To: <40512ea5dbdf297cea0d06f7270ee5ac8cb3e34e.camel@gmail.com> References: <87a5yb4e41.fsf@wireframe> <51be2fdd711bf490e3a925334e571ff7871d6cbb.camel@gmail.com> <873542o7ze.fsf@wireframe> <87zg6ampqf.fsf@wireframe> <9ee9b4f47ee7c5af274074da89febdb4df9ca68d.camel@gmail.com> <87wn1em5ti.fsf@wireframe> <8e04176d6691bdc0996fb473b56ead31be954123.camel@gmail.com> <87ttwhm2vg.fsf@wireframe> <40512ea5dbdf297cea0d06f7270ee5ac8cb3e34e.camel@gmail.com> Date: Sun, 14 May 2023 12:50:19 -0700 Message-ID: <87ilcun150.fsf@wireframe> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches On 2023-05-13, Liliana Marie Prikler wrote: > Am Freitag, dem 12.05.2023 um 18:33 -0700 schrieb Vagrant Cascadian: > >> + %D%/packages/patches/fuzzylite-relative-path-in-tests.patch \ >> + %D%/packages/patches/fuzzylite-use-catch2.patch \ >> + %D%/packages/patches/fuzzylite-when-testing-large-float-numbers- >> for-equ.patch > Prefer names that don't blow up the file name, e.g. "fuzzylite-fix- > test", "fuzzylite-soften-float-equality", or "fuzzylite-workaround- > issue-N" – although I'm not sure whether we have a precedent for the > latter. Went with fuzzylite-soften-float-equality. Thanks! >> + (patches (search-patches "fuzzylite-use-catch2.patch" >> + "fuzzylite-when-testing-large-float-numbers- >> for-equ.patch" >> + "fuzzylite-relative-path-in-tests.patch")))) > This doesn't appear properly indented. guix style strikes again! Fixed. >> + (synopsis "fuzzy logic control binary") > Capitalize the first word. IIRC we also allow title case for proper > names and such, but I don't think that'd be necessary here. Fixed. >> + "fuzzylite is a fuzzy logic control library which allows one >> +to easily create fuzzy logic controllers in a few steps utilizing >> +object-oriented programming.") > Proper sentences start with an uppercase letter. The convention is to > use @-constructs when the package name prohibits that. You can also > cheat via "This package provides ..." Went with the cheat. :) >> + (license license:gpl3))) > No +? I do not see any "or any later version" or similar wording anywhere, no. >> fuzzylite is a registered trademark of FuzzyLite Limited. > Perhaps also look into their trademark policy then, if they have any. Have not found one... >> +-#include "test/catch.hpp" >> ++#include "catch2/catch.hpp" > Use to signal that this is a system header. I tried applying this, but it failed to build... left it out of this revision. live well, vagrant From e17f53eaf5f5ff1e347686e96a403501f2386737 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Fri, 12 May 2023 16:18:18 -0700 Subject: [PATCH 1/2] gnu: Add fuzzylite 6.0. * gnu/packages/games.scm (fuzzylite): New variable. * gnu/packages/patches/fuzzylite-relative-path-in-tests.patch: New patch. * gnu/packages/patches/fuzzylite-use-catch2.patch: New patch. * gnu/packages/patches/fuzzylite-soften-float-equality.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add patches. --- gnu/local.mk | 3 + gnu/packages/games.scm | 31 +++ .../fuzzylite-relative-path-in-tests.patch | 15 ++ .../fuzzylite-soften-float-equality.patch | 30 +++ .../patches/fuzzylite-use-catch2.patch | 184 ++++++++++++++++++ 5 files changed, 263 insertions(+) create mode 100644 gnu/packages/patches/fuzzylite-relative-path-in-tests.patch create mode 100644 gnu/packages/patches/fuzzylite-soften-float-equality.patch create mode 100644 gnu/packages/patches/fuzzylite-use-catch2.patch diff --git a/gnu/local.mk b/gnu/local.mk index 012ce84d2d..dd6e3641a1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1149,6 +1149,9 @@ dist_patch_DATA = \ %D%/packages/patches/freeimage-unbundle.patch \ %D%/packages/patches/fuse-glibc-2.34.patch \ %D%/packages/patches/fuse-overlapping-headers.patch \ + %D%/packages/patches/fuzzylite-relative-path-in-tests.patch \ + %D%/packages/patches/fuzzylite-use-catch2.patch \ + %D%/packages/patches/fuzzylite-soften-float-equality.patch \ %D%/packages/patches/fxdiv-system-libraries.patch \ %D%/packages/patches/gajim-honour-GAJIM_PLUGIN_PATH.patch \ %D%/packages/patches/ganeti-disable-version-symlinks.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index d1e2248588..49d1431d99 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -3557,6 +3557,37 @@ (define-public freedink ("bash" ,bash))) (native-inputs '()))) +(define-public fuzzylite + (package + (name "fuzzylite") + (version "6.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/fuzzylite/fuzzylite") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0yay0qc81x0irlvxqpy7jywjxpkmpjabdhq2hdh28r9z85wp2nwb")) + (patches (search-patches "fuzzylite-use-catch2.patch" + "fuzzylite-soften-float-equality.patch" + "fuzzylite-relative-path-in-tests.patch")))) + (build-system cmake-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (add-before 'configure 'switch-to-fuzzylite-dir + (lambda _ + (chdir "fuzzylite")))))) + (native-inputs (list catch2)) + (home-page "https://www.fuzzylite.com/") + (synopsis "Fuzzy logic control binary") + (description + "This package provides fuzzylite, a fuzzy logic control library which +allows one to easily create fuzzy logic controllers in a few steps utilizing +object-oriented programming.") + (license license:gpl3))) + (define-public xboard (package (name "xboard") diff --git a/gnu/packages/patches/fuzzylite-relative-path-in-tests.patch b/gnu/packages/patches/fuzzylite-relative-path-in-tests.patch new file mode 100644 index 0000000000..1a03238246 --- /dev/null +++ b/gnu/packages/patches/fuzzylite-relative-path-in-tests.patch @@ -0,0 +1,15 @@ +Workaround https://github.com/fuzzylite/fuzzylite/issues/85 + +diff --git a/fuzzylite/test/BenchmarkTest.cpp b/fuzzylite/test/BenchmarkTest.cpp +index f868ec29..464d394d 100644 +--- a/fuzzylite/test/BenchmarkTest.cpp ++++ b/fuzzylite/test/BenchmarkTest.cpp +@@ -30,7 +30,7 @@ namespace fl { + } + + TEST_CASE("Benchmarks from FLD files", "[benchmark][fld]") { +- std::string path = "../../examples/"; ++ std::string path = "../examples/"; + typedef std::pair Example; + std::vector examples; + examples.push_back(Example("mamdani/AllTerms", int(1e4))); diff --git a/gnu/packages/patches/fuzzylite-soften-float-equality.patch b/gnu/packages/patches/fuzzylite-soften-float-equality.patch new file mode 100644 index 0000000000..47403605dd --- /dev/null +++ b/gnu/packages/patches/fuzzylite-soften-float-equality.patch @@ -0,0 +1,30 @@ +Origin: https://salsa.debian.org/debian/fuzzylite/-/blob/debian/6.0+dfsg-6/debian/patches/when-testing-large-float-numbers-for-equ.patch +From: Johannes 'josch' Schauer +Date: Sun, 3 Feb 2019 10:33:22 +0100 +X-Dgit-Generated: 6.0+dfsg-2 80960ae38da9db032dfbfec6405398653e8205ff +Subject: when testing large float numbers for equality, use a larger epsilon + + +--- + +--- fuzzylite-6.0+dfsg.orig/fuzzylite/test/BenchmarkTest.cpp ++++ fuzzylite-6.0+dfsg/fuzzylite/test/BenchmarkTest.cpp +@@ -96,7 +96,17 @@ 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 ++ // on i386, due to the 80bit x87 register, double floating point ++ // numbers are handled differently and thus the difference between ++ // 35e9 and the result of Benchmark::convert() will be 2.179e-6, ++ // which is greater than the default epsilon of 1e-6. ++ 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/gnu/packages/patches/fuzzylite-use-catch2.patch b/gnu/packages/patches/fuzzylite-use-catch2.patch new file mode 100644 index 0000000000..e4aa13a98b --- /dev/null +++ b/gnu/packages/patches/fuzzylite-use-catch2.patch @@ -0,0 +1,184 @@ +Origin: https://salsa.debian.org/debian/fuzzylite/-/blob/debian/6.0+dfsg-6/debian/patches/fix-tests2.patch +From: Ferdinand Thiessen +Date: Mon, 31 Jan 2022 16:06:19 GMT +Subject: Replace Catch with Catch2 and require C++11 for tests +Origin: vendor, https://github.com/fuzzylite/fuzzylite/issues/94 +Bug-Debian: http://bugs.debian.org/1017155 + +--- a/fuzzylite/CMakeLists.txt ++++ b/fuzzylite/CMakeLists.txt +@@ -194,7 +194,9 @@ if(FL_BUILD_BINARY) + endif(FL_BUILD_BINARY) + + if(FL_BUILD_TESTS) ++ find_package(Catch2) + add_executable(fl-test ${fl-headers} ${fl-tests}) ++ target_link_libraries(fl-test Catch2::Catch2) + set_target_properties(fl-test PROPERTIES OUTPUT_NAME fuzzylite-tests) + set_target_properties(fl-test PROPERTIES OUTPUT_NAME fuzzylite-tests IMPORT_PREFIX tmp-) #To prevent LNK1149 in Windows + set_target_properties(fl-test PROPERTIES DEBUG_POSTFIX -debug) +--- a/fuzzylite/test/activation/ThresholdTest.cpp ++++ b/fuzzylite/test/activation/ThresholdTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/BenchmarkTest.cpp ++++ b/fuzzylite/test/BenchmarkTest.cpp +@@ -16,7 +16,7 @@ + + #include "fl/Benchmark.h" + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + #include +--- a/fuzzylite/test/hedge/HedgeFunctionTest.cpp ++++ b/fuzzylite/test/hedge/HedgeFunctionTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/imex/FldExporterTest.cpp ++++ b/fuzzylite/test/imex/FldExporterTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/imex/FllImporterTest.cpp ++++ b/fuzzylite/test/imex/FllImporterTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/imex/RScriptExporterTest.cpp ++++ b/fuzzylite/test/imex/RScriptExporterTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + #include + +--- a/fuzzylite/test/MainTest.cpp ++++ b/fuzzylite/test/MainTest.cpp +@@ -16,7 +16,7 @@ + + #define CATCH_CONFIG_RUNNER + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + + #include "fl/Headers.h" + +--- a/fuzzylite/test/norm/NormFunctionTest.cpp ++++ b/fuzzylite/test/norm/NormFunctionTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/QuickTest.cpp ++++ b/fuzzylite/test/QuickTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/term/AggregatedTest.cpp ++++ b/fuzzylite/test/term/AggregatedTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/term/DiscreteTest.cpp ++++ b/fuzzylite/test/term/DiscreteTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/term/FunctionTest.cpp ++++ b/fuzzylite/test/term/FunctionTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/term/TrapezoidTest.cpp ++++ b/fuzzylite/test/term/TrapezoidTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/term/TriangleTest.cpp ++++ b/fuzzylite/test/term/TriangleTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + namespace fl { +--- a/fuzzylite/test/variable/VariableTest.cpp ++++ b/fuzzylite/test/variable/VariableTest.cpp +@@ -14,7 +14,7 @@ + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +-#include "test/catch.hpp" ++#include "catch2/catch.hpp" + #include "fl/Headers.h" + + #include // std::random_shuffle base-commit: b3adba7b5ef3bb56509710b1596225017f1342cc -- 2.39.2