From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.user Subject: guile-cairo - patch Date: Tue, 21 Mar 2023 02:05:31 -0300 Message-ID: <20230321020531.0417f3d9@aicha> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/gSbNF4L9QbEUN5nh=dL7u2M"; protocol="application/pgp-signature"; micalg=pgp-sha512 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9771"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Mar 21 06:06:13 2023 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1peUCL-0002L3-5u for guile-user@m.gmane-mx.org; Tue, 21 Mar 2023 06:06:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peUBx-0006ao-SJ; Tue, 21 Mar 2023 01:05:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1peUBv-0006ac-Kl for guile-user@gnu.org; Tue, 21 Mar 2023 01:05:47 -0400 Original-Received: from smtp.all2all.org ([79.99.200.14] helo=moses.all2all.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1peUBs-0005pA-WA for guile-user@gnu.org; Tue, 21 Mar 2023 01:05:47 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by moses.all2all.org (Postfix) with ESMTP id 0E81367C0081 for ; Tue, 21 Mar 2023 06:05:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at moses.all2all.org Original-Received: from moses.all2all.org ([127.0.0.1]) by localhost (moses.all2all.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZOWYgoyT_MZc for ; Tue, 21 Mar 2023 06:05:40 +0100 (CET) Original-Received: from aicha (unknown [179.210.48.245]) by moses.all2all.org (Postfix) with ESMTPSA id 304B567C007E for ; Tue, 21 Mar 2023 06:05:38 +0100 (CET) X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) Received-SPF: pass client-ip=79.99.200.14; envelope-from=david@altosw.be; helo=moses.all2all.org X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:18949 Archived-At: --Sig_/gSbNF4L9QbEUN5nh=dL7u2M Content-Type: multipart/mixed; boundary="MP_/9yE6xYabg2n6vhf3qCdZdmS" --MP_/9yE6xYabg2n6vhf3qCdZdmS Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello Daniel, Here comes 1 (attached) patch, which fixes both 'make check' and 'make distcheck'. Please double check, try ... and let me know or push if everything looks good for you as well. Thanks, David --MP_/9yE6xYabg2n6vhf3qCdZdmS Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-Fixing-make-check-and-make-distcheck.patch =46rom 1de7b5e994fd99e20849d9372963c2aadf782ed1 Mon Sep 17 00:00:00 2001 From: David Pirotte Date: Tue, 21 Mar 2023 01:54:04 -0300 Subject: [PATCH] Fixing make check and make distcheck Notes: the main goal of this patch is to remove the hard coded libguile-cairo path, which makes it impossible to run 'make check', unless you actualy first install the version you are working on/checking [which is 'none sense']. Also, even with the above problem fixed, there were still a few nitpick things to solve so that make distcheck pass. Finally, while workig on this patch, I also made a few cosmetic changes, mostly adding a space before and after '=3D' in Makefile.am targets, as well as having each filename on its own line for targets that requires filenames. Those changes are not commented here below. * Makefile.am: (1) removing the env target, as we update env.in this is not only not necessary anymore, but would actually raise an error; (2) the CLEANFILES target misses $(GOBJECTS); (3) using $(AM_V_GEN) in .scm.go target; (4) the EXTRA_DIST target misses $(SOURCES), and does not need to ship autogen.sh nor build-aux/git-version-gen. * cairo.scm: Call (dynamic-link "libguile-cairo"), not (dynamic-link *cairo-lib-path*). * cairo/Makefile.am: (1) using $(AM_V_GEN) in .scm.go target; (2) in the config.scm target, removing the @cairolibpath@ substitution; (3) the EXTRA_DIST target misses vector-types.scm and $(NOCOMP_SOURCES). * cairo/config.scm.in: Removing the *cairo-lib-path* definition. * env.in: (1) define and use abs_top_srcdir and abs_top_builddir; (2) define and export GUILE_LOAD_PATH, GUILE_LOAD_COMPILED_PATH and LTDL_LIBRARY_PATH. * tests/unit-tests/Makefile.am: (1) add context-pointer.scm to the TESTS target; (2) add a TEST_EXTENSIONS =3D .scm target; (3) update the TESTS_ENVIRONMENT to use $(abs_top_builddir); (4) remove the %.check target (unecessary in 'modern' autotools). --- Makefile.am | 26 ++++++++----- cairo.scm | 4 +- cairo/Makefile.am | 30 ++++++++++----- cairo/config.scm.in | 8 ++-- env.in | 75 +++++++++++++++++++++++++++++++++--- tests/unit-tests/Makefile.am | 21 +++++----- 6 files changed, 125 insertions(+), 39 deletions(-) diff --git a/Makefile.am b/Makefile.am index 82e41b2..514b758 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ # guile-cairo # Copyright (C) 2007,2011 Andy Wingo +# Copyright (C) 2023 David Pirotte # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -15,18 +16,20 @@ # License along with this program. If not, see # . =20 -SUBDIRS =3D guile-cairo cairo examples tests doc - -env: Makefile env.in - sed -e "s|@top_srcdir\@|$(shell cd $(top_srcdir) && pwd)|" \ - $(srcdir)/env.in > env - chmod +x env +SUBDIRS =3D \ + guile-cairo \ + cairo \ + examples \ + tests \ + doc =20 BUILT_SOURCES =3D env =20 ACLOCAL_AMFLAGS =3D -I m4 =20 -CLEANFILES =3D env +CLEANFILES =3D \ + env \ + $(GOBJECTS) =20 GOBJECTS =3D $(SOURCES:%.scm=3D%.go) =20 @@ -39,7 +42,8 @@ nobase_nodist_obj_DATA =3D $(GOBJECTS) GUILE_WARNINGS =3D -Wunbound-variable -Warity-mismatch -Wformat SUFFIXES =3D .scm .go .scm.go: - $(top_builddir)/env $(GUILD) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o= "$@" "$<" + $(AM_V_GEN) $(top_builddir)/env \ + $(GUILD) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o "$@" "$<" =20 SOURCES =3D cairo.scm =20 @@ -58,4 +62,8 @@ gen-ChangeLog: mv $(distdir)/cl-t $(distdir)/ChangeLog; \ fi =20 -EXTRA_DIST =3D env.in autogen.sh build-aux/git-version-gen HACKING COPYING= .LESSER $(scm_DATA) +EXTRA_DIST =3D \ + env.in \ + HACKING \ + COPYING.LESSER \ + $(SOURCES) diff --git a/cairo.scm b/cairo.scm index 1361d85..2cb2793 100644 --- a/cairo.scm +++ b/cairo.scm @@ -1,5 +1,6 @@ ;; guile-cairo ;; Copyright (C) 2007, 2011 Andy Wingo +;; Copyright (C) 2023 David Pirotte =20 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU Lesser General Public License as @@ -31,9 +32,10 @@ (module-use! (module-public-interface (current-module)) (resolve-interface '(cairo vector-types))) =20 + ;; This will export many things (dynamic-call "scm_init_cairo" - (dynamic-link *cairo-lib-path*)) + (dynamic-link "libguile-cairo")) =20 (if (not (member *cairo-documentation-path* documentation-files)) (set! documentation-files (cons *cairo-documentation-path* diff --git a/cairo/Makefile.am b/cairo/Makefile.am index 05b5973..0299d34 100644 --- a/cairo/Makefile.am +++ b/cairo/Makefile.am @@ -1,5 +1,6 @@ # guile-cairo # Copyright (C) 2007,2011 Andy Wingo +# Copyright (C) 2023 David Pirotte # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -15,11 +16,15 @@ # License along with this program. If not, see # . =20 -moddir=3D$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)/cairo -objdir=3D$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache/cairo +moddir =3D $(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)/cairo +objdir =3D $(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache/cairo =20 -SOURCES =3D config.scm vector-types.scm -NOCOMP_SOURCES =3D cairo-procedures.txt +SOURCES =3D \ + config.scm \ + vector-types.scm + +NOCOMP_SOURCES =3D \ + cairo-procedures.txt =20 GOBJECTS =3D $(SOURCES:%.scm=3D%.go) =20 @@ -29,12 +34,12 @@ nobase_nodist_obj_DATA =3D $(GOBJECTS) GUILE_WARNINGS =3D -Wunbound-variable -Warity-mismatch -Wformat SUFFIXES =3D .scm .go .scm.go: - $(top_builddir)/env $(GUILD) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o= "$@" "$<" + $(AM_V_GEN) $(top_builddir)/env \ + $(GUILD) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o "$@" "$<" =20 config.scm: Makefile config.scm.in - sed -e "s|@cairolibpath\@|$(libdir)/libguile-cairo|" \ - -e "s|@cairodocumentationpath\@|$(moddir)/cairo-procedures.txt|" \ - $(srcdir)/config.scm.in > config.scm + sed -e "s|\@cairodocumentationpath\@|$(moddir)/cairo-procedures.txt|" \ + $(srcdir)/config.scm.in > config.scm =20 cairo-procedures.txt.update: echo "Generated from upstream documentation; see COPYING.docs for info." \ @@ -42,6 +47,11 @@ cairo-procedures.txt.update: $(top_srcdir)/doc/docbook-to-guile-doc $(CAIRO_XML_DIR)/*.xml \ >> $(srcdir)/cairo-procedures.txt =20 -CLEANFILES =3D config.scm $(GOBJECTS) +CLEANFILES =3D \ + config.scm \ + $(GOBJECTS) =20 -EXTRA_DIST =3D config.scm.in +EXTRA_DIST =3D \ + config.scm.in \ + vector-types.scm \ + $(NOCOMP_SOURCES) diff --git a/cairo/config.scm.in b/cairo/config.scm.in index ab008fb..92895b9 100644 --- a/cairo/config.scm.in +++ b/cairo/config.scm.in @@ -1,5 +1,6 @@ ;; guile-cairo ;; Copyright (C) 2007, 2011 Andy Wingo +;; Copyright (C) 2023 David Pirotte =20 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU Lesser General Public License as @@ -22,8 +23,7 @@ ;;; Code: =20 (define-module (cairo config) - :export (*cairo-lib-path* - *cairo-documentation-path*)) + :export (*cairo-documentation-path*)) =20 -(define *cairo-lib-path* "@cairolibpath@") -(define *cairo-documentation-path* "@cairodocumentationpath@") +(define *cairo-documentation-path* + "@cairodocumentationpath@") diff --git a/env.in b/env.in index eb9d020..e93d212 100644 --- a/env.in +++ b/env.in @@ -2,6 +2,7 @@ =20 # guile-cairo # Copyright (C) 2007,2011 Andy Wingo +# Copyright (C) 2023 David Pirotte # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -17,15 +18,77 @@ # License along with this program. If not, see # . =20 -this_dir=3D$(cd $(dirname $0) && pwd) -src_dir=3D"@top_srcdir@" =20 -if [ "$src_dir" !=3D "$this_dir" ]; then - GUILE_LOAD_PATH=3D$src_dir/$pkg:$this_dir/$pkg:$GUILE_LOAD_PATH +abs_top_srcdir=3D"@abs_top_srcdir@" +abs_top_builddir=3D"@abs_top_builddir@" + +[ x"$abs_top_srcdir" =3D x -o ! -d "$abs_top_srcdir" -o \ + x"$abs_top_builddir" =3D x -o ! -d "$abs_top_builddir" ] && { + echo $0: bad environment + echo abs_top_srcdir=3D$abs_top_srcdir + echo abs_top_builddir=3D$abs_top_builddir + exit 1 +} + + +### +### GUILE_LOAD_PATH +### + +if [ x"$GUILE_LOAD_PATH" =3D x ] +then + GUILE_LOAD_PATH=3D"${abs_top_srcdir}" + if test "${abs_top_srcdir}" !=3D "${abs_top_builddir}"; then + GUILE_LOAD_PATH=3D"${abs_top_builddir}:$GUILE_LOAD_PATH" + fi else - GUILE_LOAD_PATH=3D$this_dir/$pkg:$GUILE_LOAD_PATH + GUILE_LOAD_PATH=3D"${abs_top_srcdir}:$GUILE_LOAD_PATH" + if test "${abs_top_srcdir}" !=3D "${abs_top_builddir}"; then + GUILE_LOAD_PATH=3D"${abs_top_builddir}:$GUILE_LOAD_PATH" + fi fi - +## echo $GUILE_LOAD_PATH export GUILE_LOAD_PATH =20 + +### +### GUILE_LOAD_COMPILED_PATH +### + +if [ x"$GUILE_LOAD_COMPILED_PATH" =3D x ] +then + GUILE_LOAD_COMPILED_PATH=3D"${abs_top_srcdir}" + if test "${abs_top_srcdir}" !=3D "${abs_top_builddir}"; then + GUILE_LOAD_COMPILED_PATH=3D"${abs_top_builddir}:$GUILE_LOAD_COMPIL= ED_PATH" + fi +else + GUILE_LOAD_COMPILED_PATH=3D"${abs_top_srcdir}:$GUILE_LOAD_COMPILED_PAT= H" + if test "${abs_top_srcdir}" !=3D "${abs_top_builddir}"; then + GUILE_LOAD_COMPILED_PATH=3D"${abs_top_builddir}:$GUILE_LOAD_COMPIL= ED_PATH" + fi +fi + +## echo $GUILE_LOAD_COMPILED_PATH +export GUILE_LOAD_COMPILED_PATH + + +### +### LTDL_LIBRARY_PATH +### + +if [ x"$LTDL_LIBRARY_PATH" =3D x ] +then + LTDL_LIBRARY_PATH=3D"${abs_top_srcdir}/guile-cairo:${abs_top_srcdir}/g= uile-cairo/.libs" + if test "${abs_top_srcdir}" !=3D "${abs_top_builddir}"; then + LTDL_LIBRARY_PATH=3D"${abs_top_builddir}/guile-cairo:${abs_top_bui= lddir}/guile-cairo/.libs:$LTDL_LIBRARY_PATH" + fi +else + LTDL_LIBRARY_PATH=3D"${abs_top_srcdir}/guile-cairo:${abs_top_srcdir}/g= uile-cairo/.libs:$LTDL_LIBRARY_PATH" + if test "${abs_top_srcdir}" !=3D "${abs_top_builddir}"; then + LTDL_LIBRARY_PATH=3D"${abs_top_builddir}/guile-cairo:${abs_top_bui= lddir}/guile-cairo/.libs:$LTDL_LIBRARY_PATH" + fi +fi +## echo $LTDL_LIBRARY_PATH +export LTDL_LIBRARY_PATH + exec "$@" diff --git a/tests/unit-tests/Makefile.am b/tests/unit-tests/Makefile.am index 3ba6af9..9b13bbd 100644 --- a/tests/unit-tests/Makefile.am +++ b/tests/unit-tests/Makefile.am @@ -16,18 +16,21 @@ # License along with this program. If not, see # . =20 -TESTS=3D \ - context-pointer.scm \ +TESTS =3D \ api-stability.scm \ + context-pointer.scm \ version.scm =20 -TESTS_ENVIRONMENT=3D\ - API_FILE=3D$(srcdir)/cairo.api $(top_builddir)/env guile -s +TEST_EXTENSIONS =3D .scm =20 -%.api.update: - $(top_builddir)/env $(srcdir)/update-api $(subst ., ,$*) > $(srcdir)/$*.a= pi +TESTS_ENVIRONMENT =3D \ + API_FILE=3D$(srcdir)/cairo.api \ + $(abs_top_builddir)/env $(GUILE) --no-auto-compile =20 -%.check: % - $(TESTS_ENVIRONMENT) $* +%.api.update: + $(abs_top_builddir)/env \ + $(srcdir)/update-api $(subst ., ,$*) > $(srcdir)/$*.api =20 -EXTRA_DIST=3D$(TESTS) cairo.api +EXTRA_DIST =3D \ + $(TESTS) \ + cairo.api --=20 2.39.2 --MP_/9yE6xYabg2n6vhf3qCdZdmS-- --Sig_/gSbNF4L9QbEUN5nh=dL7u2M Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAmQZOxsACgkQ83T9k6MF etcOQAgAyPpAAPrLA1C3erUuKrVq1z5SYmdBt6pOcUIWhBQ1ANHX9YbZq/naUm4K pCNdKqmLj9L0ThCJswgZ5JjR7jC65ZsmHwmSD2EIxS3qMyIIQzWDItTIXq70+IwB Il3oZVYwkGwrRPmBWFE3BnbQJivH3MIKF4MqjQdEOjdXR9JRdWM1iPsQ/kWkk/kB t+Xs6QSza57+to3U5c9KZmzPJinGhx1PlE8DiHM7gMMzjxY5dsQZw8lglKaKhqP7 9nvkXJ+IbDzXbYgGR6bwzvdfGQs2Oisck/yuuf1nSdiYRU5rBft2pgvCDTtYvqhg tkAG+pvAxVRx/BH+ufofd4BRGkg+kw== =IBiL -----END PGP SIGNATURE----- --Sig_/gSbNF4L9QbEUN5nh=dL7u2M--