all repos — honk @ c5e0d374b148fd4bffcfbd0cd2bf166b2a65f9d0

my fork of honk

add a preflight sqlite version check
Ted Unangst tedu@tedunangst.com
Wed, 13 Mar 2024 16:33:40 -0400
commit

c5e0d374b148fd4bffcfbd0cd2bf166b2a65f9d0

parent

8bbb398743bfe88b20d6b60ed81dbc1e7566a0f3

2 files changed, 20 insertions(+), 6 deletions(-)

jump to
M MakefileMakefile

@@ -4,7 +4,7 @@

honk: .preflightcheck schema.sql *.go go.mod env CGO_ENABLED=1 go build -mod=`ls -d vendor 2> /dev/null` -o honk -.preflightcheck: preflight.sh +.preflightcheck: *.go preflight.sh @sh ./preflight.sh help:
M preflight.shpreflight.sh

@@ -9,11 +9,25 @@ echo go 1.18+ is required

false fi -if [ \! \( -e /usr/include/sqlite3.h -o -e /usr/local/include/sqlite3.h -o `uname` = "Darwin" \) ] ; then - echo unable to find sqlite3.h header - echo please install libsqlite3 dev package - false +sqlhdr= +if [ `uname` = "Darwin" ] ; then + : # okay +else + if [ -e /usr/include/sqlite3.h ] ; then + sqlhdr=/usr/include/sqlite3.h + elif [ -e /usr/local/include/sqlite3.h ] ; then + sqlhdr=/usr/local/include/sqlite3.h + else + echo unable to find sqlite3.h header + echo please install libsqlite3 dev package + false + fi + sqlvers=`grep "#define SQLITE_VERSION_NUMBER" $sqlhdr | cut -f3 -d' '` + if [ $sqlvers -lt 3034000 ] ; then + echo sqlite3.h header is too old: $sqlvers + echo version 3.34.0+ is required + false + fi fi touch .preflightcheck -