gnu: Add bastet.

* gnu/packages/games.scm (bastet): New public variable.
* gnu/packages/patches/bastet-change-source-of-unordered_set.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Add it.
This commit is contained in:
Tobias Geerinckx-Rice 2018-10-04 00:30:53 +02:00
parent b008a12ae7
commit fc4738149f
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
3 changed files with 105 additions and 0 deletions

View File

@ -591,6 +591,7 @@ dist_patch_DATA = \
%D%/packages/patches/awesome-reproducible-png.patch \
%D%/packages/patches/azr3.patch \
%D%/packages/patches/bash-completion-directories.patch \
%D%/packages/patches/bastet-change-source-of-unordered_set.patch \
%D%/packages/patches/bazaar-CVE-2017-14176.patch \
%D%/packages/patches/beignet-correct-file-names.patch \
%D%/packages/patches/binutils-aarch64-symbol-relocation.patch \

View File

@ -181,6 +181,70 @@ more advanced player there are new game modes and a wide variety of physics
settings to tweak as well.")
(license license:gpl2+)))
(define-public bastet
(package
(name "bastet")
(version "0.43.2")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/fph/bastet.git")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "09kamxapm9jw9przpsgjfg33n9k94bccv65w95dakj0br33a75wn"))
(patches
(search-patches "bastet-change-source-of-unordered_set.patch"))))
(build-system gnu-build-system)
(arguments
`(#:make-flags
(list (string-append "CXXFLAGS=-I"
(assoc-ref %build-inputs "boost") "/include"))
#:phases
(modify-phases %standard-phases
(delete 'configure) ; no configure script
(replace 'check
;; The 'Test' target builds the tests, but doesn't actually run them.
(lambda* (#:key make-flags #:allow-other-keys)
(apply invoke "make" "Test" make-flags)
(setenv "HOME" ".")
(invoke "./Test")))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(share (string-append out "/share"))
(hicolor (string-append share "/icons/hicolor")))
(install-file "bastet"
(string-append out "/bin"))
(install-file "bastet.desktop"
(string-append share "/applications"))
(install-file "bastet.svg"
(string-append hicolor "/scalable/apps"))
(install-file "bastet.appdata.xml"
(string-append share "/appdata"))
(install-file "bastet.6"
(string-append out "/share/man/man6"))
#t))))))
(native-inputs
`(("hicolor-icon-theme" ,hicolor-icon-theme)))
(inputs
`(("boost" ,boost)
("ncurses" ,ncurses)))
(home-page "http://fph.altervista.org/prog/bastet.html")
(synopsis "Antagonistic Tetris-style falling brick game for text terminals")
(description
"Bastet (short for Bastard Tetris) is a simple ncurses-based falling brick
game. Unlike normal Tetris, Bastet does not choose the next brick at random.
Instead, it uses a special algorithm to choose the worst brick possible.
Playing bastet can be a painful experience, especially if you usually make
canyons and wait for the long I-shaped block to clear four rows at a time.")
(license license:gpl3+)))
(define-public cataclysm-dda
(let ((commit "ad3b0c3d521292d119f97a83390e7acfe9e9e7f7")
(revision "1"))

View File

@ -0,0 +1,40 @@
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Wed, 3 Oct 2018 23:30:42 +0200
Subject: [PATCH] bastet: Change source of unordered_set.
This allows building bastet 0.43.2 with boost >=1.66.
It was backported verbatim from the upstream master branch.
From 0e03f8d4d6bc6949cf1c447e632ce0d1b98c4be1 Mon Sep 17 00:00:00 2001
From: Federico Poloni <fpoloni@di.unipi.it>
Date: Wed, 4 Oct 2017 19:35:01 +0200
Subject: [PATCH] Changed source of unordered_set (should hopefully fix #6
without reopening #1)
---
BastetBlockChooser.hpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/BastetBlockChooser.hpp b/BastetBlockChooser.hpp
index 992e556..7ee3b7c 100644
--- a/BastetBlockChooser.hpp
+++ b/BastetBlockChooser.hpp
@@ -23,8 +23,7 @@
#include "Well.hpp"
-#include <boost/tr1/tr1/unordered_set>
-#include <set>
+#include <boost/unordered_set.hpp>
#include <boost/functional/hash.hpp>
namespace Bastet{
@@ -75,7 +74,7 @@ namespace Bastet{
public:
Searcher(BlockType b, const Well *well, Vertex v, WellVisitor *visitor);
private:
- std::tr1::unordered_set<Vertex> _visited;
+ boost::unordered_set<Vertex> _visited;
//std::set<Vertex> _visited; ^^ the above is more efficient, we need to do many inserts
BlockType _block;
const Well *_well;