GNU bug report logs - #39710
[PATCH] Add foobillardplus

Previous Next

Package: guix-patches;

Reported by: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Date: Fri, 21 Feb 2020 08:35:01 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39710 in the body.
You can then email your comments to 39710 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#39710; Package guix-patches. (Fri, 21 Feb 2020 08:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 21 Feb 2020 08:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: guix-patches <at> gnu.org
Subject: [PATCH] Add foobillardplus
Date: Fri, 21 Feb 2020 09:34:23 +0100
[Message part 1 (text/plain, inline)]
Hello,

The following patch adds foobillardplus game.

Feedback welcome.

Regards,

-- 
Nicolas Goaziou
[0001-gnu-Add-foobillardplus.patch (text/x-diff, inline)]
From f54b3ec7e59fb09550ce73443c570098a907267f Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Date: Fri, 21 Feb 2020 09:32:01 +0100
Subject: [PATCH] gnu: Add foobillardplus.

* gnu/packages/games.scm (foobillardplus): New variable.
* gnu/packages/patches/foobillardplus-pkg-config.patch: New file.
* gnu/local.mk: Reference new file.
---
 gnu/local.mk                                  |   1 +
 gnu/packages/games.scm                        | 128 ++++++++++++++++++
 .../patches/foobillardplus-pkg-config.patch   |  34 +++++
 3 files changed, 163 insertions(+)
 create mode 100644 gnu/packages/patches/foobillardplus-pkg-config.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f2289518e5..db4d7bcab3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -866,6 +866,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/findutils-test-xargs.patch		\
   %D%/packages/patches/flann-cmake-3.11.patch			\
   %D%/packages/patches/flint-ldconfig.patch			\
+  %D%/packages/patches/foobillardplus-pkg-config.patch		\
   %D%/packages/patches/foomatic-filters-CVE-2015-8327.patch	\
   %D%/packages/patches/foomatic-filters-CVE-2015-8560.patch	\
   %D%/packages/patches/fribidi-CVE-2019-18397.patch		\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 12b4cdf125..3b4532e0be 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -597,6 +597,134 @@ regular @command{cat}, but it also adds terminal escape codes between
 characters and lines resulting in a rainbow effect.")
       (license license:wtfpl2))))
 
+(define-public foobillardplus
+  (let ((svn-revision 170))
+    (package
+      (name "foobillardplus")
+      (version (string-append "3.43-r" (number->string svn-revision)))
+      (source
+       (origin
+         (method svn-fetch)
+         (uri (svn-reference
+               (url "svn://svn.code.sf.net/p/foobillardplus/code/")
+               (revision svn-revision)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "00b693ys5zvzjbjzzj3dqfzm5xw64gwjf9m8qv6bkmf0klbhmayk"))
+         (patches
+          (search-patches "foobillardplus-pkg-config.patch"))
+         (modules '((guix build utils)))
+         (snippet
+          '(begin
+             ;; Unfortunately, the game includes background music with
+             ;; a non-commercial clause.  Delete it.
+             (for-each delete-file (find-files "data/music" "\\.ogg$"))
+             #t))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:configure-flags
+         (list
+          ;; Install data in a less exotic location.
+          (string-append "--prefix=" (assoc-ref %outputs "out") "/share")
+          ;; Prevent a build error about undefined trigonometric functions.
+          "--enable-fastmath=no")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'fix-makefile
+             ;; Remove hard-coded directories.  Also fix installation
+             ;; rule: it tries to move around non-existent files or
+             ;; files already moved.
+             (lambda* (#:key outputs #:allow-other-keys)
+               (substitute* "Makefile.am"
+                 (("/usr") (assoc-ref outputs "out"))
+                 (("cp .*?/foobillardplus\\.desktop.*") "")
+                 (("cp .*?/foobillardplus\\.(png|xbm) \\$\\(datarootdir\\).*")
+                  ""))
+               #t))
+           (add-after 'unpack 'unbundle-font
+             ;; XXX: The package ships with LinBiolinum_aSB.ttf and
+             ;; LinBiolinum_aS.ttf, which are not provided in
+             ;; font-linuxlibertine package.  Therefore, we cannot replace
+             ;; them yet.
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((dejavu (string-append (assoc-ref inputs "font-dejavu")
+                                            "/share/fonts/truetype/")))
+                 (with-directory-excursion "data"
+                   (for-each (lambda (f)
+                               (delete-file f)
+                               (symlink (string-append dejavu f) f))
+                             '("DejaVuSans-Bold.ttf" "DejaVuSans.ttf"))))
+               #t))
+           (replace 'bootstrap
+             (lambda _
+               (invoke "aclocal" "--force")
+               (invoke "autoconf" "-f")
+               (invoke "autoheader" "-f")
+               (invoke "automake" "-a" "-c" "-f")))
+           (add-before 'build 'prepare-build
+             ;; Set correct environment for SDL.
+             (lambda* (#:key inputs #:allow-other-keys)
+               (setenv "CPATH"
+                       (string-append (assoc-ref inputs "sdl")
+                                      "/include/SDL:"
+                                      (or (getenv "CPATH") "")))
+               #t))
+           (add-before 'build 'fix-settings-directory
+             ;; Hide foobillardplus settings directory in $HOME.
+             (lambda _
+               (substitute* "src/history.c"
+                 (("/foobillardplus-data") "/.foobillardplus"))
+               #t))
+           (add-before 'install 'create-directories
+             ;; Install process does not create directories before
+             ;; trying to move file in it.
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (mkdir-p (string-append out "/share/icons"))
+                 (mkdir-p (string-append out "/share/applications")))
+               #t))
+           (add-after 'install 'symlink-executable
+             ;; Symlink executable to $out/bin.
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin")))
+                 (mkdir-p bin)
+                 (with-directory-excursion bin
+                   (symlink "../share/foobillardplus/bin/foobillardplus"
+                            "foobillardplus"))
+                 #t))))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("pkg-config" ,pkg-config)))
+      (inputs
+       `(("font-dejavu" ,font-dejavu)
+         ("freetype" ,freetype)
+         ("glu" ,glu)
+         ("libpng" ,libpng)
+         ("sdl" ,(sdl-union (list sdl sdl-mixer sdl-net)))))
+      (home-page "http://foobillardplus.sourceforge.net/")
+      (synopsis "3D billiard game")
+      (description "FooBillard++ is an advanced 3D OpenGL billiard game
+based on the original foobillard 3.0a sources from Florian Berger.
+You can play it with one or two players or against the computer.
+
+The game features:
+
+@itemize
+@item Wood paneled table with gold covers and gold diamonds.
+@item Reflections on balls.
+@item Zoom in and out, rotation, different angles and bird's eye view.
+@item Different game modes: 8 or 9-ball, Snooker or Carambole.
+@item Tournaments.  Compete against other players.
+@item Animated cue with strength and eccentric hit adjustment.
+@item Jump shots and snipping.
+@item Realistic gameplay and billiard sounds.
+@item Red-Green stereo.
+@item And much more.
+@end itemize")
+      (license (list license:gpl2 license:silofl1.1)))))
+
 (define-public freedoom
   (package
     (name "freedoom")
diff --git a/gnu/packages/patches/foobillardplus-pkg-config.patch b/gnu/packages/patches/foobillardplus-pkg-config.patch
new file mode 100644
index 0000000000..7cc40a4777
--- /dev/null
+++ b/gnu/packages/patches/foobillardplus-pkg-config.patch
@@ -0,0 +1,34 @@
+From: Markus Koschany <apo <at> debian.org>
+Date: Thu, 8 Mar 2018 17:49:24 +0100
+Subject: pkg-config
+
+Use pkg-config instead of the deprecated freetype-config command.
+
+Bug-Debian: https://bugs.debian.org/892338
+Forwarded: no
+---
+ src/Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 3b7d0fe..0f5a5dd 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -158,8 +158,8 @@ endif
+ SDL_CFLAGS = `sdl-config --cflags`
+ SDL_LIBS   = `sdl-config --libs`
+ 
+-FREETYPE_CFLAGS = `freetype-config --cflags`
+-FREETYPE_LIBS   = `freetype-config --libs`
++FREETYPE_CFLAGS = `pkg-config --cflags freetype2`
++FREETYPE_LIBS   = `pkg-config --libs freetype2`
+ 
+ if USE_MATHSINGLE
+ MATH_CFLAGS = -DVMATH_SINGLE_PRECISION
+@@ -233,4 +233,4 @@ AM_CFLAGS = -Wall ${FREETYPE_CFLAGS} ${SDL_CFLAGS} ${NVIDIA_CFLAGS} ${SOUND_CFLA
+             ${OPTIMIZATION_CFLAGS} ${USESSE_CFLAGS} ${USEWIN_CFLAGS} ${FASTMATH_CFLAGS} ${DEBIAN_CFLAGS} -lm
+ 
+ AM_LDFLAGS = ${all_libraries} ${FREETYPE_LIBS} ${SDL_LIBS}
+-LDADD = ${LDADD_FLAGS}
+\ No newline at end of file
++LDADD = ${LDADD_FLAGS}
-- 
2.25.0


Information forwarded to guix-patches <at> gnu.org:
bug#39710; Package guix-patches. (Wed, 18 Mar 2020 09:56:02 GMT) Full text and rfc822 format available.

Message #8 received at 39710 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 39710 <at> debbugs.gnu.org
Subject: Re: [bug#39710] [PATCH] Add foobillardplus
Date: Wed, 18 Mar 2020 10:55:33 +0100
Hi,

Nicolas Goaziou <mail <at> nicolasgoaziou.fr> skribis:

>>From f54b3ec7e59fb09550ce73443c570098a907267f Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
> Date: Fri, 21 Feb 2020 09:32:01 +0100
> Subject: [PATCH] gnu: Add foobillardplus.
>
> * gnu/packages/games.scm (foobillardplus): New variable.
> * gnu/packages/patches/foobillardplus-pkg-config.patch: New file.
> * gnu/local.mk: Reference new file.

[...]

> +(define-public foobillardplus
> +  (let ((svn-revision 170))

Could you add a comment explaining why you choose this revision rather
than the latest release?

Otherwise LGTM, thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#39710; Package guix-patches. (Wed, 18 Mar 2020 11:23:01 GMT) Full text and rfc822 format available.

Message #11 received at 39710 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 39710 <at> debbugs.gnu.org
Subject: Re: [bug#39710] [PATCH] Add foobillardplus
Date: Wed, 18 Mar 2020 12:22:31 +0100
Hello,

Ludovic Courtès <ludo <at> gnu.org> writes:

> Could you add a comment explaining why you choose this revision rather
> than the latest release?

Oops! Will do before pushing.

One question though: the home-page is "foobillardplus.sourceforge.net",
but the project name is "foobillard++". Should I name the variable
"foobillard++" instead of "foobillardpp"?

Thank you for the review.

Regards,

-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#39710; Package guix-patches. (Wed, 18 Mar 2020 14:46:01 GMT) Full text and rfc822 format available.

Message #14 received at 39710 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 39710 <at> debbugs.gnu.org
Subject: Re: [bug#39710] [PATCH] Add foobillardplus
Date: Wed, 18 Mar 2020 15:45:42 +0100
Hi,

Nicolas Goaziou <mail <at> nicolasgoaziou.fr> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Could you add a comment explaining why you choose this revision rather
>> than the latest release?
>
> Oops! Will do before pushing.
>
> One question though: the home-page is "foobillardplus.sourceforge.net",
> but the project name is "foobillard++". Should I name the variable
> "foobillard++" instead of "foobillardpp"?

Sure, ‘foobillard++’ sounds good.

Thanks,
Ludo’.




Reply sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
You have taken responsibility. (Thu, 19 Mar 2020 22:30:02 GMT) Full text and rfc822 format available.

Notification sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
bug acknowledged by developer. (Thu, 19 Mar 2020 22:30:03 GMT) Full text and rfc822 format available.

Message #19 received at 39710-done <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 39710-done <at> debbugs.gnu.org
Subject: Re: [bug#39710] [PATCH] Add foobillardplus
Date: Thu, 19 Mar 2020 23:28:54 +0100
Hello,

Ludovic Courtès <ludo <at> gnu.org> writes:

> Sure, ‘foobillard++’ sounds good.

Applied. Thank you for the review.

Regards,

-- 
Nicolas Goaziou




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 Apr 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.