unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Vagrant Cascadian <vagrant@debian.org>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>, 63435@debbugs.gnu.org
Cc: iyzsong@envs.net
Subject: [bug#63435] Add vcmi 1.2.1 to games.scm
Date: Sun, 02 Jul 2023 19:50:19 -0700	[thread overview]
Message-ID: <87fs65yahg.fsf@wireframe> (raw)
In-Reply-To: <16d133f8d31322aee3bb5cea5baff6fc03fc95ca.camel@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 364 bytes --]

On 2023-05-15, Liliana Marie Prikler wrote:
> Am Sonntag, dem 14.05.2023 um 12:52 -0700 schrieb Vagrant Cascadian:
>> Also applied. Used "fuzzylite" for XXX...
> Is the failure due to fuzzylite?  Actually, XXX is a marker for
> incomplete code like TODO.

I see, not a convention I am used to! Switched to XXX: ...

Updated patches attached.

live well,
  vagrant

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-fuzzylite-6.0.patch --]
[-- Type: text/x-diff, Size: 11847 bytes --]

From 2986a66a3bc7044e3c5f33b894a71551b4eef32d Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
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 e65888a044..9ec550355c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1157,6 +1157,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 83704dd720..d2bd448f99 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3643,6 +3643,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<std::string, int > Example;
+         std::vector<Example> 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 <josch@debian.org>
+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 <rpm@fthiessen.de>
+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 <vector>
+--- 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 <fstream>
+ 
+--- 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 <algorithm>    // std::random_shuffle

base-commit: 6cdab8fd09ffb1de169ad30f0b4edd4c9c00a201
-- 
2.39.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-gnu-Add-vcmi-1.2.1.patch --]
[-- Type: text/x-diff, Size: 4679 bytes --]

From 818fb9cc3b8f31009d9c540555c63b4f894d5335 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Sun, 7 May 2023 17:43:33 -0700
Subject: [PATCH 2/2] gnu: Add vcmi 1.2.1.

* gnu/packages/games.scm (vcmi): New variable.
* gnu/packages/patches/vcmi-disable-privacy-breach.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add patch.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/games.scm                        | 49 +++++++++++++++++++
 .../patches/vcmi-disable-privacy-breach.patch | 21 ++++++++
 3 files changed, 71 insertions(+)
 create mode 100644 gnu/packages/patches/vcmi-disable-privacy-breach.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 9ec550355c..b421e458c8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2053,6 +2053,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/vboot-utils-fix-format-load-address.patch	\
   %D%/packages/patches/vboot-utils-fix-tests-show-contents.patch	\
   %D%/packages/patches/vboot-utils-skip-test-workbuf.patch	\
+  %D%/packages/patches/vcmi-disable-privacy-breach.patch	\
   %D%/packages/patches/vinagre-newer-freerdp.patch             \
   %D%/packages/patches/vinagre-newer-rdp-parameters.patch      \
   %D%/packages/patches/virtuoso-ose-remove-pre-built-jar-files.patch	\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index d2bd448f99..c42b68fa58 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -202,6 +202,7 @@ (define-module (gnu packages games)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages squirrel)
   #:use-module (gnu packages swig)
+  #:use-module (gnu packages tbb)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages terminals)
   #:use-module (gnu packages texinfo)
@@ -11304,6 +11305,54 @@ (define-public fheroes2
 play; it will look for them at @file{~/.local/share/fheroes2} folder.")
     (license license:gpl2)))
 
+(define-public vcmi
+  (package
+    (name "vcmi")
+    (version "1.2.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/vcmi/vcmi")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0f3fk1fc2wb7f2j4pxz89dzr8zjnrdh435mijia483a3bq59w7pk"))
+              (patches (search-patches "vcmi-disable-privacy-breach.patch"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:configure-flags #~(list "-DFORCE_BUNDLED_FL=OFF")
+           ;; Test suites do not seem well supported upstream and are disabled by default.
+           ;; Pass -DENABLE_TEST to configure to enable.
+           #:tests? #f))
+    (native-inputs
+     (list boost
+           ffmpeg
+           fuzzylite
+           ;; googletest ; needed for tests, but tests are disabled
+           libxkbcommon
+           luajit
+           minizip
+           pkg-config
+           python
+           ;; XXX: Build currently fails with qtbase-6 and qttools-6
+           qtbase-5
+           qttools-5
+           sdl2
+           sdl2-mixer
+           sdl2-image
+           sdl2-ttf
+           tbb
+           vulkan-headers
+           zlib))
+    (home-page "https://vcmi.eu/")
+    (synopsis "Turn-based strategy game engine")
+    (description
+     "@code{vcmi} is an implementation of the Heroes of Might and
+Magic III game engine.  It requires assets and game resources to
+play; it will look for them at @file{~/.local/share/vcmi} folder.")
+    (license license:gpl2)))
+
 (define-public apricots
   (package
     (name "apricots")
diff --git a/gnu/packages/patches/vcmi-disable-privacy-breach.patch b/gnu/packages/patches/vcmi-disable-privacy-breach.patch
new file mode 100644
index 0000000000..c03bc66119
--- /dev/null
+++ b/gnu/packages/patches/vcmi-disable-privacy-breach.patch
@@ -0,0 +1,21 @@
+Origin: https://salsa.debian.org/games-team/vcmi/-/blob/debian/1.1.0+dfsg-1/debian/patches/disable-privacy-breach
+From: Johannes Schauer <josch@debian.org>
+Subject: do not check remote repositories on startup by default
+Forwarded: not-needed
+
+--- a/config/schemas/settings.json
++++ b/config/schemas/settings.json
+@@ -401,11 +401,11 @@
+ 				},
+ 				"autoCheckRepositories" : {
+ 					"type" : "boolean",
+-					"default" : true
++					"default" : false
+ 				},
+ 				"updateOnStartup" : {
+ 					"type" : "boolean",
+-					"default" : true
++					"default" : false
+ 				},
+ 				"updateConfigUrl" : {
+ 					"type" : "string",
-- 
2.39.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  parent reply	other threads:[~2023-07-03  2:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11  5:43 [bug#63435] Add vcmi 1.2.1 to games.scm Vagrant Cascadian
2023-05-11 17:17 ` Liliana Marie Prikler
2023-05-11 21:48   ` Vagrant Cascadian
2023-05-11 23:07     ` Vagrant Cascadian
2023-05-12  1:47       ` Liliana Marie Prikler
2023-05-12  6:17         ` Vagrant Cascadian
2023-05-12 20:53           ` Liliana Marie Prikler
2023-05-13  1:33             ` Vagrant Cascadian
2023-05-13  1:35               ` Vagrant Cascadian
2023-05-13  6:16                 ` Liliana Marie Prikler
2023-05-14 19:52                   ` Vagrant Cascadian
2023-05-15 18:31                     ` Liliana Marie Prikler
2023-05-15 19:07                       ` Vagrant Cascadian
2023-07-03  2:50                       ` Vagrant Cascadian [this message]
2023-07-09  5:36                         ` bug#63435: " Liliana Marie Prikler
2023-05-13  6:12               ` [bug#63435] " Liliana Marie Prikler
2023-05-14 19:50                 ` Vagrant Cascadian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fs65yahg.fsf@wireframe \
    --to=vagrant@debian.org \
    --cc=63435@debbugs.gnu.org \
    --cc=iyzsong@envs.net \
    --cc=liliana.prikler@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).