From b2fb74f514772352e12587c15ea3d9c9e2fb520d Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Tue, 28 Apr 2015 07:06:20 +0000 Subject: [PATCH 1/4] Get rid of git submodules. Closes #4 --- .gitignore | 3 ++- .gitmodules | 7 ------ .travis.yml | 9 +++----- Makefile | 55 ++++++++++++++++++++++++++++++++++++++++++++ build.sh | 18 +++++---------- https.l | 2 +- lib/.keep | 0 module.l | 5 ++-- test.l | 2 +- vendor/neon | 1 - vendor/picolisp-unit | 1 - 11 files changed, 70 insertions(+), 33 deletions(-) delete mode 100644 .gitmodules create mode 100644 Makefile delete mode 100644 lib/.keep delete mode 160000 vendor/neon delete mode 160000 vendor/picolisp-unit diff --git a/.gitignore b/.gitignore index bf6f814..4a697dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -lib/*.so +.lib/ +.modules/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 6f8ea26..0000000 --- a/.gitmodules +++ /dev/null @@ -1,7 +0,0 @@ -[submodule "vendor/neon"] - path = vendor/neon - url = https://github.com/aw/neon-unofficial-mirror.git - ignore = dirty -[submodule "vendor/picolisp-unit"] - path = vendor/picolisp-unit - url = https://github.com/aw/picolisp-unit.git diff --git a/.travis.yml b/.travis.yml index 37784be..f882c60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9b550c8 --- /dev/null +++ b/Makefile @@ -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)/$(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)/$(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) && \ + rm -f $(TARGET) && \ + cd - && \ + cd $(PIL_SYMLINK_DIR) && \ + rm -f $(TARGET) diff --git a/build.sh b/build.sh index aef9466..753c0a1 100755 --- a/build.sh +++ b/build.sh @@ -2,20 +2,14 @@ # # Copyright (c) 2015 Alexander Williams, Unscramble # 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 diff --git a/https.l b/https.l index 83ab160..b1b1134 100644 --- a/https.l +++ b/https.l @@ -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") diff --git a/lib/.keep b/lib/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/module.l b/module.l index c7f789f..cfb1e06 100644 --- a/module.l +++ b/module.l @@ -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 ") - ("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") ] \ No newline at end of file diff --git a/test.l b/test.l index 14e400c..5732d2a 100755 --- a/test.l +++ b/test.l @@ -1,6 +1,6 @@ #!/usr/bin/env pil -(load "vendor/picolisp-unit/unit.l") +(load ".modules/picolisp-unit/HEAD/unit.l") (load "https.l") diff --git a/vendor/neon b/vendor/neon deleted file mode 160000 index bad42a5..0000000 --- a/vendor/neon +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bad42a59389b83e1aa78a6bbdee881625f5662be diff --git a/vendor/picolisp-unit b/vendor/picolisp-unit deleted file mode 160000 index 69fe093..0000000 --- a/vendor/picolisp-unit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 69fe093ef3d0472f0a1dbf0437e748ba43c1566d From 72e8785e3f52c6ac63df005206640cad828b88e1 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Tue, 28 Apr 2015 07:08:57 +0000 Subject: [PATCH 2/4] fix Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9b550c8..de7f36f 100644 --- a/Makefile +++ b/Makefile @@ -32,8 +32,8 @@ $(TEST_DIR): $(BUILD_DIR)/$(TARGET): cd $(BUILD_DIR) && \ - ./autogen.sh - ./configure $(BFLAGS) + ./autogen.sh && \ + ./configure $(BFLAGS) && \ $(COMPILE) && \ strip --strip-unneeded $(LIB_DIR)/$(TARGET) From a8a20682a72b4be04ea828c05304a8c70666417f Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Tue, 28 Apr 2015 07:12:58 +0000 Subject: [PATCH 3/4] Don't build lib if already build --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index de7f36f..fc1d218 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ COMPILE = make .PHONY: all clean -all: $(BUILD_DIR) $(BUILD_DIR)/$(TARGET) symlink +all: $(BUILD_DIR) $(BUILD_DIR)/$(LIB_DIR)/$(TARGET) symlink $(BUILD_DIR): mkdir -p $(BUILD_DIR) && \ @@ -30,7 +30,7 @@ $(TEST_DIR): mkdir -p $(TEST_DIR) && \ git clone $(TEST_REPO) $(TEST_DIR) -$(BUILD_DIR)/$(TARGET): +$(BUILD_DIR)/$(LIB_DIR)/$(TARGET): cd $(BUILD_DIR) && \ ./autogen.sh && \ ./configure $(BFLAGS) && \ @@ -48,7 +48,7 @@ run-tests: ./test.l clean: - cd $(BUILD_DIR) && \ + cd $(BUILD_DIR)/$(LIB_DIR) && \ rm -f $(TARGET) && \ cd - && \ cd $(PIL_SYMLINK_DIR) && \ From 655cf13459bcdbf452240edb8c37bd4171508862 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Tue, 28 Apr 2015 07:18:57 +0000 Subject: [PATCH 4/4] Update documentation --- CHANGELOG.md | 7 +++++++ EXPLAIN.md | 4 ++-- README.md | 16 ++++++++-------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bae8247..d25414f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/EXPLAIN.md b/EXPLAIN.md index 19f2539..a6fb3cf 100644 --- a/EXPLAIN.md +++ b/EXPLAIN.md @@ -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: diff --git a/README.md b/README.md index 2fddd00..d81c5fb 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,9 @@ 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 @@ -36,15 +36,15 @@ These FFI bindings require the [Neon C library](http://www.webdav.org/neon/), co 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 @@ -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