Skip to content
This repository was archived by the owner on Dec 12, 2021. It is now read-only.

Commit 34701fa

Browse files
committed
Merge pull request #2 from aw/destroy-submodules
Get rid of git submodules.
2 parents 03003b8 + 83be04a commit 34701fa

File tree

14 files changed

+96
-56
lines changed

14 files changed

+96
-56
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ sudo: false
33
cache: apt
44

55
before_script:
6-
- ./build.sh
6+
- make
77
- wget http://software-lab.de/picoLisp.tgz -O /tmp/picolisp.tgz
88
- cd /tmp; tar -xf /tmp/picolisp.tgz
99
- cd /tmp/picoLisp/src64 && make
1010

1111
script:
12-
- 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: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,49 @@
11
# Changelog
22

3-
## 0.5.26 (2014-04-23)
3+
## 0.5.27 (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+
10+
## 0.5.26 (2015-04-23)
411

512
* Replace (cond) with (case)
613

7-
## 0.5.25 (2014-04-15)
14+
## 0.5.25 (2015-04-15)
815

916
* Split 'make-socket' for more flexibility
1017
* Update EXPLAIN.md
1118

12-
## 0.5.24 (2014-04-14)
19+
## 0.5.24 (2015-04-14)
1320

1421
* Update to picolisp-unit v0.6.1
1522
* Run travis-ci tests in a docker container
1623

17-
## 0.5.23 (2014-04-08)
24+
## 0.5.23 (2015-04-08)
1825

1926
* Split the 'make-socket' function to allow pooled connections
2027
* Ensure travis tests with the latest version of PicoLisp
2128

22-
## 0.5.22 (2014-04-07)
29+
## 0.5.22 (2015-04-07)
2330

2431
* Update to picolisp-unit v0.6.0
2532
* Ignore dirty submodules
2633

27-
## 0.5.21 (2014-04-01)
34+
## 0.5.21 (2015-04-01)
2835

2936
* Update to picolisp-unit v0.5.2
3037

31-
## 0.5.20 (2014-03-24)
38+
## 0.5.20 (2015-03-24)
3239

3340
* Add test for sending/receiving messages
3441

35-
## 0.5.19 (2014-03-24)
42+
## 0.5.19 (2015-03-24)
3643

3744
* Swap order of module.l loading
3845

39-
## 0.5.18 (2014-03-24)
46+
## 0.5.18 (2015-03-24)
4047

4148
* Don't forget to load module.l
4249

Makefile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Makefile
2+
3+
PIL_MODULE_DIR ?= .modules
4+
PIL_SYMLINK_DIR ?= .lib
5+
6+
## Edit below
7+
BUILD_REPO = https://github.com/nanomsg/nanomsg.git
8+
BUILD_DIR = $(PIL_MODULE_DIR)/nanomsg/HEAD
9+
LIB_DIR = .libs
10+
TARGET = libnanomsg.so
11+
BFLAGS = --enable-shared
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: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,25 @@ To learn more about PicoLisp and this Nanomsg library, please read the [EXPLAIN.
2525

2626
# Getting started
2727

28-
This binding relies on the _Official Nanomsg C Library_, compiled as a shared library. It is included here as a [git submodule](http://git-scm.com/book/en/v2/Git-Tools-Submodules).
28+
This binding relies on the _Official Nanomsg C Library_, compiled as a shared library.
2929

30-
1. Type `./build.sh` to pull and compile the _Official Nanomsg C Library_.
30+
1. Type `make` to pull and compile the _Official Nanomsg C Library_.
3131
2. Include `nanomsg.l` in your project
3232
3. Try the example below
3333

3434
### Linking and Paths
3535

36-
Once compiled, the shared library is symlinked in `lib/libnanomsg.so` pointing to `vendor/nanomsg/.libs/libnanomsg.so`.
36+
Once compiled, the shared library is symlinked as:
3737

38-
The `nanomsg.l` file searches for `lib/libnanomsg.so`, relative to its current directory.
38+
.lib/libnanomsg.so -> .modules/nanomsg/HEAD/src/.libs/libnanomsg.so
39+
40+
The `nanomsg.l` file searches for `.lib/libnanomsg.so`, relative to its current directory.
3941

4042
### Updating
4143

42-
This library uses git submodules, type this keep everything updated:
44+
To keep everything updated, type:
4345

44-
./update.sh
46+
git pull && make clean && make
4547

4648
# Usage
4749

@@ -322,9 +324,9 @@ This can be changed with the environment variable `NANOMSG_MAX_SIZE`. You can al
322324

323325
# Testing
324326

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

327-
./test.l
329+
make check
328330

329331
# Contributing
330332

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/nanomsg
13-
./autogen.sh
14-
./configure --enable-shared
15-
make
16-
cd -
11+
# cleanup artifacts
12+
rm -rf lib vendor
1713

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

lib/.keep

Whitespace-only changes.

module.l

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
[de MODULE_INFO
22
("name" "nanomsg")
3-
("version" "0.5.26")
3+
("version" "0.5.27")
44
("summary" "Nanomsg ffi-binding for PicoLisp")
55
("source" "https://github.com/aw/picolisp-nanomsg.git")
66
("author" "Alexander Williams")
77
("license" "MIT")
88
("copyright" "(c) 2015 Alexander Williams, Unscramble <license@unscramble.jp>")
9-
("install" "build.sh")
10-
("update" "update.sh")
9+
("install" "make")
1110
("requires"
1211
("picolisp-unit" "v0.6.1" "https://github.com/aw/picolisp-unit.git")
1312
("nanomsg" "0.5-beta" "https://github.com/nanomsg/nanomsg.git") ]

nanomsg.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
(setq
1818
MSG_MAX_SIZE (if (sys "NANOMSG_MAX_SIZE") (format @) 8192) # 8KB should be enough
1919

20-
*Nanomsg (pack (car (file)) "lib/libnanomsg.so") )
20+
*Nanomsg (pack (car (file)) ".lib/libnanomsg.so") )
2121

2222
# ffi-bindings
2323
[de nn-socket (Domain Protocol)

test.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env pil
22

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

55
(chdir "test/"
66
(mapcar load (filter '((N) (sub? "test_" N)) (dir "."))) )

update.sh

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

vendor/nanomsg

Lines changed: 0 additions & 1 deletion
This file was deleted.

vendor/picolisp-unit

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)