Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.

Commit f3290e6

Browse files
committed
Merge pull request #6 from aw/destroy-submodules
Destroy submodules
2 parents 58c5024 + 655cf13 commit f3290e6

File tree

14 files changed

+87
-43
lines changed

14 files changed

+87
-43
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
lib/*.so
1+
.lib/
2+
.modules/

.gitmodules

Lines changed: 0 additions & 7 deletions
This file was deleted.

.travis.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ language: bash
22
sudo: false
33
cache: apt
44

5-
#before_install:
6-
# - sudo apt-get update -qq
7-
# - sudo apt-get install -y build-essential zlibc make autoconf libtool clang libxml2-dev picolisp libcurl4-openssl-dev
8-
95
before_script:
10-
- ./build.sh
6+
- make
117
- wget http://software-lab.de/picoLisp.tgz -O /tmp/picolisp.tgz
128
- cd /tmp; tar -xf /tmp/picolisp.tgz
139
- cd /tmp/picoLisp/src64 && make
1410

1511
script:
16-
- cd ${TRAVIS_BUILD_DIR} && /tmp/picoLisp/pil test.l
12+
- export PATH=$PATH:/tmp/picoLisp
13+
- cd ${TRAVIS_BUILD_DIR} && make check

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.30.1.11 (2015-04-28)
4+
5+
* Remove the need for git submodules
6+
* Add Makefile for fetching and building dependencies
7+
* Change default path for dependencies and shared module (.modules and .lib)
8+
* Adjust README.md, tests and travis-ci unit testing config
9+
310
## 0.30.1.10 (2015-04-22)
411

512
* Fix bug where downloading a file to an inexistant dir fails horribly

EXPLAIN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ So far so good, but what happens when the file you load also loads a file in a d
3737
To fix this, we use [file](http://software-lab.de/doc/refF.html#file):
3838

3939
```lisp
40-
*Https (pack (car (file)) "lib/libneon.so")
40+
*Https (pack (car (file)) ".lib/libneon.so")
4141
```
4242

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

4545
We use this technique further down as well:
4646

Makefile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# picolisp-json Makefile
2+
3+
PIL_MODULE_DIR ?= .modules
4+
PIL_SYMLINK_DIR ?= .lib
5+
6+
## Edit below
7+
BUILD_REPO = https://github.com/aw/neon-unofficial-mirror.git
8+
BUILD_DIR = $(PIL_MODULE_DIR)/neon/HEAD
9+
LIB_DIR = src/.libs
10+
TARGET = libneon.so
11+
BFLAGS = --enable-shared --with-ssl=openssl --enable-threadsafe-ssl=posix
12+
## Edit above
13+
14+
# Unit testing
15+
TEST_REPO = https://github.com/aw/picolisp-unit.git
16+
TEST_DIR = $(PIL_MODULE_DIR)/picolisp-unit/HEAD
17+
18+
# Generic
19+
COMPILE = make
20+
21+
.PHONY: all clean
22+
23+
all: $(BUILD_DIR) $(BUILD_DIR)/$(LIB_DIR)/$(TARGET) symlink
24+
25+
$(BUILD_DIR):
26+
mkdir -p $(BUILD_DIR) && \
27+
git clone $(BUILD_REPO) $(BUILD_DIR)
28+
29+
$(TEST_DIR):
30+
mkdir -p $(TEST_DIR) && \
31+
git clone $(TEST_REPO) $(TEST_DIR)
32+
33+
$(BUILD_DIR)/$(LIB_DIR)/$(TARGET):
34+
cd $(BUILD_DIR) && \
35+
./autogen.sh && \
36+
./configure $(BFLAGS) && \
37+
$(COMPILE) && \
38+
strip --strip-unneeded $(LIB_DIR)/$(TARGET)
39+
40+
symlink:
41+
mkdir -p $(PIL_SYMLINK_DIR) && \
42+
cd $(PIL_SYMLINK_DIR) && \
43+
ln -sf ../$(BUILD_DIR)/$(LIB_DIR)/$(TARGET) $(TARGET)
44+
45+
check: all $(TEST_DIR) run-tests
46+
47+
run-tests:
48+
./test.l
49+
50+
clean:
51+
cd $(BUILD_DIR)/$(LIB_DIR) && \
52+
rm -f $(TARGET) && \
53+
cd - && \
54+
cd $(PIL_SYMLINK_DIR) && \
55+
rm -f $(TARGET)

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ Please read [EXPLAIN.md](EXPLAIN.md) to learn more about PicoLisp and this HTTPS
2626

2727
# Getting Started
2828

29-
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).
29+
These FFI bindings require the [Neon C library](http://www.webdav.org/neon/), compiled as a shared library.
3030

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

3535
### Linking and Paths
3636

3737
Once compiled, the shared library is symlinked as:
3838

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

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

4343
### Updating
4444

45-
This library uses git submodules, type this keep everything updated:
45+
To keep everything updated, type:
4646

47-
./update.sh
47+
git pull && make clean && make
4848

4949
# Usage
5050

@@ -273,9 +273,9 @@ s>^J")
273273

274274
# Testing
275275

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

278-
./test.l
278+
make check
279279

280280
# Alternatives
281281

build.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22
#
33
# Copyright (c) 2015 Alexander Williams, Unscramble <license@unscramble.jp>
44
# MIT License
5+
#
6+
# For backwards compatibility
57

68
set -u
79
set -e
810

9-
git submodule init
10-
git submodule update
11-
12-
cd vendor/neon
13-
./autogen.sh
14-
./configure --enable-shared --with-ssl=openssl --enable-threadsafe-ssl=posix
15-
make
16-
cd -
11+
# cleanup artifacts
12+
rm -rf lib vendor
1713

18-
cd lib
19-
rm -f libneon.so
20-
ln -s ../vendor/neon/src/.libs/libneon.so libneon.so
21-
cd -
14+
# rebuild
15+
make

https.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
(load (pack (car (file)) "module.l"))
1212

1313
(setq
14-
*Https (pack (car (file)) "lib/libneon.so")
14+
*Https (pack (car (file)) ".lib/libneon.so")
1515
*Buffer_size 8192
1616
*Headers '(("Accept" . "*/*")
1717
("Accept-Charset" . "utf-8")

lib/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)