Skip to content

Commit

Permalink
Update to latest Xapian release
Browse files Browse the repository at this point in the history
Swap Travis for Github CI
  • Loading branch information
castaway committed Jul 11, 2024
1 parent 9a23c62 commit 34fdfe9
Show file tree
Hide file tree
Showing 10 changed files with 1,762 additions and 45 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Runbox-SearchIndex

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v1
with:
node-version: '16.x'
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- run: ./setup-emsdh.sh
- run: source ./emsdk/emsdk_env.sh
- run: ./build-xapian.sh
- run: npm ci
- run: npm run test-no-watch

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ node_modules
xapianasm.*
.vscode
dist
/xapian/
*.log
/xapian*
/emsdk/
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ https://github.com/xapian/xapian/blob/master/xapian-core/emscripten/README.md
In order to build the web assembly binaries you will have to set the `XAPIAN` environment variable to
the location of the `xapian_core` folder of your Xapian emscripten build.

You may then build it using `XAPIAN=xapian_core_location npm run build`
You may then build it using `npm run build --xapiandir=xapian_core_location`

You can also have a look at the [.travis.yml](.travis.yml) file for a complete build and test procedure (which is run on every push).
You can also have a look at the [Github CI](.github/workflows/ci.yml) file for a complete build and test procedure (which is run on every push).

## Running tests

Expand Down
13 changes: 4 additions & 9 deletions build-xapian.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
#!/bin/bash
THREADS=${THREADS:-2}

git clone https://github.com/xapian/xapian
cd xapian
git checkout v1.4.16
./bootstrap xapian-core
./configure CXXFLAGS=-O0 --disable-backend-honey --disable-backend-inmemory --disable-backend-remote
make -j$THREADS
make -j$THREADS distclean
cd xapian-core
wget https://oligarchy.co.uk/xapian/1.4.25/xapian-core-1.4.25.tar.xz
tar -xf xapian-core-1.4.25.tar.xz
cd xapian-core-1.4.25
emconfigure ./configure CPPFLAGS='-DFLINTLOCK_USE_FLOCK' CXXFLAGS='-Oz -s USE_ZLIB=1 -fno-rtti' --disable-backend-honey --disable-backend-inmemory --disable-shared --disable-backend-remote
emmake make -j$THREADS
cd ../..
cd ..
2 changes: 1 addition & 1 deletion compilermmxapianapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if(!process.env.XAPIAN) {
mkdirSync('dist');
}
execSync(`em++ -Oz -s DISABLE_EXCEPTION_CATCHING=0 -s USE_ZLIB=1 ` +
`-s "EXTRA_EXPORTED_RUNTIME_METHODS=['FS','cwrap','stringToUTF8','UTF8ToString','getValue']" ` +
`-s "EXPORTED_RUNTIME_METHODS=['FS','cwrap','stringToUTF8','UTF8ToString','getValue']" ` +
`-std=c++11 -s DEMANGLE_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 ` +
`-I$XAPIAN/include -I$XAPIAN -I$XAPIAN/common rmmxapianapi.cc $XAPIAN/.libs/libxapian.a ` +
`-o dist/xapianasm.js -lidbfs.js -lnodefs.js`, { stdio: 'inherit' });
Expand Down
Loading

0 comments on commit 34fdfe9

Please sign in to comment.