Packageize
This commit is contained in:
parent
f10d1ac0f0
commit
7c3b3f3c6c
23
Makefile
23
Makefile
|
@ -1,17 +1,16 @@
|
|||
SYSTEM_LIBRARY_SUBPATH:=compiled/native/$(shell racket -e '(display (path->string (system-library-subpath)))')
|
||||
SYSTEM_LIBRARY_SUFFIX:=$(shell racket -e '(begin (require dynext/file) (display (path->string (append-extension-suffix "DUMMY"))))' | sed -e s:DUMMY::)
|
||||
PACKAGENAME=ansi
|
||||
COLLECTS=ansi
|
||||
|
||||
all: $(SYSTEM_LIBRARY_SUBPATH)/tty-raw-extension$(SYSTEM_LIBRARY_SUFFIX)
|
||||
all: setup
|
||||
|
||||
clean:
|
||||
rm -rf compiled
|
||||
find . -name compiled -type d | xargs rm -rf
|
||||
|
||||
$(SYSTEM_LIBRARY_SUBPATH):
|
||||
mkdir -p $@
|
||||
setup:
|
||||
raco setup $(COLLECTS)
|
||||
|
||||
$(SYSTEM_LIBRARY_SUBPATH)/%$(SYSTEM_LIBRARY_SUFFIX): %.c $(SYSTEM_LIBRARY_SUBPATH)
|
||||
mzc --xform $*.c
|
||||
mzc --3m --cc $*.3m.c
|
||||
mzc --3m --ld $@ $*_3m.o
|
||||
rm -f $*.3m.c
|
||||
rm -f $*_3m.o
|
||||
link:
|
||||
raco pkg install --link -n $(PACKAGENAME) $$(pwd)
|
||||
|
||||
unlink:
|
||||
raco pkg remove $(PACKAGENAME)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define name "ansi")
|
||||
(define blurb
|
||||
(list
|
||||
`(p "ANSI and VT10x escape sequences.")))
|
||||
(define homepage "https://github.com/tonyg/racket-ansi")
|
||||
(define primary-file "main.rkt")
|
||||
|
||||
(define pre-install-collection "private/install.rkt")
|
||||
(define compile-omit-files '("private/install.rkt"))
|
|
@ -149,7 +149,7 @@
|
|||
))
|
||||
|
||||
(module+ main
|
||||
(require "tty-raw-extension")
|
||||
(require "private/tty-raw-extension")
|
||||
(tty-raw!)
|
||||
(let loop ()
|
||||
(match (lex-lcd-input (current-input-port))
|
|
@ -0,0 +1,7 @@
|
|||
#lang racket/base
|
||||
|
||||
(require "ansi.rkt"
|
||||
"lcd-terminal.rkt")
|
||||
|
||||
(provide (all-from-out "ansi.rkt")
|
||||
(all-from-out "lcd-terminal.rkt"))
|
|
@ -0,0 +1,29 @@
|
|||
#lang racket/base
|
||||
|
||||
(provide pre-installer)
|
||||
|
||||
(require racket/file)
|
||||
(require dynext/file)
|
||||
(require dynext/compile)
|
||||
(require dynext/link)
|
||||
|
||||
(define (pre-installer collections-top-path collection-path)
|
||||
(define private-path (build-path collection-path "private"))
|
||||
(parameterize ((current-directory private-path))
|
||||
(define shared-object-target-path (build-path private-path
|
||||
"compiled"
|
||||
"native"
|
||||
(system-library-subpath)))
|
||||
(define shared-object-target (build-path shared-object-target-path
|
||||
(append-extension-suffix "tty-raw-extension")))
|
||||
(when (not (file-exists? shared-object-target))
|
||||
(define c-source (build-path private-path "tty-raw-extension.c"))
|
||||
(define object (build-path shared-object-target-path "tty-raw-extension.o"))
|
||||
(make-directory* shared-object-target-path)
|
||||
(compile-extension #f ;; not quiet
|
||||
c-source
|
||||
object
|
||||
'())
|
||||
(link-extension #f ;; not quiet
|
||||
(list object)
|
||||
shared-object-target))))
|
|
@ -1,6 +1,6 @@
|
|||
#lang racket/base
|
||||
|
||||
(require "tty-raw-extension")
|
||||
(require "private/tty-raw-extension")
|
||||
(require "ansi.rkt")
|
||||
|
||||
(define (main)
|
Loading…
Reference in New Issue