guix-patches
[Top][All Lists]
Advanced

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

[bug#62178] [PATCH v1 5/5] gnu: Add terrarium.


From: Liliana Marie Prikler
Subject: [bug#62178] [PATCH v1 5/5] gnu: Add terrarium.
Date: Tue, 18 Apr 2023 20:28:58 +0200
User-agent: Evolution 3.46.0

Am Donnerstag, dem 16.03.2023 um 14:32 +0800 schrieb Adam Faiz:
>  From e041b01dd31b915ac042ca0e30cbcbd0cf9c62df Mon Sep 17 00:00:00
> 2001
> Message-Id:
> <e041b01dd31b915ac042ca0e30cbcbd0cf9c62df.1678947948.git.adam.faiz@di
> sroot.org>
> In-Reply-To:
> <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@di
> sroot.org>
> References:
> <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@di
> sroot.org>
> From: AwesomeAdam54321 <adam.faiz@disroot.org>
> Date: Tue, 14 Mar 2023 14:19:59 +0800
> Subject: [PATCH v1 5/5] gnu: Add terrarium.
> 
> * gnu/packages/games.scm (terrarium): New variable.
> ---
>   gnu/packages/games.scm | 97
> ++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 97 insertions(+)
> 
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index 2946c787af..b475be4654 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -618,6 +618,103 @@ (define-public bastet
>   canyons and wait for the long I-shaped block to clear four rows at
> a time.")
>       (license license:gpl3+)))
>   
> +(define-public terrarium
> +  (let ((commit "4a489717b2fc53903b934487d7321be4682e4e2b")
> +        (revision "0"))
> +  (package
> +    (name "terrarium")
> +    (version (git-version "0.1.9" revision commit))
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://gitlab.com/hydren/terrarium";)
> +             (commit commit)))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32
> "0xq7kfl7dvvw222kamw1b5paq5p997z8px8ximbz12v0kj62aqjf"))
> +       (modules '((guix build utils)))
> +       (snippet
> +        #~(begin
> +            (for-each
> +             delete-file
> +             '("resources/jack.ttf" ; unlicensed font, probably
> shareware
> +               "resources/liberation.ttf")) ; bundled font
> +            (for-each
> +             (lambda (file)
> +               (copy-recursively
> +                (string-append "build/linux-gcc-sdl2-release/" file)
> +                (string-append "./" file)))
> +             '("src"
> +               "makefile"
> +               "configure.sh"
> +               "objects.mk"
> +               "sources.mk"))
> +            (rename-file "configure.sh" "configure")
> +            (substitute* "configure"
> +              (("which") "type -p"))
> +            (substitute* "makefile"
> +              (("..LIBS. `sdl2-config --cflags --libs`")
> +               "-lbox2d -lfgeal -lfutil -lgeramun")
> +              (("@echo 'Building target: .@'")
> +               (string-append
> +                "sed -i -e \"s,@DESTDIR@,$(DESTDIR),\""
> +                " -e \"s,@PREFIX@,$(PREFIX),\""
> +                " -e \"s,@FONT_DIR@,$(FONT_DIR),\""
> +                " src/loading_state.cpp src/main.cpp"
> +                " src/options_menu_state.cpp
> src/main_menu_state.cpp\n\t"
> +                "@echo 'Building target: $@'"))
> +              (("clean:")
> +               (string-append
> +                "install: terrarium\n\t"
> +                "install -d $(DESTDIR)$(PREFIX)/share\n\t"
> +                "cp -r resources $(DESTDIR)$(PREFIX)/share\n\t"
> +                "install -d $(DESTDIR)$(PREFIX)/bin\n\t"
> +                "install -m 755 terrarium
> $(DESTDIR)$(PREFIX)/bin\n\n"
> +                "clean:")))
> +            (substitute* "src/terrarium_game_logic.cpp"
> +              (("config.properties")
> ".terrarium/config.properties"))
> +            (substitute* "src/main_menu_state.cpp"
> +              (("resources/maps") ".terrarium/maps")
> +              (("resources/chars") ".terrarium/chars")
> +              (("resources/jack.ttf") "@FONT_DIR@/LiberationSans-
> Bold.ttf")
> +              (("resources/liberation.ttf")
> +               "@FONT_DIR@/LiberationMono-Regular.ttf"))
> +            (substitute* "src/options_menu_state.cpp"
> +              (("resources/jack.ttf") "@FONT_DIR@/LiberationSans-
> Bold.ttf")
> +              (("resources/liberation.ttf")
> +               "@FONT_DIR@/LiberationMono-Regular.ttf"))
I'd use @BOLD_FONT@ and @REGULAR_FONT@ and possibly allow users to
parameterize those if necessary.  In any case, this type of fix is
typically made in a build phase rather than a snippet so that the
actual path can be hardcoded via search-input-file.
> +            (substitute* '("src/loading_state.cpp"
> +                           "src/main.cpp"
> +                           "src/main_menu_state.cpp")
> +              (("\\./resources/") "resources/"))
> +            (substitute* '("src/options_menu_state.cpp"
> +                           "src/loading_state.cpp"
> +                           "src/main_menu_state.cpp"
> +                           "src/main.cpp")
> +              (("resources/")
> "@DESTDIR@@PREFIX@/share/resources/"))))))
> +    (build-system gnu-build-system)
> +    (inputs
> +     (list box2d
> +           fgeal
> +           font-liberation
> +           futil
> +           libgeramun
> +           rapidxml))
> +    (arguments
> +     (list #:tests? #f ; no tests
> +           #:make-flags
> +           #~(list (string-append "DESTDIR=" #$output)
> +                   (string-append "FONT_DIR="
> +                                  #$(this-package-input "font-
> liberation")
> +                                  "/share/fonts/truetype"))))
> +    (home-page "https://gitlab.com/hydren/terrarium";)
> +    (synopsis "2D block sandbox game")
> +    (description "Terrarium is a 2D sandbox game centered around
> exploration
> +and building.  Players can create and destroy various types of
> blocks in a
> +two-dimensional open world, inhabited with the occasional toad.")
> +    (license license:gpl2+))))
> +
>   (define-public tetrinet
>     (package
>       (name "tetrinet")

Cheers

reply via email to

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