From 22707789ec7b9ed6a9b9d821ea870354e2ff22d0 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 27 Jul 2018 17:14:32 +0200 Subject: Generate %assets-root value. --- .gitignore | 1 + config.scm | 28 ---------------------------- config.scm.in | 42 ++++++++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- 4 files changed, 44 insertions(+), 29 deletions(-) delete mode 100644 config.scm create mode 100644 config.scm.in diff --git a/.gitignore b/.gitignore index a617842..40685ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.go +config.scm configure config.log config.status diff --git a/config.scm b/config.scm deleted file mode 100644 index d52ae55..0000000 --- a/config.scm +++ /dev/null @@ -1,28 +0,0 @@ -;;; The Inevitable Game -;;; Copyright © 2018 Ricardo Wurmus -;;; -;;; 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 -;;; . - -(define-module (config) - #:export (%width - %height - %line-height - %message-margin)) - - -(define %width 320) -(define %height 240) -(define %line-height 12.5) -(define %message-margin 4.0) diff --git a/config.scm.in b/config.scm.in new file mode 100644 index 0000000..43db6cf --- /dev/null +++ b/config.scm.in @@ -0,0 +1,42 @@ +;;; The Inevitable Game +;;; Copyright © 2018 Ricardo Wurmus +;;; +;;; 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 +;;; . + +(define-module (config) + #:export (%width + %height + %line-height + %message-margin + %assets-root)) + + +(define %width 320) +(define %height 240) +(define %line-height 12.5) +(define %message-margin 4.0) +(define %assets-root + (let* ((prefix "@prefix@") + (datarootdir + (string-append prefix + (string-drop "@datarootdir@" + (string-length "${prefix}")))) + (pkgdatadir + (string-append datarootdir + (string-drop "@datadir@/@PACKAGE@" + (string-length "${datarootdir}"))))) + (if (getenv "INEVITABLE_UNINSTALLED") + (getcwd) + pkgdatadir))) diff --git a/configure.ac b/configure.ac index fe92128..8f8c9c4 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AM_INIT_AUTOMAKE([color-tests -Wall -Wno-portability foreign]) AM_SILENT_RULES([yes]) AC_PATH_PROG([GUILE], [guile]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile config.scm]) AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) AC_CONFIG_FILES([scripts/inevitable], [chmod +x scripts/inevitable]) -- cgit v1.2.3