mirror of https://github.com/scrapy/scrapy.git
link system libxml2 before building from travis-ci
This commit is contained in:
parent
7cba9bc274
commit
7bbeadb92c
|
|
@ -9,6 +9,7 @@ env:
|
|||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qf python-libxml2
|
||||
- python -c 'import libxml2' || .travis/link-libxml2
|
||||
install:
|
||||
- pip install --use-mirrors -r .travis/requirements-$BUILDENV.txt
|
||||
script:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/python
|
||||
import site, os
|
||||
from os.path import exists, join
|
||||
from optparse import OptionParser
|
||||
|
||||
|
||||
def _link_libxml2():
|
||||
for path in site.getsitepackages():
|
||||
if exists(join(path, 'libxml2.py')):
|
||||
os.symlink(join(path, 'libxml2.py'), 'libxml2.py')
|
||||
os.symlink(join(path, 'libxml2mod.so'), 'libxml2mod.so')
|
||||
break
|
||||
else:
|
||||
assert False, 'Failed to link libxml2'
|
||||
|
||||
def main():
|
||||
op = OptionParser()
|
||||
opts, args = op.parse_args()
|
||||
_link_libxml2()
|
||||
import libxml2
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Loading…
Reference in New Issue