Ask Your Question
1

How to directly copy a file on build?

asked 2011-12-16 03:27:25 +0100

jordi gravatar image

Hi,

I'm preparing a patch and I have a shared library for python (let's call it g.so) that I need to be installed on build under local/lib/python/site-packages. So, in SAGE_ROOT/devel/sage/sage I created a directory gdir contining g.so and other regular python modules.

The problem is that you need haskell to build g.so, therefore I cannot use the python distutils for that. So I'm forced to have the sage builder to copy it directly to local/lib/python/site-packages. I do this by adding a SConstruct file to gdir and (this is the tricky part) adding a pair of lines to the sage builder (local/bin/sage-build) for it to run scons on gdir and make the copy.

I know that the root of the hg repository is SAGE_ROOT/devel/sage but I changed local/bin/sage-build which is beyond it.

Is there an approved way to deal with this? or could you suggest a neater way to do it?

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-12-16 06:24:15 +0100

Volker Braun gravatar image

A haskell compiler is not part of the Sage dependencies, so you won't be able to include your code with the official Sage distribution for the forseeable future. We could theoretically ship generated C source but that's not very maintainable.

Having said that, as an out-of-tree library you can copy its files any way you want. I don't think there is an "official" way.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-12-16 03:27:25 +0100

Seen: 774 times

Last updated: Dec 16 '11