[KDE/Mac] How can I change one piece of code in a MacPorts installation?

Ian Wadham iandw.au at gmail.com
Fri Jul 25 06:42:43 UTC 2014

Hi Bradley, Nicolas and Marko,

Thank you very much for all your replies, especially Marko's, which enabled
me to get one patch into kdelibs4 on MacPorts and prove that MacPorts'
kdelibs4 (KCrash) is definitely failing to connect a socket to kdeinit4, which
is listening with the wrong socket name.  So kdeinit4, KCrash and Dr Konqi
have probably never worked properly on Apple OS X.

The more advanced stuff you wrote is totally over my head, I am sorry to say.

Right now, I am wondering if I can modify the code in the KCrash patch to
provide more debugging output on stderr and then apply the patch again, e.g.
what "port" commands would I use and, if I use "sudo port upgrade" again, will it
bomb out if I do not give kdelibs4 a new revision number?  I don't think I can use
"sudo port uninstall kdelibs4 <patch-version>" and "sudo port install kdelibs4
<patch-version>", because it will just complain about dependencies that are
still installed…  So how do I re-build kdelibs4 (and only kdelibs4) after editing
the contents of my patch?

As you can see, I usually work at a very elementary level of MacPorts… :-)

Cheers, Ian W.

On 22/07/2014, at 8:10 AM, Bradley Giesbrecht wrote:
> On Jul 21, 2014, at 1:17 PM, Marko Käning <mk-lists at email.de> wrote:
>> On 21 Jul 2014, at 15:41 , Nicolas Pavillon <nicos at macports.org> wrote:
>>> it can be pretty cumbersome, as you have to rebuild everything from scratch each time, with your new patches. 
>>> Another way to avoid rebuilding everything is to use lower-level Macports commands, to avoid the fact that a new clean copy of your gets extracted each time, with a clean at the end of the install. You can run “port extract” to get a copy, change the code with patches or manually, and then run “port activate” to install the port, but normally without the cleaning stage, so that you keep the copy of the code.
>> well, it is also helpful to check out port’s options ‘-k’ and ‘-o’! :-)
>> ‘-k’ keeps the sources even after the port got installed, so omitting the cleaning phase somehow, which enables the debugger to find the program’s sources later on.
> You can also save time extracting or building large packages with -ko by editing the macports state file:
> # install a port
> cd $(port dir bash-completion)
> sudo port -kof install bash-completion
> # uninstall the port keeping work dir
> sudo port -kof uninstall bash-completion
> # to redo the destroot phase and the phases that follow
> sudo sed -i '' '/destroot/,$d' ./work/.macports.bash-completion.state
> sudo rm -R ./work/destroot
> # now edit Portfile or source files and run "port install" again
> sudo port -kof install bash-completion
> # Optionally, if you need to go back and redo earlier phases such as build or configure try:
> # to redo the configure phase and the phases that follow
> sudo sed -i '' '/configure/,$d' ./work/.macports.bash-completion.state
> # or to redo the build phase and the phases that follow
> sudo sed -i '' '/build/,$d' ./work/.macports.bash-completion.state
> Regards,
> Bradley Giesbrecht (pixilla)
> _______________________________________________
> kde-mac at kde.org
> List Information: https://mail.kde.org/mailman/listinfo/kde-mac
> KDE/Mac Information: http://community.kde.org/Mac

More information about the kde-mac mailing list