unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Bruno Victal <mirai@makinata.eu>
To: Yovan Naumovski <yovan@gorski.stream>
Cc: 62550@debbugs.gnu.org
Subject: [bug#62550] [PATCH] gnu: Add alienblaster.
Date: Fri, 31 Mar 2023 11:41:27 +0100	[thread overview]
Message-ID: <44ee896c-d97a-456a-bb0d-24dfa3e71b7c@makinata.eu> (raw)
In-Reply-To: <20230330192629.31655-1-yovan@gorski.stream>

Hi Yovan,

On 2023-03-30 20:26, Yovan Naumovski via Guix-patches via wrote:
> +   (arguments
> +    '(#:tests? #f ;; no tests
> +      #:phases
> +      (modify-phases %standard-phases
> +        (add-after 'unpack 'fix-sdl-paths
> +          (lambda* (#:key inputs outputs #:allow-other-keys)
> +            (let* ((out (assoc-ref outputs "out"))
> +                   (share (string-append out "/share"))
> +                   (sdl-mixer (assoc-ref inputs "sdl-mixer")))
> +
> +              ;; fix name and append path to SDL_mixer.h
> +              (substitute* "src/Makefile"
> +                (("GAME_NAME=alienBlaster")
> +                 "GAME_NAME=alienblaster")
> +                (("SDL_FLAGS=\\$\\(shell sdl-config --cflags\\)" line)
> +                 (string-append line " -I" sdl-mixer "/include/SDL")))
> +
> +              ;; substitute relative paths in .cfg and source/header files
> +              (substitute* (find-files "./cfg")
> +                (("(\\./)?images") (string-append share "/images")))
> +              (substitute* (list "src/global.h" "src/global.cc")
> +                (("./images") (string-append share "/images"))
> +                (("./sound") (string-append share "/sound"))
> +                (("./cfg") (string-append share "/cfg"))))))
> +
> +        (delete 'configure)
> +
> +        (replace 'install
> +          (lambda* (#:key outputs #:allow-other-keys)
> +            (let* ((out (assoc-ref outputs "out"))
> +                   (bin (string-append out "/bin")))
> +              (install-file "alienblaster" bin)
> +              (for-each
> +               (lambda (dir)
> +                 (copy-recursively dir (string-append out "/share/" dir)))
> +               '("images" "sound" "cfg")))
> +            #t)))))

You should use G-Expressions here, i.e.

(arguments
 (list
  #:tests? #f  ; no tests
  #:phases
  #~(modify-phases %standard-phases
        (add-after 'unpack 'fix-sdl-paths
          (lambda* (#:key inputs #:allow-other-keys)
            (let ((out (assoc-ref outputs "out"))
                   (share (string-append #$output "/share"))
                   (sdl-mixer (assoc-ref inputs "sdl-mixer")))
              ;; fix name and append path to SDL_mixer.h
              (substitute* "src/Makefile"
                (("GAME_NAME=alienBlaster")
                 "GAME_NAME=alienblaster")
                (("SDL_FLAGS=\\$\\(shell sdl-config --cflags\\)" line)
                 (string-append line " -I" sdl-mixer "/include/SDL")))

              ;; substitute relative paths in .cfg and source/header files
              (substitute* (find-files "./cfg")
                (("(\\./)?images") (string-append share "/images")))
              (substitute* (list "src/global.h" "src/global.cc")
                (("./images") (string-append share "/images"))
                (("./sound") (string-append share "/sound"))
                (("./cfg") (string-append share "/cfg"))))))
… )


Take a look at the existing packages that use G-Expressions for inspiration.
(examples that come to mind are mympd, libavif, autokey, rng-tools,
dropwatch, nvme-cli, …)

> +   (home-page "http://www.schwardtnet.de/alienblaster/")
> +   (synopsis "Action-loaded 2D arcade shooter game")
> +   (description "Alien Blaster is an action-loaded 2D arcade shooter
> +game. Your mission in the game is simple: stop the invasion of the aliens by
> +blasting them. Simultaneous two-player mode is available.")

Keep the sentences separated with two spaces between them. (Texinfo syntax)


Thanks,
Bruno




  reply	other threads:[~2023-03-31 10:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 19:26 [bug#62550] [PATCH] gnu: Add alienblaster Yovan Naumovski via Guix-patches via
2023-03-31 10:41 ` Bruno Victal [this message]
2023-03-31 16:03 ` [bug#62550] [PATCH v2] " Yovan Naumovski via Guix-patches via
2023-04-21  8:59   ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44ee896c-d97a-456a-bb0d-24dfa3e71b7c@makinata.eu \
    --to=mirai@makinata.eu \
    --cc=62550@debbugs.gnu.org \
    --cc=yovan@gorski.stream \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).