How to tweak the source of an existing port ?

Hi guys,

Today i was trying to modify the port /usr/ports/editors/texmacs
It is the first time i do such thing and I guess I am missing the master way.

I need to do a slight modification to the C++ code, but since I am hunting
for a bug I need to do many trials, modfiy, compile and run many times.

The best way i found is this:
Code:
while (true) {
$> sudo make patch
==> my C modifications ====
$> sudo make build
==> check if the bug is gone, since i am here it is not, so
$> sudo make clean
}

It goes without saying that this is BAD, for each tiny modification i must recompile
all TeXmacs which quite long and boring.

Is there a better option ?

bye
Nicola
 
You don't have to make clean, just remove a couple of files from /usr/ports/whatever/portname/work
Code:
# rm work/.build_done.portname._usr_local work/.install_done.portname._usr_local
I don't think it helps now...
It won't rebuild after I change a source file.
 
Very wired aragats !

To me it works, i am super happy about this easy method
and I also somehow corrected the TeXmacs port thanks to this.

I put this in the port directory
Code:
----- my-remake.sh -----------
#!/bin/sh

echo "--- Remove built signal ----"
rm work/.build_done.texmacs._usr_local

echo "--- Re-Make --- "
make build
------------------------------------
Then I modified the code at least 10 times and run for each of them
$> sudo ./my-remake
Tested Texmacs locally after the make, It never failed.

In what port are you trying ?

bye
n.
 
I made some changes to sysutils/u-boot-beaglebone (to eliminate the flood of boot messages I mentioned in another thread).
So, this method didn't work, I had to make my own patch and add the corresponding path to EXTRA_PATCHES= in the Makefile.
 
I tried to check but I can't compile it, it requires perl-5.28.0 and here i have only perl-5.28.1.
I may see on a BBB, but I don't have them here at office.

I red about the patch method in the old thread, that is ok when you already know what changes
to make and you wish to stabilized them.

I am using FreeBSD-11.2, what are you using? Maybe they changed the bsd.port.mk (i hope not)

Are you compiling on the BBB ?

I am NOT using poudriere ! I still had no time to learn that;)
 
I'm using FreeBSD 12.0-RELEASE on my amd64 desktop.
I guess, all u-boot* ports exist only for ARM anyway. My compiled MLO and u-boot.img perfectly work with BBB.
 
What happens if you go to
Code:
$> cd /usr/ports/sysutils/u-boot-beaglebone
#> make build
then
Code:
$> cd /usr/ports/sysutils/u-boot-beaglebone/work/u-boot-2018.09
--- change some code
$> make
does it run ? If not maybe is the original-project-makefile which is not detecting time of change in sources
(just an idea, I don't know if that is even possible)

Other thing,
I just build the patch, then out of curiosity I made this experiment:

Suppose I am operating on file foo.c
Code:
#> cd WHERE-NEEDED
#>  cp foo.c  foo.c.orig
loop:
   #> edit file foo.c
   #> cd "port base dir"
   #> make makepatch
   #> make patch
   #> make build
For what I can see, it is seems to me the port does not get rebuilt when I change foo.c.

To me the only two option remains
  • make clean --- slow
  • "jalla" method --- fast (but in your case not working)
Does your EXTRA_PATCH way force the rebuild if you change the patch (and you do not make clean)?
 
What happens if you go to
$> cd /usr/ports/sysutils/u-boot-beaglebone
#> make bulid
then
$> cd /usr/ports/sysutils/u-boot-beaglebone/work/u-boot-2018.09
--- change some code
$> make
If I run make at the top level it doesn't build, just silently exits.
If I run make in the actual directory, it spits out a lot of errors. I guess, it may work for certain ports, but won't be a universal approach.
Does your EXTRA_PATCH way force the rebuild if you change the patch (and you do not make clean)?
No, it doesn't trigger a build, make doesn't do anything...
 
Back
Top