guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add MARS shooter.


From: Eric Bavier
Subject: Re: [PATCH] Add MARS shooter.
Date: Sat, 19 Sep 2015 12:17:18 -0500

On Fri, 18 Sep 2015 21:25:00 +0200
Ricardo Wurmus <address@hidden> 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 :)

> 
> I could not get sound to work, unfortunately, because /dev/dsp does not
> exist on my machine.  It’s not a problem with the package, but maybe
> 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 <address@hidden>
> Date: Mon, 31 Aug 2015 10:09:40 +0200
> Subject: [PATCH] gnu: Add MARS.
> 
> * 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 of 
> SFML
> +  ;; with a different API, so we take the latest version from the official
> +  ;; 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 = \"./data/\";")
> +                 (string-append "C_dataPath = \""
> +                                (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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]