fail to destroot port with only makefile

Ryan Schmidt ryandesign at
Wed Mar 8 00:10:47 UTC 2017

On Mar 7, 2017, at 13:27, db wrote:

> On 7 Mar 2017, at 20:00, Ryan Schmidt wrote:
>> That can be an acceptable workaround. Sometimes it has side effects. I don't know if it does with this port.
> Can you give an example?

Suppose the program builds a dynamic library. The absolute path of the final installation location, including the prefix, will be recorded in the library's install_name. The build system therefore needs to know the difference between the prefix (/opt/local) and the destroot / destdir (the staging directory where files will be installed, prior to being copied by MacPorts to the real destination).

> Something strange I found is that file copy fails silently, no log whatsoever, pre- and post-destroot.
> post-destroot {
>    file copy ${worksrcpath}/autocomplete/complete.bash \
>        ~/.tldr.complete
> }

In the destroot phase, you should not be attempting to modify anything outside of the ${destroot} directory. Only items in the destroot will be properly recorded by MacPorts as belonging to that port. I'm not certain, but hopefully MacPorts would prevent you from placing files outside of that directory.

If you need to install config files and such for the user to modify, you can do so in the activate phase (post-activate block). However, you should not attempt to do anything in the user's home directory. The user installing the port is not necessarily the user, or the only user, using the software.

It's likely that in Tcl "~" does not have the special meaning that it does on the shell.

More information about the macports-users mailing list