I am trying to figure out the easiest way to apply a patch to a port and still use the port command to install and uninstall etc. The port is giflib and the patch file is here. <http://users.own-hero.net/~decoder/fuzzyocr/giftext-segfault.patch> Is there a simple way to modify the local portfile to install this patch for me. TIA, Kevin
On Mar 21, 2007, at 15:07, Kevin Windham wrote:
I am trying to figure out the easiest way to apply a patch to a port and still use the port command to install and uninstall etc.
The port is giflib and the patch file is here.
<http://users.own-hero.net/~decoder/fuzzyocr/giftext-segfault.patch>
Is there a simple way to modify the local portfile to install this patch for me.
Hi Kevin. Let's see what we can do here! First, why do you want to patch? From the name of the patchfile, it sounds like you are attempting to fix a crashing bug in the software. So then this is a patch that you would ultimately want to make available to all MacPorts users, right? This modification won't just stay local to your machine? You just want to try it out now to make sure it works? So then you can just drop the patch into the files directory for the port and add it to the Portfile. First, go to the port directory. Type "cd `port dir giflib`" to get there. If there isn't already a "files" directory next to the Portfile, make one with "sudo mkdir files". Now you can put the patchfile into that directory. The naming convention is that the patchfile's name starts with "patch-" and ends with ".diff" and has the name of the file being patched in between. So you should name it "patch-giftext.c.diff". Also, it should be in unified diff format, not context diff format like you have at the above URL. To generate unified diffs, use "diff -u <oldfile> <newfile>". Now edit the portfile. Type "port edit giflib". Add a line that reads "patchfiles patch-giftext.c.diff". That should do it. Now you can try installing the port and see if it works better. Try enabling the debugging and verbose flags with "sudo port install -dv giflib"; this way you will see the line about whether the patch succeeded or failed. If you find that the patch works, and you would like to submit these changes to the Portfile for all to enjoy, create a ticket in Trac, attach you patchfile, and also a unified diff of your changes for the Portfile, and tell us here what the ticket number is, and someone can commit it. Also, note that giflib has no maintainer; if you would like to become the maintainer, just say so, or you can also just change the maintainers line in the Portfile to your email address and include that in the Portfile diff in the ticket.
On Mar 21, 2007, at 5:37 PM, Ryan Schmidt wrote:
On Mar 21, 2007, at 15:07, Kevin Windham wrote:
I am trying to figure out the easiest way to apply a patch to a port and still use the port command to install and uninstall etc.
The port is giflib and the patch file is here.
<http://users.own-hero.net/~decoder/fuzzyocr/giftext-segfault.patch>
Is there a simple way to modify the local portfile to install this patch for me.
If you find that the patch works, and you would like to submit these changes to the Portfile for all to enjoy, create a ticket in Trac, attach you patchfile, and also a unified diff of your changes for the Portfile, and tell us here what the ticket number is, and someone can commit it. Also, note that giflib has no maintainer; if you would like to become the maintainer, just say so, or you can also just change the maintainers line in the Portfile to your email address and include that in the Portfile diff in the ticket.
I managed to get this working and the patch seems to work as well, although I am not the originator of the patch. I am actually trying to install fuzzyocr and they recommended this patch on their site as the giftext tool would crash on certain malformed gifs. I don't have any of those gifs to test with, and I didn't find any with google when I went to try and test their fix. Anyway, I think it would probably be a good idea to update the port for anyone else who wants to use this. In order to get the patch to work properly I needed to run the diff tool from the giflib directory and pass it relative paths to the giftext.c file. Is there any similar convention that would need to be followed for making the diff of the portfile? I don't have a clue how the backend works as far as maintaining the ports, so I want to make sure I do that properly before I create the ticket in Trac. Thanks for your help, Kevin
On Mar 21, 2007, at 9:19 PM, Kevin Windham wrote:
On Mar 21, 2007, at 5:37 PM, Ryan Schmidt wrote:
On Mar 21, 2007, at 15:07, Kevin Windham wrote:
I am trying to figure out the easiest way to apply a patch to a port and still use the port command to install and uninstall etc.
The port is giflib and the patch file is here.
<http://users.own-hero.net/~decoder/fuzzyocr/giftext-segfault.patch>
Is there a simple way to modify the local portfile to install this patch for me.
If you find that the patch works, and you would like to submit these changes to the Portfile for all to enjoy, create a ticket in Trac, attach you patchfile, and also a unified diff of your changes for the Portfile, and tell us here what the ticket number is, and someone can commit it. Also, note that giflib has no maintainer; if you would like to become the maintainer, just say so, or you can also just change the maintainers line in the Portfile to your email address and include that in the Portfile diff in the ticket.
I managed to get this working and the patch seems to work as well, although I am not the originator of the patch. I am actually trying to install fuzzyocr and they recommended this patch on their site as the giftext tool would crash on certain malformed gifs. I don't have any of those gifs to test with, and I didn't find any with google when I went to try and test their fix.
I found another port which I think can be updated fairly easily. The netpbm graphics routines are required for FuzzyOcr. One of the tools FuzzyOcr uses is called pamthreshold and it is only available in netpbm 10.34 or later. I edited the portfile to use 10.34 as the version, and updated the md5 hash for the 10.34 .tgz archive and installed the port. It installed normally, and I tested the several of the utilities required for FuzzyOcr including pamthreshold, and they seem to work fine. This may be useful for others who are wanting to get rid of those annoying image spams. Kevin
participants (2)
-
Kevin Windham
-
Ryan Schmidt