/scripts/scramble/scripts/pysqlite.py

https://bitbucket.org/cistrome/cistrome-harvard/ · Python · 36 lines · 23 code · 9 blank · 4 comment · 3 complexity · 11ea170168d7f9315cde6f0250668e17 MD5 · raw file

  1. import os, sys
  2. def prep_sqlite( prepped, args ):
  3. os.makedirs( 'amalgamation' )
  4. for file in ( 'sqlite3.h', 'sqlite3.c', 'sqlite3ext.h' ):
  5. os.rename( file, os.path.join( 'amalgamation', file ) )
  6. # change back to the build dir
  7. if os.path.dirname( sys.argv[0] ) != "":
  8. os.chdir( os.path.dirname( sys.argv[0] ) )
  9. # find setuptools
  10. sys.path.append( os.path.join( '..', '..', '..', 'lib' ) )
  11. from scramble_lib import *
  12. tag = get_tag() # get the tag
  13. sqlite_version = ( tag.split( "_" ) )[1].replace('.','_')
  14. sqlite_archive_base = os.path.join( archives, "sqlite-amalgamation-%s" % sqlite_version )
  15. sqlite_archive = get_archive( sqlite_archive_base )
  16. clean( ['amalgamation'] ) # clean up any existing stuff (could happen if you run scramble.py by hand)
  17. unpack_dep( sqlite_archive, None, prep_sqlite, None )
  18. # reset args for distutils
  19. me = sys.argv[0]
  20. sys.argv = [ me ]
  21. sys.argv.append( "build_static" )
  22. if tag is not None:
  23. sys.argv.append( "egg_info" )
  24. sys.argv.append( "--tag-build=%s" %tag )
  25. sys.argv.append( "bdist_egg" )
  26. # do it
  27. execfile( "setup.py", globals(), locals() )