all repos — honk @ 6415fc53473647713c17bac11239ea1a199232c7

my fork of honk

clarify build requirements and add a check script for common errors
Ted Unangst tedu@tedunangst.com
Thu, 01 Oct 2020 21:58:50 -0400
commit

6415fc53473647713c17bac11239ea1a199232c7

parent

fcde0c7e9374af8d7b6027a3d440771ae823ac0e

5 files changed, 37 insertions(+), 4 deletions(-)

jump to
M MakefileMakefile

@@ -4,8 +4,11 @@

schema.go: schema.sql sh ./genschemago.sh -honk: schema.go *.go go.mod +honk: .preflightcheck schema.go *.go go.mod go build -mod=`ls -d vendor 2> /dev/null` -o honk + +.preflightcheck: preflight.sh + @sh ./preflight.sh clean: rm -f honk
M READMEREADME

@@ -20,7 +20,7 @@

-- build It should be sufficient to type make after unpacking a release. -You'll need a go compiler version 1.11 or later. +You'll need a go compiler version 1.13 or later. And libsqlite3. Even on a fast machine, building from source can take several seconds.
M docs/honk.8docs/honk.8

@@ -41,7 +41,7 @@ .Ed

.Ss Build Building .Nm -requires a go compiler and libsqlite. +requires a go compiler 1.13 and libsqlite. On .Ox this is the go and sqlite3 packages.
M go.modgo.mod

@@ -1,6 +1,6 @@

module humungus.tedunangst.com/r/honk -go 1.11 +go 1.13 require ( github.com/andybalholm/cascadia v1.1.0
A preflight.sh

@@ -0,0 +1,30 @@

+set -e + +go version > /dev/null 2>&1 || (echo go 1.13+ is required && false) + +v=`go version | egrep -o 'go1[^ ]+'` +case $v in + go1.10*|go1.11*|go1.12*) + echo go version is too old: $v + echo go 1.13+ is required + false + ;; + go1.1*) + # just pretend nobody is still using go 1.1 or 1.2 + ;; + go1.2*) + ;; + *) + echo unknown go version: $v + false + ;; +esac + +if [ \! \( -e /usr/include/sqlite3.h -o -e /usr/local/include/sqlite3.h \) ] ; then + echo unable to find sqlite3.h header + echo please install libsqlite3 dev package + false +fi + +touch .preflightcheck +