[PATCH] gnu: Add opensludge.

  • Open
  • quality assurance status badge
Details
One participant
  • Adam Faiz
Owner
unassigned
Submitted by
Adam Faiz
Severity
normal

Debbugs page

Adam Faiz wrote 3 weeks ago
(address . guix-patches@gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(name . 宋文 武)(address . iyzsong@envs.net)
d7fb5604-caa3-4052-ad6f-fdbcfc32b5ac@disroot.org
From 0300d45e1508ba1e763e07c71f202ba54180e368 Mon Sep 17 00:00:00 2001
Message-ID: <0300d45e1508ba1e763e07c71f202ba54180e368.1740888495.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Sun, 2 Mar 2025 12:00:30 +0800
Subject: [PATCH] gnu: Add opensludge.

* gnu/packages/patches/opensludge-support-datadir-variable.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it here.
* gnu/packages/game-development.scm (opensludge): New variable.
---
gnu/local.mk | 1 +
gnu/packages/game-development.scm | 51 +++++++++++++++++++
.../opensludge-support-datadir-variable.patch | 33 ++++++++++++
3 files changed, 85 insertions(+)
create mode 100644 gnu/packages/patches/opensludge-support-datadir-variable.patch

Toggle diff (117 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 2ea3763d40..b7401b794d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1958,6 +1958,7 @@ dist_patch_DATA = \
%D%/packages/patches/openscad-with-cgal-5.3.patch \
%D%/packages/patches/openscad-with-cgal-5.4.patch \
%D%/packages/patches/opensles-add-license-file.patch \
+ %D%/packages/patches/opensludge-support-datadir-variable.patch \
%D%/packages/patches/openssl-1.1-c-rehash-in.patch \
%D%/packages/patches/openssl-3.0-c-rehash-in.patch \
%D%/packages/patches/openssl-hurd64.patch \
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index e014089c23..00b76ac21f 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -2955,6 +2955,57 @@ (define-public instead
(files '("share/instead/games")))))
(license license:expat)))
+(define-public opensludge
+ (let ((commit "a247b3669d41b3c2de0d06b88fc3e21ad4898a47")
+ (revision "0"))
+ (package
+ (name "opensludge")
+ (version (git-version "2.2.2" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/opensludge/opensludge")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1kl763j98398y1cbj36m45jbkwir7nj4wrq2sb6gl9vx90ipvsyg"))
+ (patches (search-patches "opensludge-support-datadir-variable.patch"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (substitute* "configure.ac"
+ (("openal") "libmodplug libmpg123 openal"))))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:configure-flags
+ #~(list "--enable-devkit")
+ #:make-flags
+ #~(list "CXXFLAGS=-g")))
+ (native-inputs (list autoconf automake pkg-config))
+ (inputs
+ (list alure
+ dumb
+ flac
+ openal
+ glew
+ glib
+ gtk+-2
+ gtkglext
+ libmodplug
+ libogg
+ libpng
+ libvorbis
+ libvpx
+ mpg123
+ sdl12-compat))
+ (synopsis "Adventure game engine")
+ (description
+ "SLUDGE is a game development toolkit for making point-and-click style
+adventure games.")
+ (home-page "https://opensludge.github.io/")
+ (license license:gpl3+))))
+
(define-public openvr
(package
(name "openvr")
diff --git a/gnu/packages/patches/opensludge-support-datadir-variable.patch b/gnu/packages/patches/opensludge-support-datadir-variable.patch
new file mode 100644
index 0000000000..05cd88ec71
--- /dev/null
+++ b/gnu/packages/patches/opensludge-support-datadir-variable.patch
@@ -0,0 +1,33 @@
+From 6ec17f5595def22b0f7e4c2020571d3bd631e6dc Mon Sep 17 00:00:00 2001
+From: AwesomeAdam54321 <adam.faiz@disroot.org>
+Date: Sun, 2 Mar 2025 09:53:31 +0800
+Subject: [PATCH] opensludge: Support SLUDGE_DATADIR environment variable.
+
+This patch is from the Robin's Rescue game, and rebased on the latest
+commit:
+https://gitlab.com/Cheeseness/robins-rescue/-/raw/master/sludge/source_changes/main.cpp.diff
+---
+ source/Engine/main.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/source/Engine/main.cpp b/source/Engine/main.cpp
+index d3b9951..1418bbc 100755
+--- a/source/Engine/main.cpp
++++ b/source/Engine/main.cpp
+@@ -298,7 +298,12 @@ int main(int argc, char *argv[]) try
+ #ifdef __APPLE__
+ // bundleFolder is set in applicationDidFinishLaunching.
+ #elif defined __unix__
+- bundleFolder = copyString(DATADIR); // DATADIR is defined in the Makefile.
++ bundleFolder = getenv("SLUDGE_DATADIR");
++ if (bundleFolder == NULL)
++ {
++ bundleFolder = copyString(DATADIR); // DATADIR is defined in the Makefile.
++ fprintf(stderr, "SLUDGE_DATADIR not found, defaulting to %s\n", bundleFolder);
++ }
+ #else
+ bundleFolder = copyString(argv[0]);
+ int lastSlash = -1;
+--
+2.46.0
+

base-commit: 4b5f0408e66392ab745dc0f7830732217d88f17d
--
2.46.0
Adam Faiz wrote 3 weeks ago
[PATCH v1] gnu: Add opensludge.
(address . guix-patches@gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(name . 宋文 武)(address . iyzsong@envs.net)
2ae78f49-43c2-4002-9390-6f04b933a04a@disroot.org
From fbc30833380544ce6db791046dca575923cd5e75 Mon Sep 17 00:00:00 2001
Message-ID: <fbc30833380544ce6db791046dca575923cd5e75.1740889796.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Sun, 2 Mar 2025 12:00:30 +0800
Subject: [PATCH v1] gnu: Add opensludge.

* gnu/packages/patches/opensludge-support-datadir-variable.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it here.
* gnu/packages/game-development.scm (opensludge): New variable.
---
gnu/local.mk | 1 +
gnu/packages/game-development.scm | 51 +++++++++++++++++++
.../opensludge-support-datadir-variable.patch | 33 ++++++++++++
3 files changed, 85 insertions(+)
create mode 100644 gnu/packages/patches/opensludge-support-datadir-variable.patch

Toggle diff (117 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 2ea3763d40..b7401b794d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1958,6 +1958,7 @@ dist_patch_DATA = \
%D%/packages/patches/openscad-with-cgal-5.3.patch \
%D%/packages/patches/openscad-with-cgal-5.4.patch \
%D%/packages/patches/opensles-add-license-file.patch \
+ %D%/packages/patches/opensludge-support-datadir-variable.patch \
%D%/packages/patches/openssl-1.1-c-rehash-in.patch \
%D%/packages/patches/openssl-3.0-c-rehash-in.patch \
%D%/packages/patches/openssl-hurd64.patch \
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index e014089c23..364aac79c3 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -2955,6 +2955,57 @@ (define-public instead
(files '("share/instead/games")))))
(license license:expat)))
+(define-public opensludge
+ (let ((commit "a247b3669d41b3c2de0d06b88fc3e21ad4898a47")
+ (revision "0"))
+ (package
+ (name "opensludge")
+ (version (git-version "2.2.2" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/opensludge/opensludge")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1kl763j98398y1cbj36m45jbkwir7nj4wrq2sb6gl9vx90ipvsyg"))
+ (patches (search-patches "opensludge-support-datadir-variable.patch"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (substitute* "configure.ac"
+ (("openal") "flac libmodplug libmpg123 openal"))))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:configure-flags
+ #~(list "--enable-devkit")
+ #:make-flags
+ #~(list "CXXFLAGS=-g")))
+ (native-inputs (list autoconf automake pkg-config))
+ (inputs
+ (list alure
+ dumb
+ flac
+ openal
+ glew
+ glib
+ gtk+-2
+ gtkglext
+ libmodplug
+ libogg
+ libpng
+ libvorbis
+ libvpx
+ mpg123
+ sdl12-compat))
+ (synopsis "Adventure game engine")
+ (description
+ "SLUDGE is a game development toolkit for making point-and-click style
+adventure games.")
+ (home-page "https://opensludge.github.io/")
+ (license license:gpl3+))))
+
(define-public openvr
(package
(name "openvr")
diff --git a/gnu/packages/patches/opensludge-support-datadir-variable.patch b/gnu/packages/patches/opensludge-support-datadir-variable.patch
new file mode 100644
index 0000000000..05cd88ec71
--- /dev/null
+++ b/gnu/packages/patches/opensludge-support-datadir-variable.patch
@@ -0,0 +1,33 @@
+From 6ec17f5595def22b0f7e4c2020571d3bd631e6dc Mon Sep 17 00:00:00 2001
+From: AwesomeAdam54321 <adam.faiz@disroot.org>
+Date: Sun, 2 Mar 2025 09:53:31 +0800
+Subject: [PATCH] opensludge: Support SLUDGE_DATADIR environment variable.
+
+This patch is from the Robin's Rescue game, and rebased on the latest
+commit:
+https://gitlab.com/Cheeseness/robins-rescue/-/raw/master/sludge/source_changes/main.cpp.diff
+---
+ source/Engine/main.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/source/Engine/main.cpp b/source/Engine/main.cpp
+index d3b9951..1418bbc 100755
+--- a/source/Engine/main.cpp
++++ b/source/Engine/main.cpp
+@@ -298,7 +298,12 @@ int main(int argc, char *argv[]) try
+ #ifdef __APPLE__
+ // bundleFolder is set in applicationDidFinishLaunching.
+ #elif defined __unix__
+- bundleFolder = copyString(DATADIR); // DATADIR is defined in the Makefile.
++ bundleFolder = getenv("SLUDGE_DATADIR");
++ if (bundleFolder == NULL)
++ {
++ bundleFolder = copyString(DATADIR); // DATADIR is defined in the Makefile.
++ fprintf(stderr, "SLUDGE_DATADIR not found, defaulting to %s\n", bundleFolder);
++ }
+ #else
+ bundleFolder = copyString(argv[0]);
+ int lastSlash = -1;
+--
+2.46.0
+

base-commit: 4b5f0408e66392ab745dc0f7830732217d88f17d
--
2.46.0
?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 76673
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
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help