From 02b98ce15f5db68504183689de10bbfd9065c3fd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Apr 2013 01:13:54 +0200 Subject: [PATCH] 2013-04-10 01:10 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbhpdf/3rd/libhpdf/hpdfimap.c * contrib/hbhpdf/3rd/libhpdf/libhpdf.dif + patched to build with libpng 1.6 w/o warning identical to this upstream patch: https://github.com/libharu/libharu/commit/f1817baea49ab09de4635e383dc86b04a0fc3d8f * bin/commit.hb ! fixed to add shebang to newly created commit hook * bin/check.hb ! exclude maskimag.png from processing ! typo in png processor name ! minor syntax clarification * contrib/hbhpdf/tests/files/maskimag.png ! restored original version, as any optimized version will cause libharu to GPF (visible when running the demo) --- ChangeLog.txt | 19 ++++++++++++++ bin/check.hb | 9 ++++--- bin/commit.hb | 4 +++ contrib/hbhpdf/3rd/libhpdf/hpdfimap.c | 1 + contrib/hbhpdf/3rd/libhpdf/libhpdf.dif | 32 +++++++++++++++++++----- contrib/hbhpdf/tests/files/maskimag.png | Bin 114 -> 149 bytes 6 files changed, 56 insertions(+), 9 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 5fdfaae7f9..3bfccf9043 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,25 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-04-10 01:10 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/hbhpdf/3rd/libhpdf/hpdfimap.c + * contrib/hbhpdf/3rd/libhpdf/libhpdf.dif + + patched to build with libpng 1.6 w/o warning + identical to this upstream patch: + https://github.com/libharu/libharu/commit/f1817baea49ab09de4635e383dc86b04a0fc3d8f + + * bin/commit.hb + ! fixed to add shebang to newly created commit hook + + * bin/check.hb + ! exclude maskimag.png from processing + ! typo in png processor name + ! minor syntax clarification + + * contrib/hbhpdf/tests/files/maskimag.png + ! restored original version, as any optimized version will + cause libharu to GPF (visible when running the demo) + 2013-04-09 03:27 UTC+0200 Viktor Szakats (harbour syenar.net) * bin/check.hb * deleted one more contrib exception diff --git a/bin/check.hb b/bin/check.hb index 4216345b80..095f280479 100644 --- a/bin/check.hb +++ b/bin/check.hb @@ -149,6 +149,9 @@ STATIC FUNCTION CheckFile( cName, /* @ */ aErr, lApplyFixes ) LOCAL aForcedLF := { ; "*.sh" } + LOCAL aNoProc := { ; + "maskimag.png" } /* will crash libharu demo if optimized in any way */ + LOCAL aCanHaveIdent LOCAL hAllowedExt := LoadGitattributes( @aCanHaveIdent ) LOCAL nLines @@ -287,7 +290,7 @@ STATIC FUNCTION CheckFile( cName, /* @ */ aErr, lApplyFixes ) ENDIF ENDIF - IF ( tmp := "$" + "Id" ) $ cFile != FNameExc( cName, aCanHaveIdent ) + IF ( ( tmp := "$" + "Id" ) $ cFile ) != FNameExc( cName, aCanHaveIdent ) IF tmp AAdd( aErr, "content: has " + "$" + "Id" ) ELSE @@ -321,7 +324,7 @@ STATIC FUNCTION CheckFile( cName, /* @ */ aErr, lApplyFixes ) EXIT ENDIF NEXT - IF lProcess + IF lProcess .AND. ! FNameExc( cName, aNoProc ) OutStd( cName + ": " + "content: processing" + hb_eol() ) ProcFile( cName ) ENDIF @@ -599,7 +602,7 @@ STATIC FUNCTION FNameExc( cName, aList ) STATIC PROCEDURE ProcFile( cFileName ) LOCAL hProc := { ; - ".png" => { "avdpng -z -4 %1$s", "optipng -o7 %1$s" }, ; + ".png" => { "advpng -z -4 %1$s", "optipng -o7 %1$s" }, ; ".jpg" => { "jpegoptim --strip-all %1$s" }, ; ".c" => { hb_StrFormat( "uncrustify -c %1$s %%1$s", hb_DirSepToOS( _HBROOT_ + "bin/harbour.ucf" ) ), @FixFuncCase() }, ; ".cpp" => ".c", ; diff --git a/bin/commit.hb b/bin/commit.hb index c9090d2be3..f48f1093c0 100644 --- a/bin/commit.hb +++ b/bin/commit.hb @@ -147,6 +147,10 @@ STATIC FUNCTION InstallHook( cHookName, cCommand ) RETURN .T. ENDIF + IF Empty( cFile ) + cFile += "#!/bin/sh" + hb_eol() + ENDIF + RETURN hb_MemoWrit( cName, cFile + hb_eol() + cCommand + hb_eol() ) STATIC FUNCTION FindChangeLog() diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfimap.c b/contrib/hbhpdf/3rd/libhpdf/hpdfimap.c index fc215ef0e5..230d36f5a4 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfimap.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfimap.c @@ -21,6 +21,7 @@ #ifndef LIBHPDF_HAVE_NOPNGLIB #include +#include static void PngErrorFunc (png_structp png_ptr, diff --git a/contrib/hbhpdf/3rd/libhpdf/libhpdf.dif b/contrib/hbhpdf/3rd/libhpdf/libhpdf.dif index db27b2e62d..fe8ebfb978 100644 --- a/contrib/hbhpdf/3rd/libhpdf/libhpdf.dif +++ b/contrib/hbhpdf/3rd/libhpdf/libhpdf.dif @@ -1,6 +1,6 @@ -diff -urN libhpdf-rc2.orig\hpdf.h libhpdf-rc2\hpdf.h ---- libhpdf-rc2.orig\hpdf.h Wed Apr 04 21:40:06 2012 -+++ libhpdf-rc2\hpdf.h Wed Apr 04 21:40:06 2012 +diff -urN libhpdf.orig\hpdf.h libhpdf\hpdf.h +--- libhpdf.orig\hpdf.h Wed Apr 10 01:02:31 2013 ++++ libhpdf\hpdf.h Wed Apr 10 01:02:31 2013 @@ -17,7 +17,7 @@ #ifndef _HPDF_H #define _HPDF_H @@ -19,9 +19,20 @@ diff -urN libhpdf-rc2.orig\hpdf.h libhpdf-rc2\hpdf.h HPDF_Page_CreateTextMarkupAnnot (HPDF_Page page, HPDF_Rect rect, const char *text, -diff -urN libhpdf-rc2.orig\hpdfutil.h libhpdf-rc2\hpdfutil.h ---- libhpdf-rc2.orig\hpdfutil.h Wed Apr 04 21:40:06 2012 -+++ libhpdf-rc2\hpdfutil.h Wed Apr 04 21:40:06 2012 +diff -urN libhpdf.orig\hpdfimap.c libhpdf\hpdfimap.c +--- libhpdf.orig\hpdfimap.c Wed Apr 10 01:02:31 2013 ++++ libhpdf\hpdfimap.c Wed Apr 10 01:02:31 2013 +@@ -21,6 +21,7 @@ + + #ifndef LIBHPDF_HAVE_NOPNGLIB + #include ++#include + + static void + PngErrorFunc (png_structp png_ptr, +diff -urN libhpdf.orig\hpdfutil.h libhpdf\hpdfutil.h +--- libhpdf.orig\hpdfutil.h Wed Apr 10 01:02:31 2013 ++++ libhpdf\hpdfutil.h Wed Apr 10 01:02:31 2013 @@ -18,7 +18,7 @@ #ifndef _HPDF_UTILS_H #define _HPDF_UTILS_H @@ -31,3 +42,12 @@ diff -urN libhpdf-rc2.orig\hpdfutil.h libhpdf-rc2\hpdfutil.h #include "hpdftype.h" #ifdef __cplusplus +diff -urN libhpdf.orig\t4.h libhpdf\t4.h +--- libhpdf.orig\t4.h Wed Apr 10 01:02:31 2013 ++++ libhpdf\t4.h Wed Apr 10 01:02:31 2013 +@@ -1,4 +1,4 @@ +-/* $Id: t4.h,v 1.20 2007/11/10 18:40:44 drolon Exp $ */ ++/* $Id$ */ + + /* + * Copyright (c) 1988-1997 Sam Leffler diff --git a/contrib/hbhpdf/tests/files/maskimag.png b/contrib/hbhpdf/tests/files/maskimag.png index af1bd0858493c62268cf4e126094b439f42517e1..d896abadb7a97faf9ad69826505657fe64a1ebbc 100644 GIT binary patch delta 131 zcmV-}0DS*)l>v|#eFy>o008_L?V|ty09;8#K~#90?Nvbv05AyB{r}JHw9#d-U@Zc@ z6@s9V1PluX!VMd43oynXNJf7FdheqC-thZdl%Ih;y7v>mzeOK1@KZt_{Vn?Ni_{0z l0_uZ$0rf$>fcl_bU;>t3G%wm6wBP^$002ovPDHLkV1l?4X`xOH&x%W-KO|ftjvAb}!_2VPv%c}1<0?s@Vg^rFKbLh*2~7ZU;~%g9