aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2014-03-03 10:09:06 -0500
committerJohn Szakmeister <john@szakmeister.net>2014-03-21 15:22:00 -0400
commit0b2f6a0cf4c50d86744b1d3d774103db39773b4c (patch)
tree7bbc6275200f2c42ba20bf0a910c2b92fbdc4a50 /scripts
parent5dd0ce4263721b636f5b006a47ceb7e769e10dca (diff)
downloadrneovim-0b2f6a0cf4c50d86744b1d3d774103db39773b4c.tar.gz
rneovim-0b2f6a0cf4c50d86744b1d3d774103db39773b4c.tar.bz2
rneovim-0b2f6a0cf4c50d86744b1d3d774103db39773b4c.zip
Revamp the build system.
This achieves several goals: * Less reliance on scripts so we have better portability to Windows (though we still have a ways to go for proper Windows support). Luajit, luarocks, moonscript, and busted are all installed via CMake now. * Trying to make use of pkg-config to get the correct libraries. The latest libuv is still broken in this regard, but we'll at least be in a position to use it. * Allow the use of Ninja or make. The former runs faster in many environments, and automatically makes use of parallel builds. This also allows for system installed dependencies--though not through the Makefile just yet--and adds support for FreeBSD. This also make us build libuv and luajit as static libraries only, since we're only concerned about having static libraries for our bundled dependencies.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/common.sh65
-rw-r--r--scripts/compile-libuv.sh10
-rw-r--r--scripts/compile-lua.sh6
-rw-r--r--scripts/setup-test-tools.sh26
-rwxr-xr-xscripts/travis.sh11
-rw-r--r--scripts/unittest.sh10
6 files changed, 9 insertions, 119 deletions
diff --git a/scripts/common.sh b/scripts/common.sh
deleted file mode 100644
index 5196d594a3..0000000000
--- a/scripts/common.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-platform='unknown'
-unameval=`uname`
-if [ "$unameval" = 'Linux' ]; then
- platform='linux'
-elif [ "$unameval" = 'FreeBSD' ]; then
- platform='freebsd'
-elif [ "$unameval" = 'Darwin' ]; then
- platform='darwin'
-fi
-
-sha1sumcmd='sha1sum'
-if [ "$platform" = 'freebsd' ]; then
- sha1sumcmd='shasum'
-elif [ "$platform" = 'darwin' ]; then
- sha1sumcmd='shasum'
-fi
-
-pkgroot="$(pwd)"
-deps="$pkgroot/.deps"
-prefix="$deps/usr"
-export PATH="$prefix/bin:$PATH"
-
-download() {
- local url=$1
- local tgt=$2
- local sha1=$3
-
- if [ ! -d "$tgt" ]; then
- mkdir -p "$tgt"
- local download_command=""
- if which wget > /dev/null 2>&1; then
- # -O - to send output to stdout
- download_command="wget --no-verbose $url -O -"
- elif which curl >/dev/null 2>&1; then
- # -L to follow the redirects that github will send us
- # -sS to supress the progress bar, but show errors
- # curl sends output to stdout by default
- download_command="curl -L -sS $url"
- else
- echo "Missing wget utility and curl utility"
- exit 1
- fi
- local tmp_dir=$(mktemp -d "/tmp/download_sha1check_XXXXXXX")
- local fifo="$tmp_dir/fifo"
- mkfifo "$fifo"
- echo "Downloading $url..."
- # download, untar and calculate sha1 sum in one pass
- ($download_command | tee "$fifo" | \
- (cd "$tgt"; tar --strip-components=1 -xzf -)) &
- local sum=$("$sha1sumcmd" < "$fifo" | cut -d ' ' -f1)
- rm -rf "$tmp_dir"
- if [ "$sum" != "$sha1" ]; then
- echo "SHA1 sum doesn't match, expected '$sha1' got '$sum'"
- exit 1
- else
- echo "Download complete."
- fi
- fi
-}
-
-github_download() {
- local repo=$1
- local ver=$2
- download "https://github.com/${repo}/archive/${ver}.tar.gz" "$3" "$4"
-}
diff --git a/scripts/compile-libuv.sh b/scripts/compile-libuv.sh
deleted file mode 100644
index 9979aa1095..0000000000
--- a/scripts/compile-libuv.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-. scripts/common.sh
-
-uv_dir="third-party/libuv"
-
-cd "$uv_dir"
-sh autogen.sh
-./configure --prefix="$prefix" --with-pic
-make
-make install
-rm "$prefix/lib/"libuv*.{so,dylib} "$prefix/lib/"libuv*.{so,dylib}.* || true
diff --git a/scripts/compile-lua.sh b/scripts/compile-lua.sh
deleted file mode 100644
index 9187c07877..0000000000
--- a/scripts/compile-lua.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-. scripts/common.sh
-
-lua_dir="$pkgroot/third-party/luajit"
-
-cd "$lua_dir"
-make PREFIX="$prefix" install
diff --git a/scripts/setup-test-tools.sh b/scripts/setup-test-tools.sh
deleted file mode 100644
index 97ba808dd4..0000000000
--- a/scripts/setup-test-tools.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-. scripts/common.sh
-
-luarocks_ver=v2.1.2
-luarocks_repo=keplerproject/luarocks
-luarocks_sha1=69ea9b641a5066b1f316847494d8c63a4693977d
-luarocks_dir="$pkgroot/third-party/luarocks"
-
-github_download "$luarocks_repo" "$luarocks_ver" "$luarocks_dir" \
- "$luarocks_sha1"
-
-cd "$luarocks_dir"
-
-./configure --prefix="$prefix" --force-config --with-lua="$prefix" \
- --with-lua-include="$prefix/include/luajit-2.0" \
- --lua-suffix="jit"
-
-make bootstrap
-
-echo 'rocks_servers = {
- "http://luarocks.giga.puc-rio.br/";
-}' >> "$prefix/etc/luarocks/config-5.1.lua"
-
-# install tools for testing
-luarocks install moonrocks --server=http://rocks.moonscript.org
-moonrocks install moonscript
-moonrocks install busted
diff --git a/scripts/travis.sh b/scripts/travis.sh
index 8b79930aa0..8ae9a7a502 100755
--- a/scripts/travis.sh
+++ b/scripts/travis.sh
@@ -17,6 +17,14 @@ check_and_report() {
)
}
+# Travis reports back that it has 32-cores via /proc/cpuinfo, but it's not
+# what we really have available. According to their documentation, it only has
+# 1.5 virtual cores.
+# See:
+# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
+# for more information.
+alias make="make -j2"
+
if [ "$CC" = "clang" ]; then
# force using the version installed by 'travis-setup.sh'
export CC=/usr/bin/clang
@@ -46,9 +54,8 @@ if [ "$CC" = "clang" ]; then
check_and_report
make install
else
- export BUSTED_OUTPUT_TYPE="TAP"
export SKIP_EXEC=1
+ make CMAKE_EXTRA_FLAGS="-DBUSTED_OUTPUT_TYPE=TAP"
make cmake
make unittest
fi
-
diff --git a/scripts/unittest.sh b/scripts/unittest.sh
deleted file mode 100644
index 539fae6401..0000000000
--- a/scripts/unittest.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-. scripts/common.sh
-
-(cd "$pkgroot/build" && make) || exit 1
-eval "$(luarocks path)"
-
-if [ -z "$BUSTED_OUTPUT_TYPE" ]; then
- export BUSTED_OUTPUT_TYPE="utf_terminal"
-fi
-make -C ./test/includes
-busted --pattern=.moon -o $BUSTED_OUTPUT_TYPE ./test