Skip to content

Commit

Permalink
feat: single-file bundle (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon authored Jun 10, 2023
1 parent 46a55f8 commit 9f77317
Show file tree
Hide file tree
Showing 86 changed files with 10,700 additions and 11,898 deletions.
74 changes: 40 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ compile-linux:
gcc -O3 $(LINIX_FLAGS) src/sqlite3-define.c src/define/*.c -o dist/define.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-fileio.c src/fileio/*.c -o dist/fileio.so
gcc -O1 $(LINIX_FLAGS) src/sqlite3-fuzzy.c src/fuzzy/*.c -o dist/fuzzy.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-ipaddr.c -o dist/ipaddr.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-ipaddr.c src/ipaddr/*.c -o dist/ipaddr.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-json1.c -o dist/json1.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-math.c -o dist/math.so -lm
gcc -O3 $(LINIX_FLAGS) -DPCRE2_CODE_UNIT_WIDTH=8 -DLINK_SIZE=2 -DHAVE_CONFIG_H -DSUPPORT_UNICODE src/sqlite3-regexp.c src/regexp/regexp.c src/regexp/pcre2/*.c -o dist/regexp.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-stats.c -o dist/stats.so -lm
gcc -O3 $(LINIX_FLAGS) src/sqlite3-math.c src/math/*.c -o dist/math.so -lm
gcc -O3 $(LINIX_FLAGS) -include src/regexp/constants.h src/sqlite3-regexp.c src/regexp/*.c src/regexp/pcre2/*.c -o dist/regexp.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-stats.c src/stats/*.c -o dist/stats.so -lm
gcc -O3 $(LINIX_FLAGS) src/sqlite3-text.c src/text/*.c -o dist/text.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-unicode.c -o dist/unicode.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-uuid.c -o dist/uuid.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-vsv.c -o dist/vsv.so -lm
gcc -O3 $(LINIX_FLAGS) src/sqlite3-unicode.c src/unicode/*.c -o dist/unicode.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-uuid.c src/uuid/*.c -o dist/uuid.so
gcc -O3 $(LINIX_FLAGS) src/sqlite3-vsv.c src/vsv/*.c -o dist/vsv.so -lm
gcc -O1 $(LINIX_FLAGS) -include src/regexp/constants.h src/sqlite3-sqlean.c src/crypto/*.c src/define/*.c src/fileio/*.c src/fuzzy/*.c src/math/*.c src/regexp/*.c src/regexp/pcre2/*.c src/stats/*.c src/text/*.c src/unicode/*.c src/uuid/*.c src/vsv/*.c -o dist/sqlean.so -lm

pack-linux:
zip -j dist/sqlean-linux-x86.zip dist/*.so
Expand All @@ -50,13 +51,14 @@ compile-windows:
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-fileio.c src/fileio/*.c -o dist/fileio.dll
gcc -O1 $(WINDO_FLAGS) -I. src/sqlite3-fuzzy.c src/fuzzy/*.c -o dist/fuzzy.dll
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-json1.c -o dist/json1.dll
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-math.c -o dist/math.dll -lm
gcc -O3 $(WINDO_FLAGS) -DPCRE2_CODE_UNIT_WIDTH=8 -DLINK_SIZE=2 -DHAVE_CONFIG_H -DSUPPORT_UNICODE -DPCRE2_STATIC -I. src/sqlite3-regexp.c src/regexp/regexp.c src/regexp/pcre2/*.c -o dist/regexp.dll
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-stats.c -o dist/stats.dll -lm
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-math.c src/math/*.c -o dist/math.dll -lm
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-regexp.c -include src/regexp/constants.h src/regexp/*.c src/regexp/pcre2/*.c -o dist/regexp.dll
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-stats.c src/stats/*.c -o dist/stats.dll -lm
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-text.c src/text/*.c -o dist/text.dll
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-unicode.c -o dist/unicode.dll
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-uuid.c -o dist/uuid.dll
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-vsv.c -o dist/vsv.dll -lm
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-unicode.c src/unicode/*.c -o dist/unicode.dll
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-uuid.c src/uuid/*.c -o dist/uuid.dll
gcc -O3 $(WINDO_FLAGS) -I. src/sqlite3-vsv.c src/vsv/*.c -o dist/vsv.dll -lm
gcc -O1 $(WINDO_FLAGS) -I. -include src/regexp/constants.h src/sqlite3-sqlean.c src/crypto/*.c src/define/*.c src/fileio/*.c src/fuzzy/*.c src/math/*.c src/regexp/*.c src/regexp/pcre2/*.c src/stats/*.c src/text/*.c src/unicode/*.c src/uuid/*.c src/vsv/*.c -o dist/sqlean.dll -lm

pack-windows:
7z a -tzip dist/sqlean-win-x64.zip ./dist/*.dll
Expand All @@ -66,47 +68,50 @@ compile-macos:
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-define.c src/define/*.c -o dist/define.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-fileio.c src/fileio/*.c -o dist/fileio.dylib
gcc -O1 $(MACOS_FLAGS) -I src src/sqlite3-fuzzy.c src/fuzzy/*.c -o dist/fuzzy.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-ipaddr.c -o dist/ipaddr.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-ipaddr.c src/ipaddr/*.c -o dist/ipaddr.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-json1.c -o dist/json1.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-math.c -o dist/math.dylib -lm
gcc -O3 $(MACOS_FLAGS) -DPCRE2_CODE_UNIT_WIDTH=8 -DLINK_SIZE=2 -DHAVE_CONFIG_H -DSUPPORT_UNICODE -I src src/sqlite3-regexp.c src/regexp/regexp.c src/regexp/pcre2/*.c -o dist/regexp.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-stats.c -o dist/stats.dylib -lm
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-math.c src/math/*.c -o dist/math.dylib -lm
gcc -O3 $(MACOS_FLAGS) -include src/regexp/constants.h -I src src/sqlite3-regexp.c src/regexp/*.c src/regexp/pcre2/*.c -o dist/regexp.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-stats.c src/stats/*.c -o dist/stats.dylib -lm
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-text.c src/text/*.c -o dist/text.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-unicode.c -o dist/unicode.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-uuid.c -o dist/uuid.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-vsv.c -o dist/vsv.dylib -lm
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-unicode.c src/unicode/*.c -o dist/unicode.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-uuid.c src/uuid/*.c -o dist/uuid.dylib
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-vsv.c src/vsv/*.c -o dist/vsv.dylib -lm
gcc -O1 $(MACOS_FLAGS) -I src -include src/regexp/constants.h src/sqlite3-sqlean.c src/crypto/*.c src/define/*.c src/fileio/*.c src/fuzzy/*.c src/math/*.c src/regexp/*.c src/regexp/pcre2/*.c src/stats/*.c src/text/*.c src/unicode/*.c src/uuid/*.c src/vsv/*.c -o dist/sqlean.dylib -lm

compile-macos-x86:
mkdir -p dist/x86
gcc -O1 $(MACOS_FLAGS) -I src src/sqlite3-crypto.c src/crypto/*.c -o dist/x86/crypto.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-define.c src/define/*.c -o dist/x86/define.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-fileio.c src/fileio/*.c -o dist/x86/fileio.dylib -target x86_64-apple-macos10.12
gcc -O1 $(MACOS_FLAGS) -I src src/sqlite3-fuzzy.c src/fuzzy/*.c -o dist/x86/fuzzy.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-ipaddr.c -o dist/x86/ipaddr.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-ipaddr.c src/ipaddr/*.c -o dist/x86/ipaddr.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-json1.c -o dist/x86/json1.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-math.c -o dist/x86/math.dylib -target x86_64-apple-macos10.12 -lm
gcc -O3 $(MACOS_FLAGS) -DPCRE2_CODE_UNIT_WIDTH=8 -DLINK_SIZE=2 -DHAVE_CONFIG_H -DSUPPORT_UNICODE -I src src/sqlite3-regexp.c src/regexp/regexp.c src/regexp/pcre2/*.c -o dist/x86/regexp.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-stats.c -o dist/x86/stats.dylib -target x86_64-apple-macos10.12 -lm
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-math.c src/math/*.c -o dist/x86/math.dylib -target x86_64-apple-macos10.12 -lm
gcc -O3 $(MACOS_FLAGS) -include src/regexp/constants.h -I src src/sqlite3-regexp.c src/regexp/*.c src/regexp/pcre2/*.c -o dist/x86/regexp.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-stats.c src/stats/*.c -o dist/x86/stats.dylib -target x86_64-apple-macos10.12 -lm
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-text.c src/text/*.c -o dist/x86/text.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-unicode.c -o dist/x86/unicode.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-uuid.c -o dist/x86/uuid.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-vsv.c -o dist/x86/vsv.dylib -target x86_64-apple-macos10.12 -lm
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-unicode.c src/unicode/*.c -o dist/x86/unicode.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-uuid.c src/uuid/*.c -o dist/x86/uuid.dylib -target x86_64-apple-macos10.12
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-vsv.c src/vsv/*.c -o dist/x86/vsv.dylib -target x86_64-apple-macos10.12 -lm
gcc -O1 $(MACOS_FLAGS) -I src -include src/regexp/constants.h src/sqlite3-sqlean.c src/crypto/*.c src/define/*.c src/fileio/*.c src/fuzzy/*.c src/math/*.c src/regexp/*.c src/regexp/pcre2/*.c src/stats/*.c src/text/*.c src/unicode/*.c src/uuid/*.c src/vsv/*.c -o dist/x86/sqlean.dylib -target x86_64-apple-macos10.12 -lm

compile-macos-arm64:
mkdir -p dist/arm64
gcc -O1 $(MACOS_FLAGS) -I src src/sqlite3-crypto.c src/crypto/*.c -o dist/arm64/crypto.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-define.c src/define/*.c -o dist/arm64/define.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-fileio.c src/fileio/*.c -o dist/arm64/fileio.dylib -target arm64-apple-macos11
gcc -O1 $(MACOS_FLAGS) -I src src/sqlite3-fuzzy.c src/fuzzy/*.c -o dist/arm64/fuzzy.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-ipaddr.c -o dist/arm64/ipaddr.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-ipaddr.c src/ipaddr/*.c -o dist/arm64/ipaddr.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-json1.c -o dist/arm64/json1.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-math.c -o dist/arm64/math.dylib -target arm64-apple-macos11 -lm
gcc -O3 $(MACOS_FLAGS) -DPCRE2_CODE_UNIT_WIDTH=8 -DLINK_SIZE=2 -DHAVE_CONFIG_H -DSUPPORT_UNICODE -I src src/sqlite3-regexp.c src/regexp/regexp.c src/regexp/pcre2/*.c -o dist/arm64/regexp.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-stats.c -o dist/arm64/stats.dylib -target arm64-apple-macos11 -lm
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-math.c src/math/*.c -o dist/arm64/math.dylib -target arm64-apple-macos11 -lm
gcc -O3 $(MACOS_FLAGS) -include src/regexp/constants.h -I src src/sqlite3-regexp.c src/regexp/*.c src/regexp/pcre2/*.c -o dist/arm64/regexp.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-stats.c src/stats/*.c -o dist/arm64/stats.dylib -target arm64-apple-macos11 -lm
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-text.c src/text/*.c -o dist/arm64/text.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-unicode.c -o dist/arm64/unicode.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-uuid.c -o dist/arm64/uuid.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-vsv.c -o dist/arm64/vsv.dylib -target arm64-apple-macos11 -lm
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-unicode.c src/unicode/*.c -o dist/arm64/unicode.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-uuid.c src/uuid/*.c -o dist/arm64/uuid.dylib -target arm64-apple-macos11
gcc -O3 $(MACOS_FLAGS) -I src src/sqlite3-vsv.c src/vsv/*.c -o dist/arm64/vsv.dylib -target arm64-apple-macos11 -lm
gcc -O1 $(MACOS_FLAGS) -I src -include src/regexp/constants.h src/sqlite3-sqlean.c src/crypto/*.c src/define/*.c src/fileio/*.c src/fuzzy/*.c src/math/*.c src/regexp/*.c src/regexp/pcre2/*.c src/stats/*.c src/text/*.c src/unicode/*.c src/uuid/*.c src/vsv/*.c -o dist/arm64/sqlean.dylib -target arm64-apple-macos11 -lm

pack-macos:
zip -j dist/sqlean-macos-x86.zip dist/x86/*.dylib
Expand All @@ -126,6 +131,7 @@ test-all:
make test suite=unicode
make test suite=uuid
make test suite=vsv
make test suite=sqlean

# fails if grep does find a failed test case
# https://stackoverflow.com/questions/15367674/bash-one-liner-to-exit-with-the-opposite-status-of-a-grep-command/21788642
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Think of them as the extended standard library for SQLite:
- [uuid](docs/uuid.md): Universally Unique IDentifiers
- [vsv](docs/vsv.md): CSV files as virtual tables

The single-file `sqlean` bundle contains all extensions from the main set (except `ipaddr`).

## Incubator

These extensions haven't yet made their way to the main set. They may be untested, poorly documented, too broad, too narrow, or without a well-thought API.
Expand Down Expand Up @@ -81,7 +83,7 @@ Incubator extensions are [also available](https://github.com/nalgeon/sqlean/rele

## Installation and Usage

Examples below use the `stats` extension; you can specify any other supported extension.
Examples below use the `stats` extension; you can specify any other supported extension. To load all extensions at once, use the single-file `sqlean` bundle.

SQLite command-line interface (CLI, aka 'sqlite3.exe' on Windows):

Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Incubator extensions are [also available](https://github.com/nalgeon/sqlean/rele

## 2. Load and Use

Examples below use the `stats` extension; you can specify any other supported extension.
Examples below use the `stats` extension; you can specify any other supported extension. To load all extensions at once, use the single-file `sqlean` bundle.

SQLite command-line interface (CLI, aka 'sqlite3.exe' on Windows):

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/base32.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ uint8_t* base32_decode(const uint8_t* src, size_t len, size_t* out_len) {
}
*out_len = count;
return decoded;
}
}
2 changes: 1 addition & 1 deletion src/crypto/base32.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
uint8_t* base32_encode(const uint8_t* src, size_t len, size_t* out_len);
uint8_t* base32_decode(const uint8_t* src, size_t len, size_t* out_len);

#endif /* _BASE32_H_ */
#endif /* _BASE32_H_ */
2 changes: 1 addition & 1 deletion src/crypto/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
uint8_t* base64_encode(const uint8_t* src, size_t len, size_t* out_len);
uint8_t* base64_decode(const uint8_t* src, size_t len, size_t* out_len);

#endif /* BASE64_H */
#endif /* BASE64_H */
2 changes: 1 addition & 1 deletion src/crypto/base85.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
uint8_t* base85_encode(const uint8_t* src, size_t len, size_t* out_len);
uint8_t* base85_decode(const uint8_t* src, size_t len, size_t* out_len);

#endif /* _BASE85_H_ */
#endif /* _BASE85_H_ */
Loading

0 comments on commit 9f77317

Please sign in to comment.