NSElvis/homebrew — comment on commit cc59dcdf12aaab8018c93c90d778e07a71415707
File: Library/Formula/leptonica.rb line 15
By mistydemeo:

Unfortunately, this own't work because that URL is an HTML page displaying the patch, not the patch itself. I should have checked that the original URL would work consistently before submitting.

It looks like Google Code doesn't have a permanent way to access the raw attachment itself. We can host it on a gist (https://raw.github.com/gist/1320510/b11d417326344202d8ff03ede8151c147ec2598d/zlib-include.patch), but it's also small enough we could put it directly in the formula itself. That's done by replacing the patch URL with `DATA`, and placing this at the end of the file:

```
__END__
diff -Nurd -x'*~' leptonica-1.68.orig/src/pngio.c leptonica-1.68/src/pngio.c
--- leptonica-1.68.orig/src/pngio.c	2011-02-01 00:41:12.000000000 -0500
+++ leptonica-1.68/src/pngio.c	2011-07-09 09:17:17.000000000 -0400
@@ -108,6 +108,10 @@

#include "png.h"

+#ifdef HAVE_LIBZ
+#include "zlib.h"
+#endif
+
/* ----------------Set defaults for read/write options ----------------- */
/* strip 16 bpp --> 8 bpp on reading png; default is for stripping */
static l_int32 var_PNG_STRIP_16_TO_8 = 1;