Skip to content

Commit 0ebb159

Browse files
committed
add build_sqlcipher option
1 parent 51032d8 commit 0ebb159

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build_ext]
2+
libraries=sqlcipher
23
#define=
34
#include_dirs=/usr/local/include
45
#library_dirs=/usr/local/lib
5-
libraries=sqlite3
66
#define=SQLITE_OMIT_LOAD_EXTENSION

setup.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ def get_amalgamation():
110110
os.mkdir(AMALGAMATION_ROOT)
111111
print "Downloading amalgation."
112112

113-
# XXX upload the amalgamation file to a somewhat more
114-
# official place
113+
# XXX upload the amalgamation file to downloads.leap.se
115114
amalgamation_url = ("http://futeisha.org/sqlcipher/"
116115
"amalgamation-sqlcipher-2.1.0.zip")
117116

@@ -142,6 +141,15 @@ def __init__(self, *args, **kwargs):
142141
build.__init__(self, *args, **kwargs)
143142

144143

144+
class LibSQLCipherBuilder(build_ext):
145+
146+
description = ("Build C extension linking against libsqlcipher library.")
147+
148+
def build_extension(self, ext):
149+
ext.extra_link_args.append("-lsqlcipher")
150+
build_ext.build_extension(self, ext)
151+
152+
145153
class MyBuildExt(build_ext):
146154
amalgamation = True # We want amalgamation on the default build for now
147155
static = False
@@ -304,7 +312,8 @@ def get_setup_args():
304312
("pysqlcipher-doc/code",
305313
glob.glob("doc/code/*.py"))]
306314

307-
py_modules = ["sqlcipher"],
315+
#XXX ?
316+
#py_modules = ["sqlcipher"],
308317

309318
setup_args = dict(
310319
name="pysqlcipher",
@@ -317,7 +326,6 @@ def get_setup_args():
317326
license="zlib/libpng", # is THIS a license?
318327
# It says MIT in the google project
319328
platforms="ALL",
320-
#XXX missing url
321329
url="http://github.com/leapcode/pysqlcipher/",
322330
# Description of the modules and packages in the distribution
323331
package_dir={"pysqlcipher": "lib"},
@@ -338,7 +346,7 @@ def get_setup_args():
338346
define_macros=define_macros)
339347
],
340348
classifiers=[
341-
"Development Status :: 5 - Production/Stable",
349+
"Development Status :: 4 - Beta",
342350
"Intended Audience :: Developers",
343351
"License :: OSI Approved :: zlib/libpng License",
344352
"Operating System :: MacOS :: MacOS X",
@@ -355,6 +363,7 @@ def get_setup_args():
355363
{"build_docs": DocBuilder,
356364
"build_ext": MyBuildExt,
357365
"build_static": AmalgamationBuilder,
366+
"build_sqlcipher": LibSQLCipherBuilder,
358367
"cross_bdist_wininst": cross_bdist_wininst.bdist_wininst})
359368
return setup_args
360369

0 commit comments

Comments
 (0)