From 0ebb159495b941dc40c1f9eaeab250e87edaea7b Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 30 May 2013 04:36:58 +0900 Subject: add build_sqlcipher option --- setup.cfg | 2 +- setup.py | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/setup.cfg b/setup.cfg index 731e079..1482ef6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [build_ext] +libraries=sqlcipher #define= #include_dirs=/usr/local/include #library_dirs=/usr/local/lib -libraries=sqlite3 #define=SQLITE_OMIT_LOAD_EXTENSION diff --git a/setup.py b/setup.py index ef9fe43..dff0c64 100644 --- a/setup.py +++ b/setup.py @@ -110,8 +110,7 @@ def get_amalgamation(): os.mkdir(AMALGAMATION_ROOT) print "Downloading amalgation." - # XXX upload the amalgamation file to a somewhat more - # official place + # XXX upload the amalgamation file to downloads.leap.se amalgamation_url = ("http://futeisha.org/sqlcipher/" "amalgamation-sqlcipher-2.1.0.zip") @@ -142,6 +141,15 @@ class AmalgamationBuilder(build): build.__init__(self, *args, **kwargs) +class LibSQLCipherBuilder(build_ext): + + description = ("Build C extension linking against libsqlcipher library.") + + def build_extension(self, ext): + ext.extra_link_args.append("-lsqlcipher") + build_ext.build_extension(self, ext) + + class MyBuildExt(build_ext): amalgamation = True # We want amalgamation on the default build for now static = False @@ -304,7 +312,8 @@ def get_setup_args(): ("pysqlcipher-doc/code", glob.glob("doc/code/*.py"))] - py_modules = ["sqlcipher"], + #XXX ? + #py_modules = ["sqlcipher"], setup_args = dict( name="pysqlcipher", @@ -317,7 +326,6 @@ def get_setup_args(): license="zlib/libpng", # is THIS a license? # It says MIT in the google project platforms="ALL", - #XXX missing url url="http://github.com/leapcode/pysqlcipher/", # Description of the modules and packages in the distribution package_dir={"pysqlcipher": "lib"}, @@ -338,7 +346,7 @@ def get_setup_args(): define_macros=define_macros) ], classifiers=[ - "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: zlib/libpng License", "Operating System :: MacOS :: MacOS X", @@ -355,6 +363,7 @@ def get_setup_args(): {"build_docs": DocBuilder, "build_ext": MyBuildExt, "build_static": AmalgamationBuilder, + "build_sqlcipher": LibSQLCipherBuilder, "cross_bdist_wininst": cross_bdist_wininst.bdist_wininst}) return setup_args -- cgit v1.2.3