Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade dependencies #87

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/compile_better_sqlite3
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export LDFLAGS="${LDFLAGS} -Wl,-rpath,${RUNTIME}/lib" # set 'rpath'
export LDFLAGS="${LDFLAGS} $(${RUNTIME}/bin/icu-config --ldflags-libsonly)"

# compile better-sqlite3
npm install [email protected] \
npm install [email protected] \
--no-save \
--build-from-source \
--sqlite3="${RUNTIME}/src"

Expand Down
2 changes: 1 addition & 1 deletion bin/env_check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -o pipefail

npx tap --no-cov --reporter=specy test/environment.js
npx tap --no-cov --reporter=classic test/environment.js
2 changes: 1 addition & 1 deletion bin/test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -o pipefail

npx tap -J --no-cov --test-ignore='^test/'
npx tap -J --no-cov --reporter=classic --test-ignore='^test/'
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"dependencies": {
"@mapbox/polyline": "^1.1.1",
"@turf/buffer": "^5.1.5",
"better-sqlite3": "^7.0.1",
"bindings": "^1.5.0",
"csv-parse": "^4.8.2",
"express": "^4.17.1",
Expand Down
15 changes: 9 additions & 6 deletions runtime/install/geos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@ cd /tmp
rm -rf geos && mkdir -p geos

# download release and decompress it
curl -L 'http://download.osgeo.org/geos/geos-3.8.1.tar.bz2' \
curl -L 'http://download.osgeo.org/geos/geos-3.13.1.tar.bz2' \
| tar -xj --strip-components=1 -C geos

# working directory
cd geos
mkdir geos/build
cd geos/build

# configure build
./configure \
--prefix="${RUNTIME}" \
--enable-static=no
cmake \
-DCMAKE_INSTALL_PREFIX="${RUNTIME}" \
-DBUILD_BENCHMARKS=OFF \
-DBUILD_TESTING=OFF \
..

# compile and install in runtime directory
make -j4
make install-strip
make install

# clean up
rm -rf /tmp/geos
14 changes: 13 additions & 1 deletion runtime/install/sqlite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cd /tmp
rm -rf sqlite && mkdir -p sqlite

# download release and decompress it
curl -L 'https://www.sqlite.org/2020/sqlite-autoconf-3310100.tar.gz' \
curl -L 'https://www.sqlite.org/2025/sqlite-autoconf-3480000.tar.gz' \
| tar -xz --strip-components=1 -C sqlite

# working directory
Expand Down Expand Up @@ -44,6 +44,18 @@ cat << EOF > sqlite3.patch.c
#define SQLITE_ENABLE_ICU 1
#define SQLITE_INTROSPECTION_PRAGMAS 1
#define SQLITE_SOUNDEX 1
#define HAVE_INT16_T 1
#define HAVE_INT32_T 1
#define HAVE_INT8_T 1
#define HAVE_STDINT_H 1
#define HAVE_UINT16_T 1
#define HAVE_UINT32_T 1
#define HAVE_UINT8_T 1
#define HAVE_USLEEP 1
#define SQLITE_ENABLE_DBSTAT_VTAB 1
#define SQLITE_ENABLE_DESERIALIZE 1
#define SQLITE_ENABLE_MATH_FUNCTIONS 1
#define SQLITE_TRACE_SIZE_LIMIT 32
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New pragmas defined by better-sqlite3

EOF

# append sqlite3.c
Expand Down
11 changes: 5 additions & 6 deletions test/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const os = require('os')
const tap = require('tap')
const common = require('./common')
const semver = require('semver')
Expand All @@ -14,8 +15,6 @@ tap.test('compile_options', (t) => {
t.notEqual(pragmas.ENABLE_RTREE, '0', 'ENABLE_RTREE != 0')
t.true(pragmas.hasOwnProperty('ENABLE_COLUMN_METADATA'), 'ENABLE_COLUMN_METADATA')
t.notEqual(pragmas.ENABLE_COLUMN_METADATA, '0', 'ENABLE_COLUMN_METADATA != 0')
t.true(pragmas.hasOwnProperty('ENABLE_JSON1'), 'ENABLE_JSON1')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t.notEqual(pragmas.ENABLE_JSON1, '0', 'ENABLE_JSON1 != 0')
t.end()
})

Expand All @@ -34,13 +33,13 @@ tap.test('dependencies', (t) => {
let res, actual, expected

res = db.prepare(`SELECT sqlite_version()`).get()
t.equals(res['sqlite_version()'], '3.31.1', `sqlite_version: ${res['sqlite_version()']}`)
t.equals(res['sqlite_version()'], '3.48.0', `sqlite_version: ${res['sqlite_version()']}`)

res = db.prepare(`SELECT spatialite_version()`).get()
t.equal(res['spatialite_version()'], '5.0.0-RC1', 'spatialite 5 RC1 required')
t.equal(res['spatialite_version()'], '5.1.1-rc0', 'spatialite 5 RC1 required')

res = db.prepare(`SELECT spatialite_target_cpu()`).get()
t.true(res['spatialite_target_cpu()'].startsWith('x86_64'), `spatialite_target_cpu: ${res['spatialite_target_cpu()']}`)
t.true(res['spatialite_target_cpu()'].startsWith(os.arch()), `spatialite_target_cpu: ${res['spatialite_target_cpu()']}`)

// res = db.prepare(`SELECT freexl_version()`).get()
// console.error(res)
Expand All @@ -55,7 +54,7 @@ tap.test('dependencies', (t) => {

res = db.prepare(`SELECT geos_version()`).get()
actual = semver.coerce(res['geos_version()'])
expected = semver.coerce('3.8.1-CAPI-1.13.3')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test seems to do nothing, it passed on any semver 🤷

expected = semver.coerce('3.13.1')
t.true(semver.gte(actual, expected), `geos_version: ${res['geos_version()']}`)

res = db.prepare(`SELECT rttopo_version()`).get()
Expand Down
Loading