[bug#79005,1/1] gnu: Add dialogc.

Message ID c821e13a-ef96-4b26-aa5d-da7e36ea78f1@disroot.org
State New
Headers
Series gnu: Add dialogc. |

Commit Message

Adam Faiz July 13, 2025, 9:46 a.m. UTC
From 842ade98c525c2ea256a2020cccc8912c0363673 Mon Sep 17 00:00:00 2001
Message-ID: 
<842ade98c525c2ea256a2020cccc8912c0363673.1752395681.git.adam.faiz@disroot.org>
In-Reply-To: <cover.1752395681.git.adam.faiz@disroot.org>
References: <cover.1752395681.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Sun, 13 Jul 2025 16:30:50 +0800
Subject: [PATCH 1/1] gnu: Add dialogc.

* gnu/packages/game-development.scm (dialogc): New variable.

Change-Id: Id02c124814854785a73d8ff7e1739158a7d03faf
---
  gnu/packages/game-development.scm | 43 +++++++++++++++++++++++++++++++
  1 file changed, 43 insertions(+)
  

Comments

Andreas Enge July 14, 2025, 8:42 a.m. UTC | #1
Hello,

Am Sun, Jul 13, 2025 at 05:46:43PM +0800 schrieb Adam Faiz:
> +        #:tests? #f ; requires dfrotz, causing a circular module dependency

what do you mean by this? Modules can have a dependency circle.
And I do not find dfrotz among our packages, just frotz-dumb-terminal.

Andreas
  
Adam Faiz July 14, 2025, 10:44 a.m. UTC | #2
On 14 July 2025 4:42:51 pm MYT, Andreas Enge <andreas@enge.fr> wrote:
>Hello,
>
>Am Sun, Jul 13, 2025 at 05:46:43PM +0800 schrieb Adam Faiz:
>> +        #:tests? #f ; requires dfrotz, causing a circular module dependency
>
>what do you mean by this? Modules can have a dependency circle.
>And I do not find dfrotz among our packages, just frotz-dumb-terminal.
>
>Andreas
>

Oh, I guess I was mistaken. I thought package modules wouldn't load properly if there was a cycle, since I was bitten by a strange error related to that a long time ago.

I'll send a revised patch later that runs the tests (frotz-dumb-terminal provides dfrotz).
  
Andreas Enge July 14, 2025, 10:58 a.m. UTC | #3
Am Mon, Jul 14, 2025 at 06:44:32PM +0800 schrieb Adam Faiz:
> Oh, I guess I was mistaken. I thought package modules wouldn't load properly if there was a cycle, since I was bitten by a strange error related to that a long time ago.

In a different issue someone pointed me to this:
   https://guix.gnu.org/manual/devel/en/html_node/Cyclic-Module-Dependencies.html

So they can be a bit tricky, but are not a problem for any kinds of
inputs. The example in the documentation of inheritance is a common
case where there is a problem.

Andreas
  

Patch

diff --git a/gnu/packages/game-development.scm 
b/gnu/packages/game-development.scm
index 61520575a8..91d3494a41 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -316,6 +316,49 @@  (define-public deutex
  DeuTex has functions such as merging wads, etc.")
     (license license:gpl2+)))

+(define-public dialogc
+  (let ((commit "68476f9f3b1ca2db15615e508837ca721e0759ab")
+        (revision "0"))
+    (package
+      (name "dialogc")
+      (version (git-version "1a-01" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+                (url "https://github.com/Dialog-IF/dialog")
+                (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1gm6fb86chq74fh2llmmgji6fwylk0xd53fmij6l9x348nvw1bkn"))
+         (modules '((guix build utils)))
+         (snippet
+          #~(begin
+              (substitute* "src/Makefile"
+                (("cp dialogc" all)
+                 (string-append "install -d ${PREFIX}/bin\n\t" all))
+                (("/usr/local") "${PREFIX}"))))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+        #:test-target "test"
+        #:tests? #f ; requires dfrotz, causing a circular module dependency
+        #:phases
+        #~(modify-phases %standard-phases
+            (delete 'configure)
+            (add-before 'build 'set-install-prefix
+              (lambda _
+                (setenv "PREFIX" #$output)))
+            (add-before 'build 'change-to-src-directory
+              (lambda _
+                (chdir "src"))))))
+      (synopsis "Dialog interactive fiction compiler")
+      (description
+       "Dialog is a domain-specific language for creating works
+of interactive fiction.  It is heavily inspired by Inform 7 and Prolog.")
+      (home-page "https://github.com/Dialog-IF/dialog")
+      (license license:bsd-3))))
+
  (define-public go-codeberg-org-anaseto-gruid-sdl
    (package
      (name "go-codeberg-org-anaseto-gruid-sdl")