From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: Re: [PATCH] Add MARS shooter. Date: Sat, 19 Sep 2015 12:17:18 -0500 Message-ID: <20150919121718.1eeccc11@openmailbox.org> References: <8761377ct3.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdQOy-0001KV-7I for guix-devel@gnu.org; Sat, 19 Sep 2015 18:14:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZdQOu-0005JE-A1 for guix-devel@gnu.org; Sat, 19 Sep 2015 18:14:36 -0400 Received: from smtp2.openmailbox.org ([62.4.1.36]:34771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdQOt-0005J2-Ue for guix-devel@gnu.org; Sat, 19 Sep 2015 18:14:32 -0400 In-Reply-To: <8761377ct3.fsf@elephly.net> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ricardo Wurmus Cc: guix-devel On Fri, 18 Sep 2015 21:25:00 +0200 Ricardo Wurmus wrote: > attached is a patch to add MARS. This is really a fun game and you can > play it with a friend on the same machine. Yay! I was pleased to find that it even plays nicely on my i686 netbook :) >=20 > I could not get sound to work, unfortunately, because /dev/dsp does not > exist on my machine. It=E2=80=99s not a problem with the package, but ma= ybe > someone could give me a hint about what kernel module to load to get > this device. Same on my machine. I learned about the ossdp software, which may help. http://sourceforge.net/projects/osspd/ > From 75019485e0090a9c4169a55005232689efa70c2f Mon Sep 17 00:00:00 2001 > From: Ricardo Wurmus > Date: Mon, 31 Aug 2015 10:09:40 +0200 > Subject: [PATCH] gnu: Add MARS. >=20 > * gnu/packages/games.scm (mars): New variable. > * gnu/packages/patches/mars-install.patch: New file. > * gnu/packages/patches/mars-sfml-2.3.patch: New file. > * gnu-system.am (dist_patch_DATA): Add them. > --- > gnu-system.am | 2 + > gnu/packages/games.scm | 54 +++++++++++ > gnu/packages/patches/mars-install.patch | 17 ++++ > gnu/packages/patches/mars-sfml-2.3.patch | 151 +++++++++++++++++++++++++= ++++++ > 4 files changed, 224 insertions(+) > create mode 100644 gnu/packages/patches/mars-install.patch > create mode 100644 gnu/packages/patches/mars-sfml-2.3.patch [...] > +(define-public mars > + ;; The latest release on SourceForge relies on an unreleased version o= f SFML > + ;; with a different API, so we take the latest version from the offici= al > + ;; repository on Github. > + (let ((commit "c855d04409")) > + (package > + (name "mars") > + (version (string-append "0.7.5-c" commit )) I realize we have no guidelines in the manual concerning the version field for git checkouts, but I wonder whether we should, as it comes up a bit. Several existing packages use (string-append "1.2.3." commit), where "1.2.3" is the version of the corresponding source. One other package uses the (string-append "1.2.3-c" commit) method, and another uses (string-append "1.2.3-" commit. I personally prefer the "-" notation, since it distinguishes the commit hash from the version number (does it confuse any internal logic that assumes a package version number is the last component of the store path following a dash?). In this case, the "-c" seems confusing because the commit hash itself begins with a 'c'. I recall some discussion previously about how it would be nice for git-checkout package versions to still "sort" nicely. > + (source (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/thelaui/M.A.R.S..git") > + (commit commit))) guix lint should warn now about the 'file-name' of the origin. > + (sha256 > + (base32 > + "1r4c5gap1z2zsv4yjd34qriqkxaq4lb4rykapyzkkdf4g36lc3nh"= )) > + (patches (list (search-patch "mars-sfml-2.3.patch") As mentioned on IRC, I had trouble applying this patch because some DOS line-endings went missing somewhere. We just need to make sure they are preserved by git. > + (search-patch "mars-install.patch"))))) > + (build-system cmake-build-system) > + (arguments > + `(#:tests? #f ; There are no tests > + #:phases > + (modify-phases %standard-phases > + (add-after 'unpack 'fix-install-path > + (lambda _ > + (substitute* "src/CMakeLists.txt" > + (("\\$\\{CMAKE_INSTALL_PREFIX\\}/games") > + "${CMAKE_INSTALL_PREFIX}/bin")))) As in the following phase, could you return #t after the 'substitute*'? > + (add-after 'unpack 'fix-data-path > + (lambda* (#:key outputs #:allow-other-keys) > + (substitute* "src/System/settings.cpp" > + (("C_dataPath =3D \"./data/\";") > + (string-append "C_dataPath =3D \"" > + (assoc-ref outputs "out") > + "/share/games/marsshooter/\";"))) > + #t))))) > + (inputs > + `(("mesa" ,mesa) > + ("fribidi" ,fribidi) > + ("taglib" ,taglib) > + ("sfml" ,sfml))) Our sfml package has been failing to build on hydra for a few weeks because of receiving unexpected hashes from the source downloads. It appears the authors may have changed the zip file in place when they released the latest version, and you simply had the previous zip in your store from before. Hydra seems to not be serving the correct zip file either. `~Eric > + (home-page "http://marsshooter.org") > + (synopsis "2D space shooter") > + (description > + "M.A.R.S. is a 2D space shooter with awesome visual effects and > +attractive physics. Players can battle each other or computer controlled > +enemies in exciting game modes.") > + (license license:gpl3+)))) > + > (define minetest-data > (package > (name "minetest-data")