Skip to content

Commit

Permalink
python: fix sqlite module without CLT
Browse files Browse the repository at this point in the history
  • Loading branch information
tdsmith committed Sep 30, 2016
1 parent 46be01e commit c8807b3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Formula/python.rb
Expand Up @@ -158,10 +158,16 @@ def install
args << "--enable-universalsdk=/" << "--with-universal-archs=intel"
end

# Allow sqlite3 module to load extensions:
# https://docs.python.org/library/sqlite3.html#f1
if build.with? "sqlite"
inreplace("setup.py", 'sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1"))', "")
inreplace "setup.py" do |s|
s.gsub! "sqlite_setup_debug = False", "sqlite_setup_debug = True"
s.gsub! "for d_ in inc_dirs + sqlite_inc_paths:",
"for d_ in ['#{Formula["sqlite"].opt_include}']:"

# Allow sqlite3 module to load extensions:
# https://docs.python.org/library/sqlite3.html#f1
s.gsub! 'sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1"))', ""
end
end

# Allow python modules to use ctypes.find_library to find homebrew's stuff
Expand Down

0 comments on commit c8807b3

Please sign in to comment.