1

I am trying to install a ready-made waf package (py2cairo) in a directory of my choice. Ideally in my virtualenv site-packages. This should be simple, but I can't seem to get waf to do it.

$ sudo ./waf install
  ./options()
Waf: Entering directory `/tmp/py2cairo-1.10.0/build_directory'
  ./build()
  src/build()
- install /usr/local/include/pycairo/pycairo.h (from src/pycairo.h)
+ install /usr/local/lib/python2.6/site-packages/cairo/_cairo.so (from build_directory/src/_cairo.so)
+ install /usr/local/lib/pkgconfig/pycairo.pc (from pycairo.pc)
Waf: Leaving directory `/tmp/py2cairo-1.10.0/build_directory'
- install /usr/local/lib/python2.6/site-packages/cairo/__init__.py (from src/__init__.py)
+ byte compiling '/usr/local/lib/python2.6/site-packages/cairo/__init__.py'
'install' finished successfully (0.130s)

I want to change /usr/local/lib/python2.6/site-packages/cairo/__init__.py to something of my choosing. I can't find a configuration option that does this for me.

The --prefix command add a prefix to string, but doesn't change it. The --destdir seem sto make no difference.

Joe
  • 46,419
  • 33
  • 155
  • 245

2 Answers2

1

Edit: If the developer did not implement such an option, --prefix is all you get.

You can dig through it yourself and add such an option which usees the methods .install_as , .symlink_as, .install_files.

For details see the wafbook chapter 4.2.2

drahnr
  • 6,782
  • 5
  • 48
  • 75
  • Thanks very much. I had a feeling this might be the case. I'd like to keep things as simple as possible because 1 - I want to be able to install this automatically for ease of server configuration and 2 - I don't necessarily know where my site-packages directory is if I'm using virtualenv – Joe Apr 15 '12 at 19:32
  • I'm accepting my fate, and allowing it to be installed in global site packages. – Joe Apr 16 '12 at 11:23
0

There's an argument you can use in conjunction with .waf install to specify the location:

./waf install --destdir=/tmp/package