Use a scheme file to propagate version from configure.ac

Julien LepillerSun Apr 12 23:49:39+0200 2020

8c280d0

Use a scheme file to propagate version from configure.ac

.gitignore

1010
missing             
1111
pre-inst-env        
1212
*.go
13+
config.scm
1314
1415
*.log
1516
*.trs

Makefile.am

11
include guile.am
22
33
SOURCES= \
4+
  config.scm \
45
  jsonld.scm \
56
  jsonld/compaction.scm \
67
  jsonld/context-processing.scm \

config.scm.in unknown status 1

1+
;;;; Copyright (C) 2020 Julien Lepiller <julien@lepiller.eu>
2+
;;;; 
3+
;;;; This library is free software; you can redistribute it and/or
4+
;;;; modify it under the terms of the GNU Lesser General Public
5+
;;;; License as published by the Free Software Foundation; either
6+
;;;; version 3 of the License, or (at your option) any later version.
7+
;;;; 
8+
;;;; This library is distributed in the hope that it will be useful,
9+
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11+
;;;; Lesser General Public License for more details.
12+
;;;; 
13+
;;;; You should have received a copy of the GNU Lesser General Public
14+
;;;; License along with this library; if not, write to the Free Software
15+
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16+
;;;; 
17+
18+
(define-module (config)
19+
  #:export (version))
20+
21+
(define version "@PACKAGE_VERSION@")

configure.ac

2323
2424
2525
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
26+
AC_CONFIG_FILES([config.scm], [])
2627
AC_CONFIG_FILES([tests/compact.scm], [chmod +x tests/compact.scm])
2728
AC_CONFIG_FILES([tests/expand.scm], [chmod +x tests/expand.scm])
2829
AC_CONFIG_FILES([tests/flatten.scm], [chmod +x tests/flatten.scm])

test-modules/result.scm

1616
;;;; 
1717
1818
(define-module (test-modules result)
19+
  #:use-module ((config) #:prefix config:)
1920
  #:use-module (srfi srfi-9)
2021
  #:use-module (srfi srfi-19)
2122
  #:use-module (ice-9 match)

125126
      (format port "   doap:programming-language \"GNU Guile\"^^xsd:string;~%")
126127
      (format port "   doap:shortdesc \"JSON-LD support for GNU Guile.\"@en;~%")
127128
      (format port "   doap:release [~%")
128-
      (format port "      doap:name \"guile-jsonld-1.0.0\";~%")
129-
      (format port "      doap:revision \"1.0.0\";~%")
129+
      (format port "      doap:name \"guile-jsonld-~a\";~%" config:version)
130+
      (format port "      doap:revision \"~a\";~%" config:version)
130131
      (format port "      doap:created \"2020-03-29\"^^xsd:date;~%")
131132
      (format port "   ] .~%")
132133
      (format port "~%")