unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#58295] [PATCH] Add dds-bridge
@ 2022-10-04 21:56 Nicolas Goaziou
  2022-10-16 19:22 ` bug#58295: " Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Goaziou @ 2022-10-04 21:56 UTC (permalink / raw)
  To: 58295

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

Hello,

The following patch adds the DDS library for bridge card game
development.

Note: it builds without libomp (but not without boost). I'm not sure it
is really necessary, even though OpenMP is mentioned in the code base.

Regards,
-- 
Nicolas Goaziou

[-- Attachment #2: 0001-gnu-Add-dds-bridge.patch --]
[-- Type: text/x-diff, Size: 5120 bytes --]

From af7d1beeebac44c18cac7a37c539043de244215b Mon Sep 17 00:00:00 2001
Message-Id: <af7d1beeebac44c18cac7a37c539043de244215b.1664920290.git.mail@nicolasgoaziou.fr>
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date: Tue, 4 Oct 2022 23:51:00 +0200
Subject: [PATCH] gnu: Add dds-bridge.

* gnu/packages/game-development.scm (dds-bridge): New variable.
---
 gnu/packages/game-development.scm | 70 ++++++++++++++++++++++++++++++-
 1 file changed, 69 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 889b435cfb..bda72fe72e 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2019, 2020, 2021 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;; Copyright © 2019 Jethro Cao <jethrocao@gmail.com>
-;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2020-2022 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
@@ -74,6 +74,7 @@ (define-module (gnu packages game-development)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages fribidi)
   #:use-module (gnu packages dbm)
+  #:use-module (gnu packages gawk)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
@@ -85,6 +86,7 @@ (define-module (gnu packages game-development)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages mp3)
@@ -181,6 +183,72 @@ (define-public bullet
 is used in some video games and movies.")
     (license license:zlib)))
 
+(define-public dds-bridge
+  (package
+    (name "dds-bridge")
+    (version "2.9.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/dds-bridge/dds")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1iv09qic43nvla02lm8zgnkqpjgnc95p8zh3wyifmnmlh1rz02yj"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'chdir
+                 (lambda _
+                   (chdir "src")))
+               (replace 'configure
+                 ;; Configuration is done by copying the appropriate
+                 ;; make file in the working directory.  There is no
+                 ;; configure script.
+                 (lambda _
+                   (copy-file "Makefiles/Makefile_linux_shared"
+                              "Makefile")))
+               (replace 'check
+                 ;; There is no "check" traget.  We must compile
+                 ;; a "dtest" program and apply it on a data set.
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (install-file "libdds.so" "../test")
+                     (with-directory-excursion "../test"
+                       (copy-file "Makefiles/Makefile_linux"
+                                  "Makefile")
+                       (substitute* "Makefile"
+                         (("-Werror") ""))
+                       (invoke "make")
+                       (invoke "./dtest")
+                       (invoke "./dtest" "-f" "../hands/list100.txt")))))
+               (replace 'install
+                 ;; "install" target merely moves ".so" file around
+                 ;; the source directory.  We install it in the store,
+                 ;; along with all shipped documentation (which cannot
+                 ;; be built from source unfortunately).
+                 (lambda _
+                   (install-file "libdds.so"
+                                 (string-append #$output "/lib"))
+                   (let ((doc (string-append #$output
+                                             "/share/doc/"
+                                             #$name "-" #$version)))
+                     (install-file "../LICENSE" doc)
+                     (copy-recursively "../doc" doc)))))))
+    (native-inputs
+     (list gawk procps))
+    (inputs
+     (list boost libomp))
+    (home-page "http://privat.bahnhof.se/wb758135/")
+    (synopsis "Double dummy solver for the bridge card game")
+    (description "DDS is a double-dummy solver of bridge hands.  It supports
+single-threading and multi-threading for improved performance.  DDS
+offers a wide range of functions, including par-score calculations.")
+    (license license:asl2.0)))
+
 (define-public deutex
   (package
    (name "deutex")
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#58295: [PATCH] Add dds-bridge
  2022-10-04 21:56 [bug#58295] [PATCH] Add dds-bridge Nicolas Goaziou
@ 2022-10-16 19:22 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2022-10-16 19:22 UTC (permalink / raw)
  To: 58295-done

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> The following patch adds the DDS library for bridge card game
> development.
>
> Note: it builds without libomp (but not without boost). I'm not sure it
> is really necessary, even though OpenMP is mentioned in the code base.

I renamed it to "dds", removed libomp from inputs, and pushed.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-16 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 21:56 [bug#58295] [PATCH] Add dds-bridge Nicolas Goaziou
2022-10-16 19:22 ` bug#58295: " Nicolas Goaziou

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).