gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Tue Jul 14 13:48:59 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/8fbd11e0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6e520ee2 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b6254f97 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/888f77f9 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/30843a0d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/fe3787c4 (commit)
	from  https://github.com/Gnucash/gnucash/commit/996115b9 (commit)



commit 8fbd11e061e21b340bd9372b1b832e882774667b
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Jul 14 21:23:56 2020 +0800

    [README] document support for guile-3.0

diff --git a/README.dependencies b/README.dependencies
index 9402e3b24..6c18781ce 100644
--- a/README.dependencies
+++ b/README.dependencies
@@ -57,7 +57,7 @@ Libraries/Deps
   cmake                 3.10                    Build system manager
   glib2                 2.56.1
   gtk+3                 3.22.30
-  guile                 2.2.0 or 2.0.9          Must be built with regex
+  guile                 3.0, 2.2 or 2.0.9       Must be built with regex
                                                 support enabled
   libxml2               2.9.4
   gettext               0.20                    Required to build gnucash.pot,

commit 6e520ee2cff49e177b6353c3a1d51f68bb74cdc2
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Jul 14 01:00:03 2020 +0800

    [CmakeLists] Find and link guile-3.0
    
    This prefers guile 3.0 > 2.2 > 2.0 and links to the most recent
    version found.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a014a2fd..6456df558 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -275,41 +275,54 @@ include (${SWIG_USE_FILE})
 string(REGEX MATCH "^[0-9]+[.]" SWIG_MAJOR ${SWIG_VERSION})
 
 # Find Guile and determine which version we are using.
-# Look for guile versions in this order: 2.2 > 2.0
+# Look for guile versions in this order: 3.0 > 2.2 > 2.0
 
 # guile library and include dir
+pkg_check_modules (GUILE3 guile-3.0 QUIET)
 pkg_check_modules (GUILE22 guile-2.2 QUIET)
-if (GUILE22_FOUND) # found guile-2.2
+pkg_check_modules (GUILE2 guile-2.0>=2.0.9 QUIET)
+
+if (GUILE3_FOUND) # found guile-3.0
+  add_definitions (-DHAVE_GUILE30)
+  set(HAVE_GUILE3 TRUE)
+  set(GUILE_EFFECTIVE_VERSION 3.0)
+  set(GUILE_INCLUDE_DIRS ${GUILE3_INCLUDE_DIRS})
+  set(GUILE_LDFLAGS ${GUILE3_LDFLAGS})
+  find_program (GUILD_EXECUTABLE NAMES guild3.0 guild)
+  if (NOT GUILD_EXECUTABLE)
+    message (SEND_ERROR "The guild executable was not found, but is required. Please set GUILD_EXECUTABLE.")
+  endif()
+  message(STATUS "Using guile-3.0.x")
+  find_program (GUILE_EXECUTABLE NAMES guile3.0 guile)
+
+elseif (GUILE22_FOUND) # found guile-2.2
   add_definitions (-DHAVE_GUILE22)
   set(HAVE_GUILE2 TRUE)
   set(GUILE_EFFECTIVE_VERSION 2.2)
   set(GUILE_INCLUDE_DIRS ${GUILE22_INCLUDE_DIRS})
   set(GUILE_LDFLAGS ${GUILE22_LDFLAGS})
-
   find_program (GUILD_EXECUTABLE NAMES guild2.2 guild)
   if (NOT GUILD_EXECUTABLE)
     message (SEND_ERROR "The guild executable was not found, but is required. Please set GUILD_EXECUTABLE.")
   endif()
   message(STATUS "Using guile-2.2.x")
   find_program (GUILE_EXECUTABLE NAMES guile2.2 guile)
-else()
-  pkg_check_modules (GUILE2 guile-2.0>=2.0.9 QUIET)
-  if (GUILE2_FOUND) # found guile-2.0
-    add_definitions (-DHAVE_GUILE20)
-    set(HAVE_GUILE2 TRUE)
-    set(GUILE_EFFECTIVE_VERSION 2.0)
-    set(GUILE_INCLUDE_DIRS ${GUILE2_INCLUDE_DIRS})
-    set(GUILE_LDFLAGS ${GUILE2_LDFLAGS})
-
-    find_program (GUILD_EXECUTABLE NAMES guild2.0 guild)
-    if (NOT GUILD_EXECUTABLE)
-      message (SEND_ERROR "The guild executable was not found, but is required. Please set GUILD_EXECUTABLE.")
-    endif()
-    message(STATUS "Using guile-2.0.x")
-    find_program (GUILE_EXECUTABLE NAMES guile2.0 guile)
-  else()
-    message (FATAL_ERROR "Neither guile 2.2 nor guile 2.0 were found GnuCash can't run without one of them. Ensure that one is installed and can be found with pkg-config.")
+
+elseif (GUILE2_FOUND) # found guile-2.0
+  add_definitions (-DHAVE_GUILE20)
+  set(HAVE_GUILE2 TRUE)
+  set(GUILE_EFFECTIVE_VERSION 2.0)
+  set(GUILE_INCLUDE_DIRS ${GUILE2_INCLUDE_DIRS})
+  set(GUILE_LDFLAGS ${GUILE2_LDFLAGS})
+  find_program (GUILD_EXECUTABLE NAMES guild2.0 guild)
+  if (NOT GUILD_EXECUTABLE)
+    message (SEND_ERROR "The guild executable was not found, but is required. Please set GUILD_EXECUTABLE.")
   endif()
+  message(STATUS "Using guile-2.0.x")
+  find_program (GUILE_EXECUTABLE NAMES guile2.0 guile)
+
+else()
+  message (FATAL_ERROR "Neither guile 3.0, guile 2.2, nor guile 2.0 were found GnuCash can't run without one of them. Ensure that one is installed and can be found with pkg-config.")
 endif()
 
 if (NOT GUILE_EXECUTABLE)

commit b6254f971d733ea7265d6997df9cfb0ed7f491ce
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Jul 14 00:59:12 2020 +0800

    [test-html-fonts] load-from-path instead of load
    
    otherwise guile-3 complains:
    
    "WARNING: Use of `load' in declarative module (#{ g79}#).
    Add #:declarative? #f to your define-module invocation."

diff --git a/gnucash/report/test/test-html-fonts.scm b/gnucash/report/test/test-html-fonts.scm
index c9a0910d9..65352f9a6 100644
--- a/gnucash/report/test/test-html-fonts.scm
+++ b/gnucash/report/test/test-html-fonts.scm
@@ -1,6 +1,6 @@
 (use-modules (srfi srfi-64))
 (use-modules (tests srfi64-extras))
-(load "gnucash/report/html-fonts")
+(load-from-path "gnucash/report/html-fonts")
 
 (setlocale LC_ALL "C")
 

commit 888f77f9addaadb015cad2eaf517a554d241373e
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Jul 14 00:58:27 2020 +0800

    [libguile] use scm_list_N instead of SCM_LISTN

diff --git a/gnucash/gnome/dialog-report-column-view.c b/gnucash/gnome/dialog-report-column-view.c
index 4453c1012..88c5925fc 100644
--- a/gnucash/gnome/dialog-report-column-view.c
+++ b/gnucash/gnome/dialog-report-column-view.c
@@ -490,11 +490,13 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
                 oldlist = SCM_CDR(oldlist);
             }
             newlist = scm_append
-                      (scm_list_n (scm_reverse(scm_cons(SCM_LIST4(new_report,
-                                               scm_from_int (1),
-                                               scm_from_int (1),
-                                               SCM_BOOL_F),
-                                               newlist)),
+                      (scm_list_n (scm_reverse
+                                   (scm_cons
+                                    (scm_list_4 (new_report,
+                                                 scm_from_int (1),
+                                                 scm_from_int (1),
+                                                 SCM_BOOL_F),
+                                     newlist)),
                                    oldlist,
                                    SCM_UNDEFINED));
         }
@@ -502,10 +504,11 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
         {
             newlist = scm_append
                       (scm_list_n (oldlist,
-                                   SCM_LIST1(SCM_LIST4(new_report,
-                                             scm_from_int (1),
-                                             scm_from_int (1),
-                                             SCM_BOOL_F)),
+                                   scm_list_1
+                                   (scm_list_4 (new_report,
+                                                scm_from_int (1),
+                                                scm_from_int (1),
+                                                SCM_BOOL_F)),
                                    SCM_UNDEFINED));
             r->contents_selected = oldlength;
         }
@@ -680,12 +683,12 @@ gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data)
 
         if (dlg_ret == GTK_RESPONSE_OK)
         {
-            current = SCM_LIST4(SCM_CAR(current),
-                                scm_from_int (gtk_spin_button_get_value_as_int
-                                              (GTK_SPIN_BUTTON(colspin))),
-                                scm_from_int (gtk_spin_button_get_value_as_int
-                                              (GTK_SPIN_BUTTON(rowspin))),
-                                SCM_BOOL_F);
+            current = scm_list_4 (SCM_CAR (current),
+                                  scm_from_int (gtk_spin_button_get_value_as_int
+                                                (GTK_SPIN_BUTTON(colspin))),
+                                  scm_from_int (gtk_spin_button_get_value_as_int
+                                                (GTK_SPIN_BUTTON(rowspin))),
+                                  SCM_BOOL_F);
             scm_gc_unprotect_object(r->contents_list);
             r->contents_list = scm_list_set_x(r->contents_list,
                                               scm_from_int (r->contents_selected),
diff --git a/gnucash/import-export/qif-imp/assistant-qif-import.c b/gnucash/import-export/qif-imp/assistant-qif-import.c
index b17bea8fb..f8f2514da 100644
--- a/gnucash/import-export/qif-imp/assistant-qif-import.c
+++ b/gnucash/import-export/qif-imp/assistant-qif-import.c
@@ -1422,9 +1422,9 @@ gnc_ui_qif_import_close_cb (GtkAssistant *gtkassistant, gpointer user_data)
 SCM
 gnc_ui_qif_import_assistant_get_mappings (QIFImportWindow * w)
 {
-    return SCM_LIST3(w->acct_map_info,
-                     w->cat_map_info,
-                     w->memo_map_info);
+    return scm_list_3 (w->acct_map_info,
+                       w->cat_map_info,
+                       w->memo_map_info);
 }
 
 
@@ -3038,15 +3038,16 @@ gnc_ui_qif_import_convert_progress_start_cb (GtkButton * button,
     /* This step will fill 70% of the bar. */
     gnc_progress_dialog_push (wind->convert_progress, 0.7);
     retval = scm_apply (qif_to_gnc,
-                       SCM_LIST8(wind->imported_files,
-                                 wind->acct_map_info,
-                                 wind->cat_map_info,
-                                 wind->memo_map_info,
-                                 wind->security_hash,
-                                 scm_from_utf8_string (currname ? currname : ""),
-                                 wind->transaction_status,
-                                 progress),
-                       SCM_EOL);
+                        scm_list_n (wind->imported_files,
+                                    wind->acct_map_info,
+                                    wind->cat_map_info,
+                                    wind->memo_map_info,
+                                    wind->security_hash,
+                                    scm_from_utf8_string (currname ? currname : ""),
+                                    wind->transaction_status,
+                                    progress,
+                                    SCM_UNDEFINED),
+                        SCM_EOL);
     gnc_progress_dialog_pop (wind->convert_progress);
 
     if (retval == SCM_BOOL_T)
@@ -3403,9 +3404,9 @@ gnc_ui_qif_import_finish_cb (GtkAssistant *assistant,
 
     /* Save the user's mapping preferences. */
     scm_result = scm_apply (save_map_prefs,
-                            SCM_LIST5 (wind->acct_map_info, wind->cat_map_info,
-                                      wind->memo_map_info, wind->security_hash,
-                                      wind->security_prefs),
+                            scm_list_5 (wind->acct_map_info, wind->cat_map_info,
+                                        wind->memo_map_info, wind->security_hash,
+                                        wind->security_prefs),
                             SCM_EOL);
 
     if (scm_result == SCM_BOOL_F)

commit 30843a0d075a8cbe8ed1df5b1a35804e6114474c
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Jul 13 23:20:34 2020 +0800

    [gnucash-pot] Add G_ as gettext keyword

diff --git a/po/gnucash-pot.cmake b/po/gnucash-pot.cmake
index 7edee3df9..fc953a95c 100644
--- a/po/gnucash-pot.cmake
+++ b/po/gnucash-pot.cmake
@@ -22,6 +22,7 @@ execute_process(
                         --flag=g_scanner_warn:2:c-format
                         --keyword=_
                         --keyword=Q_:1g
+                        --keyword=G_
                         --keyword=N_
                         --keyword=C_:1c,2
                         --keyword=NC_:1c,2

commit fe3787c427e16cc29c3bea3c8e40dcfc5a1356db
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Jul 13 22:28:00 2020 +0800

    [gnc-numeric] use srfi-9 records for :gnc-monetary

diff --git a/bindings/guile/gnc-numeric.scm b/bindings/guile/gnc-numeric.scm
index f7c846a5c..4f147a64e 100644
--- a/bindings/guile/gnc-numeric.scm
+++ b/bindings/guile/gnc-numeric.scm
@@ -21,6 +21,8 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(use-modules (srfi srfi-9))
+
 ;; use 'logior' in guile to bit-combine RND and DENOM flags.
 
 (define GNC-RND-FLOOR           1)
@@ -48,30 +50,17 @@
 (define GNC-ERROR-REMAINDER    -4)
 
 
-(define <gnc-monetary> 
-  (make-record-type "<gnc-monetary>" 
-		    '(commodity amount)))
-
-;; Constructor; takes one <gnc:commodity*> and one <gnc-numeric>
-(define (gnc:make-gnc-monetary c a)
-  ;;FIXME: we used to type-check the values, like:
-  ;; (gw:wcp-is-of-type? <gnc:commodity*> c)
-  (if (and #t (number? a))
-      ((record-constructor <gnc-monetary>) c a)
-      (warn "wrong arguments for gnc:make-gnc-monetary: " c a)))
-
-(define gnc:gnc-monetary? 
-  (record-predicate <gnc-monetary>))
-
-(define gnc:gnc-monetary-commodity
-  (record-accessor <gnc-monetary> 'commodity))
-
-(define gnc:gnc-monetary-amount
-  (record-accessor <gnc-monetary> 'amount))
+(define-record-type :gnc-monetary
+  (make-gnc-monetary commodity amount)
+  gnc-monetary?
+  (commodity gnc-monetary-commodity)
+  (amount gnc-monetary-amount))
 
+(define gnc:make-gnc-monetary make-gnc-monetary)
+(define gnc:gnc-monetary? gnc-monetary?)
+(define gnc:gnc-monetary-commodity gnc-monetary-commodity)
+(define gnc:gnc-monetary-amount gnc-monetary-amount)
 (define (gnc:monetary-neg a)
-  (if (gnc:gnc-monetary? a)
-      (gnc:make-gnc-monetary 
-       (gnc:gnc-monetary-commodity a)
-       (gnc-numeric-neg (gnc:gnc-monetary-amount a)))
-      (warn "wrong arguments for gnc:monetary-neg: " a)))
+  (gnc:make-gnc-monetary
+   (gnc:gnc-monetary-commodity a)
+   (- (gnc:gnc-monetary-amount a))))
diff --git a/gnucash/report/html-style-sheet.scm b/gnucash/report/html-style-sheet.scm
index 39127fe1c..b0384e7e4 100644
--- a/gnucash/report/html-style-sheet.scm
+++ b/gnucash/report/html-style-sheet.scm
@@ -130,7 +130,7 @@
     (list (cons "<string>" gnc:default-html-string-renderer)
           (cons "<gnc-numeric>" gnc:default-html-gnc-numeric-renderer)
           (cons "<number>" gnc:default-html-number-renderer)
-          (cons "<gnc-monetary>" gnc:default-html-gnc-monetary-renderer)))
+          (cons ':gnc-monetary gnc:default-html-gnc-monetary-renderer)))
   (and template
        (let ((ss (gnc:make-html-style-sheet-internal
                   style-sheet-name template-name



Summary of changes:
 CMakeLists.txt                                     | 53 ++++++++++++++--------
 README.dependencies                                |  2 +-
 bindings/guile/gnc-numeric.scm                     | 39 ++++++----------
 gnucash/gnome/dialog-report-column-view.c          | 33 ++++++++------
 .../import-export/qif-imp/assistant-qif-import.c   | 31 +++++++------
 gnucash/report/html-style-sheet.scm                |  2 +-
 gnucash/report/test/test-html-fonts.scm            |  2 +-
 po/gnucash-pot.cmake                               |  1 +
 8 files changed, 85 insertions(+), 78 deletions(-)



More information about the gnucash-changes mailing list