tweaking a port (build issue)

Gary Aitken freebsd at dreamchaser.org
Sat Jan 23 03:33:34 UTC 2021


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?

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





More information about the freebsd-questions mailing list