Last active
December 10, 2020 05:39
-
-
Save hmml/4647895 to your computer and use it in GitHub Desktop.
Install lxml on Mac OS X 10.7 (Python 2.7.1)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Install lxml on Mac OS X 10.7. It might work for 10.8 as well. | |
# | |
LXML_LIB=libxml2-2.9.0 | |
LXML_ARCHIVE=libxml2-2.9.0.tar.gz | |
# Start install, it's going to fail... | |
STATIC_DEPS=true pip install lxml | |
# Patch sources... | |
pushd /private/tmp/pip-build/lxml/libs | |
tar -zxvf $LXML_ARCHIVE | |
rm $LXML_ARCHIVE | |
pushd $LXML_LIB | |
curl https://git.gnome.org/browse/libxml2/patch/threads.c?id=3f6cfbd1d38d0634a2ddcb9a0a13e1b5a2195a5e | patch | |
popd | |
tar -zcvf $LXML_ARCHIVE $LXML_LIB | |
rm -rf $LXML_LIB | |
popd | |
# Build again... | |
STATIC_DEPS=true pip install --no-download lxml | |
# Check if package is usable... | |
echo "import lxml; from lxml import etree" | python - | |
if [ $? -ne 0 ] | |
then | |
echo "LXML failed to install." | |
else | |
echo "LXML ready to use." | |
fi | |
Seems http://git.gnome.org/browse/libxml2/patch/threads.c?id=3f6cfbd1d38d0634a2ddcb9a0a13e1b5a2195a5e is invalid now. They've moved it to: https://git.gnome.org/browse/libxml2/patch/threads.c?id=3f6cfbd1d38d0634a2ddcb9a0a13e1b5a2195a5e.
Updating gist...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 383 100 383 0 0 336 0 0:00:01 0:00:01 --:--:-- 1672
patch: **** Only garbage was found in the patch input.