combining directories / moving files within Portfile

Rainer Müller raimue at macports.org
Thu Jul 20 14:46:47 UTC 2017


On 2017-07-19 23:09, Michael Dickens wrote:
> I have an issue with SIP that needs to be addressed, that I'm not sure
> how do execute in port via Portfiles. I have a solution, but it's kinda
> a hack.

This confused me a lot as I first assumed you are talking about
System Integrity Protection... :-)

> [...]

> My Hack
> ---
> My "hack" is to have SIP check in pre-activate for the directory
> "$prefix/share/pyXY-sip/" and if found then create an archive of its
> contents (into /tmp/something.tar), and "cd $prefix/share && rm -rf
> pyXY-sip". Then the 'activate' takes place, which creates the symlink to
> the "$PYTHON_PREFIX/share/sip/$subport" directory. Then in post-activate
> check for the archive & if found restore the contents into the directory
> "$PYTHON_PREFIX/share/sip/" && remove the archive.

These files would no longer be properly attributed to the port in the
registry, so they might be left behind on uninstall.

It sounds like you need the deactivate hack that is already in use for
some ports that needed to replace files:
https://trac.macports.org/wiki/PortfileRecipes#deactivatehack

I would deactivate all ports known to install files there in a
pre-activate phase in the main sip port.

Rainer


More information about the macports-dev mailing list