[PATCH 0/5] Add terrarium.

  • Open
  • quality assurance status badge
Details
2 participants
  • Adam Faiz
  • Liliana Marie Prikler
Owner
unassigned
Submitted by
Adam Faiz
Severity
normal
A
A
Adam Faiz wrote on 14 Mar 2023 07:52
(address . guix-patches@gnu.org)
00c2af06-fa2f-81d3-e3de-444eaf232732@disroot.org
From 914d9ebcaffee24da73bb4d9711c0428ff36feb0 Mon Sep 17 00:00:00 2001
Message-Id: <cover.1678775193.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Tue, 14 Mar 2023 14:26:33 +0800
Subject: [PATCH 0/5] Add terrarium.

NOTES:
The game is hardcoded to look at user data under .terrarium/ in the
current directory, with the user's characters being in
.terrarium/chars/ and maps in .terrarium/maps/. These directories
have to be created beforehand.

The game also keeps game settings in .terrarium/config.properties,
and doesn't run without important variables being defined. A sample
config.properties is attached.

In terrarium's package output, it has demo worlds in its
share/resources/maps/ directory that you can copy to
.terrarium/maps/ to play, in addition to making your own characters
and maps of course.


AwesomeAdam54321 (5):
gnu: Add fgeal.
gnu: Add futil.
gnu: Add libgeramun.
gnu: Add rapidxml.
gnu: Add terrarium.

gnu/local.mk | 2 +
gnu/packages/cpp.scm | 38 +++++
gnu/packages/game-development.scm | 147 ++++++++++++++++++
gnu/packages/games.scm | 96 ++++++++++++
gnu/packages/patches/futil-Add-Makefile.patch | 91 +++++++++++
.../patches/libgeramun-Add-Makefile.patch | 79 ++++++++++
gnu/packages/xml.scm | 30 ++++
7 files changed, 483 insertions(+)
create mode 100644 gnu/packages/patches/futil-Add-Makefile.patch
create mode 100644 gnu/packages/patches/libgeramun-Add-Makefile.patch


base-commit: 5befcff66edb4d72ab8e713c81836fb8519ce3e6
--
2.39.2
Attachment: config.properties
A
A
Adam Faiz wrote on 14 Mar 2023 07:57
[PATCH 1/5] gnu: Add fgeal.
(address . 62178@debbugs.gnu.org)
21349edf-d7fa-ec74-e40f-7fc155658449@disroot.org
From f2dc6209535b2ad8aed999845c0992264cc7aff6 Mon Sep 17 00:00:00 2001
Message-Id: <f2dc6209535b2ad8aed999845c0992264cc7aff6.1678775193.git.adam.faiz@disroot.org>
In-Reply-To: <cover.1678775193.git.adam.faiz@disroot.org>
References: <cover.1678775193.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Tue, 14 Mar 2023 13:38:36 +0800
Subject: [PATCH 1/5] gnu: Add fgeal.

* gnu/packages/game-development.scm (fgeal): New variable.
---
gnu/packages/game-development.scm | 106 ++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)

Toggle diff (119 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index a384572a9d..f86793fda0 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -2359,6 +2359,112 @@ (define-public flatzebra
double-buffering.")
(license license:gpl2+)))
+(define-public fgeal
+ (let ((commit "0ae72fbf31eb2e133fe83520391e7a82c0b59e67")
+ (revision "0"))
+ (package
+ (name "fgeal")
+ (version (git-version "0.8.4" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/hydren/fgeal")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0lck86n8nkhb088bd0jg4imi9j5l1lwfr2pddqqr880rjrnnm8fw"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (with-directory-excursion "project/build/linux-gcc-sdl2-release"
+ (rename-file "configure.sh" "configure")
+ (substitute* "configure"
+ (("-exec sed -i")
+ (string-append
+ "-exec sed -i"
+ " \"s,SDL2_CFLAGS,`pkg-config --cflags sdl2`,g\" {} \\;"
+ " -exec sed -i"))
+ (("which") "type -p"))
+ (substitute* "makefile"
+ (("RM := rm -rf")
+ (string-append "RM := rm -rf\n"
+ "PREFIX ?= /usr/local"))
+ (("clean:")
+ (string-append
+ "install:\n\t"
+ "install -d $(DESTDIR)$(PREFIX)/include\n\t"
+ "cp -r ../fgeal $(DESTDIR)$(PREFIX)/include\n\t"
+ "install -d $(DESTDIR)$(PREFIX)/lib\n\t"
+ "install -m 644 libfgeal.so $(DESTDIR)$(PREFIX)/lib\n\n"
+ "clean:")))
+ (substitute* "extra/subdir.mk"
+ (("../extra/input_manager.cpp \\\\")
+ (string-append "../extra/input_manager.cpp \\\n"
+ "../extra/primitives.cpp \\"))
+ (("./extra/input_manager.o \\\\")
+ (string-append "./extra/input_manager.o \\\n"
+ "./extra/primitives.o \\"))
+ (("./extra/input_manager.d \\\\")
+ (string-append "./extra/input_manager.d \\\n"
+ "./extra/primitives.d \\"))))
+ (copy-recursively "project/build/linux-gcc-sdl2-release"
+ "linux-gcc-sdl2-release")
+ (substitute* (find-files "." "\\.mk")
+ (("-I\"BUILD_PATH\"") "-I\"BUILD_PATH\" SDL2_CFLAGS"))
+ (for-each
+ (lambda (file)
+ (install-file file "fgeal"))
+ '("agnostic_cached_drawable_text.hxx"
+ "agnostic_filesystem.hxx"
+ "agnostic_sound_stream.hxx"
+ "colors.hpp"
+ "core.hpp"
+ "display.hpp"
+ "event.hpp"
+ "exceptions.hpp"
+ "fgeal.hpp"
+ "filesystem.hpp"
+ "font.hpp"
+ "friend_classes.hxx"
+ "generic_graphics.hxx"
+ "geometry.hpp"
+ "graphics.hpp"
+ "image.hpp"
+ "input.hpp"
+ "sound.hpp"
+ "version.h"))
+ (for-each
+ (lambda (file)
+ (install-file file "fgeal/extra"))
+ (find-files "extra" "\\.hpp"))))))
+ (build-system gnu-build-system)
+ (native-inputs
+ (list pkg-config))
+ (inputs
+ (list sdl2
+ sdl2-gfx
+ sdl2-image
+ sdl2-mixer
+ sdl2-ttf))
+ (arguments
+ (list #:tests? #f ; no tests
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'configure 'chdir
+ (lambda _
+ (chdir "linux-gcc-sdl2-release"))))
+ #:make-flags
+ #~(list (string-append "DESTDIR=" #$output)
+ "PREFIX=")))
+ (home-page "https://gitlab.com/hydren/fgeal")
+ (synopsis "Simple C++ game library wrapper")
+ (description "fgeal is a simple C++ wrapper library meant to provide
+common functionalities between some game libraries through a single API.
+ It serves as a cross-platform abstraction layer to other low-level game
+libraries, such as SDL.")
+ (license license:lgpl2.1+))))
+
(define-public libccd
(package
(name "libccd")
--
2.39.2
A
A
Adam Faiz wrote on 14 Mar 2023 08:02
[PATCH 2/5] gnu: Add futil.
(address . 62178@debbugs.gnu.org)
dbde991b-71c4-2083-c805-fe8c762d08a1@disroot.org
From ca7eeb834e5b53667d0ec945454d80794ee2a717 Mon Sep 17 00:00:00 2001
Message-Id: <ca7eeb834e5b53667d0ec945454d80794ee2a717.1678775193.git.adam.faiz@disroot.org>
In-Reply-To: <cover.1678775193.git.adam.faiz@disroot.org>
References: <cover.1678775193.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Tue, 14 Mar 2023 13:55:09 +0800
Subject: [PATCH 2/5] gnu: Add futil.

* gnu/packages/cpp.scm (futil): New variable.
* gnu/packages/patches/futil-Add-Makefile.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
gnu/local.mk | 1 +
gnu/packages/cpp.scm | 38 ++++++++
gnu/packages/patches/futil-Add-Makefile.patch | 91 +++++++++++++++++++
3 files changed, 130 insertions(+)
create mode 100644 gnu/packages/patches/futil-Add-Makefile.patch

Toggle diff (160 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index c2521acf02..1bdbddce5e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1133,6 +1133,7 @@ dist_patch_DATA = \
%D%/packages/patches/freeimage-unbundle.patch \
%D%/packages/patches/fuse-glibc-2.34.patch \
%D%/packages/patches/fuse-overlapping-headers.patch \
+ %D%/packages/patches/futil-Add-Makefile.patch \
%D%/packages/patches/fxdiv-system-libraries.patch \
%D%/packages/patches/gajim-honour-GAJIM_PLUGIN_PATH.patch \
%D%/packages/patches/ganeti-disable-version-symlinks.patch \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index ed6ae69198..69cda8aacc 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1216,6 +1216,44 @@ (define-public folly
(supported-systems '("aarch64-linux" "x86_64-linux"))
(license license:asl2.0)))
+(define-public futil
+ (let ((commit "83fcf85cf7638947a44657b2f334c2d8a2d5d02d")
+ (revision "0"))
+ (package
+ (name "futil")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/hydren/futil")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "05vyx6n4aqix3w1z76hal9zxzixfxnlw0cg4b06lc1l9gnw6ja71"))
+ (patches
+ (search-patches "futil-Add-Makefile.patch"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (for-each
+ (lambda (file)
+ (install-file file "include/futil"))
+ (find-files "." "\\.h"))))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:tests? #f ; no tests
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure))
+ #:make-flags
+ #~(list (string-append "DESTDIR=" #$output)
+ "PREFIX=")))
+ (home-page "https://gitlab.com/hydren/futil")
+ (synopsis "C++ utility code library")
+ (description "Futil is a set of C++ utility code and library headers.")
+ (license license:zlib))))
+
(define-public poco
(package
(name "poco")
diff --git a/gnu/packages/patches/futil-Add-Makefile.patch b/gnu/packages/patches/futil-Add-Makefile.patch
new file mode 100644
index 0000000000..2c5760d31b
--- /dev/null
+++ b/gnu/packages/patches/futil-Add-Makefile.patch
@@ -0,0 +1,91 @@
+From 29c2ab3931bc0749fb72d222b14a629170cea9e6 Mon Sep 17 00:00:00 2001
+From: AwesomeAdam54321 <adam.faiz@disroot.org>
+Date: Sun, 12 Mar 2023 00:47:56 +0800
+Subject: [PATCH] futil: Add Makefile.
+
+Adapted from https://gitlab.com/hydren/terrarium/-/blob/master/build/linux-gcc-sdl2-release/src_libs/futil/subdir.mk
+---
+ Makefile | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 71 insertions(+)
+ create mode 100644 Makefile
+
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..39d2275
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,71 @@
++################################################################################
++# Automatically-generated file. Do not edit!
++################################################################################
++
++# Add inputs and outputs from these tool invocations to the build variables
++CPP_SRCS += \
++exception.cpp \
++properties.cpp \
++stox.cpp \
++string_actions.cpp \
++string_extra_operators.cpp \
++string_parse.cpp \
++string_split.cpp
++
++C_SRCS += \
++chrono.c \
++random.c \
++round.c \
++snprintf.c \
++strtox.c
++
++OBJS += \
++chrono.so \
++exception.so \
++properties.so \
++random.so \
++round.so \
++snprintf.so \
++stox.so \
++string_actions.so \
++string_extra_operators.so \
++string_parse.so \
++string_split.so \
++strtox.so
++
++SRCDIR ?= .
++INCLUDE_PATH ?= ${SRCDIR}/include
++PREFIX ?= /usr/local
++
++all: libfutil.so
++
++libfutil.so: $(OBJS) $(USER_OBJS)
++ @echo 'Building target: $@'
++ @echo 'Invoking: GCC C++ Linker'
++ g++ -shared -o "libfutil.so" $(OBJS) $(USER_OBJS) $(LIBS)
++ @echo 'Finished building target: $@'
++ @echo ' '
++
++install: all
++ install -d $(DESTDIR)$(PREFIX)
++ cp -r include $(DESTDIR)$(PREFIX)
++ install -d $(DESTDIR)$(PREFIX)/lib
++ install -m 644 libfutil.so $(DESTDIR)$(PREFIX)/lib
++
++%.so: %.c
++ @echo 'Building file: $<'
++ @echo 'Invoking: GCC C Compiler'
++ gcc -O3 -Wall -shared -fPIC -I${INCLUDE_PATH} -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
++ @echo 'Finished building: $<'
++ @echo ' '
++
++%.so: %.cpp
++ @echo 'Building file: $<'
++ @echo 'Invoking: GCC C++ Compiler'
++ g++ -I${INCLUDE_PATH} -O3 -Wall -shared -fPIC -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
++ @echo 'Finished building: $<'
++ @echo ' '
++
++clean:
++ rm $(wildcard *.so)
++
+--
+2.39.2
+
--
2.39.2
A
A
Adam Faiz wrote on 14 Mar 2023 08:09
[PATCH 3/5] gnu: Add libgeramun.
(address . 62178@debbugs.gnu.org)
4a5cec1d-edac-a65d-c010-5a969c365e5b@disroot.org
From 03a5262a846175be5ce4c8e1b9ea6d199a46b4fa Mon Sep 17 00:00:00 2001
Message-Id: <03a5262a846175be5ce4c8e1b9ea6d199a46b4fa.1678775193.git.adam.faiz@disroot.org>
In-Reply-To: <cover.1678775193.git.adam.faiz@disroot.org>
References: <cover.1678775193.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Tue, 14 Mar 2023 14:02:58 +0800
Subject: [PATCH 3/5] gnu: Add libgeramun.

* gnu/packages/game-development.scm (libgeramun): New variable.
* gnu/packages/patches/libgeramun-Add-Makefile.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
gnu/local.mk | 1 +
gnu/packages/game-development.scm | 41 ++++++++++
.../patches/libgeramun-Add-Makefile.patch | 79 +++++++++++++++++++
3 files changed, 121 insertions(+)
create mode 100644 gnu/packages/patches/libgeramun-Add-Makefile.patch

Toggle diff (151 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 1bdbddce5e..228ec92bb1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1382,6 +1382,7 @@ dist_patch_DATA = \
%D%/packages/patches/libffi-3.3-powerpc-fixes.patch \
%D%/packages/patches/libffi-float128-powerpc64le.patch \
%D%/packages/patches/libgeotiff-fix-tests-with-proj-9.1.1.patch \
+ %D%/packages/patches/libgeramun-Add-Makefile.patch \
%D%/packages/patches/libobjc2-unbundle-robin-map.patch \
%D%/packages/patches/librime-fix-build-with-gcc10.patch \
%D%/packages/patches/libvirt-add-install-prefix.patch \
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index f86793fda0..57bffa9b88 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -2494,6 +2494,47 @@ (define-public libccd
a.k.a. XenoCollide) as described in Game Programming Gems 7.")
(license license:expat)))
+(define-public libgeramun
+ (let ((commit "29668d33266a00fa730d8ee5a16893a86ee2d04d")
+ (revision "0"))
+ (package
+ (name "libgeramun")
+ (version (git-version "0.14" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/hydren/libgeramun")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1nfsdyp3nnz33wxy54vnbbm50kr2y5h6q40kz6g1whz12lqmi79n"))
+ (patches
+ (search-patches "libgeramun-Add-Makefile.patch"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (for-each
+ (lambda (file)
+ (install-file file "include/libgeramun"))
+ (find-files "." "\\.h"))))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:tests? #f ; no tests
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure))
+ #:make-flags
+ #~(list (string-append "DESTDIR=" #$output)
+ "PREFIX=")))
+ (synopsis "Procedural platformer-game map generation library")
+ (description
+ "libgeramun is a set of
+stochastic, procedural platformer-game map generation routines.
+ The routines are meant to produce maps with a Terraria-like look and feel.")
+ (home-page "https://gitlab.com/hydren/libgeramun")
+ (license license:gpl2+))))
+
(define-public ode
(package
(name "ode")
diff --git a/gnu/packages/patches/libgeramun-Add-Makefile.patch b/gnu/packages/patches/libgeramun-Add-Makefile.patch
new file mode 100644
index 0000000000..01a94d6422
--- /dev/null
+++ b/gnu/packages/patches/libgeramun-Add-Makefile.patch
@@ -0,0 +1,79 @@
+From ac239d7be2755dc28fa831ba15a0fb318848a5a6 Mon Sep 17 00:00:00 2001
+From: AwesomeAdam54321 <adam.faiz@disroot.org>
+Date: Sun, 12 Mar 2023 01:30:46 +0800
+Subject: [PATCH] libgeramun: Add Makefile.
+
+Adapted from https://gitlab.com/hydren/terrarium/-/raw/master/build/linux-gcc-sdl2-release/src_libs/libgeramun/subdir.mk
+---
+ Makefile | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 59 insertions(+)
+ create mode 100644 Makefile
+
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..8d37ce4
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,59 @@
++################################################################################
++# Automatically-generated file. Do not edit!
++################################################################################
++
++# Add inputs and outputs from these tool invocations to the build variables
++CPP_SRCS += \
++brush.cpp \
++cave.cpp \
++debug.cpp \
++generators.cpp \
++midpoint_displacement.cpp \
++miners.cpp \
++preview_callback.cpp \
++random_walk.cpp \
++spring.cpp \
++surf_replacer.cpp
++
++OBJS += \
++brush.so \
++cave.so \
++debug.so \
++generators.so \
++midpoint_displacement.so \
++miners.so \
++preview_callback.so \
++random_walk.so \
++spring.so \
++surf_replacer.so
++
++SRCDIR ?= .
++INCLUDE_PATH ?= ${SRCDIR}/include
++PREFIX ?= /usr/local
++
++all: libgeramun.so
++
++libgeramun.so: $(OBJS) $(USER_OBJS)
++ @echo 'Building target: $@'
++ @echo 'Invoking: GCC C++ Linker'
++ g++ -shared -o "libgeramun.so" $(OBJS) $(USER_OBJS) $(LIBS)
++ @echo 'Finished building target: $@'
++ @echo ' '
++
++install: all
++ install -d $(DESTDIR)$(PREFIX)
++ cp -r include $(DESTDIR)$(PREFIX)
++ install -d $(DESTDIR)$(PREFIX)/lib
++ install -m 644 libgeramun.so $(DESTDIR)$(PREFIX)/lib
++
++%.so: %.cpp
++ @echo 'Building file: $<'
++ @echo 'Invoking: GCC C++ Compiler'
++ g++ -I${INCLUDE_PATH} -O3 -Wall -shared -fPIC -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
++ @echo 'Finished building: $<'
++ @echo ' '
++
++clean:
++ rm $(wildcard *.so)
++
++
+--
+2.39.2
+
--
2.39.2
A
A
Adam Faiz wrote on 14 Mar 2023 08:11
[PATCH 4/5] gnu: Add rapidxml.
(address . 62178@debbugs.gnu.org)
d1c742da-b1bc-2421-c5b6-b8690d5beea5@disroot.org
From f103aa078174b6b2d1ae733546a73eeb1ed853c3 Mon Sep 17 00:00:00 2001
Message-Id: <f103aa078174b6b2d1ae733546a73eeb1ed853c3.1678775193.git.adam.faiz@disroot.org>
In-Reply-To: <cover.1678775193.git.adam.faiz@disroot.org>
References: <cover.1678775193.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Tue, 14 Mar 2023 14:07:08 +0800
Subject: [PATCH 4/5] gnu: Add rapidxml.

* gnu/packages/xml.scm (rapidxml): New variable.
---
gnu/packages/xml.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 0b26a63e85..c8dbd27772 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -76,6 +76,7 @@ (define-module (gnu packages xml)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system cmake)
+ #:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
#:use-module (guix build-system meson)
#:use-module (guix build-system perl)
@@ -1983,3 +1984,32 @@ (define-public python-xmltodict
(description "This package provides a Python library to convert XML to
@code{OrderedDict}.")
(license license:expat)))
+
+(define-public rapidxml
+ (package
+ (name "rapidxml")
+ (version "1.13")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://sourceforge.net/projects/"
+ "rapidxml/files/rapidxml/rapidxml%20"
+ version "/rapidxml-" version ".zip"))
+ (sha256
+ (base32
+ "0w9mbdgshr6sh6a5jr10lkdycjyvapbj7wxwz8hbp0a96y3biw63"))))
+ (build-system copy-build-system)
+ (native-inputs
+ (list unzip))
+ (arguments
+ (list
+ #:install-plan
+ #~'(("./" "include/rapidxml" #:include-regexp ("\\.hpp$")))))
+ (synopsis "XML Parser")
+ (description
+ "RapidXml is an attempt to create the fastest XML parser possible,
+while retaining useability, portability and reasonable W3C compatibility.
+ It is an in-situ parser written in modern C++, with parsing speed approaching
+that of strlen function executed on the same data.")
+ (home-page "https://rapidxml.sourceforge.net/")
+ (license license:boost1.0)))
--
2.39.2
A
A
Adam Faiz wrote on 14 Mar 2023 08:13
[PATCH 5/5] gnu: Add terrarium.
(address . 62178@debbugs.gnu.org)
7f959aa7-fbc9-d027-da03-7b6a7727274f@disroot.org
From 914d9ebcaffee24da73bb4d9711c0428ff36feb0 Mon Sep 17 00:00:00 2001
Message-Id: <914d9ebcaffee24da73bb4d9711c0428ff36feb0.1678775193.git.adam.faiz@disroot.org>
In-Reply-To: <cover.1678775193.git.adam.faiz@disroot.org>
References: <cover.1678775193.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Tue, 14 Mar 2023 14:19:59 +0800
Subject: [PATCH 5/5] gnu: Add terrarium.

* gnu/packages/games.scm (terrarium): New variable.
---
gnu/packages/games.scm | 96 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 96 insertions(+)

Toggle diff (109 lines)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 2946c787af..adcaba1248 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -618,6 +618,102 @@ (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"))
+ (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 "Terraria-clone game")
+ (description "Terrarium is an attempt to do a Terraria clone game,
+possibly with some new features.")
+ (license license:gpl2+))))
+
(define-public tetrinet
(package
(name "tetrinet")
--
2.39.2
L
L
Liliana Marie Prikler wrote on 14 Mar 2023 18:50
(address . iyzsong@envs.net)
5ef390460a8c1d531a6f2228403957a17e517652.camel@gmail.com
Am Dienstag, dem 14.03.2023 um 15:13 +0800 schrieb Adam Faiz:
Toggle quote (130 lines)
>  From 914d9ebcaffee24da73bb4d9711c0428ff36feb0 Mon Sep 17 00:00:00
> 2001
> Message-Id:
> <914d9ebcaffee24da73bb4d9711c0428ff36feb0.1678775193.git.adam.faiz@di
> sroot.org>
> In-Reply-To: <cover.1678775193.git.adam.faiz@disroot.org>
> References: <cover.1678775193.git.adam.faiz@disroot.org>
> From: AwesomeAdam54321 <adam.faiz@disroot.org>
> Date: Tue, 14 Mar 2023 14:19:59 +0800
> Subject: [PATCH 5/5] gnu: Add terrarium.
>
> * gnu/packages/games.scm (terrarium): New variable.
> ---
>   gnu/packages/games.scm | 96
> ++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 96 insertions(+)
>
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index 2946c787af..adcaba1248 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -618,6 +618,102 @@ (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"))
> +            (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 "Terraria-clone game")
> +    (description "Terrarium is an attempt to do a Terraria clone
> game,
> +possibly with some new features.")
A more helpful synopsis and description would be nice. See minetest as
a reference :)
L
L
Liliana Marie Prikler wrote on 14 Mar 2023 20:41
Re: [PATCH 3/5] gnu: Add libgeramun.
(address . iyzsong@envs.net)
f4aeb73a16444692ec979acf86a6265c95f864a3.camel@gmail.com
Am Dienstag, dem 14.03.2023 um 15:09 +0800 schrieb Adam Faiz:
Toggle quote (64 lines)
>  From 03a5262a846175be5ce4c8e1b9ea6d199a46b4fa Mon Sep 17 00:00:00
> 2001
> Message-Id:
> <03a5262a846175be5ce4c8e1b9ea6d199a46b4fa.1678775193.git.adam.faiz@di
> sroot.org>
> In-Reply-To: <cover.1678775193.git.adam.faiz@disroot.org>
> References: <cover.1678775193.git.adam.faiz@disroot.org>
> From: AwesomeAdam54321 <adam.faiz@disroot.org>
> Date: Tue, 14 Mar 2023 14:02:58 +0800
> Subject: [PATCH 3/5] gnu: Add libgeramun.
>
> * gnu/packages/game-development.scm (libgeramun): New variable.
> * gnu/packages/patches/libgeramun-Add-Makefile.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> ---
>   gnu/local.mk                                  |  1 +
>   gnu/packages/game-development.scm             | 41 ++++++++++
>   .../patches/libgeramun-Add-Makefile.patch     | 79
> +++++++++++++++++++
>   3 files changed, 121 insertions(+)
>   create mode 100644 gnu/packages/patches/libgeramun-Add-
> Makefile.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 1bdbddce5e..228ec92bb1 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -1382,6 +1382,7 @@ dist_patch_DATA
> =                                         \
>     %D%/packages/patches/libffi-3.3-powerpc-fixes.patch         \
>     %D%/packages/patches/libffi-float128-powerpc64le.patch      \
>     %D%/packages/patches/libgeotiff-fix-tests-with-proj-
> 9.1.1.patch     \
> +  %D%/packages/patches/libgeramun-Add-Makefile.patch   \
>     %D%/packages/patches/libobjc2-unbundle-robin-map.patch      \
>     %D%/packages/patches/librime-fix-build-with-gcc10.patch     \
>     %D%/packages/patches/libvirt-add-install-prefix.patch       \
> diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-
> development.scm
> index f86793fda0..57bffa9b88 100644
> --- a/gnu/packages/game-development.scm
> +++ b/gnu/packages/game-development.scm
> @@ -2494,6 +2494,47 @@ (define-public libccd
>   a.k.a. XenoCollide) as described in Game Programming Gems 7.")
>       (license license:expat)))
>  
> +(define-public libgeramun
> +  (let ((commit "29668d33266a00fa730d8ee5a16893a86ee2d04d")
> +             (revision "0"))
> +  (package
> +    (name "libgeramun")
> +    (version (git-version "0.14" revision commit))
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://gitlab.com/hydren/libgeramun")
> +                    (commit commit)))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +               
> "1nfsdyp3nnz33wxy54vnbbm50kr2y5h6q40kz6g1whz12lqmi79n"))
> +              (patches
> +               (search-patches "libgeramun-Add-Makefile.patch"))
We prefer not to add too many capital letters.
Toggle quote (7 lines)
> +              (modules '((guix build utils)))
> +              (snippet
> +               #~(begin
> +                   (for-each
> +                    (lambda (file)
> +                      (install-file file "include/libgeramun"))
> +                    (find-files "." "\\.h"))))))
This only matches the .hpp files by accident. Use "\\.h(pp)?$"
instead.
Toggle quote (15 lines)
> +    (build-system gnu-build-system)
> +    (arguments
> +     (list #:tests? #f ; no tests
> +           #:phases
> +           #~(modify-phases %standard-phases
> +               (delete 'configure))
> +           #:make-flags
> +           #~(list (string-append "DESTDIR=" #$output)
> +                   "PREFIX=")))
> +    (synopsis "Procedural platformer-game map generation library")
> +    (description
> +     "libgeramun is a set of
> +stochastic, procedural platformer-game map generation routines.
> +  The routines are meant to produce maps with a Terraria-like look
> and feel.")
Don't break lines abruptly. Also, you don't need to indent the
beginning of sentences.
Toggle quote (64 lines)
> +    (license license:gpl2+))))
> +
>   (define-public ode
>     (package
>       (name "ode")
> diff --git a/gnu/packages/patches/libgeramun-Add-Makefile.patch
> b/gnu/packages/patches/libgeramun-Add-Makefile.patch
> new file mode 100644
> index 0000000000..01a94d6422
> --- /dev/null
> +++ b/gnu/packages/patches/libgeramun-Add-Makefile.patch
> @@ -0,0 +1,79 @@
> +From ac239d7be2755dc28fa831ba15a0fb318848a5a6 Mon Sep 17 00:00:00
> 2001
> +From: AwesomeAdam54321 <adam.faiz@disroot.org>
> +Date: Sun, 12 Mar 2023 01:30:46 +0800
> +Subject: [PATCH] libgeramun: Add Makefile.
> +
> +Adapted from
> https://gitlab.com/hydren/terrarium/-/raw/master/build/linux-gcc-sdl2-release/src_libs/libgeramun/subdir.mk
> +---
> + Makefile | 59
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> + 1 file changed, 59 insertions(+)
> + create mode 100644 Makefile
> +
> +diff --git a/Makefile b/Makefile
> +new file mode 100644
> +index 0000000..8d37ce4
> +--- /dev/null
> ++++ b/Makefile
> +@@ -0,0 +1,59 @@
> ++###################################################################
> #############
> ++# Automatically-generated file. Do not edit!
> ++###################################################################
> #############
> ++
> ++# Add inputs and outputs from these tool invocations to the build
> variables
> ++CPP_SRCS += \
> ++brush.cpp \
> ++cave.cpp \
> ++debug.cpp \
> ++generators.cpp \
> ++midpoint_displacement.cpp \
> ++miners.cpp \
> ++preview_callback.cpp \
> ++random_walk.cpp \
> ++spring.cpp \
> ++surf_replacer.cpp
> ++
> ++OBJS += \
> ++brush.so \
> ++cave.so \
> ++debug.so \
> ++generators.so \
> ++midpoint_displacement.so \
> ++miners.so \
> ++preview_callback.so \
> ++random_walk.so \
> ++spring.so \
> ++surf_replacer.so
Is it really necessary to make all of the objects shared?

Toggle quote (24 lines)
> ++SRCDIR ?= .
> ++INCLUDE_PATH ?= ${SRCDIR}/include
> ++PREFIX ?= /usr/local
> ++
> ++all: libgeramun.so
> ++
> ++libgeramun.so: $(OBJS) $(USER_OBJS)
> ++      @echo 'Building target: $@'
> ++      @echo 'Invoking: GCC C++ Linker'
> ++      g++ -shared -o "libgeramun.so" $(OBJS) $(USER_OBJS) $(LIBS)
> ++      @echo 'Finished building target: $@'
> ++      @echo ' '
> ++
> ++install: all
> ++      install -d $(DESTDIR)$(PREFIX)
> ++      cp -r include $(DESTDIR)$(PREFIX)
> ++      install -d $(DESTDIR)$(PREFIX)/lib
> ++      install -m 644 libgeramun.so $(DESTDIR)$(PREFIX)/lib
> ++
> ++%.so: %.cpp
> ++      @echo 'Building file: $<'
> ++      @echo 'Invoking: GCC C++ Compiler'
> ++      g++ -I${INCLUDE_PATH} -O3 -Wall -shared -fPIC -c -fmessage-
> length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
I think some of this ought to be abstracted into CFLAGS and similar
variables.


Also note that a Makefile isn't strictly needed.
You could just as well
(apply invoke #$(cc-for-target) "-shared" "-o" "libgeramun.so"
;; some more CFLAGS
(find-files "." "\\.cpp"))

Cheers
A
A
Adam Faiz wrote on 16 Mar 2023 07:26
[PATCH v1 1/5] gnu: Add fgeal.
(address . 62178@debbugs.gnu.org)
6aa63f14-d96a-3777-417a-ed49c6c65294@disroot.org
From 735f08bc3d271959685e03d761f5ac9039e5cfd3 Mon Sep 17 00:00:00 2001
Message-Id: <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Tue, 14 Mar 2023 13:38:36 +0800
Subject: [PATCH v1 1/5] gnu: Add fgeal.

* gnu/packages/game-development.scm (fgeal): New variable.
---
gnu/packages/game-development.scm | 106 ++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)

Toggle diff (121 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index a384572a9d..cbededa8e4 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -2359,6 +2359,112 @@ (define-public flatzebra
double-buffering.")
(license license:gpl2+)))
+(define-public fgeal
+ (let ((commit "0ae72fbf31eb2e133fe83520391e7a82c0b59e67")
+ (revision "0"))
+ (package
+ (name "fgeal")
+ (version (git-version "0.8.4" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/hydren/fgeal")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0lck86n8nkhb088bd0jg4imi9j5l1lwfr2pddqqr880rjrnnm8fw"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (with-directory-excursion "project/build/linux-gcc-sdl2-release"
+ (rename-file "configure.sh" "configure")
+ (substitute* "configure"
+ (("-exec sed -i")
+ (string-append
+ "-exec sed -i"
+ " \"s,SDL2_CFLAGS,`pkg-config --cflags sdl2`,g\" {} \\;"
+ " -exec sed -i"))
+ (("which") "type -p"))
+ (substitute* "makefile"
+ (("RM := rm -rf")
+ (string-append "RM := rm -rf\n"
+ "PREFIX ?= /usr/local"))
+ (("clean:")
+ (string-append
+ "install:\n\t"
+ "install -d $(DESTDIR)$(PREFIX)/include\n\t"
+ "cp -r ../fgeal $(DESTDIR)$(PREFIX)/include\n\t"
+ "install -d $(DESTDIR)$(PREFIX)/lib\n\t"
+ "install -m 644 libfgeal.so $(DESTDIR)$(PREFIX)/lib\n\n"
+ "clean:")))
+ (substitute* "extra/subdir.mk"
+ (("../extra/input_manager.cpp \\\\")
+ (string-append "../extra/input_manager.cpp \\\n"
+ "../extra/primitives.cpp \\"))
+ (("./extra/input_manager.o \\\\")
+ (string-append "./extra/input_manager.o \\\n"
+ "./extra/primitives.o \\"))
+ (("./extra/input_manager.d \\\\")
+ (string-append "./extra/input_manager.d \\\n"
+ "./extra/primitives.d \\"))))
+ (copy-recursively "project/build/linux-gcc-sdl2-release"
+ "linux-gcc-sdl2-release")
+ (substitute* (find-files "." "\\.mk")
+ (("-I\"BUILD_PATH\"") "-I\"BUILD_PATH\" SDL2_CFLAGS"))
+ (for-each
+ (lambda (file)
+ (install-file file "fgeal"))
+ '("agnostic_cached_drawable_text.hxx"
+ "agnostic_filesystem.hxx"
+ "agnostic_sound_stream.hxx"
+ "colors.hpp"
+ "core.hpp"
+ "display.hpp"
+ "event.hpp"
+ "exceptions.hpp"
+ "fgeal.hpp"
+ "filesystem.hpp"
+ "font.hpp"
+ "friend_classes.hxx"
+ "generic_graphics.hxx"
+ "geometry.hpp"
+ "graphics.hpp"
+ "image.hpp"
+ "input.hpp"
+ "sound.hpp"
+ "version.h"))
+ (for-each
+ (lambda (file)
+ (install-file file "fgeal/extra"))
+ (find-files "extra" "\\.hpp$"))))))
+ (build-system gnu-build-system)
+ (native-inputs
+ (list pkg-config))
+ (inputs
+ (list sdl2
+ sdl2-gfx
+ sdl2-image
+ sdl2-mixer
+ sdl2-ttf))
+ (arguments
+ (list #:tests? #f ; no tests
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'configure 'chdir
+ (lambda _
+ (chdir "linux-gcc-sdl2-release"))))
+ #:make-flags
+ #~(list (string-append "DESTDIR=" #$output)
+ "PREFIX=")))
+ (home-page "https://gitlab.com/hydren/fgeal")
+ (synopsis "Simple C++ game library wrapper")
+ (description "fgeal is a simple C++ wrapper library meant to provide
+common functionalities between some game libraries through a single API.
+ It serves as a cross-platform abstraction layer to other low-level game
+libraries, such as SDL.")
+ (license license:lgpl2.1+))))
+
(define-public libccd
(package
(name "libccd")

base-commit: 5befcff66edb4d72ab8e713c81836fb8519ce3e6
--
2.39.2
A
A
Adam Faiz wrote on 16 Mar 2023 07:29
[PATCH v1 2/5] gnu: Add futil.
(address . 62178@debbugs.gnu.org)
d6919530-2e0e-0895-7cb4-1c6523d80f68@disroot.org
From 53d9b1d0ab260a2b2aa4ee84dd00f97517c381db Mon Sep 17 00:00:00 2001
Message-Id: <53d9b1d0ab260a2b2aa4ee84dd00f97517c381db.1678947948.git.adam.faiz@disroot.org>
In-Reply-To: <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@disroot.org>
References: <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Tue, 14 Mar 2023 13:55:09 +0800
Subject: [PATCH v1 2/5] gnu: Add futil.

* gnu/packages/cpp.scm (futil): New variable.
* gnu/packages/patches/futil-add-makefile.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
gnu/local.mk | 1 +
gnu/packages/cpp.scm | 38 ++++++++
gnu/packages/patches/futil-add-makefile.patch | 92 +++++++++++++++++++
3 files changed, 131 insertions(+)
create mode 100644 gnu/packages/patches/futil-add-makefile.patch

Toggle diff (161 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index c2521acf02..76129c9d82 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1133,6 +1133,7 @@ dist_patch_DATA = \
%D%/packages/patches/freeimage-unbundle.patch \
%D%/packages/patches/fuse-glibc-2.34.patch \
%D%/packages/patches/fuse-overlapping-headers.patch \
+ %D%/packages/patches/futil-add-makefile.patch \
%D%/packages/patches/fxdiv-system-libraries.patch \
%D%/packages/patches/gajim-honour-GAJIM_PLUGIN_PATH.patch \
%D%/packages/patches/ganeti-disable-version-symlinks.patch \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index ed6ae69198..5b146b3f4a 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1216,6 +1216,44 @@ (define-public folly
(supported-systems '("aarch64-linux" "x86_64-linux"))
(license license:asl2.0)))
+(define-public futil
+ (let ((commit "83fcf85cf7638947a44657b2f334c2d8a2d5d02d")
+ (revision "0"))
+ (package
+ (name "futil")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/hydren/futil")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "05vyx6n4aqix3w1z76hal9zxzixfxnlw0cg4b06lc1l9gnw6ja71"))
+ (patches
+ (search-patches "futil-add-makefile.patch"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (for-each
+ (lambda (file)
+ (install-file file "include/futil"))
+ (find-files "." "\\.h(pp)?$"))))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:tests? #f ; no tests
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure))
+ #:make-flags
+ #~(list (string-append "DESTDIR=" #$output)
+ "PREFIX=")))
+ (home-page "https://gitlab.com/hydren/futil")
+ (synopsis "C++ utility code library")
+ (description "Futil is a set of C++ utility code and library headers.")
+ (license license:zlib))))
+
(define-public poco
(package
(name "poco")
diff --git a/gnu/packages/patches/futil-add-makefile.patch b/gnu/packages/patches/futil-add-makefile.patch
new file mode 100644
index 0000000000..c580128f5e
--- /dev/null
+++ b/gnu/packages/patches/futil-add-makefile.patch
@@ -0,0 +1,92 @@
+From da31e9bb1abd95d81b4d4eb18888e41c30092fb9 Mon Sep 17 00:00:00 2001
+From: AwesomeAdam54321 <adam.faiz@disroot.org>
+Date: Sun, 12 Mar 2023 00:47:56 +0800
+Subject: [PATCH] futil: add makefile.
+
+Adapted from https://gitlab.com/hydren/terrarium/-/raw/master/build/linux-gcc-sdl2-release/src_libs/futil/subdir.mk
+---
+ Makefile | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 72 insertions(+)
+ create mode 100644 Makefile
+
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..a97ea48
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,72 @@
++################################################################################
++# Automatically-generated file. Do not edit!
++################################################################################
++
++# Add inputs and outputs from these tool invocations to the build variables
++CPP_SRCS += \
++exception.cpp \
++properties.cpp \
++stox.cpp \
++string_actions.cpp \
++string_extra_operators.cpp \
++string_parse.cpp \
++string_split.cpp
++
++C_SRCS += \
++chrono.c \
++random.c \
++round.c \
++snprintf.c \
++strtox.c
++
++OBJS += \
++chrono.o \
++exception.o \
++properties.o \
++random.o \
++round.o \
++snprintf.o \
++stox.o \
++string_actions.o \
++string_extra_operators.o \
++string_parse.o \
++string_split.o \
++strtox.o
++
++SRCDIR ?= .
++INCLUDE_PATH ?= ${SRCDIR}/include
++PREFIX ?= /usr/local
++CFLAGS = -O3 -Wall -fPIC -c -fmessage-length=0 -MMD -MP
++
++all: libfutil.so
++
++libfutil.so: $(OBJS) $(USER_OBJS)
++ @echo 'Building target: $@'
++ @echo 'Invoking: GCC C++ Linker'
++ g++ -shared -o "libfutil.so" $(OBJS) $(USER_OBJS) $(LIBS)
++ @echo 'Finished building target: $@'
++ @echo ' '
++
++install: all
++ install -d $(DESTDIR)$(PREFIX)
++ cp -r include $(DESTDIR)$(PREFIX)
++ install -d $(DESTDIR)$(PREFIX)/lib
++ install -m 644 libfutil.so $(DESTDIR)$(PREFIX)/lib
++
++%.o: %.c
++ @echo 'Building file: $<'
++ @echo 'Invoking: GCC C Compiler'
++ gcc -I${INCLUDE_PATH} $(CFLAGS) -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
++ @echo 'Finished building: $<'
++ @echo ' '
++
++%.o: %.cpp
++ @echo 'Building file: $<'
++ @echo 'Invoking: GCC C++ Compiler'
++ g++ -I${INCLUDE_PATH} $(CFLAGS) -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
++ @echo 'Finished building: $<'
++ @echo ' '
++
++clean:
++ rm $(wildcard *.o) libfutil.so
++
+--
+2.39.2
+
--
2.39.2
A
A
Adam Faiz wrote on 16 Mar 2023 07:30
[PATCH v1 3/5] gnu: Add libgeramun.
(address . 62178@debbugs.gnu.org)
71f085a9-4ea6-a8b2-1f18-b7967f86d881@disroot.org
From bffbe04a9c180de7e883f4c5b74c5041b7ee80f0 Mon Sep 17 00:00:00 2001
Message-Id: <bffbe04a9c180de7e883f4c5b74c5041b7ee80f0.1678947948.git.adam.faiz@disroot.org>
In-Reply-To: <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@disroot.org>
References: <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Tue, 14 Mar 2023 14:02:58 +0800
Subject: [PATCH v1 3/5] gnu: Add libgeramun.

* gnu/packages/game-development.scm (libgeramun): New variable.
* gnu/packages/patches/libgeramun-add-makefile.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
gnu/local.mk | 1 +
gnu/packages/game-development.scm | 41 ++++++++++
.../patches/libgeramun-add-makefile.patch | 80 +++++++++++++++++++
3 files changed, 122 insertions(+)
create mode 100644 gnu/packages/patches/libgeramun-add-makefile.patch

Toggle diff (152 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 76129c9d82..7396208a9b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1382,6 +1382,7 @@ dist_patch_DATA = \
%D%/packages/patches/libffi-3.3-powerpc-fixes.patch \
%D%/packages/patches/libffi-float128-powerpc64le.patch \
%D%/packages/patches/libgeotiff-fix-tests-with-proj-9.1.1.patch \
+ %D%/packages/patches/libgeramun-add-makefile.patch \
%D%/packages/patches/libobjc2-unbundle-robin-map.patch \
%D%/packages/patches/librime-fix-build-with-gcc10.patch \
%D%/packages/patches/libvirt-add-install-prefix.patch \
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index cbededa8e4..021a206326 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -2494,6 +2494,47 @@ (define-public libccd
a.k.a. XenoCollide) as described in Game Programming Gems 7.")
(license license:expat)))
+(define-public libgeramun
+ (let ((commit "29668d33266a00fa730d8ee5a16893a86ee2d04d")
+ (revision "0"))
+ (package
+ (name "libgeramun")
+ (version (git-version "0.14" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/hydren/libgeramun")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1nfsdyp3nnz33wxy54vnbbm50kr2y5h6q40kz6g1whz12lqmi79n"))
+ (patches
+ (search-patches "libgeramun-add-makefile.patch"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (for-each
+ (lambda (file)
+ (install-file file "include/libgeramun"))
+ (find-files "." "\\.h(pp)?$"))))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:tests? #f ; no tests
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure))
+ #:make-flags
+ #~(list (string-append "DESTDIR=" #$output)
+ "PREFIX=")))
+ (synopsis "Procedural platformer-game map generation library")
+ (description
+ "libgeramun is a set of stochastic, procedural platformer-game map
+generation routines.
+The routines are meant to produce maps with a Terraria-like look and feel.")
+ (home-page "https://gitlab.com/hydren/libgeramun")
+ (license license:gpl2+))))
+
(define-public ode
(package
(name "ode")
diff --git a/gnu/packages/patches/libgeramun-add-makefile.patch b/gnu/packages/patches/libgeramun-add-makefile.patch
new file mode 100644
index 0000000000..b61e730526
--- /dev/null
+++ b/gnu/packages/patches/libgeramun-add-makefile.patch
@@ -0,0 +1,80 @@
+From 38f790a0526de3ca74480e8e3f7504ff648ba272 Mon Sep 17 00:00:00 2001
+From: AwesomeAdam54321 <adam.faiz@disroot.org>
+Date: Sun, 12 Mar 2023 01:30:46 +0800
+Subject: [PATCH] libgeramun: add makefile.
+
+Adapted from https://gitlab.com/hydren/terrarium/-/raw/master/build/linux-gcc-sdl2-release/src_libs/libgeramun/subdir.mk
+---
+ Makefile | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 60 insertions(+)
+ create mode 100644 Makefile
+
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..38608c1
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,60 @@
++################################################################################
++# Automatically-generated file. Do not edit!
++################################################################################
++
++# Add inputs and outputs from these tool invocations to the build variables
++CPP_SRCS += \
++brush.cpp \
++cave.cpp \
++debug.cpp \
++generators.cpp \
++midpoint_displacement.cpp \
++miners.cpp \
++preview_callback.cpp \
++random_walk.cpp \
++spring.cpp \
++surf_replacer.cpp
++
++OBJS += \
++brush.o \
++cave.o \
++debug.o \
++generators.o \
++midpoint_displacement.o \
++miners.o \
++preview_callback.o \
++random_walk.o \
++spring.o \
++surf_replacer.o
++
++SRCDIR ?= .
++INCLUDE_PATH ?= ${SRCDIR}/include
++PREFIX ?= /usr/local
++CFLAGS = -O3 -Wall -fPIC -c -fmessage-length=0 -MMD -MP
++
++all: libgeramun.so
++
++libgeramun.so: $(OBJS) $(USER_OBJS)
++ @echo 'Building target: $@'
++ @echo 'Invoking: GCC C++ Linker'
++ g++ -shared -o "libgeramun.so" $(OBJS) $(USER_OBJS) $(LIBS)
++ @echo 'Finished building target: $@'
++ @echo ' '
++
++install: all
++ install -d $(DESTDIR)$(PREFIX)
++ cp -r include $(DESTDIR)$(PREFIX)
++ install -d $(DESTDIR)$(PREFIX)/lib
++ install -m 644 libgeramun.so $(DESTDIR)$(PREFIX)/lib
++
++%.o: %.cpp
++ @echo 'Building file: $<'
++ @echo 'Invoking: GCC C++ Compiler'
++ g++ -I${INCLUDE_PATH} $(CFLAGS) -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
++ @echo 'Finished building: $<'
++ @echo ' '
++
++clean:
++ rm $(wildcard *.o) libgeramun.so
++
++
+--
+2.39.2
+
--
2.39.2
A
A
Adam Faiz wrote on 16 Mar 2023 07:31
[PATCH v1 4/5] gnu: Add rapidxml.
(address . 62178@debbugs.gnu.org)
00d3c326-8ae2-86ad-5d4c-466334ad3c93@disroot.org
From 470ac3c7e5cea2c08a64745037cd73af59027c26 Mon Sep 17 00:00:00 2001
Message-Id: <470ac3c7e5cea2c08a64745037cd73af59027c26.1678947948.git.adam.faiz@disroot.org>
In-Reply-To: <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@disroot.org>
References: <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Tue, 14 Mar 2023 14:07:08 +0800
Subject: [PATCH v1 4/5] gnu: Add rapidxml.

* gnu/packages/xml.scm (rapidxml): New variable.
---
gnu/packages/xml.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 0b26a63e85..c8dbd27772 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -76,6 +76,7 @@ (define-module (gnu packages xml)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system cmake)
+ #:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
#:use-module (guix build-system meson)
#:use-module (guix build-system perl)
@@ -1983,3 +1984,32 @@ (define-public python-xmltodict
(description "This package provides a Python library to convert XML to
@code{OrderedDict}.")
(license license:expat)))
+
+(define-public rapidxml
+ (package
+ (name "rapidxml")
+ (version "1.13")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://sourceforge.net/projects/"
+ "rapidxml/files/rapidxml/rapidxml%20"
+ version "/rapidxml-" version ".zip"))
+ (sha256
+ (base32
+ "0w9mbdgshr6sh6a5jr10lkdycjyvapbj7wxwz8hbp0a96y3biw63"))))
+ (build-system copy-build-system)
+ (native-inputs
+ (list unzip))
+ (arguments
+ (list
+ #:install-plan
+ #~'(("./" "include/rapidxml" #:include-regexp ("\\.hpp$")))))
+ (synopsis "XML Parser")
+ (description
+ "RapidXml is an attempt to create the fastest XML parser possible,
+while retaining useability, portability and reasonable W3C compatibility.
+ It is an in-situ parser written in modern C++, with parsing speed approaching
+that of strlen function executed on the same data.")
+ (home-page "https://rapidxml.sourceforge.net/")
+ (license license:boost1.0)))
--
2.39.2
A
A
Adam Faiz wrote on 16 Mar 2023 07:32
[PATCH v1 5/5] gnu: Add terrarium.
(address . 62178@debbugs.gnu.org)
051317d0-87ca-d0bd-4e1c-4a7b2fb1a6e3@disroot.org
From e041b01dd31b915ac042ca0e30cbcbd0cf9c62df Mon Sep 17 00:00:00 2001
Message-Id: <e041b01dd31b915ac042ca0e30cbcbd0cf9c62df.1678947948.git.adam.faiz@disroot.org>
In-Reply-To: <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@disroot.org>
References: <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@disroot.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(+)

Toggle diff (110 lines)
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"))
+ (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")
--
2.39.2
A
A
Adam Faiz wrote on 18 Apr 2023 16:34
Re: [PATCH 5/5] gnu: Add terrarium.
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 62178@debbugs.gnu.org)
cdb26182-e0c1-be7d-119e-f7c4374aa84e@disroot.org
Hi Liliana,

Could you review my v1 revision of the patchset? I think it addresses the problems you mentioned with the first set of patches I sent.
L
L
Liliana Marie Prikler wrote on 18 Apr 2023 18:50
Re: [PATCH v1 1/5] gnu: Add fgeal.
cfb26f304877a4bc91866692a02fa1efcd9b4fce.camel@gmail.com
Am Donnerstag, dem 16.03.2023 um 14:26 +0800 schrieb Adam Faiz:
Toggle quote (53 lines)
>  From 735f08bc3d271959685e03d761f5ac9039e5cfd3 Mon Sep 17 00:00:00
> 2001
> Message-Id:
> <735f08bc3d271959685e03d761f5ac9039e5cfd3.1678947948.git.adam.faiz@di
> sroot.org>
> From: AwesomeAdam54321 <adam.faiz@disroot.org>
> Date: Tue, 14 Mar 2023 13:38:36 +0800
> Subject: [PATCH v1 1/5] gnu: Add fgeal.
>
> * gnu/packages/game-development.scm (fgeal): New variable.
> ---
>   gnu/packages/game-development.scm | 106
> ++++++++++++++++++++++++++++++
>   1 file changed, 106 insertions(+)
>
> diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-
> development.scm
> index a384572a9d..cbededa8e4 100644
> --- a/gnu/packages/game-development.scm
> +++ b/gnu/packages/game-development.scm
> @@ -2359,6 +2359,112 @@ (define-public flatzebra
>   double-buffering.")
>       (license license:gpl2+)))
>  
> +(define-public fgeal
> +  (let ((commit "0ae72fbf31eb2e133fe83520391e7a82c0b59e67")
> +        (revision "0"))
> +  (package
> +    (name "fgeal")
> +    (version (git-version "0.8.4" revision commit))
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://gitlab.com/hydren/fgeal")
> +             (commit commit)))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32
> "0lck86n8nkhb088bd0jg4imi9j5l1lwfr2pddqqr880rjrnnm8fw"))
> +       (modules '((guix build utils)))
> +       (snippet
> +        #~(begin
> +            (with-directory-excursion "project/build/linux-gcc-sdl2-
> release"
> +              (rename-file "configure.sh" "configure")
> +              (substitute* "configure"
> +                (("-exec sed -i")
> +                 (string-append
> +                 "-exec sed -i"
> +                 " \"s,SDL2_CFLAGS,`pkg-config --cflags sdl2`,g\" {}
> \\;"
> +                 " -exec sed -i"))
Capture the existing match with a variable, then use that variable.
Toggle quote (5 lines)
> +                (("which") "type -p"))
> +              (substitute* "makefile"
> +                (("RM := rm -rf")
> +                 (string-append "RM := rm -rf\n"
> +                                "PREFIX ?= /usr/local"))
Same here.
Toggle quote (9 lines)
> +                (("clean:")
> +                 (string-append
> +                  "install:\n\t"
> +                  "install -d $(DESTDIR)$(PREFIX)/include\n\t"
> +                  "cp -r ../fgeal $(DESTDIR)$(PREFIX)/include\n\t"
> +                  "install -d $(DESTDIR)$(PREFIX)/lib\n\t"
> +                  "install -m 644 libfgeal.so
> $(DESTDIR)$(PREFIX)/lib\n\n"
> +                  "clean:")))
Simply replace the install phase instead.
Toggle quote (36 lines)
> +              (substitute* "extra/subdir.mk"
> +                (("../extra/input_manager.cpp \\\\")
> +                 (string-append "../extra/input_manager.cpp \\\n"
> +                                "../extra/primitives.cpp \\"))
> +                (("./extra/input_manager.o \\\\")
> +                 (string-append "./extra/input_manager.o \\\n"
> +                                "./extra/primitives.o \\"))
> +                (("./extra/input_manager.d \\\\")
> +                 (string-append "./extra/input_manager.d \\\n"
> +                                "./extra/primitives.d \\"))))
> +            (copy-recursively "project/build/linux-gcc-sdl2-release"
> +                              "linux-gcc-sdl2-release")
> +            (substitute* (find-files "." "\\.mk")
> +              (("-I\"BUILD_PATH\"") "-I\"BUILD_PATH\" SDL2_CFLAGS"))
> +            (for-each
> +             (lambda (file)
> +               (install-file file "fgeal"))
> +             '("agnostic_cached_drawable_text.hxx"
> +               "agnostic_filesystem.hxx"
> +               "agnostic_sound_stream.hxx"
> +               "colors.hpp"
> +               "core.hpp"
> +               "display.hpp"
> +               "event.hpp"
> +               "exceptions.hpp"
> +               "fgeal.hpp"
> +               "filesystem.hpp"
> +               "font.hpp"
> +               "friend_classes.hxx"
> +               "generic_graphics.hxx"
> +               "geometry.hpp"
> +               "graphics.hpp"
> +               "image.hpp"
> +               "input.hpp"
> +               "sound.hpp"
> +               "version.h"))
Why is it necessary to move these files? Also, could this perhaps be
expressed via find-files?
Toggle quote (39 lines)
> +            (for-each
> +             (lambda (file)
> +               (install-file file "fgeal/extra"))
> +             (find-files "extra" "\\.hpp$"))))))
> +    (build-system gnu-build-system)
> +    (native-inputs
> +     (list pkg-config))
> +    (inputs
> +     (list sdl2
> +           sdl2-gfx
> +           sdl2-image
> +           sdl2-mixer
> +           sdl2-ttf))
> +    (arguments
> +     (list #:tests? #f ; no tests
> +           #:phases
> +           #~(modify-phases %standard-phases
> +               (add-before 'configure 'chdir
> +                 (lambda _
> +                   (chdir "linux-gcc-sdl2-release"))))
> +           #:make-flags
> +           #~(list (string-append "DESTDIR=" #$output)
> +                   "PREFIX=")))
> +    (home-page "https://gitlab.com/hydren/fgeal")
> +    (synopsis "Simple C++ game library wrapper")
> +    (description "fgeal is a simple C++ wrapper library meant to
> provide
> +common functionalities between some game libraries through a single
> API.
> +  It serves as a cross-platform abstraction layer to other low-level
> game
> +libraries, such as SDL.")
> +    (license license:lgpl2.1+))))
> +
>   (define-public libccd
>     (package
>       (name "libccd")
>
> base-commit: 5befcff66edb4d72ab8e713c81836fb8519ce3e6
Cheers
L
L
Liliana Marie Prikler wrote on 18 Apr 2023 18:55
Re: [PATCH v1 2/5] gnu: Add futil.
8ce5eaaddb8e80d074acd2b5b6c967f5d1fd52f7.camel@gmail.com
Am Donnerstag, dem 16.03.2023 um 14:29 +0800 schrieb Adam Faiz:
Toggle quote (72 lines)
>  From 53d9b1d0ab260a2b2aa4ee84dd00f97517c381db Mon Sep 17 00:00:00
> 2001
> Message-Id:
> <53d9b1d0ab260a2b2aa4ee84dd00f97517c381db.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 13:55:09 +0800
> Subject: [PATCH v1 2/5] gnu: Add futil.
>
> * gnu/packages/cpp.scm (futil): New variable.
> * gnu/packages/patches/futil-add-makefile.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> ---
>   gnu/local.mk                                  |  1 +
>   gnu/packages/cpp.scm                          | 38 ++++++++
>   gnu/packages/patches/futil-add-makefile.patch | 92
> +++++++++++++++++++
>   3 files changed, 131 insertions(+)
>   create mode 100644 gnu/packages/patches/futil-add-makefile.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index c2521acf02..76129c9d82 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -1133,6 +1133,7 @@ dist_patch_DATA
> =                                         \
>     %D%/packages/patches/freeimage-unbundle.patch               \
>     %D%/packages/patches/fuse-glibc-2.34.patch                  \
>     %D%/packages/patches/fuse-overlapping-headers.patch         \
> +  %D%/packages/patches/futil-add-makefile.patch                \
>     %D%/packages/patches/fxdiv-system-libraries.patch           \
>     %D%/packages/patches/gajim-honour-GAJIM_PLUGIN_PATH.patch   \
>     %D%/packages/patches/ganeti-disable-version-symlinks.patch  \
> diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
> index ed6ae69198..5b146b3f4a 100644
> --- a/gnu/packages/cpp.scm
> +++ b/gnu/packages/cpp.scm
> @@ -1216,6 +1216,44 @@ (define-public folly
>       (supported-systems '("aarch64-linux" "x86_64-linux"))
>       (license license:asl2.0)))
>  
> +(define-public futil
> +  (let ((commit "83fcf85cf7638947a44657b2f334c2d8a2d5d02d")
> +        (revision "0"))
> +  (package
> +    (name "futil")
> +    (version (git-version "0.0.0" revision commit))
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://gitlab.com/hydren/futil")
> +             (commit commit)))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32
> "05vyx6n4aqix3w1z76hal9zxzixfxnlw0cg4b06lc1l9gnw6ja71"))
> +       (patches
> +        (search-patches "futil-add-makefile.patch"))
> +       (modules '((guix build utils)))
> +       (snippet
> +        #~(begin
> +            (for-each
> +             (lambda (file)
> +               (install-file file "include/futil"))
> +             (find-files "." "\\.h(pp)?$"))))))
Is this snippet intended to go together with the patch? If so, perhaps
you can adapt the patch to emit the renames as well or use a second
patch to do so rather than a snippet.
Toggle quote (9 lines)
> +    (build-system gnu-build-system)
> +    (arguments
> +     (list #:tests? #f ; no tests
> +           #:phases
> +           #~(modify-phases %standard-phases
> +               (delete 'configure))
> +           #:make-flags
> +           #~(list (string-append "DESTDIR=" #$output)
> +                   "PREFIX=")))
Let PREFIX be #$output instead and leave DESTDIR empty.
Toggle quote (7 lines)
> +    (home-page "https://gitlab.com/hydren/futil")
> +    (synopsis "C++ utility code library")
> +    (description "Futil is a set of C++ utility code and library
> headers.")
> +    (license license:zlib))))
> [...]

Cheers
L
L
Liliana Marie Prikler wrote on 18 Apr 2023 19:28
Re: [PATCH v1 4/5] gnu: Add rapidxml.
3af919a3a0c1a4b67eb247470f9937ff8efcd81e.camel@gmail.com
Am Donnerstag, dem 16.03.2023 um 14:31 +0800 schrieb Adam Faiz:
Toggle quote (48 lines)
>  From 470ac3c7e5cea2c08a64745037cd73af59027c26 Mon Sep 17 00:00:00
> 2001
> Message-Id:
> <470ac3c7e5cea2c08a64745037cd73af59027c26.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:07:08 +0800
> Subject: [PATCH v1 4/5] gnu: Add rapidxml.
>
> * gnu/packages/xml.scm (rapidxml): New variable.
> ---
>   gnu/packages/xml.scm | 30 ++++++++++++++++++++++++++++++
>   1 file changed, 30 insertions(+)
>
> diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
> index 0b26a63e85..c8dbd27772 100644
> --- a/gnu/packages/xml.scm
> +++ b/gnu/packages/xml.scm
> @@ -76,6 +76,7 @@ (define-module (gnu packages xml)
>     #:use-module (guix download)
>     #:use-module (guix git-download)
>     #:use-module (guix build-system cmake)
> +  #:use-module (guix build-system copy)
>     #:use-module (guix build-system gnu)
>     #:use-module (guix build-system meson)
>     #:use-module (guix build-system perl)
> @@ -1983,3 +1984,32 @@ (define-public python-xmltodict
>       (description "This package provides a Python library to convert
> XML to
>   @code{OrderedDict}.")
>       (license license:expat)))
> +
> +(define-public rapidxml
> +  (package
> +    (name "rapidxml")
> +    (version "1.13")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> +                    "https://sourceforge.net/projects/"
> +                    "rapidxml/files/rapidxml/rapidxml%20"
> +                    version "/rapidxml-" version ".zip"))
Small nitpick, you should try to fit this as
(uri (string-append
"files/rapidxml/rapidxml%20" version "/"
"rapidxml-" version ".zip"))
Toggle quote (7 lines)
> +              (sha256
> +               (base32
> +               
> "0w9mbdgshr6sh6a5jr10lkdycjyvapbj7wxwz8hbp0a96y3biw63"))))
> +    (build-system copy-build-system)
> +    (native-inputs
> +     (list unzip))
Can go on one line, but arguments should be first.
Toggle quote (13 lines)
> +    (arguments
> +     (list
> +      #:install-plan
> +      #~'(("./" "include/rapidxml" #:include-regexp ("\\.hpp$")))))
> +    (synopsis "XML Parser")
> +    (description
> +     "RapidXml is an attempt to create the fastest XML parser
> possible,
> +while retaining useability, portability and reasonable W3C
> compatibility.
> +  It is an in-situ parser written in modern C++, with parsing speed
> approaching
> +that of strlen function executed on the same data.")
I think we should avoid claims like "the fastest" in particular with
benchmarks referring to GCC 4 :)
Better, "RapidXml is a fast, mostly W3C-compatible XML DOM parser. It
uses an in-situ parsing approach, that is it does not copy the input
string."
Toggle quote (2 lines)
> +    (license license:boost1.0)))
Cheers
L
L
Liliana Marie Prikler wrote on 18 Apr 2023 20:28
Re: [PATCH v1 5/5] gnu: Add terrarium.
d673c32b16e66df723679213c3bf660a2a777b6f.camel@gmail.com
Am Donnerstag, dem 16.03.2023 um 14:32 +0800 schrieb Adam Faiz:
Toggle quote (103 lines)
>  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.
Toggle quote (39 lines)
> +            (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
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 62178@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 62178
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch