Solved How to make code changes in a port and then reinstall?

I have tried to make changes to the port textproc/php84-xsl, but must be missing something?!

I don't have a patch, but I'm guessing I should create one myself, with the code change, right?

I have tried the following:

Code:
1. cd /usr/ports/textproc/php84-xsl
2. make extract
3. cd work/php-8.4.19/ext/xsl/
4. cp  php_xsl.c php_xsl.orig
5. mcedit php_xsl.c and make desired the changes (see link below)
6. cd ../../../ && make makepatch

But that only creates a lot of empty files and directories?!

The change I want to do is the following:

Thanks,
 
Not sure if this is the problem but does removing some dot files in the work directory have effect? .compile_done, .configure_done, etc...
 
Edit:
Code:
diff --git a/textproc/php84-xsl/Makefile b/textproc/php84-xsl/Makefile
index 64d8e7f98b..be3080a27b 100644
--- a/textproc/php84-xsl/Makefile
+++ b/textproc/php84-xsl/Makefile
@@ -4,6 +4,11 @@ MASTERDIR=     ${.CURDIR}/../../lang/php84

 PKGNAMESUFFIX= -xsl

+PATCH_SITES=   https://github.com/php/php-src/pull/21610/commits/
+PATCHFILES=    7fec72c74af072f8a8170b8929a03ee335a0feb4.patch:-p3
+
+DISTINFO_FILE= ${.CURDIR}/distinfo
+
 post-patch:
        ${REINPLACE_CMD} -e \
                's|#include "../dom/xml_common.h"|#include "ext/dom/xml_common.h"|g' \
diff --git a/textproc/php84-xsl/distinfo b/textproc/php84-xsl/distinfo
new file mode 100644
index 0000000000..78d1d2cf33
--- /dev/null
+++ b/textproc/php84-xsl/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1775301156
+SHA256 (php-8.4.19.tar.xz) = 11f7164ab26d356c31f94d3d69cc0e0707d5d2d6494a221aaeae307c08eaaa1c
+SIZE (php-8.4.19.tar.xz) = 13684456
+SHA256 (7fec72c74af072f8a8170b8929a03ee335a0feb4.patch) = ce8ae9129e3375b47d326bf7313d3d62101e59eec9597672b0ca26cf43d085ff
+SIZE (7fec72c74af072f8a8170b8929a03ee335a0feb4.patch) = 1056
 
I had problems where it did checksums... When you modify checksums no longer ok. But with patchfiles ok.
There is the porters handbook, too high level for me. But SirDice has good answers ...
 
I have found when you run make makepatch you must manually move the files from the tmp directory under /work to /files.

Maybe I am not doing it right...

makepatch is nice because it gives you the proper patch file name prefix.
 
I've run into the problem where - after building a port and making small changes, running make causes a fresh copy of the original source to be downloaded and built - overwriting any local edits. Don't recall which port this was.
 
The OP won't reply, but there's a typo.
Code:
4. cp php_xsl.c php_xsl.c.orig
6. cd ../../../..
7. make makepatch
However, as mentioned in #4, it's better to use PATCH_SITES and PATCHFILES.
 
after building a port and making small changes, running make causes a fresh copy of the original source to be downloaded and built
I don't build port first or if I do I make clean..

I have been modifying ports u-boot configuration files this way for a while. I got so frustrated trying to create a new file with a patch I gave up and tried different ways.

Extract files, modify files and compile.
 
The nice thing about make makepatch and retrieving/copying the patch file it creates, Is that it will not be deleted from /files with a make clean. It sticks around.

So my workflow is modify u-boot defconfig files manually until I get the desired results then make a patchfile and move to next issue
 
I think I am missing a step in my build system.
make patch
I do not use this but manually move patch from /work/tmp/blah/blah to the ports /files after running make makepatch.

This post helped me understand some...
 
Once you have your port and package working well you might want to lock your package with pkg lock
This is especially needed if just running a patched program from Ports Tree with FreeBSD generated packages used for everything else.
 
Once you have your port and package working well you might want to lock your package with pkg lock
This is especially needed if just running a patched program from Ports Tree with FreeBSD generated packages used for everything else.
Thanks for the tip!

We have locked versions before, when newer versions weren't compatible with other software.
Last time it was OpenSearch I think.

I hope this change will be in the upstream next time we upgrade PHP.
One problem was all the logging in /var/log/messages from crontab, running php scripts each minute 24/7.

All this was new to me, and I have been using FreeBSD since 2006 (20 years).
Seems you'll never been too old to learn new things! 🙃
 
Back
Top