Skip to content

Instantly share code, notes, and snippets.

@ralexx
Created March 22, 2017 18:42
Show Gist options
  • Save ralexx/0354d06ede42dd2583cc4786a97e15ab to your computer and use it in GitHub Desktop.
Save ralexx/0354d06ede42dd2583cc4786a97e15ab to your computer and use it in GitHub Desktop.
custom compile of Sqlite3 for Python 3.6

For building and installation with conda.

Make a working directory

cd /tmp
mkdir foo
cd foo

Download Conda recipe from Github

wget the links if you so desire

  1. meta.yaml
  2. build.sh

Edit build.sh to include extensions not compiled into the standard Sqlite3 build: FTS5, JSON1, dynamic extension loading

./configure $B --enable-threadsafe \
            --enable-tempstore \
            --enable-shared=yes \
            --disable-tcl \
            --disable-readline \
            --enable-dynamic-extensions \   # ADD THIS
            --enable-fts5 \   # ADD THIS
            --enable-json1 \   # ADD THIS
            --prefix=$PREFIX

Edit meta.yaml

As of this writing, Python 3.6 has a dependency of sqlite 3.13.* in Conda. Change the version number and year to have conda-build download the correct source.

{% set version="3.13.0" %}
{% set year="2016" %}

Comment out the checksum to avoid conflict (unless you want to download the source tarball and run it against openssl) # sha256: 65cc0c3e9366f50c0679c5ccd31432cea894bc4a3e8947dabab88c8693263615

Specify Python 3.6 in the requirements

requirements:
  build:
    # python is for lining up vc feature (runtime)
    - python >=3.6      # [win]
  run:
    - python >=3.6  

Build

conda build --python 3.6 --debug .

Aftermath

If all goes well you should see:

+ sqlite3 --version
3.13.0 2016-05-18 10:57:30 fc49f556e48970561d7ab6a2f24fdd7d9eb81ff2
TEST END: /usr/local/share/anaconda/conda-bld/osx-64/sqlite-3.13.0-[build number from meta.yaml].tar.bz2
INFO conda_build.config:__exit__(422): --dirty flag not specified.  Removing build folder after successful build/test.

# If you want to upload package(s) to anaconda.org later, type:

anaconda upload /usr/local/share/anaconda/conda-bld/osx-64/sqlite-3.13.0-99.tar.bz2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment