Subject: [WIP/HELP] [PATCH] gnu: smalltalk: Enable all features.

From: Andrew Wong <[email-masked]>
Date: Fri, 25 Apr 2025 21:23:54 -0400

* gnu/packages/smalltalk.scm(smalltalk): Enable all features.

Change-Id: I9514526b6313c0240e1f206f0c8b9b94ed9f2553
---

I've been trying to enable the rest of GNU Smalltalk's features and
libraries--specifically, the 'gst-browser' feature--so that it can get full use
as an educational tool. However, I've hit some roadblocks in development. In
particular, although I've gotten the GTK library to build, it seems to have
missing symbols; Also, the build process cannot find Tk, even when it is in the
inputs. This leaves the software without any GUI libraries.

Would anyone with more knowledge/experience regarding the gnu build
system, autotools, or smalltalk be able to take a look at what's going on?

I am aware that enabling all of the features will bloat the closure size, as was
warned, but after enabling them I hope to split the package up into multiple
outputs to bring it back down.

Any insight or advice is appreciated!

 gnu/packages/smalltalk.scm | 49 +++++++++++++++++++++++++-------------
 1 file changed, 33 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/smalltalk.scm b/gnu/packages/smalltalk.scm
index 5c5b93236a..25f824a689 100644
--- a/gnu/packages/smalltalk.scm
+++ b/gnu/packages/smalltalk.scm
@@ -58,6 +58,13 @@ (define-public smalltalk
       (sha256
        (base32
         "1zb2h5cbz1cwybqjl24lflw359lwj7sjvvhwb4x6miypzhwq4qh0"))
+      (modules '((guix build utils)))
+      (snippet '(begin
+                  ;; This stops an error where this script fails on line 70 when it
+                  ;; tries to print to stdout. This may be the reason why the browser
+                  ;; is broken, but the same function uses `print` to print error
+                  ;; messages, so it may be something else.
+                  (substitute* "packages/gtk/mkorder.awk" (("^.+print.+$") ""))))
       ;; XXX: To be removed with the next release of Smalltalk.
       (patches (search-patches "smalltalk-multiplication-overflow.patch"))))
     (build-system gnu-build-system)
@@ -68,24 +75,34 @@ (define-public smalltalk
            autoconf
            automake
            libtool
-           zip))
-    ;; TODO: These optional dependencies raise the closure size to ~1 GiB
-    ;; from the current ~100 MiB, although some of them might be very
-    ;; useful for end users:
-    ;;  - freeglut
-    ;;  - glib
-    ;;  - gobject-introspection
-    ;;  - gtk+-2
-    ;;  - tcl/tk
-    ;;  - SDL (sdl-union)
-    ;;  - sqlite
-    ;;  - zlib
+           zip
+           (@ (gnu packages emacs) emacs-minimal)                ;for comint.el
+           ;; (@ (gnu packages gettext) gettext)
+           ))
     (inputs
-     (list gmp libffi libltdl libsigsegv lightning))
+     (list gmp libffi libltdl libsigsegv lightning
+           (@ (gnu packages readline) readline)
+           (@ (gnu packages tls) gnutls)
+           (@ (gnu packages tcl) tcl)    ;for Tcl/Tk and tclsh
+           ;; (@ (gnu packages tcl) tk)     ;this is not detected, so no BloxTK
+           (@ (gnu packages sqlite) sqlite)
+           (@ (gnu packages dbm) gdbm)
+           (@ (gnu packages gtk) cairo)
+           (@ (gnu packages glib) glib)
+           (@ (gnu packages glib) gobject-introspection)
+           (@ (gnu packages gtk) gtk+-2)
+           (@ (gnu packages xorg) libx11)
+           (@ (gnu packages gl) mesa)   ;for gl.h
+           (@ (gnu packages gl) freeglut)
+           (@ (gnu packages sdl) sdl12-compat)
+           (@ (gnu packages sdl) sdl-image)
+           (@ (gnu packages sdl) sdl-mixer)
+           ;; there is no sdl-sound
+           (@ (gnu packages sdl) sdl-ttf)
+           (@ (gnu packages xml) expat) ;xml parser
+           (@ (gnu packages compression) zlib)))
     (arguments
-     `(;; FIXME: Tests fail on x86-64 in the build container, but they pass
-       ;; in a regular shell.
-       #:tests? ,(not (target-x86-64?))
+     `(#:tests? #t ;old note says tests fail for x86-64; works on my machine
        #:phases
        (modify-phases %standard-phases
          ;; XXX: To be removed with the next release of Smalltalk.

base-commit: f7c41ab31f5023023385500f6eb9083d23dd1ccb
-- 
2.49.0