unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [ANN] guile-gi v0.0.1 released
       [not found] <20181115144125.GA23468@joshua.dnsalias.com>
@ 2019-06-01  9:02 ` Jan Nieuwenhuizen
  2019-06-02 16:15   ` Ludovic Courtès
  2019-06-03 14:46   ` Mike Gran
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Nieuwenhuizen @ 2019-06-01  9:02 UTC (permalink / raw)
  To: Mike Gran; +Cc: guix-devel, guile-user

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

Mike Gran writes:

> Hello. I am announcing guile-gi v0.0.1.

Wow, congrats!  And thanks!

> guile-gi is a library that autogenerates Guile bindings for GObject
> libraries that provide typelib files.

I've created a package description for Guix (see attached), with some
patches (also attached).

How is is that I overlooked this thread?  I spent last Thursday --
reluctantly -- adding webkitgtk bindings to guile-gnome and debugging
an initial browser test.  With Guile-GI it worked in minutes! :-)

One of the patches adds the web browser example and the last one adds an
editor example...but that segfaults in the key-press-event handler.

I've just noticed test/closures.c -- is that intended for handlers like
key-press-event; are they different from `clicked'?

Patches also on my `wip' branch: https://gitlab.com/janneke/guile-gi.git

janneke


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-guile-gi.patch --]
[-- Type: text/x-patch, Size: 3238 bytes --]

From f4602d57f74cb2690b01fb23638ce2037ccd9105 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Fri, 31 May 2019 19:47:21 +0200
Subject: [PATCH] gnu: Add guile-gi.

* gnu/packages/guile-xyz.scm (guile-gi): New variable.
---
 gnu/packages/guile-xyz.scm | 42 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 365f909c2c..589e41dad2 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -53,8 +53,10 @@
   #:use-module (gnu packages gawk)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gl)
+  #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gperf)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages hurd)
   #:use-module (gnu packages image)
@@ -76,6 +78,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
+  #:use-module (gnu packages webkit)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
@@ -2232,3 +2235,42 @@ slashes are present and accounted for, resolving @code{.} and @code{..}, etc).
 Inevitably, you have to break the string up into chunks and operate on that
 list of components.  This module takes care of that for you.")
     (license license:lgpl3+)))
+
+(define-public guile-gi
+  (let ((commit "91753258892c4a1fbf7ed43ff793a00ac0f77cf6")
+        (revision "0"))
+    (package
+      (name "guile-gi")
+      (version (string-append "0.0.1-" revision "." (string-take commit 7)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://gitlab.com/janneke/guile-gi.git")
+                      (commit commit)))
+                (file-name (string-append name "-" version))
+                (sha256
+                 (base32
+                  "1i76jfs90p8pbx0bfrjd4sias9380pmjb9x387rx7hav4kvnsd1b"))))
+      (build-system gnu-build-system)
+      (native-inputs `(("autoconf" ,autoconf)
+                       ("automake" ,automake)
+                       ("gettext" ,gnu-gettext)
+                       ("libtool" ,libtool)
+                       ("pkg-config" ,pkg-config)
+                       ("texinfo" ,texinfo)))
+      (propagated-inputs `(("glib" ,glib)
+                           ("gobject-introspection" ,gobject-introspection)
+                           ("gssettings-desktop-schemas" ,gsettings-desktop-schemas)
+                           ("gtk+" ,gtk+)
+                           ("guile-lib" ,guile-lib)
+                           ("webkitgtk" ,webkitgtk)))
+      (inputs `(("guile" ,guile-2.2)))
+      (arguments
+       `(#:configure-flags '("--with-gnu-filesystem-hierarchy")))
+      (home-page "https://github.com/spk121/guile-gi")
+      (synopsis "GObject bindings for Guile")
+      (description
+       "Guile-GI is a library for Guile that allows using GObject-based
+libraries, such as GTK+3.  Its README comes with the disclaimer: This is
+pre-alpha code.")
+      (license license:gpl3+))))
-- 
2.21.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-webkit-browser-example.patch --]
[-- Type: text/x-patch, Size: 3025 bytes --]

From f1ffa56b7ec078f0270eb6bba7a23faa11999db7 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Fri, 31 May 2019 00:54:18 +0200
Subject: [PATCH 1/4] webkit browser example.

* test/browser.scm: New file.
---
 test/Makefile.am |  8 ++++++--
 test/browser.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 2 deletions(-)
 create mode 100644 test/browser.scm

diff --git a/test/Makefile.am b/test/Makefile.am
index 5fae67d..e87bf99 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -46,5 +46,9 @@ AM_SCM_LOG_FLAGS = --no-auto-compile -L $(abs_top_srcdir)/src -L $(abs_top_srcdi
 EXTRA_DIST = \
   $(TESTS) \
   lib.scm \
-  automake-test-lib.scm \
-  example-1.scm
+  automake-test-lib.scm
+
+exampledir = $(datadir)/doc/guile-gi
+dist_example_DATA = \
+  example-1.scm \
+  browser.scm
diff --git a/test/browser.scm b/test/browser.scm
new file mode 100644
index 0000000..d262e53
--- /dev/null
+++ b/test/browser.scm
@@ -0,0 +1,52 @@
+;; Copyright (C) 2019  Michael L. Gran
+;; Copyright (C) 2019  Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+
+;; This program is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https:;;www.gnu.org/licenses/>.
+(use-modules (gi))
+
+(typelib-load "Gio" "2.0")
+(typelib-load "Gtk" "3.0")
+(typelib-load "GLib" "2.0")
+(typelib-load "WebKit2" "4.0")
+
+(define (print-hello widget data)
+  (display "Hello World\n"))
+
+(define (activate app user-data)
+  (let ((window (cast (ApplicationWindow-new app) <GtkApplicationWindow>))
+        (vbox (cast (VBox-new 0 0) <GtkVBox>))
+        (browser (cast (WebView-new) <WebKitWebView>))
+        (button-box (cast (ButtonBox-new 0) <GtkButtonBox>))
+        (button (Button-new-with-label "Hello World")))
+    (send window (set-title "Window"))
+    (send window (set-default-size 200 200))
+    (send window (show-all))
+    (send window (add vbox))
+    (send vbox (add browser))
+    (send vbox (add button-box))
+
+    (connect button (clicked print-hello #f))
+    (connect button (clicked (lambda x
+                               (send window (destroy)))
+                             #f))
+    (send browser (load-uri "http://gnu.org/s/mes"))
+    (send button-box (add button))
+    (send window (show-all))))
+
+(define (main)
+  (let ((app (Application-new "org.gtk.example" 0)))
+    (connect app (activate activate #f))
+    (send app (run (length (command-line)) (command-line)))))
+
+(main)
-- 
2.21.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0002-build-compile-and-install-.go-files.patch --]
[-- Type: text/x-patch, Size: 2857 bytes --]

From ac0e08efce96f26d63911658dbdaecd16461f07e Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Fri, 31 May 2019 19:13:41 +0200
Subject: [PATCH 2/4] build: compile and install .go files.

---
 bootstrap       |  6 ++++++
 configure.ac    |  3 ++-
 src/Makefile.am | 11 +++++------
 3 files changed, 13 insertions(+), 7 deletions(-)
 create mode 100755 bootstrap

diff --git a/bootstrap b/bootstrap
new file mode 100755
index 0000000..8defb5d
--- /dev/null
+++ b/bootstrap
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+# Create the build system.
+
+set -e -x
+exec autoreconf -vfi
diff --git a/configure.ac b/configure.ac
index 0cdd9e8..811a29b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,7 +68,7 @@ case "x$with_gnu_filesystem_hierarchy" in
        # Follow the GNU Filesystem Heirarchy Standard correctly
        # Installed .scm scheme libraries go here
        AC_MSG_CHECKING([Guile site directory])
-       guilesitedir="\$(datadir)/guile/site/$guile_effective_version"
+       guilesitedir="\${datadir}/guile/site/$guile_effective_version"
        AC_MSG_RESULT([$guilesitedir])
        AC_SUBST(guilesitedir)
 
@@ -207,4 +207,5 @@ AC_CONFIG_FILES([tools/uninstalled-env], [chmod +x tools/uninstalled-env])
 AC_CONFIG_FILES([tools/run-guile], [chmod +x tools/run-guile])
 AC_CONFIG_FILES([tools/gdb-guile], [chmod +x tools/gdb-guile])
 AC_CONFIG_FILES([tools/gdb-test], [chmod +x tools/gdb-test])
+AC_CONFIG_FILES([tools/guile-gi], [chmod +x tools/guile-gi])
 AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index 6c96095..2040399 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -147,25 +147,26 @@ libguile_gi_la_LIBADD = \
 ################################################################
 
 pkgguilesitedir=$(guilesitedir)/gi
+pkgguileobjectdir=$(guileobjectdir)/gi
 
 dist_guilesite_DATA = \
   gi.scm
 
 dist_pkgguilesite_DATA = gi/glib-2.scm gi/gtk-3.scm gi/gio-2.scm gi/webkit2-4.scm
 
-guileobject_DATA = $(guilesite_DATA:%.scm=%.go)
+pkgguileobject_DATA = $(dist_guilesite_DATA:%.scm=%.go) $(dist_pkgguilesite_DATA:%.scm=%.go)
 
 $(pkgguileobject_DATA): libguile-gi.la
 
-GUILEC_FLAGS = -Warity-mismatch -Wformat
+GUILEC_FLAGS = -Warity-mismatch -Wformat --load-path=$(PWD)
 
 .scm.go:
 	GUILE_AUTO_COMPILE=0 \
 	LTDL_LIBRARY_PATH=$(abs_builddir)/.libs \
-	$(GUILE) compile --target="$(host)" $(GUILEC_FLAGS) \
+	$(GUILE_TOOLS) compile --target="$(host)" $(GUILEC_FLAGS) \
 	-o "$@" "$<"
 
-CLEANFILES = $(guileobject_DATA) $(BUILT_SOURCES)
+CLEANFILES = $(pkgguileobject_DATA) $(BUILT_SOURCES)
 
 ################################################################
 # FLYMAKE
@@ -175,5 +176,3 @@ check-syntax:
 	$(CC) -std=c11 $(GUILE_CFLAGS) $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) \
 	 $(GOBJECT_INTROSPECTION_CFLAGS) $(FFI_CFLAGS) \
 	 -DG_LOG_DOMAIN=\"GuileGI\" $(CFLAGS) -fsyntax-only $(CHK_SOURCES)
-
-
-- 
2.21.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0003-guix-Add-guix-package-description.patch --]
[-- Type: text/x-patch, Size: 6702 bytes --]

From e2bf3ca2db064d4b5232a9ad2049241eab158e6f Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Fri, 31 May 2019 19:21:52 +0200
Subject: [PATCH 3/4] guix: Add guix package description.

---
 .gitignore        |  1 +
 README            |  6 ++++
 guix.scm          | 92 +++++++++++++++++++++++++++++++++++++++++++++++
 test/Makefile.am  |  3 ++
 tools/Makefile.am |  3 +-
 tools/guile-gi.in | 27 ++++++++++++++
 6 files changed, 131 insertions(+), 1 deletion(-)
 create mode 100644 guix.scm
 create mode 100644 tools/guile-gi.in

diff --git a/.gitignore b/.gitignore
index e72434b..21eb93e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,6 +68,7 @@ tools/gdb-test
 tools/uninstalled-env
 tools/gdb-guile
 tools/run-guile
+tools/guile-gi
 
 # executables
 fo_gen
diff --git a/README b/README
index f3c4de6..cb31e1e 100644
--- a/README
+++ b/README
@@ -21,3 +21,9 @@ box, but, you can use this library to generate those bindings
 automatically.
 
 For the moment, the docs are at https://spk121.github.io/guile-gi/
+
+Try:
+
+    guix environment --ad-hoc -l guix.scm guile
+    guile-gi test/example-1.scm
+    guile-gi test/browser.scm
diff --git a/guix.scm b/guix.scm
new file mode 100644
index 0000000..30789de
--- /dev/null
+++ b/guix.scm
@@ -0,0 +1,92 @@
+;;; Guile-GI --- GObject bindings for Guile.
+;;; Copyright (C) 2019 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;
+;;; This file is part of Guile-GI.
+;;;
+;;; Guile-GI is free software: you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation, either version 3 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; Guile-GI is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with Guile-GI.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; GNU Guix development package.  To build and play, run:
+;;
+;;   guix environment --ad-hoc -l guix.scm guile
+;;
+;; To build and install, run:
+;;
+;;   guix package -f guix.scm
+;;
+;; To build it, but not install it, run:
+;;
+;;   guix build -f guix.scm
+;;
+;; To use as the basis for a development environment, run:
+;;
+;;   guix environment -l guix.scm
+;;
+;;; Code:
+
+(use-modules (srfi srfi-1)
+             (srfi srfi-26)
+             (ice-9 popen)
+             (ice-9 match)
+             (ice-9 rdelim)
+             (guix packages)
+             (guix licenses)
+             (guix gexp)
+             (guix git-download)
+             (guix build-system gnu)
+             ((guix build utils) #:select (with-directory-excursion))
+             (gnu packages)
+             (gnu packages autotools)
+             (gnu packages gettext)
+             (gnu packages glib)
+             (gnu packages gnome)
+             (gnu packages gtk)
+             (gnu packages guile)
+             (gnu packages guile-xyz)
+             (gnu packages pkg-config)
+             (gnu packages texinfo)
+             (gnu packages webkit))
+
+(define %source-dir (dirname (current-filename)))
+
+(package
+  (name "guile-gi")
+  (version "git")
+  (source (local-file %source-dir
+                      #:recursive? #t
+                      #:select? (git-predicate %source-dir)))
+  (build-system gnu-build-system)
+  (native-inputs `(("autoconf" ,autoconf)
+                   ("automake" ,automake)
+                   ("gettext" ,gnu-gettext)
+                   ("libtool" ,libtool)
+                   ("pkg-config" ,pkg-config)
+                   ("texinfo" ,texinfo)))
+  (propagated-inputs `(("glib" ,glib)
+                       ("gobject-introspection" ,gobject-introspection)
+                       ("gssettings-desktop-schemas" ,gsettings-desktop-schemas)
+                       ("gtk+" ,gtk+)
+                       ("guile-lib" ,guile-lib)
+                       ("webkitgtk" ,webkitgtk)))
+  (inputs `(("guile" ,guile-2.2)))
+  (arguments
+   `(#:configure-flags '("--with-gnu-filesystem-hierarchy")))
+  (home-page "https://github.com/spk121/guile-gi")
+  (synopsis "GObject bindings for Guile")
+  (description
+   "Guile-GI is a library for Guile that allows using GObject-based
+libraries, such as GTK+3.  Its README comes with the disclaimer: This
+is pre-alpha code.")
+  (license gpl3+))
diff --git a/test/Makefile.am b/test/Makefile.am
index e87bf99..14ca20d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -36,6 +36,9 @@ TESTS = \
  bytes_new_null_size.scm \
  bytes_new_null_contents.scm
 
+XFAIL_TESTS = \
+ bytes_new_null_size.scm
+
 SCM_LOG_COMPILER = \
   ${top_builddir}/libtool \
   --dlopen=${top_builddir}/src/libguile-gi.la \
diff --git a/tools/Makefile.am b/tools/Makefile.am
index aeafaf6..b93b5ba 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -14,5 +14,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
-EXTRA_DIST = uninstalled-env.in run-guile.in gdb-guile.in gdb-test.in
+EXTRA_DIST = uninstalled-env.in run-guile.in gdb-guile.in gdb-test.in guile-gi.in
 
+bin_SCRIPTS = guile-gi
diff --git a/tools/guile-gi.in b/tools/guile-gi.in
new file mode 100644
index 0000000..2004bef
--- /dev/null
+++ b/tools/guile-gi.in
@@ -0,0 +1,27 @@
+#! @SHELL@
+
+# Guile-GI --- GObject bindings for Guile.
+# Copyright (C) 2019 Jan Nieuwenhuizen <janneke@gnu.org>
+#
+# This file is part of Guile-GI.
+#
+# Guile-GI is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Guile-GI is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Guile-GI.  If not, see <http://www.gnu.org/licenses/>.
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+datadir="@datarootdir@"
+datarootdir="@datarootdir@"
+
+LD_LIBRARY_PATH="@guileextensiondir@${GUIX_ENVIRONMENT:+:}$GUIX_ENVIRONMENT${GUIX_ENVIRONMENT:+/lib:}${LIBRARY_PATH:+:}$LIBRARY_PATH{LD_IBRARY_PATH:+:}$LD_IBRARY_PATH${GUIX_PROFILE:+/lib:}$GUIX_PROFILE"\
+        exec @GUILE@ -L "@guilesitedir@" -C "@guileobjectdir@" "$@"
-- 
2.21.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0004-textview-editor-example.BOOM.patch --]
[-- Type: text/x-patch, Size: 3178 bytes --]

From 91753258892c4a1fbf7ed43ff793a00ac0f77cf6 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sat, 1 Jun 2019 10:22:23 +0200
Subject: [PATCH 4/4] textview editor example...BOOM.

---
 README          |  7 ++++++
 test/editor.scm | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+)
 create mode 100644 test/editor.scm

diff --git a/README b/README
index cb31e1e..0c2682b 100644
--- a/README
+++ b/README
@@ -27,3 +27,10 @@ Try:
     guix environment --ad-hoc -l guix.scm guile
     guile-gi test/example-1.scm
     guile-gi test/browser.scm
+
+Or, create and run in a development environment
+
+    guix environment -l guix.scm
+    ./bootstrap && ./configure && make
+    tools/uninstalled-env tools/guile-gi test/browser.scm
+    tools/uninstalled-env tools/guile-gi test/editor.scm
diff --git a/test/editor.scm b/test/editor.scm
new file mode 100644
index 0000000..5294943
--- /dev/null
+++ b/test/editor.scm
@@ -0,0 +1,58 @@
+;; Copyright (C) 2019  Michael L. Gran
+;; Copyright (C) 2019  Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+
+;; This program is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https:;;www.gnu.org/licenses/>.
+(use-modules (gi))
+
+(typelib-load "Gio" "2.0")
+(typelib-load "Gtk" "3.0")
+(typelib-load "GLib" "2.0")
+(typelib-load "WebKit2" "4.0")
+
+(define (print-goodbye widget data)
+  (display "Goodbye World\n"))
+
+(define (key-press widget event)
+  (display "key\n")
+  (format "key: ~s\n" event)
+  #f)
+
+(define (activate app user-data)
+  (let ((window (cast (ApplicationWindow-new app) <GtkApplicationWindow>))
+        (vbox (cast (VBox-new 0 0) <GtkVBox>))
+        (editor (cast (TextView-new) <GtkTextView>))
+        (button-box (cast (ButtonBox-new 0) <GtkButtonBox>))
+        (button (Button-new-with-label "Quit")))
+    (send window (set-title "Window"))
+    (send window (set-default-size 200 200))
+    (send window (show-all))
+    (send window (add vbox))
+    (send vbox (add editor))
+    (send vbox (add button-box))
+    (connect button (clicked print-goodbye #f))
+    (connect button (clicked (lambda x
+                               (send window (destroy)))
+                             #f))
+    ;; disable this and we are `fine'
+    (connect editor (key-press-event key-press #f)) ;; BOOM
+    (send editor (grab-focus))
+    (send button-box (add button))
+    (send window (show-all))))
+
+(define (main)
+  (let ((app (Application-new "org.gtk.example" 0)))
+    (connect app (activate activate #f))
+    (send app (run (length (command-line)) (command-line)))))
+
+(main)
-- 
2.21.0


[-- Attachment #7: Type: text/plain, Size: 152 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

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

* Re: [ANN] guile-gi v0.0.1 released
  2019-06-01  9:02 ` [ANN] guile-gi v0.0.1 released Jan Nieuwenhuizen
@ 2019-06-02 16:15   ` Ludovic Courtès
  2019-06-02 18:22     ` Jan Nieuwenhuizen
  2019-06-03 14:46   ` Mike Gran
  1 sibling, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2019-06-02 16:15 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel, guile-user

Hello!

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> Mike Gran writes:
>
>> Hello. I am announcing guile-gi v0.0.1.
>
> Wow, congrats!  And thanks!

Yay, congrats!

> From f4602d57f74cb2690b01fb23638ce2037ccd9105 Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke@gnu.org>
> Date: Fri, 31 May 2019 19:47:21 +0200
> Subject: [PATCH] gnu: Add guile-gi.
>
> * gnu/packages/guile-xyz.scm (guile-gi): New variable.

LGTM!

Guile-GI has the potential to make a lot of people happy.  :-)

Thanks,
Ludo’.

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

* Re: [ANN] guile-gi v0.0.1 released
  2019-06-02 16:15   ` Ludovic Courtès
@ 2019-06-02 18:22     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Nieuwenhuizen @ 2019-06-02 18:22 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, guile-user, Mike Gran

Ludovic Courtès writes:

Hi!

>> * gnu/packages/guile-xyz.scm (guile-gi): New variable.
>
> LGTM!
>
> Guile-GI has the potential to make a lot of people happy.  :-)

Yes, even if they're mostly developers atm ;-)  Pushed to master as

    bdf2dd797e1e57dab1d504a6e1af783ec5802afd

Teaser added to the Guile-GI README

--8<---------------cut here---------------start------------->8---
Try:

    guix environment --ad-hoc -l guix.scm guile
    guile-gi test/example-1.scm
    guile-gi test/browser.scm

Or, create and run in a development environment

    guix environment -l guix.scm
    ./bootstrap && ./configure && make
    tools/uninstalled-env tools/guile-gi test/browser.scm
    tools/uninstalled-env tools/guile-gi test/editor.scm
--8<---------------cut here---------------end--------------->8---


janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

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

* Re: [ANN] guile-gi v0.0.1 released
  2019-06-01  9:02 ` [ANN] guile-gi v0.0.1 released Jan Nieuwenhuizen
  2019-06-02 16:15   ` Ludovic Courtès
@ 2019-06-03 14:46   ` Mike Gran
  2019-06-03 16:41     ` Jan Nieuwenhuizen
  1 sibling, 1 reply; 7+ messages in thread
From: Mike Gran @ 2019-06-03 14:46 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel, guile-user

On Sat, Jun 01, 2019 at 11:02:21AM +0200, Jan Nieuwenhuizen wrote:
> 
> I've created a package description for Guix (see attached), with some
> patches (also attached).
> 
> How is is that I overlooked this thread?  I spent last Thursday --
> reluctantly -- adding webkitgtk bindings to guile-gnome and debugging
> an initial browser test.  With Guile-GI it worked in minutes! :-)
> 
> One of the patches adds the web browser example and the last one adds an
> editor example...but that segfaults in the key-press-event handler.
> 
> I've just noticed test/closures.c -- is that intended for handlers like
> key-press-event; are they different from `clicked'?

This is me trying to explain to myself how the meta_marshaller was working
in PyGObject, on which much of this code is based.

> 
> Patches also on my `wip' branch: https://gitlab.com/janneke/guile-gi.git

I am pleased and super embarrassed that someone has taken the time to
patch this code.  It is really rough code.  I had lost momentum on
this project, but, I'll try to get back to it.

Thanks for checking it out.

-Mike Gran

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

* Re: [ANN] guile-gi v0.0.1 released
  2019-06-03 14:46   ` Mike Gran
@ 2019-06-03 16:41     ` Jan Nieuwenhuizen
  2019-06-04 14:45       ` Mike Gran
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Nieuwenhuizen @ 2019-06-03 16:41 UTC (permalink / raw)
  To: Mike Gran; +Cc: guix-devel, guile-user

Mike Gran writes:

Hi!

>> I've just noticed test/closures.c -- is that intended for handlers like
>> key-press-event; are they different from `clicked'?
>
> This is me trying to explain to myself how the meta_marshaller was working
> in PyGObject, on which much of this code is based.

Ah, that makes sense.  I started playing with it and learned one or two
things, until i found src/gclosure.c :-)

Have you seen the gclosure implementation in guile-gnome, would that be
any help?

    https://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/gclosure.scm

I'm quite new to all this, I cannot see the great difference in gtk+2
and gtk+3 here, even...

>> Patches also on my `wip' branch: https://gitlab.com/janneke/guile-gi.git
>
> I am pleased and super embarrassed that someone has taken the time to
> patch this code.  It is really rough code.  I had lost momentum on
> this project, but, I'll try to get back to it.

Great!

> Thanks for checking it out.

Thanks for this awesome project, it's real impressive :) I'll update the
guix package to your git (or a next release) again when that builds
without patches.

janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

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

* Re: [ANN] guile-gi v0.0.1 released
  2019-06-03 16:41     ` Jan Nieuwenhuizen
@ 2019-06-04 14:45       ` Mike Gran
  2019-06-04 19:47         ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Gran @ 2019-06-04 14:45 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel, guile-user

On Mon, Jun 03, 2019 at 06:41:44PM +0200, Jan Nieuwenhuizen wrote:
> Mike Gran writes:
> 
> Hi!
> 
...

> 
> Ah, that makes sense.  I started playing with it and learned one or two
> things, until i found src/gclosure.c :-)
> 
> Have you seen the gclosure implementation in guile-gnome, would that be
> any help?
> 
>     https://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/gclosure.scm

Both guile-gnome and my hack have two parts
- an introspection layer
- a gobject-to-guile binding

I had a chat with Wingo at the last FOSDEM, and he thinks the
gobject-to-guile binding could be reused, and that I could just swap
the gwrap GTK+2 introspection layer with a GObject introspection
layer.  I began analyzing that path a few months before life
intervened.

> 
> I'm quite new to all this, I cannot see the great difference in gtk+2
> and gtk+3 here, even...
> 
> >> Patches also on my `wip' branch: https://gitlab.com/janneke/guile-gi.git

I incorporated these, and fixed the bug that caused your editor example
to fail.  Thanks!

Thanks,
Mike

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

* Re: [ANN] guile-gi v0.0.1 released
  2019-06-04 14:45       ` Mike Gran
@ 2019-06-04 19:47         ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Nieuwenhuizen @ 2019-06-04 19:47 UTC (permalink / raw)
  To: Mike Gran; +Cc: guix-devel, guile-user

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

Mike Gran writes:

Hi!

> Both guile-gnome and my hack have two parts
> - an introspection layer
> - a gobject-to-guile binding
>
> I had a chat with Wingo at the last FOSDEM, and he thinks the
> gobject-to-guile binding could be reused, and that I could just swap
> the gwrap GTK+2 introspection layer with a GObject introspection
> layer.  I began analyzing that path a few months before life
> intervened.

Okay, good.

>> I'm quite new to all this, I cannot see the great difference in gtk+2
>> and gtk+3 here, even...
>> 
>> >> Patches also on my `wip' branch: https://gitlab.com/janneke/guile-gi.git
>
> I incorporated these, and fixed the bug that caused your editor example
> to fail.  Thanks!

Oh great, and that's fast.  Thanks!  You maybe even did a bit too well,
the `bytes_new_null_size.scm' test now passes.  I added that to
XFAIL_TEST because it fails -- now make check fails because this test is
fixed.

The attach patch removes that workaround again.  If you apply this or
something equivalent, I will update the Guix package to point to your
updated repo.

Greetings,
jannneke


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-test-Update-for-passing-bytes_new_null_size.scm.patch --]
[-- Type: text/x-patch, Size: 701 bytes --]

From 810baa9427145d08b4c9ff46ee442e296eb1911b Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Tue, 4 Jun 2019 21:40:34 +0200
Subject: [PATCH] test: Update for passing bytes_new_null_size.scm.

* test/Makefile.am (XFAIL_TESTS): Remove bytes_new_null_size.
---
 test/Makefile.am | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index e647105..3cca48f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -39,9 +39,6 @@ TESTS = \
  gapplication_2.scm \
  softerror_create.scm
 
-XFAIL_TESTS = \
- bytes_new_null_size.scm
-
 SCM_LOG_COMPILER = \
   ${top_builddir}/libtool \
   --dlopen=${top_builddir}/src/libguile-gi.la \
-- 
2.21.0


[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

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

end of thread, other threads:[~2019-06-04 19:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20181115144125.GA23468@joshua.dnsalias.com>
2019-06-01  9:02 ` [ANN] guile-gi v0.0.1 released Jan Nieuwenhuizen
2019-06-02 16:15   ` Ludovic Courtès
2019-06-02 18:22     ` Jan Nieuwenhuizen
2019-06-03 14:46   ` Mike Gran
2019-06-03 16:41     ` Jan Nieuwenhuizen
2019-06-04 14:45       ` Mike Gran
2019-06-04 19:47         ` Jan Nieuwenhuizen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).