Commit 7a7b16df authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Also distribute the API in the SXML format

I intend to make bindings with something other than xslt.
parent fd9172bd
Pipeline #168454 passed with stages
in 35 minutes and 47 seconds
......@@ -111,6 +111,7 @@
/src/libtarot/layout/check-layout
/src/libtarot/pkgconfig/libtarot-gobject.pc
/src/libtarot/pkgconfig/libtarot.pc
/src/libtarot/semantic-api/api.sxml
/src/libtarot/semantic-api/api.xml
/src/libtarot/test/dog-impossible
/src/libtarot/test/dog-impossible.c
......@@ -119,6 +120,7 @@
/src/libtarot/test/no-slam
/src/libtarot/test/no-slam.c
/src/libtarot/xml/check_xml
/src/scheme/tarot/api.scm
/src/tarot-app/ai.c
/src/tarot-app/card_painter.c
/src/tarot-app/card_painter_default.c
......
......@@ -39,6 +39,7 @@ apt-get install -y \
gnulib \
gobject-introspection \
gperf \
guile-2.2 \
help2man \
imagemagick \
indent \
......
......@@ -35,6 +35,7 @@ git-check:
(cd .gitcheck/source && ./autogen.sh)
(cd .gitcheck/build && ../../.gitcheck/source/configure VALAFLAGS="--target-glib=2.50")
$(MAKE) $(AM_MAKEFLAGS) -C .gitcheck/build safe
$(MAKE) $(AM_MAKEFLAGS) -C .gitcheck/build all
$(MAKE) $(AM_MAKEFLAGS) -C .gitcheck/build check distcheck
$(MAKE) $(AM_MAKEFLAGS) -C .gitcheck/build indent
$(MAKE) $(AM_MAKEFLAGS) distdir
......
......@@ -15,14 +15,21 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
EXTRA_DIST += \
%reldir%/semantic-api.xsl
%reldir%/semantic-api.xsl \
%reldir%/convert-to-scm
dist_pkgdata_DATA += %reldir%/api.xml
dist_pkgdata_DATA += %reldir%/api.xml src/scheme/tarot/api.scm
MAINTAINERCLEANFILES += \
$(srcdir)/%reldir%/api.xml
$(srcdir)/%reldir%/api.xml \
$(srcdir)/src/scheme/tarot/api.scm
$(srcdir)/%reldir%/api.xml: %reldir%/semantic-api.xsl src/libtarot/gobject/Tarot.gir
$(AM_V_GEN) $(XSLTPROC) $(srcdir)/%reldir%/semantic-api.xsl $(srcdir)/src/libtarot/gobject/Tarot.gir \
| $(XMLLINT) --format - > $(srcdir)/%reldir%/api.xml-t
@mv $(srcdir)/%reldir%/api.xml-t $(srcdir)/%reldir%/api.xml
$(srcdir)/src/scheme/tarot/api.scm: %reldir%/api.xml %reldir%/convert-to-scm
$(MKDIR_P) $(srcdir)/src/scheme/tarot
$(AM_V_GEN) $(srcdir)/%reldir%/convert-to-scm < $(srcdir)/%reldir%/api.xml > $(srcdir)/src/scheme/tarot/api.scm-t
@mv $(srcdir)/src/scheme/tarot/api.scm-t $(srcdir)/src/scheme/tarot/api.scm
#!/usr/bin/env sh
# tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus
# 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 <http://www.gnu.org/licenses/>.
exec guile --no-auto-compile -s "$0" "$@"
!#
(use-modules (sxml simple))
(define data (xml->sxml #:trim-whitespace? #t))
(use-modules (ice-9 pretty-print))
(pretty-print `(library (tarot api) (export api) (import (rnrs)) (define api (quote ,data))))
(display ";; Local variables:\n")
(display ";; mode: scheme\n")
(display ";; End:\n")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment