1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/bin/sh set -e tmp=$(mktemp -d) trap "rm -rf $tmp" EXIT cat > $tmp/src.go <<EOF package main // #cgo LDFLAGS: -lnotmuch // #include <notmuch.h> import "C" func main() { C.notmuch_status_to_string(C.NOTMUCH_STATUS_SUCCESS) } EOF ${GO:-go} build -o $tmp/out $tmp/src.go