unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Emacsy - build fixes
@ 2023-11-29 22:59 Morgan Smith
  2023-12-04  6:53 ` Janneke Nieuwenhuizen
  0 siblings, 1 reply; 2+ messages in thread
From: Morgan Smith @ 2023-11-29 22:59 UTC (permalink / raw)
  To: guile-user; +Cc: janneke

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

Hello!

I'm starting to play with emacsy and the readme said this was the
mailing list to send bug reports too.

These patches allow me to build emacsy and run the example programs.
They also add a build with guile 3.0 but that doesn't seem to work too
good so I'll have to try and debug that.

Thanks,

Morgan


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-configure-Update-dependencies.patch --]
[-- Type: text/x-patch, Size: 1284 bytes --]

From e74bc4e6712db9b57782c76b985c935c82fcda90 Mon Sep 17 00:00:00 2001
From: Morgan Smith <Morgan.J.Smith@outlook.com>
Date: Wed, 29 Nov 2023 17:52:10 -0500
Subject: [PATCH 1/3] configure: Update dependencies

---
 configure.ac | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index c18374f..231fd41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,12 +69,13 @@ AS_IF([test x$with_examples != xno],
   [BUILD_EXAMPLES=yes],
   [BUILD_EXAMPLES=no])
 
-PKG_CHECK_MODULES([FREEGLUT], [freeglut >= 3.0], [HAVE_FREEGLUT=yes], [HAVE_FREEGLUT=no])
+dnl Freeglut 3.2 provides 'glut.pc', not 'freeglut.pc'.
+PKG_CHECK_MODULES([FREEGLUT], [glut >= 3.0], [HAVE_FREEGLUT=yes], [HAVE_FREEGLUT=no])
 PKG_CHECK_MODULES([GL], [gl >= 18.0.0], [HAVE_GL=yes], [HAVE_GL=no])
 PKG_CHECK_MODULES([GLU], [glu >= 9.0.0], [HAVE_GLU=yes], [HAVE_GLU=no])
 AM_CONDITIONAL([HELLO_EMACSY], [test x$BUILD_EXAMPLES$HAVE_FREEGLUT$HAVE_GL$HAVE_GLU = xyesyesyesyes])
 
-PKG_CHECK_MODULES([WEBKIT], [webkit2gtk-4.0], [HAVE_WEBKIT=yes], [HAVE_WEBKIT=no])
+PKG_CHECK_MODULES([WEBKIT], [webkit2gtk-4.1], [HAVE_WEBKIT=yes], [HAVE_WEBKIT=no])
 AM_CONDITIONAL([EMACSY_WEBKIT_GTK], [test x$BUILD_EXAMPLES$HAVE_WEBKIT = xyesyes])
 
 AC_CONFIG_FILES([Makefile])
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-guix-Fix-build-and-modernize.patch --]
[-- Type: text/x-patch, Size: 5299 bytes --]

From dc7db5ebc864a28363bd7090755a8db4a91358c6 Mon Sep 17 00:00:00 2001
From: Morgan Smith <Morgan.J.Smith@outlook.com>
Date: Wed, 29 Nov 2023 17:52:44 -0500
Subject: [PATCH 2/3] guix: Fix build and modernize

---
 guix.scm | 97 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 48 insertions(+), 49 deletions(-)

diff --git a/guix.scm b/guix.scm
index da127a9..3180e30 100644
--- a/guix.scm
+++ b/guix.scm
@@ -70,60 +70,59 @@
                         #:select? (git-predicate %source-dir)))
     (build-system glib-or-gtk-build-system)
     (native-inputs
-     `(("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("bzip2" ,bzip2)
-       ("guile" ,guile-2.2)
-       ("gettext" ,gnu-gettext)
-       ("libtool" ,libtool)
-       ("perl" ,perl)
-       ("pkg-config" ,pkg-config)
-       ("texinfo" ,texinfo)
-       ("texlive" ,(texlive-union (list texlive-generic-epsf)))))
+     (list autoconf
+           automake
+           bzip2
+           gnu-gettext
+           libtool
+           perl
+           pkg-config
+           texinfo
+           (texlive-updmap.cfg (list texlive-epsf))))
     (inputs
-     `(("dbus-glib" ,dbus-glib)
-       ("guile" ,guile-2.2)
-       ("guile-lib" ,guile-lib)
-       ("guile-readline" ,guile-readline)
-       ("freeglut" ,freeglut)
-       ("glib-networking" ,glib-networking)
-       ("gssettings-desktop-schemas"
-        ,gsettings-desktop-schemas)
-       ("webkitgtk" ,webkitgtk)))
+     (list dbus-glib
+           guile-2.2
+           guile2.2-lib
+           guile2.2-readline
+           freeglut
+           glib-networking
+           gsettings-desktop-schemas
+           webkitgtk))
     (arguments
-     `(#:tests? #t
-       #:modules ((guix build gnu-build-system)
+     (list
+      #:configure-flags #~'("BUILD_EXAMPLES=true")
+      #:tests? #t
+      #:imported-modules `((guix build guile-build-system)
+                           (guix build gnu-build-system)
+                           ,@%glib-or-gtk-build-system-modules)
+      #:modules '((guix build guile-build-system)
+                  (guix build gnu-build-system)
                   (guix build glib-or-gtk-build-system)
                   (guix build utils)
-                  (ice-9 popen)
-                  (ice-9 rdelim)
-                  (ice-9 regex)
-                  (ice-9 ftw)
                   (srfi srfi-26))
-       #:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'setenv
-           (lambda _
-             (setenv "GUILE_AUTO_COMPILE" "0")
-             #t))
-         (add-after 'install 'wrap-binaries
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (effective (read-line
-                                (open-pipe* OPEN_READ
-                                            "guile" "-c"
-                                            "(display (effective-version))")))
-                    (deps (map (cut assoc-ref inputs <>) '("guile-lib" "guile-readline")))
-                    (scm-path (map (cut string-append <> "/share/guile/site/" effective) `(,out ,@deps)))
-                    (go-path (map (cut string-append <> "/lib/guile/" effective "/site-ccache/") `(,out ,@deps)))
-                    (examples (filter (cut string-match "emacsy" <>)
-                                      (scandir (string-append out "/bin/"))))
-                    (progs (map (cut string-append out "/bin/" <>)
-                                examples)))
-               (map (cut wrap-program <>
-                         `("GUILE_LOAD_PATH" ":" prefix ,scm-path)
-                         `("GUILE_LOAD_COMPILED_PATH" ":" prefix ,go-path)) progs)
-               #t))))))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'configure 'setenv
+            (lambda _
+              (setenv "GUILE_AUTO_COMPILE" "0")))
+          (add-after 'install 'wrap-binaries
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (deps (cons
+                            (call-with-values (lambda () (target-guile-scm+go out)) cons)
+                            (map (lambda (dep) (call-with-values
+                                              (lambda () (target-guile-scm+go dep))
+                                            cons))
+                                 (list (or #$(this-package-input "guile2.2-lib")
+                                           #$(this-package-input "guile-lib"))
+                                       (or #$(this-package-input "guile2.2-readline")
+                                           #$(this-package-input "guile-readline"))))))
+                     (scm-path (map car deps))
+                     (go-path (map cdr deps))
+                     (progs (find-files (string-append out "/bin/"))))
+                (map (cut wrap-program <>
+                          `("GUILE_LOAD_PATH" ":" prefix ,scm-path)
+                          `("GUILE_LOAD_COMPILED_PATH" ":" prefix ,go-path)) progs)))))))
     (home-page "https://savannah.nongnu.org/projects/emacsy")
     (synopsis "Embeddable GNU Emacs-like library using Guile")
     (description
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-guix-Add-guile3.0-emacsy-does-not-work-yet.patch --]
[-- Type: text/x-patch, Size: 866 bytes --]

From 26cb52b0c75f23e664acaad2d88a51666e42ddf8 Mon Sep 17 00:00:00 2001
From: Morgan Smith <Morgan.J.Smith@outlook.com>
Date: Wed, 29 Nov 2023 17:53:19 -0500
Subject: [PATCH 3/3] guix: Add guile3.0-emacsy (does not work yet)

---
 guix.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/guix.scm b/guix.scm
index 3180e30..ef1b932 100644
--- a/guix.scm
+++ b/guix.scm
@@ -134,4 +134,13 @@ comes with a simple counter example using FreeGLUT and browser examples
 in C using Gtk+-3 and WebKitGtk.")
     (license license:gpl3+)))
 
+;; TODO: tests don't pass
+(define-public guile3.0-emacsy
+  (package
+    (inherit emacsy)
+    (inputs (modify-inputs (package-inputs emacsy)
+              (replace "guile" guile-3.0)
+              (replace "guile2.2-lib" guile-lib)
+              (replace "guile2.2-readline" guile-readline)))))
+
 emacsy
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Emacsy - build fixes
  2023-11-29 22:59 [PATCH] Emacsy - build fixes Morgan Smith
@ 2023-12-04  6:53 ` Janneke Nieuwenhuizen
  0 siblings, 0 replies; 2+ messages in thread
From: Janneke Nieuwenhuizen @ 2023-12-04  6:53 UTC (permalink / raw)
  To: Morgan Smith; +Cc: guile-user

Morgan Smith writes:

Hello Morgan,

> I'm starting to play with emacsy and the readme said this was the
> mailing list to send bug reports too.

Nice, yes!

> These patches allow me to build emacsy and run the example programs.

Okay, thanks.  Applied 1 and 2 to master.

> They also add a build with guile 3.0 but that doesn't seem to work too
> good so I'll have to try and debug that.

Yeah, I omitted that for now; you can send it when it works.

Thanks!

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-04  6:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-29 22:59 [PATCH] Emacsy - build fixes Morgan Smith
2023-12-04  6:53 ` Janneke Nieuwenhuizen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).