diff options
| author | Kali Kaneko <kali@leap.se> | 2013-05-30 04:36:58 +0900 | 
|---|---|---|
| committer | Kali Kaneko <kali@leap.se> | 2013-05-30 04:36:58 +0900 | 
| commit | 0ebb159495b941dc40c1f9eaeab250e87edaea7b (patch) | |
| tree | 3441fca7af2f779882e78978712c41d1c08b2838 | |
| parent | 51032d827b297e4ea0cd529d57d73cd44e0c3905 (diff) | |
add build_sqlcipher option
| -rw-r--r-- | setup.cfg | 2 | ||||
| -rw-r--r-- | setup.py | 19 | 
2 files changed, 15 insertions, 6 deletions
| @@ -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 @@ -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 | 
