Hello community, here is the log from the commit of package guile-newt for openSUSE:Factory checked in at 2020-11-26 23:14:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/guile-newt (Old) and /work/SRC/openSUSE:Factory/.guile-newt.new.5913 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "guile-newt" Thu Nov 26 23:14:53 2020 rev:3 rq:850992 version:0.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/guile-newt/guile-newt.changes 2020-01-20 22:56:23.911365530 +0100 +++ /work/SRC/openSUSE:Factory/.guile-newt.new.5913/guile-newt.changes 2020-11-26 23:15:57.377063794 +0100 @@ -1,0 +2,11 @@ +Fri Nov 6 17:36:27 UTC 2020 - Jonathan Brielmaier <jbrielma...@opensuse.org> + +- Update to 0.0.2: + * Allow builds with Guile 3.0. + * Add help callback support. + * components: Make sure callback is not GC'd. + * Add 'form-watch-fd'. +* remove patch: + * support-guile-3.0.patch: Guile 3.0 support added by upstream + +------------------------------------------------------------------- Old: ---- guile-newt-0.0.1.tar.gz support-guile-3.0.patch New: ---- guile-newt-0.0.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ guile-newt.spec ++++++ --- /var/tmp/diff_new_pack.QuyLP6/_old 2020-11-26 23:15:58.117064369 +0100 +++ /var/tmp/diff_new_pack.QuyLP6/_new 2020-11-26 23:15:58.121064372 +0100 @@ -17,7 +17,7 @@ Name: guile-newt -Version: 0.0.1 +Version: 0.0.2 Release: 0 Summary: Guile bindings to Newt License: GPL-3.0-or-later @@ -25,8 +25,6 @@ URL: https://gitlab.com/mothacehe/guile-newt Source0: https://gitlab.com/mothacehe/%{name}/-/archive/%{version}/%{name}-%{version}.tar.gz Source1: guile-newt-rpmlintrc -# Support Guile 3.0. Patch proposed upstream in https://gitlab.com/mothacehe/guile-newt/merge_requests/1 -Patch0: support-guile-3.0.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: guile-devel @@ -41,7 +39,6 @@ %prep %setup -q -%patch0 -p1 %build ./bootstrap ++++++ guile-newt-0.0.1.tar.gz -> guile-newt-0.0.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-newt-0.0.1/configure.ac new/guile-newt-0.0.2/configure.ac --- old/guile-newt-0.0.1/configure.ac 2018-11-29 08:42:46.000000000 +0100 +++ new/guile-newt-0.0.2/configure.ac 2020-03-30 12:21:54.000000000 +0200 @@ -9,7 +9,7 @@ dnl Enable silent rules by default. AM_SILENT_RULES([yes]) -GUILE_PKG([2.2 2.0]) +GUILE_PKG([3.0 2.2 2.0]) GUILE_PROGS dnl (srfi srfi-64) appeared in Guile 2.0.11. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-newt-0.0.1/examples/components.scm new/guile-newt-0.0.2/examples/components.scm --- old/guile-newt-0.0.1/examples/components.scm 2018-11-29 08:42:46.000000000 +0100 +++ new/guile-newt-0.0.2/examples/components.scm 2020-03-30 12:21:54.000000000 +0200 @@ -6,7 +6,11 @@ (newt-init) (clear-screen) -(push-help-line "This is the help line") +(newt-set-help-callback (lambda _ + (message-window "Help menu" + "Ok" + "This is the help."))) +(push-help-line "Press <F1> for help.") (make-window 10 5 40 25 "Button Sample") (define r1 (make-radio-button 1 3 "Choice 1" #t)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-newt-0.0.1/examples/listbox.scm new/guile-newt-0.0.2/examples/listbox.scm --- old/guile-newt-0.0.1/examples/listbox.scm 2018-11-29 08:42:46.000000000 +0100 +++ new/guile-newt-0.0.2/examples/listbox.scm 2020-03-30 12:21:54.000000000 +0200 @@ -7,6 +7,10 @@ (newt-init) (clear-screen) +(newt-set-help-callback (lambda _ + (message-window "Help menu" + "Ok" + "This is the help."))) (push-help-line "This is the help line") (make-window 10 5 40 25 "Listbox Sample") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-newt-0.0.1/m4/guile.m4 new/guile-newt-0.0.2/m4/guile.m4 --- old/guile-newt-0.0.1/m4/guile.m4 2018-11-29 08:42:46.000000000 +0100 +++ new/guile-newt-0.0.2/m4/guile.m4 2020-03-30 12:21:54.000000000 +0200 @@ -25,7 +25,7 @@ ## GUILE_PKG -- find Guile development files ## GUILE_PROGS -- set paths to Guile interpreter, config and tool programs ## GUILE_FLAGS -- set flags for compiling and linking with Guile -## GUILE_SITE_DIR -- find path to Guile "site" directory +## GUILE_SITE_DIR -- find path to Guile "site" directories ## GUILE_CHECK -- evaluate Guile Scheme code and capture the return value ## GUILE_MODULE_CHECK -- check feature of a Guile Scheme module ## GUILE_MODULE_AVAILABLE -- check availability of a Guile Scheme module @@ -61,7 +61,7 @@ # AC_DEFUN([GUILE_PKG], [PKG_PROG_PKG_CONFIG - _guile_versions_to_search="m4_default([$1], [2.0 1.8])" + _guile_versions_to_search="m4_default([$1], [2.2 2.0 1.8])" if test -n "$GUILE_EFFECTIVE_VERSION"; then _guile_tmp="" for v in $_guile_versions_to_search; do @@ -154,18 +154,28 @@ AC_SUBST([GUILE_LTLIBS]) ]) -# GUILE_SITE_DIR -- find path to Guile "site" directory +# GUILE_SITE_DIR -- find path to Guile site directories # # Usage: GUILE_SITE_DIR # -# This looks for Guile's "site" directory, usually something like -# PREFIX/share/guile/site, and sets var @var{GUILE_SITE} to the path. -# Note that the var name is different from the macro name. +# This looks for Guile's "site" directories. The variable @var{GUILE_SITE} will +# be set to Guile's "site" directory for Scheme source files (usually something +# like PREFIX/share/guile/site). @var{GUILE_SITE_CCACHE} will be set to the +# directory for compiled Scheme files also known as @code{.go} files +# (usually something like +# PREFIX/lib/guile/@var{GUILE_EFFECTIVE_VERSION}/site-ccache). +# @var{GUILE_EXTENSION} will be set to the directory for compiled C extensions +# (usually something like +# PREFIX/lib/guile/@var{GUILE_EFFECTIVE_VERSION}/extensions). The latter two +# are set to blank if the particular version of Guile does not support +# them. Note that this macro will run the macros @code{GUILE_PKG} and +# @code{GUILE_PROGS} if they have not already been run. # -# The variable is marked for substitution, as by @code{AC_SUBST}. +# The variables are marked for substitution, as by @code{AC_SUBST}. # AC_DEFUN([GUILE_SITE_DIR], [AC_REQUIRE([GUILE_PKG]) + AC_REQUIRE([GUILE_PROGS]) AC_MSG_CHECKING(for Guile site directory) GUILE_SITE=`$PKG_CONFIG --print-errors --variable=sitedir guile-$GUILE_EFFECTIVE_VERSION` AC_MSG_RESULT($GUILE_SITE) @@ -173,6 +183,28 @@ AC_MSG_FAILURE(sitedir not found) fi AC_SUBST(GUILE_SITE) + AC_MSG_CHECKING([for Guile site-ccache directory using pkgconfig]) + GUILE_SITE_CCACHE=`$PKG_CONFIG --variable=siteccachedir guile-$GUILE_EFFECTIVE_VERSION` + if test "$GUILE_SITE_CCACHE" = ""; then + AC_MSG_RESULT(no) + AC_MSG_CHECKING([for Guile site-ccache directory using interpreter]) + GUILE_SITE_CCACHE=`$GUILE -c "(display (if (defined? '%site-ccache-dir) (%site-ccache-dir) \"\"))"` + if test $? != "0" -o "$GUILE_SITE_CCACHE" = ""; then + AC_MSG_RESULT(no) + GUILE_SITE_CCACHE="" + AC_MSG_WARN([siteccachedir not found]) + fi + fi + AC_MSG_RESULT($GUILE_SITE_CCACHE) + AC_SUBST([GUILE_SITE_CCACHE]) + AC_MSG_CHECKING(for Guile extensions directory) + GUILE_EXTENSION=`$PKG_CONFIG --print-errors --variable=extensiondir guile-$GUILE_EFFECTIVE_VERSION` + AC_MSG_RESULT($GUILE_EXTENSION) + if test "$GUILE_EXTENSION" = ""; then + GUILE_EXTENSION="" + AC_MSG_WARN(extensiondir not found) + fi + AC_SUBST(GUILE_EXTENSION) ]) # GUILE_PROGS -- set paths to Guile interpreter, config and tool programs @@ -181,10 +213,15 @@ # # This macro looks for programs @code{guile} and @code{guild}, setting # variables @var{GUILE} and @var{GUILD} to their paths, respectively. -# If @code{guile} is not found, signal an error. +# The macro will attempt to find @code{guile} with the suffix of +# @code{-X.Y}, followed by looking for it with the suffix @code{X.Y}, and +# then fall back to looking for @code{guile} with no suffix. If +# @code{guile} is still not found, signal an error. The suffix, if any, +# that was required to find @code{guile} will be used for @code{guild} +# as well. # # By default, this macro will search for the latest stable version of -# Guile (e.g. 2.0). x.y or x.y.z versions can be specified. If an older +# Guile (e.g. 2.2). x.y or x.y.z versions can be specified. If an older # version is found, the macro will signal an error. # # The effective version of the found @code{guile} is set to @@ -198,16 +235,25 @@ # The variables are marked for substitution, as by @code{AC_SUBST}. # AC_DEFUN([GUILE_PROGS], - [AC_PATH_PROG(GUILE,guile) - _guile_required_version="m4_default([$1], [$GUILE_EFFECTIVE_VERSION])" + [_guile_required_version="m4_default([$1], [$GUILE_EFFECTIVE_VERSION])" if test -z "$_guile_required_version"; then - _guile_required_version=2.0 + _guile_required_version=2.2 fi - if test "$GUILE" = "" ; then + + _guile_candidates=guile + _tmp= + for v in `echo "$_guile_required_version" | tr . ' '`; do + if test -n "$_tmp"; then _tmp=$_tmp.; fi + _tmp=$_tmp$v + _guile_candidates="guile-$_tmp guile$_tmp $_guile_candidates" + done + + AC_PATH_PROGS(GUILE,[$_guile_candidates]) + if test -z "$GUILE"; then AC_MSG_ERROR([guile required but not found]) fi - AC_SUBST(GUILE) + _guile_suffix=`echo "$GUILE" | sed -e 's,^.*/guile\(.*\)$,\1,'` _guile_effective_version=`$GUILE -c "(display (effective-version))"` if test -z "$GUILE_EFFECTIVE_VERSION"; then GUILE_EFFECTIVE_VERSION=$_guile_effective_version @@ -241,20 +287,23 @@ else as_fn_error $? "Guile $_guile_required_version required, but $_guile_prog_version found" "$LINENO" 5 fi + elif test "$GUILE_EFFECTIVE_VERSION" = "$_major_version.$_minor_version" -a -z "$_micro_version"; then + # Allow prereleases that have the right effective version. + true else AC_MSG_ERROR([Guile $_guile_required_version required, but $_guile_prog_version found]) fi AC_MSG_RESULT([$_guile_prog_version]) - AC_PATH_PROG(GUILD,guild) + AC_PATH_PROG(GUILD,[guild$_guile_suffix]) AC_SUBST(GUILD) - AC_PATH_PROG(GUILE_CONFIG,guile-config) + AC_PATH_PROG(GUILE_CONFIG,[guile-config$_guile_suffix]) AC_SUBST(GUILE_CONFIG) if test -n "$GUILD"; then GUILE_TOOLS=$GUILD else - AC_PATH_PROG(GUILE_TOOLS,guile-tools) + AC_PATH_PROG(GUILE_TOOLS,[guile-tools$_guile_suffix]) fi AC_SUBST(GUILE_TOOLS) ]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-newt-0.0.1/newt/bindings.scm new/guile-newt-0.0.2/newt/bindings.scm --- old/guile-newt-0.0.1/newt/bindings.scm 2018-11-29 08:42:46.000000000 +0100 +++ new/guile-newt-0.0.2/newt/bindings.scm 2020-03-30 12:21:54.000000000 +0200 @@ -1,5 +1,5 @@ ;;; Guile-newt --- GNU Guile bindings of libnewt -;;; Copyright © 2018 Mathieu Othacehe <m.othac...@gmail.com> +;;; Copyright © 2018, 2020 Mathieu Othacehe <m.othac...@gmail.com> ;;; ;;; This file is part of Guile-newt. ;;; @@ -55,6 +55,7 @@ newt-refresh newt-suspend + newt-set-help-callback newt-resume)) (define libnewt @@ -133,7 +134,19 @@ ;; TODO: newtSetSuspendCallback -;; TODO: newtSetHelpCallback +(define help-callback #f) + +(define (newt-set-help-callback callback) + (let ((proc (libnewt->procedure void + "newtSetHelpCallback" + '(*)))) + ;; Save the returned pointer to make sure that it is not GC'd. + (set! help-callback + (procedure->pointer void + (lambda (component data) + (callback)) + '(* *))) + (proc help-callback))) (define (newt-resume) "Restore the Newt user interface after a call to NEWT-SUSPEND." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-newt-0.0.1/newt/components.scm new/guile-newt-0.0.2/newt/components.scm --- old/guile-newt-0.0.1/newt/components.scm 2018-11-29 08:42:46.000000000 +0100 +++ new/guile-newt-0.0.2/newt/components.scm 2020-03-30 12:21:54.000000000 +0200 @@ -185,19 +185,25 @@ (= (pointer-address (generic-component->pointer component1)) (pointer-address (generic-component->pointer component2)))) -(define component-callback - (lambda (callback) - (procedure->pointer - void - (lambda (component data) ; DATA is %null-pointer for now. - (callback component)) - '(* *)))) +(define %component-callbacks + (make-weak-key-hash-table)) (define (add-component-callback component callback) "Set CALLBACK as the callback procedure for COMPONENT." (let ((proc (libnewt->procedure void "newtComponentAddCallback" - `(* * *)))) + `(* * *))) + (component-callback + (procedure->pointer + void + (lambda (component data) + (callback)) + '(* *)))) + + ;; The given CALLBACK can be called out of the scope of this + ;; procedure. Save it in %COMPONENT-CALLBACKS to be sure it is + ;; not GC'd. + (hashq-set! %component-callbacks component component-callback) (proc (generic-component->pointer component) - (component-callback callback) + component-callback %null-pointer))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-newt-0.0.1/newt/form.scm new/guile-newt-0.0.2/newt/form.scm --- old/guile-newt-0.0.1/newt/form.scm 2018-11-29 08:42:46.000000000 +0100 +++ new/guile-newt-0.0.2/newt/form.scm 2020-03-30 12:21:54.000000000 +0200 @@ -1,5 +1,6 @@ ;;; Guile-newt --- GNU Guile bindings of libnewt -;;; Copyright © 2018 Mathieu Othacehe <m.othac...@gmail.com> +;;; Copyright © 2018, 2020 Mathieu Othacehe <m.othac...@gmail.com> +;;; Copyright © 2020 Ludovic Courtès <l...@gnu.org> ;;; ;;; This file is part of Guile-newt. ;;; @@ -30,8 +31,13 @@ run-form draw-form form-add-hotkey + form-watch-fd destroy-form + FD-READ + FD-WRITE + FD-EXCEPT + KEY-EXTRA-BASE KEY-UP KEY-DOWN @@ -60,14 +66,18 @@ (define KEY-PGDN #x800C) (define KEY-INSERT #x800D) -(define* (make-form #:key (flags 0)) +(define default-help-tag "") + +(define* (make-form #:key (flags 0) (help-tag default-help-tag)) "Create a FORM with the given FLAGS. Forms are collections of components. Only one form can be active at a time and every component which the user should be able to access must be on the running form." (let ((proc (libnewt->procedure '* "newtForm" `(* * ,int)))) - (pointer->form (proc %null-pointer %null-pointer flags)))) + (pointer->form (proc %null-pointer + (string->pointer help-tag) + flags)))) (define (set-form-timer form delay-ms) "Set a timer to expire in DELAY-MS milliseconds for given FORM." @@ -146,6 +156,8 @@ ((= exit-reason EXIT-HOTKEY) (values 'exit-hotkey (key->symbol (pointer-address argument)))) + ((= exit-reason EXIT-FDREADY) + (values 'exit-fd-ready (pointer-address argument))) (else (values 'exit-unknown argument))))))) (define (draw-form form) @@ -162,6 +174,20 @@ `(* ,int)))) (proc (form->pointer form) key))) +;; Flags for 'newtFormWatchFd'. +(define FD-READ 1) +(define FD-WRITE 2) +(define FD-EXCEPT 4) + +(define (form-watch-fd form fd flags) + "Have FORM watch for events of type FLAGS on FD, a file descriptor. FORM +exits as soon as an event occurs. FLAGS must be a bitwise or of FD-READ, +FD-WRITE, and FD-EXCEPT." + (let ((proc (libnewt->procedure void + "newtFormWatchFd" + `(* ,int ,int)))) + (proc (form->pointer form) fd flags))) + (define (destroy-form form) "Destroy the given FORM." (let ((proc (libnewt->procedure void _______________________________________________ openSUSE Commits mailing list -- commit@lists.opensuse.org To unsubscribe, email commit-le...@lists.opensuse.org List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/commit@lists.opensuse.org