tweaking a port (build issue)

Christoph Brinkhaus c.brinkhaus at t-online.de
Sat Jan 23 08:39:51 UTC 2021


Am Fri, Jan 22, 2021 at 08:28:35PM -0700 schrieb Gary Aitken:
> On 1/22/21 1:27 AM, Christoph Brinkhaus wrote:
> > Am Thu, Jan 21, 2021 at 05:17:15PM -0700 schrieb Gary Aitken:
> > 
> > Hi Gary,
> > 
> >> I'm trying to tweak a port (cad/freecad) and am having an issue getting the
> >> build to work.
> >>
> >> I modified a file in the /usr/ports/cad/freecad directory tree
> >>     work/FreeCAD-0.18.4/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
> >> and did:
> >>     pkg deinstall
> >>     make build
> >>     make install
> >>     pkg deinstall
> >>    modify something else
> >>     make build
> >>       doesn't look like anything changed.
> >>
> >> Apparently I'm using some old forgotten lore which is wrong... clues?
> ...> To preserve
> > the change it should be the best practice to follow the porters
> > handbook.
> > After make extract copy the orininal file to
> > ViewProviderSketch.cpp.orig. Then modify the cpp file.
> > cd to /usr/ports/cad/freecad and run make makepatch.
> > Now a patch-ViewProviderSketch.cpp or so should have been generated in
> > /usr/ports/cad/freecad/files. May be the path to the file is added to
> > the name after the patch-. make makepatch takes are for the proper
> > file name.
> 
> Thanks, I didn't know about makepatch.  I see it is in the new version
> of the porter's handbook but not in my 2020-08-09 (11.4) version
> 
> Unfortunately, there was a file which I did *not* modify which also had
> a .orig version.  In the files directory, a patch was generated for
> that file also.  The build failed because of that patch.  Renaming the
> failed patch to no-patch... prevented it from being used.  I'm assuming
> the .orig file is cruft left over from the porting process.
> 
> The above process works, but it's painfully slow, rebuilding the whole
> port rather than just the changed file, the library it's in, and the
> final executable.  Is there an easy way to get just those rebuilt?

I do not know about any automatism which updates just one target.
But you can mix your previous work flow with the make makepatch thing.
Just do not run make build on the complete port but compile your
library and copy the executable to its target origin.
Then a make clean and everything should be as required.

Kind regards,
Christoph

> On 1/21/21 10:23 PM, Polytropon wrote:
> 
> > You probably don't need to invoke pkg manually. The "deinstall"
> > target should do that, as it did in ye olden times.
> 
> Thanks
> 
> > After making a code change, try this:
> >> 	# cd /usr/ports/cad/freecad
> > 	# make deinstall		<--- remove installed program
> > 	# make clean			<--- remove compiler cruft
> > 	# make				<--- build everything new
> > 	# make reinstall		<--- (re)install program
> > 
> > This should work as expected even in the modern pkg times. :-)
> 
> Nope.  The make clean deletes the work subtree, and the changes, so you're
> back where you started.
> 
> Gary
> 
> 
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"


More information about the freebsd-questions mailing list