3

I have a macbook pro with osx 10.11.4 El-Capitan. I use zsh, which I wonder could be causing problems? I've been tinkering with python for the last year on a wide variety of small projects with no problems, so my environment is pretty stable. I needed gtk, so...

I started with this

git clone git://git.gnome.org/gtk+

I am following the instructions here to build the gtk+ distribution:

https://wiki.gnome.org/action/show//Projects/GTK+/OSX/Building?action=show&redirect=GTK%2B%2FOSX%2FBuilding

Things seemed to be progressing until I ran this step :

jhbuild build meta-gtk-osx-bootstrap

and get the following error :

checking for python module libxml2... not found configure: error: Python module libxml2 is needed to run this package * Error during phase configure of itstool: ########## Error running ./configure --prefix /Users/Dad/gtk/inst * [7/12]

So I tried :

brew install libxml2

gives me :

OS X already provides this software and installing another version in parallel can cause all kinds of trouble.

Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add to your build variables:

LDFLAGS:  -L/usr/local/opt/libxml2/lib
CPPFLAGS: -I/usr/local/opt/libxml2/include

Any ideas on how to proceed ? The problem seems like libxml2 is installed but can't be found by jhbuild - so I expect this to be a relatively common problem, easy to fix, but I'm stuck? I'm not sure where to set these environment variables. I set them from the command line and reran but same result.

Thanks in advance

dhruv jadia
  • 1,684
  • 2
  • 15
  • 28
mgillett
  • 74
  • 8

2 Answers2

1

I've run into this issue as well and am not sure what causes it. We had a discussion on the gtk-osx-devel mailing list some time ago: https://mail.gnome.org/archives/gtk-osx-devel-list/2015-April/msg00000.html

Summary: For some reason the libxml package isn't installing the Python module in the right place. To work around it, when itstool fails, choose the "start a shell" option and run the following commands:

cd ../libxml/python
make install
exit

Then try to continue with the build.

ptomato
  • 56,175
  • 13
  • 112
  • 165
  • This is exactly the actions I took, and as you describe it, it solves the problem. I looked at the thread you pointed to in your reply, but I did not see if a fix was being worked on. Have you had any luck finding the root cause of the issue? – Gunee May 26 '16 at 19:05
  • 1
    No, I haven't. It's definitely something with libxml's build system, but I don't know any more than that. – ptomato May 27 '16 at 04:36
0

I also had this issue and tried ptomato's answer and it didn't work for me. But I found the right .py file:

find ~ -iname "libxml2.py"
~/gtk/source/libxml2-2.9.8/python/libxml2.py
~/gtk/inst/lib/python3.6/site-packages/libxml2.py

And copied it and the libxml2mod library it needs, over to the python2.7 site packages:

cp ~/gtk/source/libxml2-2.9.8/python/libxml2.py ~/gtk/inst/lib/python2.7/site-packages/
cp ~/.cache/jhbuild/build/libxml2-2.9.8/python/.libs/libxml* ~/gtk/inst/lib/python2.7/site-packages/

I don't know (or care) why the libxml2/python makefile can't install it into the right place. However I'm leaving this here so I don't forget and run into the same problem next time.

fret
  • 1,542
  • 21
  • 36