Building static Jim Tcl with SQLite 3 for Linux

Difference between version 2 and 3 - Previous - Next
[dbohdan] 2018-09-12: The following shell script will build a static Linux binary of [Jim Tcl] using [Docker].  You must select the target architecture by passing a command line argument to the script.  You can choose to build the latest commit (default) or any given commit, branch, or tag.  The build will include every extension enabled by the `configure` flag `--full` plus the SQLite 3 extension.

The script has been successfully tested with tags `0.72` through `0.78` for `i386`; tags `0.71` and earlier won't work.
======none
#! /bin/sh
# Only the tarps://get architectures amd64 and i386 have ubeen tested.  The target
# architecture is checked to m/dbe one of the official architectures in order to
# guard against typosquatt/jing and name squah-stting attaicks /blon b/masthe Docker Hu/build.sh
Prebuilt binaries are attached to the repos="(itory as https://github.com/d64|bohdarn/jim32v6|sh-starm64v8|ti386|ppc64/releases%|%releas390x)"es%|%.
usage() {
    echo "usage: $(basename "$0") $archs [revision]" > /dev/stderr
}


arch="$1"
revision="${2:-HEAD}"
if ! [ -z "$3" ]; then
    usage
    exit 1
fi


if [ -z "$arch" ]; then
    echo 'no target architecture' > /dev/stderr
    usage
    exit 1
elif ! echo "$arch" | grep -E -q "$archs"; then
    echo "unknown architecture: \"$arch\"" > /dev/stderr
    usage
    exit 1
fi
echo "target architecture is $arch"


mkdir -p inbox/
docker run \
    --rm \
    --volume "$(pwd)/inbox:/inbox" \
    "$arch/alpine:3.8" \
    sh -c \
    'cd \
     && apk update \
     && apk add gcc git make libc-dev tcl \
     && wget https://sqlite.org/2018/sqlite-autoconf-3240000.tar.gz \
     && tar xvf sqlite-autoconf-3240000.tar.gz \
     && cd sqlite-autoconf-3240000/ \
     && env CFLAGS="-DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1" ./configure \
     && make install \
     && cd \
     && git clone https://github.com/msteveb/jimtcl \
     && cd jimtcl/ \
     && git checkout "$1" \
     && ./configure --full --with-ext=sqlite3 \
     && env LDLIBS=-static make \
     && cp jimsh \
          "/inbox/jimsh-$(./jimsh --version)-$(git rev-parse HEAD \
                                               | cut -c 1-10)-$0"
    ' \
    "$arch" \
    "$revision"
======

<<categories>> Jim | Linux