From 3745909dc9f810844d169e5e2089707df8174462 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 2 Jun 2019 01:03:08 +0200 Subject: gnu: Add ri-li. * gnu/packages/games.scm (ri-li): New variable. * gnu/packages/patches/ri-li-modernize_cpp.patch: New file. * gnu/local.mk (dist_patch_DATA): Reference patch. --- gnu/local.mk | 1 + gnu/packages/games.scm | 70 +++++ gnu/packages/patches/ri-li-modernize_cpp.patch | 391 +++++++++++++++++++++++++ 3 files changed, 462 insertions(+) create mode 100644 gnu/packages/patches/ri-li-modernize_cpp.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7f3fcae07e..81de156cf2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1239,6 +1239,7 @@ dist_patch_DATA = \ %D%/packages/patches/readline-6.2-CVE-2014-2524.patch \ %D%/packages/patches/red-eclipse-remove-gamma-name-hack.patch \ %D%/packages/patches/reposurgeon-add-missing-docbook-files.patch \ + %D%/packages/patches/ri-li-modernize_cpp.patch \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 7a433a0bfd..86bdf99a32 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -7385,3 +7385,73 @@ full of enemies that can hurt it, obstacles and food to be eaten. The goal of the game is to stay alive and collect prizes. The robot program conveniently may be written in a plain text file in the Scheme programming language.") (license license:gpl3+))) + +(define-public ri-li + (package + (name "ri-li") + (version "2.0.1") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/ri-li/" + "Ri-li%20Linux_Unix/Ri-li%20V" version "/" + "Ri-li-" version ".tar.bz2")) + (sha256 + (base32 + "1gcdsgnnbbn1mb1hkpwniv3fhkaj1nn8gq33v5c16q3wqchcq77p")) + ;; Taken from + ;; . + ;; It doesn't build otherwise. + (patches (search-patches "ri-li-modernize_cpp.patch")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + ;; Remove "gentoo" subdirectory from Makefile, as it is + ;; missing a make file and generates a build failure. + (add-after 'configure 'fix-build + (lambda _ + (substitute* "Makefile" + ((" gentoo") "")) + #t)) + (add-after 'install 'install-desktop-file + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (apps (string-append out "/share/applications")) + (pixmaps (string-append out "/share/pixmaps"))) + (for-each (lambda (f) (install-file f pixmaps)) + (find-files "data" "\\.(png|ico)$")) + (mkdir-p apps) + (with-output-to-file (string-append apps "/ri-li.desktop") + (lambda _ + (format #t + "[Desktop Entry]~@ + Name=Ri-li~@ + Exec=~a/bin/Ri_li~@ + Icon=~a/Ri-li-icon-32x32.png~@ + Categories=Game;ArcadeGame;~@ + Keywords=toy;train;wooden;snake-like;engine;~@ + Comment=a toy simulator game~@ + Comment[de]=Ein Spiel mit einem kleinen Zug~@ + Comment[fr]=un jeu de petit train~@ + Comment[ro_RO]=un joc cu un tren de jucărie~@ + Terminal=false~@ + Type=Application~%" + out pixmaps)))) + #t)) + (add-after 'install-desktop-file 'remove-spurious-files + ;; Delete redundant files already installed somewhere else. + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each delete-file + (find-files (string-append out "/share/Ri-li") + "\\.(png|ico)|COPYING")) + #t)))))) + (inputs + `(("sdl" ,(sdl-union (list sdl sdl-mixer))))) + (home-page "http://www.ri-li.org") + (synopsis "Toy train simulation game") + (description "Ri-li is a game in which you drive a wooden toy +steam locomotive across many levels and collect all the coaches to +win.") + ;; The project is dual-licensed GPL2+ and GPL3+. + (license (list license:gpl2+ license:gpl3+)))) diff --git a/gnu/packages/patches/ri-li-modernize_cpp.patch b/gnu/packages/patches/ri-li-modernize_cpp.patch new file mode 100644 index 0000000000..3d076afb39 --- /dev/null +++ b/gnu/packages/patches/ri-li-modernize_cpp.patch @@ -0,0 +1,391 @@ +diff -r -u Ri-li-2.0.1.orig/src/audio.cc Ri-li-2.0.1/src/audio.cc +--- Ri-li-2.0.1.orig/src/audio.cc 2012-01-22 00:40:56.928609371 -0800 ++++ Ri-li-2.0.1/src/audio.cc 2012-01-22 00:28:33.360636539 -0800 +@@ -22,8 +22,8 @@ + // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + #include +-#include +-#include ++#include ++#include + + #include "audio.h" + #include "utils.h" +@@ -57,7 +57,7 @@ + char PathFile[512]; + + if(Mix_OpenAudio(22050,AUDIO_S16,1,1024)) { +- cerr <<"Enable to init Sound card ! "< ++#include + #include + #include + #include +diff -r -u Ri-li-2.0.1.orig/src/editeur.cc Ri-li-2.0.1/src/editeur.cc +--- Ri-li-2.0.1.orig/src/editeur.cc 2007-11-02 04:48:17.000000000 -0700 ++++ Ri-li-2.0.1/src/editeur.cc 2012-01-22 00:28:59.632635579 -0800 +@@ -25,10 +25,10 @@ + #include + #endif + +-#include ++#include + #include + #include +-#include ++#include + #include + #include + +@@ -374,7 +374,7 @@ + + // Sauve le niveau + if(Niveau.Save()==false) { +- cerr <<"ERREUR Saving levels!"< + #endif + +-#include ++#include + #include + #include +-#include ++#include + #include + #include + +diff -r -u Ri-li-2.0.1.orig/src/loco.cc Ri-li-2.0.1/src/loco.cc +--- Ri-li-2.0.1.orig/src/loco.cc 2007-11-02 04:48:18.000000000 -0700 ++++ Ri-li-2.0.1/src/loco.cc 2012-01-22 00:14:17.878797797 -0800 +@@ -21,10 +21,10 @@ + // with this program; if not, write to the Free Software Foundation, Inc., + // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +-#include ++#include + #include + #include +-#include ++#include + #include + #include "preference.h" + #include "loco.h" +diff -r -u Ri-li-2.0.1.orig/src/main.cc Ri-li-2.0.1/src/main.cc +--- Ri-li-2.0.1.orig/src/main.cc 2007-11-02 04:48:19.000000000 -0700 ++++ Ri-li-2.0.1/src/main.cc 2012-01-22 00:29:40.080634136 -0800 +@@ -23,8 +23,8 @@ + + #include + #include +-#include +-#include ++#include ++#include + #include + #include + +@@ -115,7 +115,7 @@ + + // Initilise SDL + if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_AUDIO|SDL_INIT_NOPARACHUTE) < 0 ) { +- cerr <<"Impossible d'initialiser SDL:"<vfmt->BitsPerPixel==8) { +- cerr <<"Impossible d'utiliser 8bits pour la vidéo !"<vfmt->BitsPerPixel,vOption); + + if(sdlVideo==NULL) { +- cerr <<"Impossible de passer dans le mode vidéo 800x600 !"< ++#include + #include + #include +-#include ++#include + #include "preference.h" + #include "menu.h" + #include "sprite.h" +@@ -92,7 +92,7 @@ + // Teste la resolution video + sdlVideoInfo=(SDL_VideoInfo*)SDL_GetVideoInfo(); + if(sdlVideoInfo->vfmt->BitsPerPixel==8) { +- cerr <<"Impossible d'utiliser 8bits pour la vidéo !"<vfmt->BitsPerPixel,vOption); + if(sdlVideo==NULL) { +- cerr <<"Impossible de passer dans le mode vidéo 800x600 !"< ++#include + #include + #include "mouse.h" + #include "preference.h" +diff -r -u Ri-li-2.0.1.orig/src/sprite.cc Ri-li-2.0.1/src/sprite.cc +--- Ri-li-2.0.1.orig/src/sprite.cc 2007-11-02 04:48:20.000000000 -0700 ++++ Ri-li-2.0.1/src/sprite.cc 2012-01-22 00:30:43.640631779 -0800 +@@ -21,10 +21,10 @@ + // with this program; if not, write to the Free Software Foundation, Inc., + // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +-#include ++#include + #include + #include +-#include ++#include + #include + #include "sprite.h" + #include "preference.h" +@@ -84,7 +84,7 @@ + strcpy(PathFile,Langue[Pref.Langue]); + GetPath(PathFile); + if(FileExiste(PathFile)==false) { +- cerr <<"Impossible de trouver "< ++#include + #include + #include + #include "preference.h" +diff -r -u Ri-li-2.0.1.orig/src/utils.cc Ri-li-2.0.1/src/utils.cc +--- Ri-li-2.0.1.orig/src/utils.cc 2007-11-02 04:48:22.000000000 -0700 ++++ Ri-li-2.0.1/src/utils.cc 2012-01-22 00:31:30.944630051 -0800 +@@ -21,10 +21,10 @@ + // with this program; if not, write to the Free Software Foundation, Inc., + // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +-#include ++#include + #include + #include +-#include ++#include + + #ifdef WINDOWS + #include +@@ -77,7 +77,7 @@ + + file=fopen(Path,"r"); + if(!file) { +- cerr <<"ERREUR: Impossible d'ouvrir '"<1024) { + AfficheChargeur(); + if( fread(Po,1,1024,file) != 1024 ) { +- cerr <<"ERREUR de lecture du fichier '"<512) { + if( fwrite(Buf,1,512,file) != 512 ) { +- cerr <<"ERREUR d'ecriture du fichier '"<0) { + if( fwrite(Buf,1,(size_t)L,file) != (size_t)L ) { +- cerr <<"ERREUR d'ecriture du fichier '"<