From 09434a66895ec279fc7f8f09c4e06ed1b28bd533 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Tue, 29 Mar 2016 11:08:09 -0700 Subject: [PATCH] gtk-screen: Use autoconf. --- src/gtk-screen/Makefile | 41 --- src/gtk-screen/Makefile.in | 55 ++++ src/gtk-screen/README | 22 ++ src/gtk-screen/check.scm | 15 -- src/gtk-screen/check.sh | 54 ++++ src/gtk-screen/compile.scm | 21 -- src/gtk-screen/compile.sh | 52 ++++ src/gtk-screen/configure.ac | 39 +++ src/gtk-screen/gtk-faces.scm | 20 +- src/gtk-screen/gtk-screen-check.scm | 79 ------ src/gtk-screen/gtk-screen.pkg | 20 +- src/gtk-screen/gtk-screen.scm | 20 +- src/gtk-screen/install-sh | 251 ++++++++++++++++++ src/gtk-screen/make.scm | 11 +- src/gtk-screen/mkinstalldirs | 40 +++ .../{gtk-screen-optiondb.scm => optiondb.scm} | 4 +- 16 files changed, 551 insertions(+), 193 deletions(-) delete mode 100644 src/gtk-screen/Makefile create mode 100644 src/gtk-screen/Makefile.in create mode 100644 src/gtk-screen/README delete mode 100644 src/gtk-screen/check.scm create mode 100755 src/gtk-screen/check.sh delete mode 100644 src/gtk-screen/compile.scm create mode 100755 src/gtk-screen/compile.sh create mode 100644 src/gtk-screen/configure.ac delete mode 100644 src/gtk-screen/gtk-screen-check.scm create mode 100755 src/gtk-screen/install-sh create mode 100755 src/gtk-screen/mkinstalldirs rename src/gtk-screen/{gtk-screen-optiondb.scm => optiondb.scm} (79%) diff --git a/src/gtk-screen/Makefile b/src/gtk-screen/Makefile deleted file mode 100644 index b802a9a80..000000000 --- a/src/gtk-screen/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2011, 2012, 2013 Matthew Birkholz -# -# This file is part of an extension to MIT/GNU Scheme. -# -# MIT/GNU Scheme 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 2 of the -# License, or (at your option) any later version. -# -# MIT/GNU Scheme 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 MIT/GNU Scheme; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301, USA. - -MIT_SCHEME_EXE = mit-scheme -exe = '$(MIT_SCHEME_EXE)' --batch-mode - -all: - echo '(load "compile")' | $(exe) - @if [ -s gtk-screen-unx.crf ]; then \ - echo "gtk-screen-unx.crf:0: warning: non-empty"; exit 1; fi - -check: - echo '(load "check")' | $(exe) - -install: - echo '(install-load-option "$(DESTDIR)" "gtk-screen")' \ - | $(exe) -- *.com *.bci *.pkd make.scm - -clean distclean maintainer-clean: - rm -f TAGS *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd - -tags: - etags *.scm - -.PHONY: all check install clean distclean maintainer-clean tags diff --git a/src/gtk-screen/Makefile.in b/src/gtk-screen/Makefile.in new file mode 100644 index 000000000..e9e2b14a7 --- /dev/null +++ b/src/gtk-screen/Makefile.in @@ -0,0 +1,55 @@ +# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, +# 2016 Matthew Birkholz +# +# This file is part of a gtk-screen system for MIT/GNU Scheme. +# +# This system 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 2 of the License, or +# (at your option) any later version. +# +# This system 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 system; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301, USA. + +top_srcdir = @top_srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +scmlibdir = $(libdir)/mit-scheme-@MIT_SCHEME_ARCH@ +scmlib_subdir = $(scmlibdir)/gtk-screen +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + +MIT_SCHEME_EXE = @MIT_SCHEME_EXE@ +exe = $(MIT_SCHEME_EXE) --batch-mode + +all: + ./compile.sh + +check: + ./check.sh + +install: + $(mkinstalldirs) $(DESTDIR)$(scmlib_subdir) + $(INSTALL_DATA) *.com *.bci *.pkd make.scm $(DESTDIR)$(scmlib_subdir)/ + echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' | $(exe) + +uninstall: + rm -rf "$(DESTDIR)$(scmlib_subdir)" + echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' | $(exe) + +clean distclean maintainer-clean: + rm -f TAGS *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd + +tags: + etags *.scm + +.PHONY: all check install clean distclean maintainer-clean tags diff --git a/src/gtk-screen/README b/src/gtk-screen/README new file mode 100644 index 000000000..20e0c1e6d --- /dev/null +++ b/src/gtk-screen/README @@ -0,0 +1,22 @@ +The GTK-SCREEN option. + +This option is a Gtk+-based screen type for Edwin. After loading this +option, the old X11 display type is shadowed. The new screen type +becomes the default when Edwin starts with a DISPLAY environment +variable setting. + +The option is built and installed in the customary GNU way: + + ./configure + make all check + make install + +To try it out: + + (load-option 'GTK-SCREEN) + (spawn-edit) + +Enable it for future editing sessions by creating a ~/.edwin file +containing: + + (load-option 'GTK-SCREEN) diff --git a/src/gtk-screen/check.scm b/src/gtk-screen/check.scm deleted file mode 100644 index 577649e44..000000000 --- a/src/gtk-screen/check.scm +++ /dev/null @@ -1,15 +0,0 @@ -#| -*-Scheme-*- |# - -;;;; Test the gtk screen. - -(let ((dirname (directory-pathname (current-load-pathname))) - (param (access library-directory-path - (->environment '(runtime pathname))))) - (parameterize ((param (cons dirname (param)))) - (set! *initial-options-file* (merge-pathnames "gtk-screen-optiondb" - dirname)) - (load-option 'GTK-SCREEN))) - -(if (gtk-initialized?) - (load "gtk-screen-check") - (warn "Could not test the GTK subsystem without a DISPLAY.")) \ No newline at end of file diff --git a/src/gtk-screen/check.sh b/src/gtk-screen/check.sh new file mode 100755 index 000000000..bc0390975 --- /dev/null +++ b/src/gtk-screen/check.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# -*-Scheme-*- +# +# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, +# 2016 Matthew Birkholz +# +# This file is part of a gtk-screen system for MIT/GNU Scheme. +# +# This system 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 2 of the License, or +# (at your option) any later version. +# +# This system 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 system; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# Test the GTK-SCREEN option. + +set -e +: ${MIT_SCHEME_EXE=mit-scheme} +${MIT_SCHEME_EXE} --prepend-library . --batch-mode <<\EOF +(begin + (load-option 'GTK-SCREEN) + + (if (gtk-initialized?) + (let ((env (->environment '(gtk gtk-widget)))) + (spawn-edit) + (let loop () + (sleep-current-thread 1000) + (if (not (null? (access toplevel-windows env))) + (loop))) + (gc-flip) + (sleep-current-thread 100) ;Ensure GC deamons finish? + (let ((ffi (->environment '(runtime ffi)))) + (if (not (zero? (car ((access registered-callback-count ffi))))) + (error "Gtk-Screen did not clean up its callbacks")) + (if (not (null? (access malloced-aliens ffi))) + (error "Gtk-Screen did not free allocated memory;" + (map (lambda (elt) + (let ((alien (weak-car elt))) + (if (eq? 'uchar (alien/ctype alien)) + (c-peek-cstring alien) + alien))) + (access malloced-aliens ffi)))))) + (warn "Could not test the GTK-SCREEN option without a DISPLAY.")) + ) +EOF diff --git a/src/gtk-screen/compile.scm b/src/gtk-screen/compile.scm deleted file mode 100644 index e86b782e9..000000000 --- a/src/gtk-screen/compile.scm +++ /dev/null @@ -1,21 +0,0 @@ -#| -*-Scheme-*- |# - -;;;; Compile the Gtk-Screen system - -(load-option 'CREF) -(load-option 'SOS) -(load-option 'GTK) - -(with-working-directory-pathname (directory-pathname (current-load-pathname)) - (lambda () - (if (name->package '(EDWIN SCREEN GTK-SCREEN)) - (error "The (EDWIN SCREEN GTK-SCREEN) package already exists.") - (let ((package-set (package-set-pathname "gtk-screen"))) - (if (not (file-modification-timeenvironment '(edwin screen gtk-screen)))) - (compile-file "gtk-screen" '() env) - (compile-file "gtk-faces" '() env)) - (cref/generate-constructors "gtk-screen" 'ALL))) \ No newline at end of file diff --git a/src/gtk-screen/compile.sh b/src/gtk-screen/compile.sh new file mode 100755 index 000000000..23e6c9444 --- /dev/null +++ b/src/gtk-screen/compile.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# -*-Scheme-*- +# +# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, +# 2016 Matthew Birkholz +# +# This file is part of a gtk-screen system for MIT/GNU Scheme. +# +# This system 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 2 of the License, or +# (at your option) any later version. +# +# This system 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 system; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# Compile the GTK-SCREEN option. + +set -e +: ${MIT_SCHEME_EXE=mit-scheme} +${MIT_SCHEME_EXE} --batch-mode <<\EOF +(begin + + (parameterize ((param:suppress-loading-message? #t)) + (load-option 'CREF) + (load-option 'GTK)) + + (if (name->package '(EDWIN SCREEN GTK-SCREEN)) + (error "The (EDWIN SCREEN GTK-SCREEN) package already exists.")) + (let ((package-set (package-set-pathname "gtk-screen"))) + (if (not (file-modification-timeenvironment '(edwin screen gtk-screen)))) + (compile-file "gtk-screen" '() env) + (compile-file "gtk-faces" '() env)) + + (cref/generate-constructors "gtk-screen") + ) +EOF +SUFFIX=`echo "(display (microcode-id/operating-system-suffix))" \ + | ${MIT_SCHEME_EXE} --batch-mode` +REPORT=gtk-screen-$SUFFIX.crf +if [ -s "$REPORT" ]; then echo "$REPORT:1: error: not empty"; exit 1; fi diff --git a/src/gtk-screen/configure.ac b/src/gtk-screen/configure.ac new file mode 100644 index 000000000..28c0be272 --- /dev/null +++ b/src/gtk-screen/configure.ac @@ -0,0 +1,39 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_INIT([MIT/GNU Scheme gtk-screen], + [0.5], + [puck@birchwood-abbey.net], + [mit-scheme-gtk-screen]) +AC_CONFIG_SRCDIR([gtk-screen.pkg]) + +AC_COPYRIGHT( +[Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, + 2016 Matthew Birkholz + +This file is part of a gtk-screen system for MIT/GNU Scheme. + +This system 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 2 of the License, or (at your +option) any later version. + +This system 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 system; if not, write to the Free Software Foundation, +Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +AC_PROG_INSTALL + +: ${MIT_SCHEME_EXE=mit-scheme} +MIT_SCHEME_ARCH=`echo "(display microcode-id/compiled-code-type)" \ + | ${MIT_SCHEME_EXE} --batch-mode` + +AC_SUBST([MIT_SCHEME_EXE]) +AC_SUBST([MIT_SCHEME_ARCH]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/src/gtk-screen/gtk-faces.scm b/src/gtk-screen/gtk-faces.scm index adbfa6773..adb74ea2e 100644 --- a/src/gtk-screen/gtk-faces.scm +++ b/src/gtk-screen/gtk-faces.scm @@ -1,23 +1,23 @@ #| -*-Scheme-*- -Copyright (C) 2013 Matthew Birkholz +Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, + 2016 Matthew Birkholz -This file is part of an extension to MIT/GNU Scheme. +This file is part of a gtk-screen system for MIT/GNU Scheme. -MIT/GNU Scheme 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 2 of the License, or (at -your option) any later version. +This system 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 2 of the License, or (at your +option) any later version. -MIT/GNU Scheme is distributed in the hope that it will be useful, but +This system 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 MIT/GNU Scheme; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, -USA. +along with this system; if not, write to the Free Software Foundation, +Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |# diff --git a/src/gtk-screen/gtk-screen-check.scm b/src/gtk-screen/gtk-screen-check.scm deleted file mode 100644 index 28e60c8b4..000000000 --- a/src/gtk-screen/gtk-screen-check.scm +++ /dev/null @@ -1,79 +0,0 @@ -#| -*-Scheme-*- - -Copyright (C) 2012, 2013 Matthew Birkholz - -This file is part of MIT/GNU Scheme. - -MIT/GNU Scheme 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 2 of the License, or (at -your option) any later version. - -MIT/GNU Scheme 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 MIT/GNU Scheme; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, -USA. - -|# - -;;;; Test the Gtk Screen - -(let ((dirname (directory-pathname (current-load-pathname))) - (ffi (->environment '(runtime ffi)))) - (let ((registered-callback-count (access registered-callback-count ffi)) - (malloced-aliens (named-lambda (malloced-aliens) - (access malloced-aliens ffi)))) - - (define (run-test name thunk) - (let ((condition (ignore-errors thunk))) - (cond ((eq? condition #t) - (for-each display (list "; Test "name" succeeded.\n"))) - ((condition? condition) - (for-each display (list "; Test "name" failed with error:\n")) - (write-condition-report condition (current-output-port)) - (newline)) - (else - (for-each display (list "; Test "name" returned "condition - ".\n")))))) - - (define (assert = obj1 obj2 form) - (if (not (= obj1 obj2)) - (error "Assertion failed:" form)) - #t) - - (define (await-closed-windows) - (gtk-time-slice-window! #t) - (spawn-edit) - (let loop () - (sleep-current-thread 1000) - (if (not (null? (access toplevel-windows - (->environment '(gtk gtk-widget))))) - (loop)))) - - (define (note* . args) - (with-notification - (lambda (port) - (for-each (lambda (o) (display o port)) args)) - #f)) - - (run-test 'gtk-screens - (lambda () - (with-gc-notification! #t await-closed-windows) - (gc-flip))) - - (run-test 'gtk-screens.callbacks - (lambda () - (assert = (car (registered-callback-count)) - 0 - '(REGISTERED-CALLBACK-COUNT)))) - - (run-test 'gtk-screens.mallocs - (lambda () - (assert = (length (malloced-aliens)) - 0 - '(LENGTH MALLOCED-ALIENS)))))) \ No newline at end of file diff --git a/src/gtk-screen/gtk-screen.pkg b/src/gtk-screen/gtk-screen.pkg index ef069f6f6..b153ab13d 100644 --- a/src/gtk-screen/gtk-screen.pkg +++ b/src/gtk-screen/gtk-screen.pkg @@ -1,23 +1,23 @@ #| -*-Scheme-*- -Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Matthew Birkholz +Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, + 2016 Matthew Birkholz -This file is part of an extension to MIT/GNU Scheme. +This file is part of a gtk-screen system for MIT/GNU Scheme. -MIT/GNU Scheme 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 2 of the License, or (at -your option) any later version. +This system 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 2 of the License, or (at your +option) any later version. -MIT/GNU Scheme is distributed in the hope that it will be useful, but +This system 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 MIT/GNU Scheme; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, -USA. +along with this system; if not, write to the Free Software Foundation, +Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |# diff --git a/src/gtk-screen/gtk-screen.scm b/src/gtk-screen/gtk-screen.scm index 8c57bb276..c70003ecc 100644 --- a/src/gtk-screen/gtk-screen.scm +++ b/src/gtk-screen/gtk-screen.scm @@ -1,23 +1,23 @@ #| -*-Scheme-*- -Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Matthew Birkholz +Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, + 2016 Matthew Birkholz -This file is part of an extension to MIT/GNU Scheme. +This file is part of a gtk-screen system for MIT/GNU Scheme. -MIT/GNU Scheme 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 2 of the License, or (at -your option) any later version. +This system 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 2 of the License, or (at your +option) any later version. -MIT/GNU Scheme is distributed in the hope that it will be useful, but +This system 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 MIT/GNU Scheme; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, -USA. +along with this system; if not, write to the Free Software Foundation, +Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |# diff --git a/src/gtk-screen/install-sh b/src/gtk-screen/install-sh new file mode 100755 index 000000000..e9de23842 --- /dev/null +++ b/src/gtk-screen/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/src/gtk-screen/make.scm b/src/gtk-screen/make.scm index c45ff302f..b1fe419bf 100644 --- a/src/gtk-screen/make.scm +++ b/src/gtk-screen/make.scm @@ -2,9 +2,10 @@ Load the Gtk-Screen option. |# -(load-option 'Gtk) -(load-option 'Edwin) -(with-loader-base-uri (system-library-uri "gtk-screen/") - (lambda () - (load-package-set "gtk-screen"))) +(parameterize ((param:suppress-loading-message? #t)) + (load-option 'Gtk) + (load-option 'Edwin) + (with-loader-base-uri (system-library-uri "gtk-screen/") + (lambda () + (load-package-set "gtk-screen")))) (add-subsystem-identification! "Gtk-Screen" '(0 1)) \ No newline at end of file diff --git a/src/gtk-screen/mkinstalldirs b/src/gtk-screen/mkinstalldirs new file mode 100755 index 000000000..18f6d1782 --- /dev/null +++ b/src/gtk-screen/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $$ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/src/gtk-screen/gtk-screen-optiondb.scm b/src/gtk-screen/optiondb.scm similarity index 79% rename from src/gtk-screen/gtk-screen-optiondb.scm rename to src/gtk-screen/optiondb.scm index 75d5dac26..bc0331d92 100644 --- a/src/gtk-screen/gtk-screen-optiondb.scm +++ b/src/gtk-screen/optiondb.scm @@ -11,5 +11,5 @@ (further-load-options (merge-pathnames "optiondb" - (last ((access library-directory-path - (->environment '(runtime pathname))))))) \ No newline at end of file + (cadr (access library-directory-path + (->environment '(runtime pathname)))))) \ No newline at end of file -- 2.25.1