7
7
import shutil
8
8
import logging
9
9
10
- TAG = '3380500'
10
+ # sqlite amalgamation download URL uses relase year and tag
11
+ # 2022 and (3, 38, 5) -> '/2022/sqlite-amalgamation-3380500.zip'
12
+ VERSION = (3 , 38 , 5 )
13
+ VERSION_YEAR = 2022
11
14
HASH = '4fc2992e4c1ca1664a9b01e07c9b944003c4ed0612978e471eff262a7114e4a0699244d91e71ae4ad2b5e1fc9829917cd7d5f0313aa5859036905f974548d94a'
12
15
13
16
deps = []
@@ -22,13 +25,14 @@ def get_lib_name(settings):
22
25
23
26
24
27
def get (ports , settings , shared ):
25
- # TODO: This is an emscripten-hosted mirror of the sqlite repo from sqlite.prg.
26
- ports .fetch_project ('sqlite3' , 'https://www.sqlite.org/2022/sqlite-amalgamation-' + TAG + '.zip' , 'sqlite-amalgamation-' + TAG , sha512hash = HASH )
28
+ release = f'sqlite-amalgamation-{ VERSION [0 ]} { VERSION [1 ]:02} { VERSION [2 ]:02} 00'
29
+ # TODO: Fetch the file from an emscripten-hosted mirror.
30
+ ports .fetch_project ('sqlite3' , f'https://www.sqlite.org/{ VERSION_YEAR } /{ release } .zip' , release , sha512hash = HASH )
27
31
28
32
def create (final ):
29
33
logging .info ('building port: libsqlite3' )
30
34
31
- source_path = os .path .join (ports .get_dir (), 'sqlite3' , 'sqlite-amalgamation-' + TAG )
35
+ source_path = os .path .join (ports .get_dir (), 'sqlite3' , release )
32
36
dest_path = os .path .join (ports .get_build_dir (), 'sqlite3' )
33
37
34
38
shutil .rmtree (dest_path , ignore_errors = True )
@@ -62,12 +66,14 @@ def create(final):
62
66
'-DSQLITE_ENABLE_FTS5=1' ,
63
67
'-DSQLITE_ENABLE_RTREE=1' ,
64
68
'-DSQLITE_ENABLE_GEOPOLY=1' ,
65
- '-DSQLITE_OMIT_POPEN=1'
69
+ '-DSQLITE_OMIT_POPEN=1' ,
66
70
]
67
71
if settings .USE_PTHREADS :
68
- flags += ['-sUSE_PTHREADS=1' ]
69
- flags += ['-DSQLITE_THREADSAFE=1' ]
70
- flags += ['-D_REENTRANT=1' ]
72
+ flags += [
73
+ '-sUSE_PTHREADS=1' ,
74
+ '-DSQLITE_THREADSAFE=1' ,
75
+ '-D_REENTRANT=1' ,
76
+ ]
71
77
else :
72
78
flags += ['-DSQLITE_THREADSAFE=0' ]
73
79
@@ -80,10 +86,6 @@ def clear(ports, settings, shared):
80
86
shared .Cache .erase_lib (get_lib_name (settings ))
81
87
82
88
83
- def process_dependencies (settings ):
84
- pass
85
-
86
-
87
89
def process_args (ports ):
88
90
return []
89
91
0 commit comments