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)))')
|
PACKAGENAME=ansi
|
||||||
SYSTEM_LIBRARY_SUFFIX:=$(shell racket -e '(begin (require dynext/file) (display (path->string (append-extension-suffix "DUMMY"))))' | sed -e s:DUMMY::)
|
COLLECTS=ansi
|
||||||
|
|
||||||
all: $(SYSTEM_LIBRARY_SUBPATH)/tty-raw-extension$(SYSTEM_LIBRARY_SUFFIX)
|
all: setup
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf compiled
|
find . -name compiled -type d | xargs rm -rf
|
||||||
|
|
||||||
$(SYSTEM_LIBRARY_SUBPATH):
|
setup:
|
||||||
mkdir -p $@
|
raco setup $(COLLECTS)
|
||||||
|
|
||||||
$(SYSTEM_LIBRARY_SUBPATH)/%$(SYSTEM_LIBRARY_SUFFIX): %.c $(SYSTEM_LIBRARY_SUBPATH)
|
link:
|
||||||
mzc --xform $*.c
|
raco pkg install --link -n $(PACKAGENAME) $$(pwd)
|
||||||
mzc --3m --cc $*.3m.c
|
|
||||||
mzc --3m --ld $@ $*_3m.o
|
unlink:
|
||||||
rm -f $*.3m.c
|
raco pkg remove $(PACKAGENAME)
|
||||||
rm -f $*_3m.o
|
|
||||||
|
|
|
@ -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
|
(module+ main
|
||||||
(require "tty-raw-extension")
|
(require "private/tty-raw-extension")
|
||||||
(tty-raw!)
|
(tty-raw!)
|
||||||
(let loop ()
|
(let loop ()
|
||||||
(match (lex-lcd-input (current-input-port))
|
(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
|
#lang racket/base
|
||||||
|
|
||||||
(require "tty-raw-extension")
|
(require "private/tty-raw-extension")
|
||||||
(require "ansi.rkt")
|
(require "ansi.rkt")
|
||||||
|
|
||||||
(define (main)
|
(define (main)
|
Loading…
Reference in New Issue