From e0eee55bf3c0aa9b97973b1d53227dec2ca46095 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Wed, 15 May 2019 23:26:52 +0200 Subject: [PATCH] build: Fix mescc installation on Debian. * build-aux/pre-inst-env.in: Set bindir. * scripts/mescc.in: Fix configure/prefix issues. * mes/module/mes/boot-01.scm (integer->char): Remove. (newline): Use "\n". (%moduledir): Use string-append. * mes/module/mes/boot-02.scm: Likewise. * mes/module/mes/boot-0.scm: Likewise. --- build-aux/pre-inst-env.in | 5 ++++- mes/module/mes/boot-0.scm.in | 15 +++++---------- mes/module/mes/boot-01.scm | 7 ++----- mes/module/mes/boot-02.scm | 7 ++----- mes/module/mes/boot-03.scm | 15 +++++---------- scripts/mescc.in | 17 ++++++++++++----- 6 files changed, 30 insertions(+), 36 deletions(-) diff --git a/build-aux/pre-inst-env.in b/build-aux/pre-inst-env.in index 0ba9d8af..0bd4baec 100644 --- a/build-aux/pre-inst-env.in +++ b/build-aux/pre-inst-env.in @@ -1,7 +1,7 @@ #! @BASH@ # GNU Mes --- Maxwell Equations of Software -# Copyright © 2018 Jan (janneke) Nieuwenhuizen +# Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen # # This file is part of GNU Mes. # @@ -40,6 +40,9 @@ export PATH MES=${MES-${abs_top_builddir}/src/${program_prefix}mes} export MES +bindir=${abs_top_builddir}/scripts +export bindir + GUIX_PACKAGE_PATH="$abs_top_srcdir/guix${GUIX_PACKAGE_PATH:+:}$GUIX_PACKAGE_PATH" export GUIX_PACKAGE_PATH diff --git a/mes/module/mes/boot-0.scm.in b/mes/module/mes/boot-0.scm.in index b5629a6c..c6c0c8aa 100644 --- a/mes/module/mes/boot-0.scm.in +++ b/mes/module/mes/boot-0.scm.in @@ -1,7 +1,7 @@ ;;; -*-scheme-*- ;;; GNU Mes --- Maxwell Equations of Software -;;; Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Mes. ;;; @@ -52,11 +52,8 @@ (if (null? rest) (core:write x) (core:write-port x (car rest)))) -(define (integer->char x) - (core:make-cell 0 x)) - (define (newline . rest) - (core:display (list->string (list (integer->char 10))))) + (core:display "\n")) (define (cadr x) (car (cdr x))) @@ -142,11 +139,9 @@ (define %prefix (getenv "MES_PREFIX")) (define %moduledir (if (not %prefix) "mes/module/" - (list->string - (append (string->list %prefix) (string->list "/module/" ))))) + (string-append %prefix "/module/"))) -(include (list->string - (append2 (string->list %moduledir) (string->list "mes/type-0.mes")))) +(include (string-append %moduledir "mes/type-0.mes")) (if (and (getenv "MES_DEBUG") (not (equal2? (getenv "MES_DEBUG") "0")) @@ -191,7 +186,7 @@ (mes-use-module (mes posix)) (define-macro (include-from-path file) - (let loop ((path (cons* %moduledir "@srcdir@/module" (string-split (or (getenv "GUILE_LOAD_PATH")) #\:)))) + (let loop ((path (cons* %moduledir "@srcdir@/module" (string-split (or (getenv "GUILE_LOAD_PATH") "") #\:)))) (cond ((and=> (getenv "MES_DEBUG") (compose (lambda (o) (> o 2)) string->number)) (core:display-error (string-append "include-from-path: " file " [PATH:" (string-join path ":") "]\n"))) ((and=> (getenv "MES_DEBUG") (compose (lambda (o) (> o 1)) string->number)) diff --git a/mes/module/mes/boot-01.scm b/mes/module/mes/boot-01.scm index 74641c22..c42bc814 100644 --- a/mes/module/mes/boot-01.scm +++ b/mes/module/mes/boot-01.scm @@ -1,5 +1,5 @@ ;;; GNU Mes --- Maxwell Equations of Software -;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Mes. ;;; @@ -42,11 +42,8 @@ (if (null? rest) (core:write x) (core:write-port x (car rest)))) -(define (integer->char x) - (core:make-cell 0 x)) - (define (newline . rest) - (core:display (list->string (list (integer->char 10))))) + (core:display "\n")) (define (cadr x) (car (cdr x))) diff --git a/mes/module/mes/boot-02.scm b/mes/module/mes/boot-02.scm index 4e691b40..4f09daea 100644 --- a/mes/module/mes/boot-02.scm +++ b/mes/module/mes/boot-02.scm @@ -1,7 +1,7 @@ ;;; -*-scheme-*- ;;; GNU Mes --- Maxwell Equations of Software -;;; Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Mes. ;;; @@ -52,11 +52,8 @@ (if (null? rest) (core:write x) (core:write-port x (car rest)))) -(define (integer->char x) - (core:make-cell 0 x)) - (define (newline . rest) - (core:display (list->string (list (integer->char 10))))) + (core:display "\n")) (define (cadr x) (car (cdr x))) diff --git a/mes/module/mes/boot-03.scm b/mes/module/mes/boot-03.scm index b61874fa..248b95b4 100644 --- a/mes/module/mes/boot-03.scm +++ b/mes/module/mes/boot-03.scm @@ -1,7 +1,7 @@ ;;; -*-scheme-*- ;;; GNU Mes --- Maxwell Equations of Software -;;; Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Mes. ;;; @@ -52,11 +52,8 @@ (if (null? rest) (core:write x) (core:write-port x (car rest)))) -(define (integer->char x) - (core:make-cell 0 x)) - (define (newline . rest) - (core:display (list->string (list (integer->char 10))))) + (core:display "\n")) (define (cadr x) (car (cdr x))) @@ -141,12 +138,10 @@ (define %prefix (getenv "MES_PREFIX")) (define %moduledir - (if (not %prefix) "boe /share/mes/module/" - (list->string - (append (string->list %prefix) (string->list "/module/" ))))) + (if (not %prefix) "mes/module/" + (string-append %prefix "/module/"))) -(include (list->string - (append2 (string->list %moduledir) (string->list "mes/type-0.mes")))) +(include (string-append %moduledir "mes/type-0.mes")) (if (and (getenv "MES_DEBUG") (not (equal2? (getenv "MES_DEBUG") "0")) diff --git a/scripts/mescc.in b/scripts/mescc.in index 261bea97..1e3dbbbc 100755 --- a/scripts/mescc.in +++ b/scripts/mescc.in @@ -1,7 +1,7 @@ #! @BASH@ # GNU Mes --- Maxwell Equations of Software -# Copyright © 2018 Jan (janneke) Nieuwenhuizen +# Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen # # This file is part of GNU Mes. # @@ -28,15 +28,22 @@ export MES_ARENA MES_STACK=${MES_STACK-500000} export MES_STACK -MES_PREFIX=${MES_PREFIX-$prefix/share/mes} +MES_PREFIX=${MES_PREFIX-/usr/share/mes} export MES_PREFIX -MES=${MES-src/mes} +GUILE_LOAD_PATH=@guile_site_dir@${GUILE_LOAD_PATH+:}${GUILE_LOAD_PATH} +export GUILE_LOAD_PATH + +MES=${MES-@prefix@/bin/mes} +bindir=${bindir-@prefix@/bin/mes} + +if [ ! -f $bindir/mescc.scm ]; then + bindir=$(dirname $0) +fi -dir=$(dirname $0) ${SCHEME-$MES} \ --no-auto-compile\ -e main\ -L @guile_site_dir@\ -C @guile_site_ccache_dir@\ - $dir/mescc.scm "$@" + $bindir/mescc.scm "$@"