diff options
author | Ilya Basin | 2021-12-05 23:45:43 +0300 |
---|---|---|
committer | Ilya Basin | 2021-12-05 23:45:43 +0300 |
commit | 87bb3f9d94a2ba19caa36232021d464b3aa463c4 (patch) | |
tree | b382253444401f1724eb131425acaf3f879f0535 | |
download | aur-87bb3f9d94a2ba19caa36232021d464b3aa463c4.tar.gz |
root
-rw-r--r-- | .SRCINFO | 34 | ||||
-rw-r--r-- | LICENSE | 25 | ||||
-rw-r--r-- | Makefile.ext.in | 51 | ||||
-rw-r--r-- | PKGBUILD | 157 | ||||
-rw-r--r-- | README.md.in | 24 | ||||
-rw-r--r-- | configure-cross.patch | 24 | ||||
-rw-r--r-- | configure-linemacros.patch | 27 |
7 files changed, 342 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..928f9c5b97b7 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,34 @@ +pkgbase = mingw-w64-sqlite3 + pkgdesc = A C library that implements an SQL database engine (mingw-w64) + pkgver = 3.37.0 + pkgrel = 1 + url = https://www.sqlite.org + arch = any + license = PublicDomain + makedepends = mingw-w64-gcc + depends = mingw-w64-readline + depends = mingw-w64-tcl + provides = mingw-w64-sqlite=3.37.0 + provides = mingw-w64-sqlite-analyzer=3.37.0 + provides = mingw-w64-sqlite-docs=3.37.0 + conflicts = mingw-w64-sqlite-analyzer + replaces = mingw-w64-sqlite-analyzer + options = !strip + options = staticlibs + options = !buildflags + source = https://www.sqlite.org/2021/sqlite-src-3370000.zip + source = https://www.sqlite.org/2021/sqlite-doc-3370000.zip + source = Makefile.ext.in + source = README.md.in + source = configure-cross.patch + source = configure-linemacros.patch + source = LICENSE + sha256sums = 70977fb3942187d4627413afde9a9492fa02b954850812b53974b6a31ece8faf + sha256sums = 8af0c6a3e0850ecd5003d3318f28f0f15d3386d4e67c09eae6358a7b159a47d8 + sha256sums = 4a8a87289253529cf04c916e5743c8727a5506b5185bc9bd4070b42037e8ae20 + sha256sums = 5ca42f1f92abfb61bacc9ff60f5836cc56e2ce2af52264f918cb06c3d566d562 + sha256sums = SKIP + sha256sums = SKIP + sha256sums = 0b76663a90e034f3d7f2af5bfada4cedec5ebc275361899eccc5c18e6f01ff1f + +pkgname = mingw-w64-sqlite3 diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..0280d55555db --- /dev/null +++ b/LICENSE @@ -0,0 +1,25 @@ +All of the code and documentation in SQLite has been dedicated to the public +domain by the authors. All code authors, and representatives of the companies +they work for, have signed affidavits dedicating their contributions to the +public domain and originals of those signed affidavits are stored in a firesafe +at the main offices of Hwaci. Anyone is free to copy, modify, publish, use, +compile, sell, or distribute the original SQLite code, either in source code +form or as a compiled binary, for any purpose, commercial or non-commercial, +and by any means. + +The previous paragraph applies to the deliverable code and documentation in +SQLite - those parts of the SQLite library that you actually bundle and ship +with a larger application. Some scripts used as part of the build process (for +example the "configure" scripts generated by autoconf) might fall under other +open-source licenses. Nothing from these build scripts ever reaches the final +deliverable SQLite library, however, and so the licenses associated with those +scripts should not be a factor in assessing your rights to copy and use the +SQLite library. + +All of the deliverable code in SQLite has been written from scratch. No code has +been taken from other projects or from the open internet. Every line of code can +be traced back to its original author, and all of those authors have public +domain dedications on file. So the SQLite code base is clean and is +uncontaminated with licensed code from other projects. + +Source: https://www.sqlite.org/copyright.html diff --git a/Makefile.ext.in b/Makefile.ext.in new file mode 100644 index 000000000000..88211e4277ce --- /dev/null +++ b/Makefile.ext.in @@ -0,0 +1,51 @@ +# PLEASE KEEP IN SYNC WITH CORRESPONDING FILE IN MSYS2-SQLITE. +# +# Makefile template to generate sqlite extensions in sub-folder ext/misc + +DLL_PREFIX = +DLL_SUFFIX = + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ + +vpath %.c $(srcdir) +vpath %.in ../$(top_srcdir) + +PACKAGE_VERSION = @PACKAGE_VERSION@ +prefix = @prefix@ +datadir = @datadir@ +extdir = $(datadir)/sqlite/extensions + +# c-source for each of which an extension is built +CSRCS = $(filter-out $(addprefix $(srcdir)/,$(CSRCS_IGNORE)),$(wildcard $(srcdir)/*.c)) +# c-sources not to compile as standalone sqlite-extensions +CSRCS_IGNORE = memtrace.c json1.c +# c-source already compiled into sqlite3 client +CSRCS_IGNORE += regexp.c +# c-source to be ignored because of compilation errors +CSRCS_IGNORE += fileio.c + +DLLS = $(patsubst %.c,$(DLL_PREFIX)%$(DLL_SUFFIX).dll,$(notdir $(CSRCS))) + +CC = @CC@ +CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)/src +CFLAGS = -pedantic +LIBS = -L$(top_builddir)/.libs -lsqlite3 -lz + +.PHONY : all +all : $(DLLS) + +$(DLL_PREFIX)%$(DLL_SUFFIX).dll: %.c + $(CC) -shared $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LIBS) + +%.i: %.c + $(CC) -E $(CPPFLAGS) -o $@ $< + +.PHONY: clean install +clean: + -rm -f $(DLLS) 2> /dev/nul + +install: $(DLLS) $(CSRCS) + mkdir -p $(DESTDIR)$(extdir) + cp -vp $^ $(DESTDIR)$(extdir) diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cc3c44fab011 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,157 @@ +# Maintainer: Ilya Basin <basinilya at gmail dot com> +# https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-sqlite3 +# Contributor: Alexey Pavlov <alexpux@gmail.com> +# Contributor: Renato Silva <br.renatosilva@gmail.com> +# Contributor: Brisingr Aerowing <ztgreve@live.com> + +_architectures='i686-w64-mingw32 x86_64-w64-mingw32' +MINGW_PACKAGE_PREFIX=mingw-w64 +_adapt_msys2() { + MINGW_CHOST=${_arch:?} + MINGW_PREFIX=/usr/${_arch:?} +} + +_realname=sqlite3 +pkgbase=mingw-w64-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +_sqlite_year=2021 +_amalgamationver=3370000 +_docver=${_amalgamationver} +pkgver=3.37.0 +pkgrel=1 +pkgdesc="A C library that implements an SQL database engine (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +license=(PublicDomain) +url="https://www.sqlite.org" +provides=(${MINGW_PACKAGE_PREFIX}-sqlite=${pkgver} + ${MINGW_PACKAGE_PREFIX}-sqlite-analyzer=${pkgver} + ${MINGW_PACKAGE_PREFIX}-sqlite-docs=${pkgver}) +conflicts=(${MINGW_PACKAGE_PREFIX}-sqlite-analyzer) +replaces=(${MINGW_PACKAGE_PREFIX}-sqlite-analyzer) +depends=( + #"${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-readline" + "${MINGW_PACKAGE_PREFIX}-tcl") +makedepends=("${MINGW_PACKAGE_PREFIX}-gcc") +source=(https://www.sqlite.org/${_sqlite_year}/sqlite-src-${_amalgamationver}.zip + https://www.sqlite.org/${_sqlite_year}/sqlite-doc-${_docver}.zip + Makefile.ext.in + README.md.in + configure-cross.patch + configure-linemacros.patch + LICENSE) +sha256sums=('70977fb3942187d4627413afde9a9492fa02b954850812b53974b6a31ece8faf' + '8af0c6a3e0850ecd5003d3318f28f0f15d3386d4e67c09eae6358a7b159a47d8' + '4a8a87289253529cf04c916e5743c8727a5506b5185bc9bd4070b42037e8ae20' + '5ca42f1f92abfb61bacc9ff60f5836cc56e2ce2af52264f918cb06c3d566d562' + SKIP + SKIP + '0b76663a90e034f3d7f2af5bfada4cedec5ebc275361899eccc5c18e6f01ff1f') +options=('!strip' 'staticlibs' '!buildflags') + +sqlite_tools="sqlite3_analyzer.exe dbhash.exe sqldiff.exe" + +prepare() { + cd "${srcdir}/sqlite-src-${_amalgamationver}" + patch -Np1 -i ../configure-cross.patch + patch -Np1 -i ../configure-linemacros.patch + autoconf +} + +build() { + + for _arch in ${_architectures}; do + _adapt_msys2 + pushd . + + test -d ${srcdir}/build-${_amalgamationver}-${MINGW_CHOST} && \ + rm -rf ${srcdir}/build-${_amalgamationver}-${MINGW_CHOST} + mkdir -p ${srcdir}/build-${_amalgamationver}-${MINGW_CHOST} && \ + cd ${srcdir}/build-${_amalgamationver}-${MINGW_CHOST} + + export lt_cv_deplibs_check_method='pass_all' + + SQLITE_OPTIONS="\ + -DSQLITE_ENABLE_COLUMN_METADATA=1 \ + -DSQLITE_USE_MALLOC_H=1 \ + -DSQLITE_USE_MSIZE=1 \ + -DSQLITE_DISABLE_DIRSYNC=1 \ + -DSQLITE_ENABLE_DBSTAT_VTAB=1 \ + -DSQLITE_SOUNDEX=1 \ + -DSQLITE_ENABLE_MATH_FUNCTIONS=1 \ + " + + CFLAGS+=" -fexceptions -fno-strict-aliasing ${SQLITE_OPTIONS}" + LDFLAGS+=" -lssp" + + ${_arch}-configure \ + -C \ + --enable-threadsafe \ + --disable-editline \ + --enable-readline \ + --enable-all \ + --enable-session \ + --with-readline-inc=-I${MINGW_PREFIX}/include \ + --with-tcl=${MINGW_PREFIX}/lib \ + TCLLIBDIR=${MINGW_PREFIX}/lib/sqlite${pkgver} \ + ../sqlite-src-${_amalgamationver} + +# BUILD_EXEEXT= +# TARGET_EXEEXT=.exe \ + + make + + # build additional tools + make $sqlite_tools + + # build extensions + ./config.status --file=ext/misc/Makefile:../Makefile.ext.in + make -C ext/misc + + popd + done + +} + +check() { + return 0 + cd "${srcdir}/build-${_amalgamationver}-${MINGW_CHOST}" + # This test run lasts very loooong ... despite the target name + make quicktest || true +} + +package() { + + for _arch in ${_architectures}; do + _adapt_msys2 + pushd . + + cd ${srcdir}/build-${_amalgamationver}-${MINGW_CHOST} + make DESTDIR="${pkgdir}" install + + for t in $sqlite_tools; do + install -Dm755 .libs/$t "${pkgdir}${MINGW_PREFIX}/bin/$t" + done + mv ${pkgdir}${MINGW_PREFIX}/lib/bin/*.* ${pkgdir}${MINGW_PREFIX}/lib/sqlite${pkgver}/ + rm -rf ${pkgdir}${MINGW_PREFIX}/lib/bin + + # Install extensions + make -C ext/misc DESTDIR="${pkgdir}" install + cat "${srcdir}/README.md.in" | sed \ + -e "s|@MINGW_PREFIX@|${MINGW_PREFIX}|g" \ + -e "s|@MSYSTEM@|${MSYSTEM}|g;" \ + -e "s|@VERSION@|${pkgver}|g;" \ + > "${pkgdir}${MINGW_PREFIX}/share/sqlite/extensions/README.md" + + # Install docs + cd ${srcdir}/sqlite-doc-${_docver} + mkdir -p ${pkgdir}${MINGW_PREFIX}/share/doc/${_realname} + cp -R * ${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}/ + + install -Dm644 "${srcdir}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" + + popd + done + +} diff --git a/README.md.in b/README.md.in new file mode 100644 index 000000000000..fc47b2688805 --- /dev/null +++ b/README.md.in @@ -0,0 +1,24 @@ +# Sqlite Extensions - Usage (Sqlite @VERSION@) + +This folder contains shared libraries (dll files) `sqlite3.exe` can be +instructed to load at run-time in order to add functions usable in `sqlite3` SQL code. + + +Here an example of how to call an extension from the command line (example with +extension `csv`, other extensions are in this directory): + +- open a shell (e.g. the `@MSYSTEM@` shell) +- call `sqlite3.exe` (residing in `@MINGW_PREFIX@/bin`) +- load the sqlite extension (use an absolute path in Windows notation, see below + for an example of an absolute path) + +~~~bash + sqlite3 + sqlite3> .load "C:/msys64@MINGW_PREFIX@/share/sqlite/extensions/csv.dll" +~~~ + +Usage information to each extension is contained in the header of the c-file +corresponding to the extension you can find in this directory. + + +More information here: https://www.sqlite.org/loadext.html#loading_an_extension. diff --git a/configure-cross.patch b/configure-cross.patch new file mode 100644 index 000000000000..13680cc0a697 --- /dev/null +++ b/configure-cross.patch @@ -0,0 +1,24 @@ +--- sqlite-src-3370000/configure.ac.old 2021-12-05 22:29:52.509814861 +0300 ++++ sqlite-src-3370000/configure.ac 2021-12-05 22:53:06.317941047 +0300 +@@ -258,14 +258,16 @@ + fi + if test "$CYGWIN" = "yes"; then + BUILD_EXEEXT=.exe +-else +- BUILD_EXEEXT=$EXEEXT + fi ++ + if test x"$cross_compiling" = xno; then +- TARGET_EXEEXT=$BUILD_EXEEXT +-else +- TARGET_EXEEXT=$config_TARGET_EXEEXT ++ BUILD_EXEEXT=$EXEEXT ++fi ++ ++if test -z "$TARGET_EXEEXT"; then ++ TARGET_EXEEXT=$EXEEXT + fi ++ + if test "$TARGET_EXEEXT" = ".exe"; then + SQLITE_OS_UNIX=0 + SQLITE_OS_WIN=1 diff --git a/configure-linemacros.patch b/configure-linemacros.patch new file mode 100644 index 000000000000..8c03082157a4 --- /dev/null +++ b/configure-linemacros.patch @@ -0,0 +1,27 @@ +--- sqlite-src-3370000/configure.ac.old 2021-12-05 23:28:16.292028632 +0300 ++++ sqlite-src-3370000/configure.ac 2021-12-05 23:28:20.398758808 +0300 +@@ -577,6 +577,24 @@ + AC_SUBST(USE_AMALGAMATION) + + ######### ++# By default, amalgamation sqlite3.c will have #line directives. ++# This is a build option not shown by ./configure --help ++# To control it, use configure option: amalgamation_line_macros=? ++# where ? is no to suppress #line directives or yes to create them. ++AMALGAMATION_LINE_MACROS=--linemacros=1 ++AC_ARG_VAR(amalgamation_line_macros,) ++AC_SUBST(AMALGAMATION_LINE_MACROS) ++if test "${amalgamation_line_macros+set}" = set; then : ++ enableval=$amalgamation_line_macros; ++fi ++if test "${amalgamation_line_macros}" = "yes" ; then ++ AMALGAMATION_LINE_MACROS=--linemacros=1 ++fi ++if test "${amalgamation_line_macros}" = "no" ; then ++ AMALGAMATION_LINE_MACROS=--linemacros=0 ++fi ++ ++######### + # Look for zlib. Only needed by extensions and by the sqlite3.exe shell + AC_CHECK_HEADERS(zlib.h) + AC_SEARCH_LIBS(deflate, z, [HAVE_ZLIB="-DSQLITE_HAVE_ZLIB=1"], [HAVE_ZLIB=""]) |