Make scsh-ncurses a proper scsh package

This commit is contained in:
mainzelm 2004-09-07 14:34:15 +00:00
parent 8903036a5a
commit 714a116d7b
5 changed files with 105 additions and 3 deletions

1
AUTHORS Normal file
View File

@ -0,0 +1 @@
Christoph de Mattia

View File

@ -1,7 +1,8 @@
SUBDIRS = c
EXTRA_DIST = c/ncurses.c \
EXTRA_DIST = c/ncurses.c \
scheme/ncurses-interfaces.scm \
scheme/ncurses-packages.scm \
scheme/ncurses.scm \
scheme/scsh-package.scm \
scheme/ncurses.scm \
scheme/ncurses-constants.scm \
pkg-def.scm

8
c/Makefile.am Normal file
View File

@ -0,0 +1,8 @@
INCLUDES = -I@top_srcdir@/c -I@scsh_includes@
libsys_LTLIBRARIES = libscshncurses.la
libscshncurses_la_SOURCES = ncurses.c
libscshncurses_la_LIBADD = -lncurses
libscshncurses_la_LDFLAGS = -version-info 1:0:0 -module

30
configure.in Normal file
View File

@ -0,0 +1,30 @@
AC_INIT(scsh-ncurses, 0.1)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR(configure.in)
AC_LANG(C)
define([PREPEND], [[$2]="$[$2] [$1]"])
AC_PROG_LIBTOOL
AC_PROG_CC
AC_ARG_WITH(scsh-includes,
AC_HELP_STRING([--with-scsh-includes=DIR],
[scsh include files are in DIR [/usr/local/include]]),
scsh_includes=$withval,
scsh_includes=/usr/local/include)
AC_SUBST(scsh_includes)
missing_yp_funs=""
schemedir='${prefix}'"/scheme"
libdir='${prefix}'"/lib"
libsysdir='${prefix}'
AC_SUBST(libdir)
AC_SUBST(libsysdir)
AC_SUBST(schemedir)
AC_SUBST(LIBS)
AC_SUBST(CC)
AC_OUTPUT([Makefile c/Makefile])

62
pkg-def.scm Normal file
View File

@ -0,0 +1,62 @@
(define-package "scsh-ncurses" (0 1)
((install-lib-version (1 0)))
(display "configuring, compiling and installing c-stubs")
(newline)
(let* ((scsh-includes (include-dir))
(build-host (get-option-value 'build))
(prefix (string-append (get-directory 'lib #f) "/" build-host))
(configure `("./configure"
,(string-append "--prefix=" prefix)
,(string-append "--with-scsh-includes=" scsh-includes)
,(string-append "--enable-static=no")
,(string-append "--build=" build-host)))
(make `(make install
,(string-append "DESTDIR=" (get-option-value 'dest-dir)))))
(if (get-option-value 'dry-run)
(begin
(display configure)
(newline)
(display make)
(newline))
(if (not (and (zero? (run ,configure))
(zero? (run ,make))))
(exit))))
(display "creating load.scm")
(newline)
(let ((schemedir (get-directory 'scheme #f))
(libdir (get-directory 'lib #f)))
(write-to-load-script
`((user)
(load-package 'dynamic-externals)
(open 'dynamic-externals)
(open 'external-calls)
(open 'configure)
(open 'signals)
,@(map (lambda (x) `(run ',x)) tmpl-libtool-la-reader)
(run '(let* ((lib-dir (string-append ,libdir "/" (host)))
(la-file-name (string-append lib-dir "/libscshncurses.la"))
(initializer-name "s48_init_ncurses"))
(let ((la-alist (read-libtool-la la-file-name)))
(cond
((assoc 'dlname la-alist)
=> (lambda (p)
(let ((module-file (string-append lib-dir "/" (cdr p))))
(dynamic-load module-file)
(call-external (get-external initializer-name)))))
(else
(error "Could not figure out libscshncurses' name" la-file-name))))))
(config)
(load ,(string-append schemedir "/ncurses-packages.scm"))
(user))))
(display "installing")
(newline)
(install-directory-contents "scheme" 'scheme)
; (install-file '("COPYING" . "LICENSE") 'doc)
)