From 811badc9f9d7a6de1bef503e3e35eec992c0cdf9 Mon Sep 17 00:00:00 2001 From: Colin Dellow Date: Fri, 2 Mar 2018 18:46:40 -0500 Subject: [PATCH] Add script to fetch+build sqlite --- .gitignore | 7 +++++++ build-sqlite | 30 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 build-sqlite diff --git a/.gitignore b/.gitignore index 259148f..acee4a7 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,10 @@ *.exe *.out *.app + +# vim +*.swp + +# transient sqlite files +/sqlite +/sqlite-autoconf* diff --git a/build-sqlite b/build-sqlite new file mode 100755 index 0000000..ca88e88 --- /dev/null +++ b/build-sqlite @@ -0,0 +1,30 @@ +#!/bin/bash +set -euo pipefail + +VERSION=3220000 + +fetch_if_needed() { + if [ ! -e sqlite ]; then + curl --fail "https://sqlite.org/2018/sqlite-autoconf-${VERSION}.tar.gz" > sqlite.tar.gz + tar xf sqlite.tar.gz + rm sqlite.tar.gz + ln -s sqlite-autoconf-${VERSION} sqlite + fi +} + +build() { + cd sqlite + ./configure + make +} + +main() { + here=$(dirname "${BASH_SOURCE[0]}") + here=$(readlink -f "$here") + cd "$here" + + fetch_if_needed + build +} + +main "$@"