diff options
Diffstat (limited to 'doc/note/setup/build-sqlite.txt')
-rw-r--r-- | doc/note/setup/build-sqlite.txt | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/doc/note/setup/build-sqlite.txt b/doc/note/setup/build-sqlite.txt new file mode 100644 index 0000000..81210f9 --- /dev/null +++ b/doc/note/setup/build-sqlite.txt @@ -0,0 +1,77 @@ + +### Debian native +true \ + && PKGS_TO_ADD="curl ca-certificates gcc libc6-dev make tcl" \ + && SUDO=sudo \ + && PKGINIT="$SUDO apt update" \ + && PKGADD="$SUDO apt install -y --no-install-recommends" \ + && PKGCLEAN="$SUDO apt clean" \ + && HOST= \ + && true + + +### Alpine mingw cross +true \ + && PKGS_TO_ADD="curl gcc musl-dev make mingw-w64-gcc tar tcl" \ + && SUDO="/home/$USER/.local/bin/sudo" \ + && PKGINIT=true \ + && PKGADD="$SUDO apk add" \ + && PKGCLEAN="$SUDO apk clean" \ + && HOST=x86_64-w64-mingw32 \ + && true + + +## Generic +true \ + && SQLITE_VERSION="3.33.0" \ + && CACHE_DIR="/var/tmp" \ + && true + + +## Make +true \ + && SQLITE_URL="https://github.com/sqlite/sqlite/archive/refs/tags/version-${SQLITE_VERSION:?}.tar.gz" \ + && SQLITE_SRCTGZ="${CACHE_DIR:?}/sqlite-${SQLITE_VERSION:?}.tgz" \ + && SQLITE_BINTGZ="${SQLITE_SRCTGZ%.*}-bin.tgz" \ + && ${PKGINIT:?} && ${PKGADD:?} ${PKGS_TO_ADD} \ + && if test -n "$HOST"; then HOST_="${HOST:?}-" ;fi \ + && if test ! -e "${SQLITE_SRCTGZ:?}"; then (true \ + && echo "Download \"${SQLITE_URL:?}\"" \ + && curl -sSLo "${SQLITE_SRCTGZ:?}" "${SQLITE_URL:?}" \ + );fi \ + && if test ! -e "${SQLITE_BINTGZ:?}"; then (true \ + && printf '\n Build SqLite\n\n' \ + && tar xzf "${SQLITE_SRCTGZ:?}" \ + && cd sqlite-*${SQLITE_VERSION:?} \ + && mkdir build \ + && if echo $HOST|grep -q 'mingw'; then true \ + && ./configure --prefix=${PWD:?}/build --host=${HOST:?} \ + CC=${HOST_}cc CPP=$CPP CXX=$CXX BCC=gcc BEXE=.exe config_TARGET_EXEEXT=.exe \ + && ln -s mksourceid.exe mksourceid \ + && make clean && make -j$(nproc) && make install \ + && (cd build \ + && rm -rf lemon* mksourceid lib/pkgconfig lib/*.la \ + ) \ + ;else true \ + && ./configure --prefix=${PWD:?}/build \ + && make clean && make -j$(nproc) && make install \ + ;fi \ + && cp README.md LICENSE.md VERSION build/. \ + && (cd build \ + && rm -rf lib/libsqlite3.la lib/pkgconfig \ + && find -not -name MD5SUM -type f -exec md5sum -b {} + > MD5SUM \ + && tar --owner=0 --group=0 -czf "${SQLITE_BINTGZ:?}" * \ + && md5sum -b "${SQLITE_BINTGZ:?}" > "${SQLITE_BINTGZ:?}.md5" \ + ) \ + && cd .. && rm -rf sqlite-*${SQLITE_VERSION:?} \ + );fi \ + && printf '\n DONE\n\n' + + +## Install +true \ + && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${SQLITE_BINTGZ:?}" \ + && true + + + |