To install these software components, please follow the following installation steps:
* Download the archive with non-syntactictower Black Hole and the "bundled libs", + archive overview:
* Download
2012-11-28-bh-non-syntactictower+bundled-libs.tar.gz available for direct download at
Gambit's Dumping Grounds page.
It will be available there for as long as it's not clearly obsolete.
This is a file set that has two parts:
* In the root directory: BH, that equals the legacy branch with pull request 45 linked to above included, though I'm sending it to you separately also just to be really safe you get the right thing.
* Untar this file in your home directory (~), i.e. cd ~; tar xvfz bh-non-syntactictower+bundled-libs.tar.gz .
* Compile Black Hole: cd blackhole; gsc build
* Set up Black Hole:
* Make a /usr/bin/bsc file:
* Make ~~/lib/blackhole/build.o1 link to ~/blackhole/build.o1:
ln -s /usr/local/Gambit-C/lib/blackhole ~/blackhole
* For the package resolver for the std package to find module files, which it looks for in ~~/lib/modules/std :
ln -s /usr/local/Gambit-C/lib/modules ~/blackhole
* Set up the bundled libraries:
* the (std net/tcp-ip) module has some lowlevel dependencies, if you want access to it, copy lib/*.h of your Gambit source distribution into /usr/local/Gambit-C/lib/ i.e. something like:
cd ~/gambc-v4[tab]
cd lib
cp *.h /usr/local/Gambit-C/lib/
* Compile the bundle libraries:
bsc
(modules-compile! (modules-in-dir "~~/lib/modules")))
Please note that compiling the (std string/digest) module may occupy ~1.5-2GB memory. The others should be require much less though.
* Set up the Sack web server and client middleware:
* Create a project directory for yourself, say ~/proj : mkdir ~/proj; cd ~/proj
* Download the 2012-11-28-sack-current-for-BH-non-syntactictower.tar.gz file from Gambit's Dumping Grounds page. It will be available there for as long as it's not clearly obsolete.
* Unpack Sack into ~/proj/lib : mkdir ~/proj/lib; cd ~/proj/lib; tar xvfz ../sack-current-2012-11-28-for-BH-non-syntactictower.tar.gz; cd ..
* Optional: Compile Sack:
bsc
(modules-compile! (modules-in-dir "lib/sack")))
Done!
You can now run Gambit with Black Hole from your shell anytime under the name bsc . It's nicely pre-setup with UTF-8 encoding, clear exception reporting, and per-line output buffering for performance (note, invoking |force-output| after any |display| etc. may be needed).
Example HTTP server:
(presuming you're in ~/proj :)
bsc
(import (std misc/u8v) lib/sack/src/server)
(define (simple-webserver! server #!rest rest)
(apply sack-start!
(cons (lambda (env)
(let ((first? #t))
(values 200
'(("Content-Type" . "text/html"))
(lambda ()
(let ((r (and first? (string->utf8-u8vector (server)))))
(set! first? #f)
r)))))
rest)))
(simple-webserver! (lambda () "Hello World!") port-number: 5000)
Example HTTP client:
(presuming you're in ~/proj :)
bsc
(import (std misc/u8v) lib/sack/src/http-client)
If you have any queries please don't hesitate to ask.
Mikael
(Per: Dear Per,
Matthew and anyone downloading legacy BH from github is experiencing complete malfunction until this pull request is included.
Thanks!)
2012/11/28 Matthew Phillips
<matthew@phillipsoft.biz>
On Wed, Nov 28, 2012 at 3:26 PM, Mikael
<mikael.rcv@gmail.com> wrote:
Ah, noted Sack uses the syntactictower branch's module naming scheme for SRFI:s. Let me know if I should email over one with the non-syntactictower branch's.
Apart from what's released online yet, Sack has stable HTTPS server support, let me know if you want it.
Release of improved HTTPS client support as well as an asynchronous HTTP* client API (akin to the API exported by the web browser XHR object) is underway.
Brgds
If you could send me the Sack that works with the legacy branch, that would be wonderful.