Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
lib/*.so
.lib/
.modules/
7 changes: 0 additions & 7 deletions .gitmodules

This file was deleted.

9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ language: bash
sudo: false
cache: apt

#before_install:
# - sudo apt-get update -qq
# - sudo apt-get install -y build-essential zlibc make autoconf libtool clang libxml2-dev picolisp libcurl4-openssl-dev

before_script:
- ./build.sh
- make
- wget http://software-lab.de/picoLisp.tgz -O /tmp/picolisp.tgz
- cd /tmp; tar -xf /tmp/picolisp.tgz
- cd /tmp/picoLisp/src64 && make

script:
- cd ${TRAVIS_BUILD_DIR} && /tmp/picoLisp/pil test.l
- export PATH=$PATH:/tmp/picoLisp
- cd ${TRAVIS_BUILD_DIR} && make check
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.30.1.11 (2015-04-28)

* Remove the need for git submodules
* Add Makefile for fetching and building dependencies
* Change default path for dependencies and shared module (.modules and .lib)
* Adjust README.md, tests and travis-ci unit testing config

## 0.30.1.10 (2015-04-22)

* Fix bug where downloading a file to an inexistant dir fails horribly
Expand Down
4 changes: 2 additions & 2 deletions EXPLAIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ So far so good, but what happens when the file you load also loads a file in a d
To fix this, we use [file](http://software-lab.de/doc/refF.html#file):

```lisp
*Https (pack (car (file)) "lib/libneon.so")
*Https (pack (car (file)) ".lib/libneon.so")
```

What this does is load the file `lib/libneon.so` relative to the file that's loading it.
What this does is load the file `.lib/libneon.so` relative to the file that's loading it.

We use this technique further down as well:

Expand Down
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# picolisp-json Makefile

PIL_MODULE_DIR ?= .modules
PIL_SYMLINK_DIR ?= .lib

## Edit below
BUILD_REPO = https://github.com/aw/neon-unofficial-mirror.git
BUILD_DIR = $(PIL_MODULE_DIR)/neon/HEAD
LIB_DIR = src/.libs
TARGET = libneon.so
BFLAGS = --enable-shared --with-ssl=openssl --enable-threadsafe-ssl=posix
## Edit above

# Unit testing
TEST_REPO = https://github.com/aw/picolisp-unit.git
TEST_DIR = $(PIL_MODULE_DIR)/picolisp-unit/HEAD

# Generic
COMPILE = make

.PHONY: all clean

all: $(BUILD_DIR) $(BUILD_DIR)/$(LIB_DIR)/$(TARGET) symlink

$(BUILD_DIR):
mkdir -p $(BUILD_DIR) && \
git clone $(BUILD_REPO) $(BUILD_DIR)

$(TEST_DIR):
mkdir -p $(TEST_DIR) && \
git clone $(TEST_REPO) $(TEST_DIR)

$(BUILD_DIR)/$(LIB_DIR)/$(TARGET):
cd $(BUILD_DIR) && \
./autogen.sh && \
./configure $(BFLAGS) && \
$(COMPILE) && \
strip --strip-unneeded $(LIB_DIR)/$(TARGET)

symlink:
mkdir -p $(PIL_SYMLINK_DIR) && \
cd $(PIL_SYMLINK_DIR) && \
ln -sf ../$(BUILD_DIR)/$(LIB_DIR)/$(TARGET) $(TARGET)

check: all $(TEST_DIR) run-tests

run-tests:
./test.l

clean:
cd $(BUILD_DIR)/$(LIB_DIR) && \
rm -f $(TARGET) && \
cd - && \
cd $(PIL_SYMLINK_DIR) && \
rm -f $(TARGET)
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@ Please read [EXPLAIN.md](EXPLAIN.md) to learn more about PicoLisp and this HTTPS

# Getting Started

These FFI bindings require the [Neon C library](http://www.webdav.org/neon/), compiled as a shared library. It is included here as a [git submodule](http://git-scm.com/book/en/v2/Git-Tools-Submodules).
These FFI bindings require the [Neon C library](http://www.webdav.org/neon/), compiled as a shared library.

1. Type `./build.sh` to pull and compile the _Neon C Library_.
1. Type `make` to pull and compile the _Neon C Library_.
2. Include `https.l` in your project (it loads `ffi.l` and `internal.l`).
3. Try the [examples](#examples) below

### Linking and Paths

Once compiled, the shared library is symlinked as:

lib/libneon.so -> vendor/neon/src/.libs/libneon.so
.lib/libneon.so -> .modules/neon/HEAD/src/.libs/libneon.so

The `https.l` file searches for `lib/libneon.so`, relative to its current directory.
The `https.l` file searches for `.lib/libneon.so`, relative to its current directory.

### Updating

This library uses git submodules, type this keep everything updated:
To keep everything updated, type:

./update.sh
git pull && make clean && make

# Usage

Expand Down Expand Up @@ -273,9 +273,9 @@ s>^J")

# Testing

This library now comes with full [unit tests](https://github.com/aw/picolisp-unit). To run the tests, run:
This library now comes with full [unit tests](https://github.com/aw/picolisp-unit). To run the tests, type:

./test.l
make check

# Alternatives

Expand Down
18 changes: 6 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@
#
# Copyright (c) 2015 Alexander Williams, Unscramble <license@unscramble.jp>
# MIT License
#
# For backwards compatibility

set -u
set -e

git submodule init
git submodule update

cd vendor/neon
./autogen.sh
./configure --enable-shared --with-ssl=openssl --enable-threadsafe-ssl=posix
make
cd -
# cleanup artifacts
rm -rf lib vendor

cd lib
rm -f libneon.so
ln -s ../vendor/neon/src/.libs/libneon.so libneon.so
cd -
# rebuild
make
2 changes: 1 addition & 1 deletion https.l
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(load (pack (car (file)) "module.l"))

(setq
*Https (pack (car (file)) "lib/libneon.so")
*Https (pack (car (file)) ".lib/libneon.so")
*Buffer_size 8192
*Headers '(("Accept" . "*/*")
("Accept-Charset" . "utf-8")
Expand Down
Empty file removed lib/.keep
Empty file.
5 changes: 2 additions & 3 deletions module.l
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[de MODULE_INFO
("name" "https")
("version" "0.30.1.10")
("version" "0.30.1.11")
("summary" "HTTP(S) client for PicoLisp")
("source" "https://github.com/aw/picolisp-https.git")
("author" "Alexander Williams")
("license" "MIT")
("copyright" "(c) 2015 Alexander Williams, Unscramble <license@unscramble.jp>")
("install" "build.sh")
("update" "update.sh")
("install" "make")
("requires"
("picolisp-unit" "v0.6.1" "https://github.com/aw/picolisp-unit.git")
("neon" "0.30.1" "https://github.com/aw/neon-unofficial-mirror.git") ]
2 changes: 1 addition & 1 deletion test.l
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env pil

(load "vendor/picolisp-unit/unit.l")
(load ".modules/picolisp-unit/HEAD/unit.l")

(load "https.l")

Expand Down
1 change: 0 additions & 1 deletion vendor/neon
Submodule neon deleted from bad42a
1 change: 0 additions & 1 deletion vendor/picolisp-unit
Submodule picolisp-unit deleted from 69fe09