[prev in list] [next in list] [prev in thread] [next in thread]
List: macports-users
Subject: Re: Fixing source-code bugs using MacPorts facilities.
From: Ian Wadham <iandw.au () gmail ! com>
Date: 2020-07-26 6:15:25
Message-ID: D83DE69E-C5CA-4A04-BFF4-83F76523362D () gmail ! com
[Download RAW message or body]
Thanks very much for your help, Ken.
> On 26 Jul 2020, at 3:31 am, Ken Cunningham <ken.cunningham.webuse@gmail.com> wrote:
>
> Here is my process (courtesy of advice from many others on this list including \
> Chris and Michael and others). And this is not yet ideal, as no doubt it could be \
> further improved. This is for anything beyond trivial one-tweak patches, by the way \
> — I might not do this for a trivial source fix.
>
> Set up your local ports repository like you have, copy the current portfile \
> directory into it, etc.
> Go to the port's directory in the new repo, and
>
> sudo port -v build
>
> when it errors, open a new terminal window, navigate to the same directory you're \
> in now, and then
> cd work
> sudo chmod -R a+rw .
This seems to go to the heart of the matter, so to speak.
> cd into the source directory, whatever it's called, then set it up as a temporary \
> git repo:
> git init
> git add .
> git commit -m "init" > /dev/null
And I have git to fall back on if there is an editing glitch or if I wish to do \
multiple fixes to my source.
> now you're ready to do your work.
>
> edit your source files as needed.
>
>
> You now have two terminal windows open. One is the port directory, one is the \
> source directory.
> In the port directory, try your build again:
>
> sudo port -v build
>
> if you get errors, in your source directory, edit the files, then rebuild again. \
> Keep going until you get it to build.
> Now you have changes in your new source git tree to save, so save those into a diff \
> file that you can use later:
> git diff —no-prefix > ~/patches-for-my-fixed-port.diff
>
> then see if your port will destroot, and then install.
>
> sudo port -v destroot
>
> sudo port -v -k install
>
> (note the -k — that keeps it from blowing out your source directory if it \
> succeeds).
The above all worked very well, but only once… :-(
If I test the app I have installed and find there is still some problem, I need to \
edit the source and go back to the build step. But "build" just says "---> Computing \
dependencies for kpat" and exits, even if I use "sudo port -f build". It does not \
see that the source has changed.
I'm looking for something with an effect like "make" or "cmake", which senses that \
something has changed and starts a new build. That's why I was having to keep \
changing the name of my patch-file before. I then had to edit the portfile and re-run \
portindex.
I also tried "sudo port clean", but that wiped my source files as well as the \
build-files… :-D
Using "sudo port -k clean" also wipes the source files. Using "rm -rf work/build" \
sent the "build" command back to "Computing dependencies" and exiting, but the source \
files were still down in "work" and included an edit I had done before deleting \
"work/build/".
Maybe there is some key file in work/build/ that I can delete or edit or execute, to \
trigger a new build with the latest source-code edits.
KPat is based on building with "cmake" to generate a Makefile and then "make" to do \
the build. Back in the day I would run CMake once and then keep running a \
make-test-edit cycle to do KDE development work.
Cheers,
Ian W.
> If all is well, you're close to done. from your port directory
>
> sudo port clean
> sudo port uninstall THEPORT
>
> cd files
> mv ~/patches-for-my-fixed-port.diff .
> cd ..
> bbedit Portfile
>
> add your new patch
>
> patchfiles-append patches-for-my-fixed-port.diff
>
>
> and then try your build — hopefully it goes right through to installing, and all \
> your patches worked.
> You're done. Open your PR, have a latte, wait for someone to tell you how wonderful \
> you are (yeah, right!).
> Ken
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic