[plt-scheme] planet and mzc (again)

From: Hans Oesterholt-Dijkema (hdnews at gawab.com)
Date: Wed Dec 28 16:33:13 EST 2005

I made this:

(module pre-installer mzscheme
(require (lib "setup-extension.ss" "make")
(lib "compile.ss" "dynext")
(lib "link.ss" "dynext")
(lib "file.ss"))

(define (pre-installer plthome roos-dir)
(display (format "Pre installing c-roos.c ~%"))
(display (format " plthome = ~a ~%" plthome))
(display (format " roos-dir = ~a ~%" roos-dir))
(pre-install plthome
(build-path roos-dir)
"c-roos.c"
(build-path roos-dir)
;; header subdirs
(list)
;; unix libs
(list)
;; windows libs
(list)
;; unix extra libs (assume always there)
null
;; Windows extra libs (assume always there)
null
;; Extra depends:
(list "c-roos.scm")
;; Last-chance k:
(lambda (k) (k))
;; 3m, too:
#t))

(provide pre-installer))


Chongkai Zhu schreef:

>As I understood the doc (and my experience  to package my collection both as a normal
>.plt file or through PLaneT), you do NOT need any makefile, but only need to write 
>some easy Scheme code:
>
>In "info.ss":
>
>  (define pre-install-collection "installer.ss")
>
>and create a "installer.ss" file:
>
>(module installer mzscheme
>  (require (lib "setup-extension.ss" "make"))
>  (provide pre-installer)
>  (define (pre-installer PLTHOME)
>    (pre-install PLTHOME
>                 (collection-path "collection-name")
>                 "c-file-name.c"
>                 PLTHOME
>                 '()
>                 '()
>                 '()
>                 '()
>                 '()
>                 '()
>                 (lambda (t) (t)))))
>
>then just make the .plt file by
> mze --collection 
>or
> PLaneT --create-archive
>
>  
>
>>Thanks for your fast reply. I setup a info.ss file for ROOS and was able
>>to create a package that works, using:
>>
>>(from the makfile:)
>>
>>planet: plt
>>@echo "A collection package has been made to be distributed using planet"
>>
>>#planet: scms docs precompile
>># $(PLANET) --create-archive $(PREFIX)/$(PACKAGE)
>>
>>
>>plt: scms docs precompile
>>$(MZC) --all-users --collection-plt roos-$(VERSION).plt roos
>>#$(MZC) --collection-plt roos-$(VERSION).plt roos
>>
>>
>>precompile:
>>$(MZC) --cc c-roos.c
>>$(MZC) --ld c-roos$(SHL) c-roos.obj
>>mkdir -p $(PREFIX)/$(PACKAGE)/$(MZSCHEME_PRECOMP_DIR)
>>cp c-roos$(SHL) $(PREFIX)/$(PACKAGE)/$(MZSCHEME_PRECOMP_DIR)
>>
>>collects: zos
>>@if [ ! -d $(PREFIX)/roos ];then echo "Please install roos package
>>first";exit 1;fi
>>$(MZC) --collection-extension roos
>>
>>zos: scms
>>$(MZC) --collection-zos roos
>>
>>scms:
>>mkdir -p $(PREFIX)/$(PACKAGE)
>>cp roos.scm $(PREFIX)/$(PACKAGE)/roos.scm
>>cp c-roos.c $(PREFIX)/$(PACKAGE)/c-roos.c
>>cp c-roos.scm $(PREFIX)/$(PACKAGE)/c-roos.scm
>>cp pre-installer.ss $(PREFIX)/$(PACKAGE)/pre-installer.ss
>>cat info.ss | sed -e s/__VERSION__/$(VERSION)/g
>>    
>>
>>>$(PREFIX)/$(PACKAGE)/info.ss
>>>      
>>>
>>docs:
>>spod2html --indent-toc-with-spaces=4 --stylesheet=roos.css
>>doc/roos_manual.pod roos_manual.html
>>mkdir -p $(PREFIX)/$(PACKAGE)/html
>>cp roos_manual.html $(PREFIX)/$(PACKAGE)/html/index.html
>>-dos2unix $(PREFIX)/$(PACKAGE)/html/index.html
>>cp doc/style.css $(PREFIX)/$(PACKAGE)/html/roos.css
>>cp doc.txt $(PREFIX)/$(PACKAGE)/doc.txt
>>
>>
>>However, *planet --create-archive <dir>* doesn't seem to generate a
>>package that
>>can be used to compile (or use the pre-compiled) c-roos.c.
>>
>>Another question: Is it advisable to (at least for WIN32) add a
>>pre-compiled variant
>>of c sources or will they be mzscheme version specific?
>>    
>>
>
>I  can't fully understood you question. Compiled C file (.dll under WIN32)
>is mzscheme version specific. C source file is not mzscheme version specific
>(but PLT v20x and v30x are not compatible). What's your intention to add 
>the "variant"?
>
>  
>
>>Thanks in advance for your answers,
>>
>>Hans Oesterholt-Dijkema
>>
>>
>>Chongkai Zhu schreef:
>>
>>    
>>
>>>_setup-extension.ss_
>>>--------------------
>>>
>>>[index entry: _Setup PLT compile extension_]
>>>
>>>The "setup-extension.ss" library helps compile C code via Setup PLT's
>>>"pre-install" phase (triggered by a `pre-installer' item in "info.ss";
>>>see the "setup" collection for further information).
>>>
>>> 
>>>
>>>      
>>>
>>>>I believe that question was answered here before.
>>>>
>>>>The answer is : YES.
>>>>
>>>>Please refer to "Documentation for the Make collection" in the help
>>>>disk for details.
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>Hi all,
>>>>>
>>>>>I recently posted a question about using PlaNET with C modules.
>>>>>I'm not quite sure if it is supported or not. Can someone point
>>>>>out if it is possible to include C parts in a planet package and
>>>>>get it automatically compiled on requiring the planet package?
>>>>>
>>>>>Thanks in advance for your answers,
>>>>>
>>>>>Hans
>>>>>
>>>>>          
>>>>>
>
>
>  
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20051228/c7c13df8/attachment.html>

Posted on the users mailing list.