diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2022-12-21 09:11:13 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2022-12-22 21:04:44 +0100 |
commit | a78e7d2c89119f5e2a61ee23b2d9107a4884418f (patch) | |
tree | 92600490d0ca6a7b7a6c596a991444994ab91202 | |
parent | dev-libs/gost-engine: drop 1.1.0.3_p20181031-r3 (diff) | |
download | gentoo-a78e7d2c89119f5e2a61ee23b2d9107a4884418f.tar.gz gentoo-a78e7d2c89119f5e2a61ee23b2d9107a4884418f.tar.bz2 gentoo-a78e7d2c89119f5e2a61ee23b2d9107a4884418f.zip |
media-libs/libharu: drop 2.3.0-r3
Closes: https://bugs.gentoo.org/887565
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
5 files changed, 0 insertions, 835 deletions
diff --git a/media-libs/libharu/Manifest b/media-libs/libharu/Manifest index 646b79914b60..67053a4772dc 100644 --- a/media-libs/libharu/Manifest +++ b/media-libs/libharu/Manifest @@ -1,2 +1 @@ -DIST libharu-2.3.0.tar.gz 1396413 BLAKE2B 7f0c819f17740f12f9bf6c7a7c749eb8c6ada326d98985daeac4d3250733cfc8e085b540e0969cb1b4c3b1055f4d1e148a2ed010d9371685fd265b62a879be9c SHA512 ebcabf1e8488e21185a231e97b4c16f9de742ae0ac2ebc7535b72b6b8e2045c2619bc6a94a820f7f923b0dfeceb217408f4e4c613ef3602104373cdf000d3f41 DIST libharu-2.4.2.tar.gz 1411029 BLAKE2B 8618803022cc2c745d2517f71cf9da49eeefe16b05c486a5ecaa6ec09f6fb7e0dbe3af6d12018bf1c81d3a06c3be1446617e634ab21ea25a68ee9f9d645b65cb SHA512 faa5c0390f22ae8bbe3dbc2b49e49b475257a70c5772e456cc34df3f98b26e39b65b17b0f982dd844b9774a4217a621337a1a8a810d7be09569a7bffe4ea1f15 diff --git a/media-libs/libharu/files/libharu-2.3.0-2-Avoid-issue-with-libtiff-duplicate-symbols.patch b/media-libs/libharu/files/libharu-2.3.0-2-Avoid-issue-with-libtiff-duplicate-symbols.patch deleted file mode 100644 index 78a56f6eb33c..000000000000 --- a/media-libs/libharu/files/libharu-2.3.0-2-Avoid-issue-with-libtiff-duplicate-symbols.patch +++ /dev/null @@ -1,89 +0,0 @@ -From c1ecbf1bd286e26572fc0fd7a49d06774d6436f7 Mon Sep 17 00:00:00 2001 -From: Bruno Virlet <bruno.virlet@gmail.com> -Date: Thu, 30 Nov 2017 12:19:37 +0100 -Subject: [PATCH 2/4] Avoid issue with libtiff duplicate symbols - -To achieve this, I move the G3CODES #define to pdf_conf.h so that anyone -who builds the project has more control. ---- - include/hpdf_conf.h | 3 ++- - src/hpdf_image_ccitt.c | 9 ++++----- - src/t4.h | 6 ++++-- - 3 files changed, 10 insertions(+), 8 deletions(-) - -diff --git a/include/hpdf_conf.h b/include/hpdf_conf.h -index d25b464..27d1dff 100644 ---- a/include/hpdf_conf.h -+++ b/include/hpdf_conf.h -@@ -78,8 +78,9 @@ - - /* alignment size of memory-pool-object - */ --#define HPDF_ALIGN_SIZ sizeof int; -+#define HPDF_ALINMENT_SIZ sizeof(int) - -+#define G3CODES - - #endif /* _HPDF_CONF_H */ - -diff --git a/src/hpdf_image_ccitt.c b/src/hpdf_image_ccitt.c -index 8672763..939b0b5 100644 ---- a/src/hpdf_image_ccitt.c -+++ b/src/hpdf_image_ccitt.c -@@ -21,7 +21,6 @@ - #include <memory.h> - #include <assert.h> - --#define G3CODES - #include "t4.h" - - typedef unsigned int uint32; -@@ -578,11 +577,11 @@ HPDF_Fax3Encode2DRow(struct _HPDF_CCITT_Data *pData, unsigned char* bp, unsigned - a2 = finddiff2(bp, a1, bits, PIXEL(bp,a1)); - putcode(pData, &horizcode); - if (a0+a1 == 0 || PIXEL(bp, a0) == 0) { -- putspan(pData, a1-a0, TIFFFaxWhiteCodes); -- putspan(pData, a2-a1, TIFFFaxBlackCodes); -+ putspan(pData, a1-a0, HPDF_TIFFFaxWhiteCodes); -+ putspan(pData, a2-a1, HPDF_TIFFFaxBlackCodes); - } else { -- putspan(pData, a1-a0, TIFFFaxBlackCodes); -- putspan(pData, a2-a1, TIFFFaxWhiteCodes); -+ putspan(pData, a1-a0, HPDF_TIFFFaxBlackCodes); -+ putspan(pData, a2-a1, HPDF_TIFFFaxWhiteCodes); - } - a0 = a2; - } else { /* vertical mode */ -diff --git a/src/t4.h b/src/t4.h -index f306e15..c4c8c0d 100644 ---- a/src/t4.h -+++ b/src/t4.h -@@ -55,7 +55,7 @@ typedef struct tableentry { - * during state generation (see mkg3states.c). - */ - #ifdef G3CODES --const tableentry TIFFFaxWhiteCodes[] = { -+const tableentry HPDF_TIFFFaxWhiteCodes[] = { - { 8, 0x35, 0 }, /* 0011 0101 */ - { 6, 0x7, 1 }, /* 0001 11 */ - { 4, 0x7, 2 }, /* 0111 */ -@@ -167,7 +167,7 @@ const tableentry TIFFFaxWhiteCodes[] = { - { 12, 0x0, G3CODE_INVALID }, /* 0000 0000 0000 */ - }; - --const tableentry TIFFFaxBlackCodes[] = { -+const tableentry HPDF_TIFFFaxBlackCodes[] = { - { 10, 0x37, 0 }, /* 0000 1101 11 */ - { 3, 0x2, 1 }, /* 010 */ - { 2, 0x3, 2 }, /* 11 */ -@@ -281,5 +281,7 @@ const tableentry TIFFFaxBlackCodes[] = { - #else - extern const tableentry TIFFFaxWhiteCodes[]; - extern const tableentry TIFFFaxBlackCodes[]; -+const tableentry *HPDF_TIFFFaxWhiteCodes = TIFFFaxWhiteCodes; -+const tableentry *HPDF_TIFFFaxBlackCodes = TIFFFaxBlackCodes; - #endif - #endif /* _T4_ */ --- -2.16.0 - diff --git a/media-libs/libharu/files/libharu-2.3.0-3-cmake-fixes.patch b/media-libs/libharu/files/libharu-2.3.0-3-cmake-fixes.patch deleted file mode 100644 index 385dfc228257..000000000000 --- a/media-libs/libharu/files/libharu-2.3.0-3-cmake-fixes.patch +++ /dev/null @@ -1,177 +0,0 @@ -From 751d8a334d0f3fbce9c74352004e9d3899ec8b38 Mon Sep 17 00:00:00 2001 -From: Jonathan Scruggs <j.scruggs@gmail.com> -Date: Wed, 24 Jan 2018 11:08:16 +0000 -Subject: [PATCH 3/4] cmake fixes - ---- - CMakeLists.txt | 31 +++++++++++++++++-------------- - cmake/modules/haru.cmake | 2 +- - src/CMakeLists.txt | 19 ++++++++++++------- - src/hpdf_image_png.c | 2 +- - 4 files changed, 31 insertions(+), 23 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 354ca75..4227f03 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -25,7 +25,7 @@ endif(MSVC) - - # information about libharu - set(LIBHPDF_MAJOR 2) --set(LIBHPDF_MINOR 2) -+set(LIBHPDF_MINOR 3) - set(LIBHPDF_PATCH 0) - set(LIBHPDF_VERSION ${LIBHPDF_MAJOR}.${LIBHPDF_MINOR}.${LIBHPDF_PATCH}) - set(LIBHPDF_DESCRIPTION "libHaru is a free, cross platform, open source library for generating PDF files.") -@@ -53,12 +53,17 @@ option(LIBHPDF_STATIC "Build static lib" YES) - option(LIBHPDF_EXAMPLES "Build libharu examples" NO) - option(DEVPAK "Create DevPackage" NO) - -+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") -+ set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -undefined dynamic_lookup") -+endif() -+ - # Enable exceptions on linux if required - # (eg if you are using libharu in a C++ environment, - # and you want your error-callback to throw an exception, - # you will need to enable this for the exception to be - # able to throw through the libharu callstack). - if (CMAKE_COMPILER_IS_GNUCC OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) -+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") - option (LIBHPDF_ENABLE_EXCEPTIONS "Enable exceptions" NO) - if (LIBHPDF_ENABLE_EXCEPTIONS) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions") -@@ -81,6 +86,7 @@ endif(BUILD_SHARED_LIBS) - # ======================================================================= - # look for headers and libraries - # ======================================================================= -+include(GNUInstallDirs) - include(haru) - include(summary) - -@@ -110,7 +116,7 @@ endif(PNG_FOUND) - if(MSVC_VERSION GREATER 1399) - add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE) - endif(MSVC_VERSION GREATER 1399) --include_directories(${CMAKE_SOURCE_DIR}/include) -+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) - - - # these are options -@@ -149,16 +155,16 @@ endif (NOT ZLIB_FOUND) - - # create hpdf_config.h - configure_file( -- ${CMAKE_SOURCE_DIR}/include/hpdf_config.h.cmake -- ${CMAKE_BINARY_DIR}/include/hpdf_config.h -+ ${CMAKE_CURRENT_SOURCE_DIR}/include/hpdf_config.h.cmake -+ ${CMAKE_CURRENT_BINARY_DIR}/include/hpdf_config.h - ) --include_directories(${CMAKE_BINARY_DIR}/include) -+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) - - # create DevPackage file - if(DEVPAK) - configure_file( -- ${CMAKE_SOURCE_DIR}/libharu.DevPackage.cmake -- ${CMAKE_BINARY_DIR}/libharu.DevPackage -+ ${CMAKE_CURRENT_SOURCE_DIR}/libharu.DevPackage.cmake -+ ${CMAKE_CURRENT_BINARY_DIR}/libharu.DevPackage - ) - endif(DEVPAK) - # ======================================================================= -@@ -203,19 +209,16 @@ set( - include/hpdf_pdfa.h - include/hpdf_3dmeasure.h - include/hpdf_exdata.h -- ${CMAKE_BINARY_DIR}/include/hpdf_config.h -+ ${CMAKE_CURRENT_BINARY_DIR}/include/hpdf_config.h - ) - - # install header files --install(FILES ${haru_HDRS} DESTINATION include) -+install(FILES ${haru_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - - # install various files --install(FILES README CHANGES INSTALL DESTINATION .) --if(NOT DEVPAK) -- install(DIRECTORY if DESTINATION .) --endif(NOT DEVPAK) -+install(FILES README CHANGES INSTALL DESTINATION ${CMAKE_INSTALL_DOCDIR}) - if(DEVPAK) -- install(FILES ${CMAKE_BINARY_DIR}/libharu.DevPackage DESTINATION .) -+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libharu.DevPackage DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif(DEVPAK) - - # ======================================================================= -diff --git a/cmake/modules/haru.cmake b/cmake/modules/haru.cmake -index 95647b9..f0b08b5 100644 ---- a/cmake/modules/haru.cmake -+++ b/cmake/modules/haru.cmake -@@ -28,7 +28,7 @@ check_include_files(unistd.h LIBHPDF_HAVE_UNISTD_H) - # On windows systems the math library is not separated so do not specify - # it unless you are on a non-windows system. - if(NOT WIN32) -- find_library(MATH_LIB NAMES m PATHS /usr/local/lib /usr/lib) -+ find_library(MATH_LIB NAMES m PATHS ${CMAKE_INSTALL_FULL_LIBDIR}) - if(NOT MATH_LIB) - message(FATAL_ERROR "Cannot find required math library") - endif(NOT MATH_LIB) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 9d2a604..6f93d18 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -72,16 +72,21 @@ set( - # ======================================================================= - if(LIBHPDF_STATIC) - add_library(${LIBHPDF_NAME_STATIC} STATIC ${LIBHPDF_SRCS}) -+ -+ if( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) -+ set_target_properties(${LIBHPDF_NAME_STATIC} PROPERTIES COMPILE_FLAGS "-fPIC") -+ endif( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) -+ - target_link_libraries(${LIBHPDF_NAME_STATIC} ${ADDITIONAL_LIBRARIES}) - install( - TARGETS ${LIBHPDF_NAME_STATIC} -- ARCHIVE DESTINATION lib -- LIBRARY DESTINATION lib -- RUNTIME DESTINATION bin -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) - if(WIN32 AND NOT CYGWIN) - foreach(addlib ${ADDITIONAL_LIBRARIES}) -- install(FILES ${addlib} DESTINATION lib) -+ install(FILES ${addlib} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endforeach(addlib) - endif(WIN32 AND NOT CYGWIN) - endif(LIBHPDF_STATIC) -@@ -93,8 +98,8 @@ if(LIBHPDF_SHARED) - endif(WIN32 AND NOT CYGWIN) - install( - TARGETS ${LIBHPDF_NAME} -- ARCHIVE DESTINATION lib -- LIBRARY DESTINATION lib -- RUNTIME DESTINATION bin -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) - endif(LIBHPDF_SHARED) -diff --git a/src/hpdf_image_png.c b/src/hpdf_image_png.c -index 3a35f5c..4304ced 100644 ---- a/src/hpdf_image_png.c -+++ b/src/hpdf_image_png.c -@@ -20,7 +20,7 @@ - #include "hpdf_image.h" - - #ifndef LIBHPDF_HAVE_NOPNGLIB --#include <png.h> -+#include "png.h" - #include <string.h> - - static void --- -2.16.0 - diff --git a/media-libs/libharu/files/libharu-2.3.0-4-Add-support-for-free-form-triangle-Shading-objects.patch b/media-libs/libharu/files/libharu-2.3.0-4-Add-support-for-free-form-triangle-Shading-objects.patch deleted file mode 100644 index 5248c4fcac16..000000000000 --- a/media-libs/libharu/files/libharu-2.3.0-4-Add-support-for-free-form-triangle-Shading-objects.patch +++ /dev/null @@ -1,530 +0,0 @@ -From 54c145867ad04c20cc71878fab662f6eb720621e Mon Sep 17 00:00:00 2001 -From: "David C. Lonie" <david.lonie@kitware.com> -Date: Wed, 10 May 2017 11:07:28 -0400 -Subject: [PATCH 4/4] Add support for free-form triangle Shading objects. - ---- - include/hpdf.h | 24 ++++- - include/hpdf_error.h | 3 + - include/hpdf_objects.h | 2 + - include/hpdf_pages.h | 5 + - include/hpdf_types.h | 14 +++ - src/CMakeLists.txt | 1 + - src/hpdf_page_operator.c | 31 +++++++ - src/hpdf_pages.c | 55 ++++++++++- - src/hpdf_shading.c | 231 +++++++++++++++++++++++++++++++++++++++++++++++ - 9 files changed, 362 insertions(+), 4 deletions(-) - create mode 100644 src/hpdf_shading.c - -diff --git a/include/hpdf.h b/include/hpdf.h -index e369f67..40e3c41 100644 ---- a/include/hpdf.h -+++ b/include/hpdf.h -@@ -77,6 +77,7 @@ typedef HPDF_HANDLE HPDF_Dict; - typedef HPDF_HANDLE HPDF_EmbeddedFile; - typedef HPDF_HANDLE HPDF_OutputIntent; - typedef HPDF_HANDLE HPDF_Xref; -+typedef HPDF_HANDLE HPDF_Shading; - - #else - -@@ -1171,6 +1172,11 @@ HPDF_EXPORT(HPDF_STATUS) - HPDF_Page_SetExtGState (HPDF_Page page, - HPDF_ExtGState ext_gstate); - -+/* sh */ -+HPDF_EXPORT(HPDF_STATUS) -+HPDF_Page_SetShading (HPDF_Page page, -+ HPDF_Shading shading); -+ - - /*--- Special graphic state operator --------------------------------------*/ - -@@ -1450,7 +1456,23 @@ HPDF_Page_SetCMYKStroke (HPDF_Page page, - - /*--- Shading patterns ---------------------------------------------------*/ - --/* sh --not implemented yet */ -+/* Notes for docs: -+ * - ShadingType must be HPDF_SHADING_FREE_FORM_TRIANGLE_MESH (the only -+ * defined option...) -+ * - colorSpace must be HPDF_CS_DEVICE_RGB for now. -+ */ -+HPDF_EXPORT(HPDF_Shading) -+HPDF_Shading_New (HPDF_Doc pdf, -+ HPDF_ShadingType type, -+ HPDF_ColorSpace colorSpace, -+ HPDF_REAL xMin, HPDF_REAL xMax, -+ HPDF_REAL yMin, HPDF_REAL yMax); -+ -+HPDF_EXPORT(HPDF_STATUS) -+HPDF_Shading_AddVertexRGB(HPDF_Shading shading, -+ HPDF_Shading_FreeFormTriangleMeshEdgeFlag edgeFlag, -+ HPDF_REAL x, HPDF_REAL y, -+ HPDF_UINT8 r, HPDF_UINT8 g, HPDF_UINT8 b); - - /*--- In-line images -----------------------------------------------------*/ - -diff --git a/include/hpdf_error.h b/include/hpdf_error.h -index b04e2cd..ef4fa61 100644 ---- a/include/hpdf_error.h -+++ b/include/hpdf_error.h -@@ -145,6 +145,9 @@ extern "C" { - #define HPDF_INVALID_U3D_DATA 0x1083 - #define HPDF_NAME_CANNOT_GET_NAMES 0x1084 - #define HPDF_INVALID_ICC_COMPONENT_NUM 0x1085 -+/* 0x1086 */ -+/* 0x1087 */ -+#define HPDF_INVALID_SHADING_TYPE 0x1088 - - /*---------------------------------------------------------------------------*/ - -diff --git a/include/hpdf_objects.h b/include/hpdf_objects.h -index 525adda..b16de02 100644 ---- a/include/hpdf_objects.h -+++ b/include/hpdf_objects.h -@@ -61,6 +61,7 @@ extern "C" { - #define HPDF_OSUBCLASS_EXT_GSTATE_R 0x0B00 /* read only object */ - #define HPDF_OSUBCLASS_NAMEDICT 0x0C00 - #define HPDF_OSUBCLASS_NAMETREE 0x0D00 -+#define HPDF_OSUBCLASS_SHADING 0x0E00 - - - -@@ -595,6 +596,7 @@ typedef HPDF_Array HPDF_Destination; - typedef HPDF_Dict HPDF_U3D; - typedef HPDF_Dict HPDF_OutputIntent; - typedef HPDF_Dict HPDF_JavaScript; -+typedef HPDF_Dict HPDF_Shading; - - #ifdef __cplusplus - } -diff --git a/include/hpdf_pages.h b/include/hpdf_pages.h -index 44b816c..60b1d84 100644 ---- a/include/hpdf_pages.h -+++ b/include/hpdf_pages.h -@@ -55,6 +55,7 @@ typedef struct _HPDF_PageAttr_Rec { - HPDF_Dict fonts; - HPDF_Dict xobjects; - HPDF_Dict ext_gstates; -+ HPDF_Dict shadings; - HPDF_GState gstate; - HPDF_Point str_pos; - HPDF_Point cur_pos; -@@ -101,6 +102,10 @@ const char* - HPDF_Page_GetExtGStateName (HPDF_Page page, - HPDF_ExtGState gstate); - -+const char* -+HPDF_Page_GetShadingName (HPDF_Page page, -+ HPDF_Shading shading); -+ - - HPDF_Box - HPDF_Page_GetMediaBox (HPDF_Page page); -diff --git a/include/hpdf_types.h b/include/hpdf_types.h -index 8b3e0a8..a2e2157 100644 ---- a/include/hpdf_types.h -+++ b/include/hpdf_types.h -@@ -557,6 +557,20 @@ typedef enum _HPDF_NameDictKey { - HPDF_NAME_EOF - } HPDF_NameDictKey; - -+/*----------------------------------------------------------------------------*/ -+ -+typedef enum _HPDF_ShadingType { -+ HPDF_SHADING_FREE_FORM_TRIANGLE_MESH = 4 /* TODO the rest */ -+} HPDF_ShadingType; -+ -+typedef enum _HPDF_Shading_FreeFormTriangleMeshEdgeFlag { -+ HPDF_FREE_FORM_TRI_MESH_EDGEFLAG_NO_CONNECTION = 0, -+ HPDF_FREE_FORM_TRI_MESH_EDGEFLAG_BC, -+ HPDF_FREE_FORM_TRI_MESH_EDGEFLAG_AC -+} HPDF_Shading_FreeFormTriangleMeshEdgeFlag; -+ -+/*----------------------------------------------------------------------------*/ -+ - #ifdef __cplusplus - } - #endif /* __cplusplus */ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 6f93d18..d428b78 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -56,6 +56,7 @@ set( - hpdf_page_operator.c - hpdf_pages.c - hpdf_real.c -+ hpdf_shading.c - hpdf_streams.c - hpdf_string.c - hpdf_u3d.c -diff --git a/src/hpdf_page_operator.c b/src/hpdf_page_operator.c -index 23f5920..dda1078 100644 ---- a/src/hpdf_page_operator.c -+++ b/src/hpdf_page_operator.c -@@ -312,6 +312,37 @@ HPDF_Page_SetExtGState (HPDF_Page page, - return ret; - } - -+/* sh */ -+HPDF_EXPORT(HPDF_STATUS) -+HPDF_Page_SetShading (HPDF_Page page, -+ HPDF_Shading shading) -+{ -+ HPDF_STATUS ret = HPDF_Page_CheckState (page, HPDF_GMODE_PAGE_DESCRIPTION); -+ HPDF_PageAttr attr; -+ const char *local_name; -+ -+ HPDF_PTRACE ((" HPDF_Page_SetShading\n")); -+ -+ if (ret != HPDF_OK) -+ return ret; -+ -+ if (page->mmgr != shading->mmgr) -+ return HPDF_RaiseError (page->error, HPDF_INVALID_OBJECT, 0); -+ -+ attr = (HPDF_PageAttr)page->attr; -+ local_name = HPDF_Page_GetShadingName (page, shading); -+ -+ if (!local_name) -+ return HPDF_CheckError (page->error); -+ -+ if (HPDF_Stream_WriteEscapeName (attr->stream, local_name) != HPDF_OK) -+ return HPDF_CheckError (page->error); -+ -+ if (HPDF_Stream_WriteStr (attr->stream, " sh\012") != HPDF_OK) -+ return HPDF_CheckError (page->error); -+ -+ return ret; -+} - - /*--- Special graphic state operator --------------------------------------*/ - -diff --git a/src/hpdf_pages.c b/src/hpdf_pages.c -index fcc9b5c..c0a7c4f 100644 ---- a/src/hpdf_pages.c -+++ b/src/hpdf_pages.c -@@ -514,7 +514,7 @@ HPDF_Page_GetLocalFontName (HPDF_Page page, - /* search font-object from font-resource */ - key = HPDF_Dict_GetKeyByObj (attr->fonts, font); - if (!key) { -- /* if the font is not resisterd in font-resource, register font to -+ /* if the font is not registered in font-resource, register font to - * font-resource. - */ - char fontName[HPDF_LIMIT_MAX_NAME_LEN + 1]; -@@ -603,7 +603,7 @@ HPDF_Page_GetXObjectName (HPDF_Page page, - /* search xobject-object from xobject-resource */ - key = HPDF_Dict_GetKeyByObj (attr->xobjects, xobj); - if (!key) { -- /* if the xobject is not resisterd in xobject-resource, register -+ /* if the xobject is not registered in xobject-resource, register - * xobject to xobject-resource. - */ - char xobj_name[HPDF_LIMIT_MAX_NAME_LEN + 1]; -@@ -654,7 +654,7 @@ HPDF_Page_GetExtGStateName (HPDF_Page page, - /* search ext_gstate-object from ext_gstate-resource */ - key = HPDF_Dict_GetKeyByObj (attr->ext_gstates, state); - if (!key) { -- /* if the ext-gstate is not resisterd in ext-gstate resource, register -+ /* if the ext-gstate is not registered in ext-gstate resource, register - * to ext-gstate resource. - */ - char ext_gstate_name[HPDF_LIMIT_MAX_NAME_LEN + 1]; -@@ -673,6 +673,55 @@ HPDF_Page_GetExtGStateName (HPDF_Page page, - return key; - } - -+const char* -+HPDF_Page_GetShadingName (HPDF_Page page, -+ HPDF_Shading shading) -+{ -+ HPDF_PageAttr attr = (HPDF_PageAttr )page->attr; -+ const char *key; -+ -+ HPDF_PTRACE((" HPDF_Page_GetShadingName\n")); -+ -+ if (!attr->shadings) { -+ HPDF_Dict resources; -+ HPDF_Dict shadings; -+ -+ resources = HPDF_Page_GetInheritableItem (page, "Resources", -+ HPDF_OCLASS_DICT); -+ if (!resources) -+ return NULL; -+ -+ shadings = HPDF_Dict_New (page->mmgr); -+ if (!shadings) -+ return NULL; -+ -+ if (HPDF_Dict_Add (resources, "Shading", shadings) != HPDF_OK) -+ return NULL; -+ -+ attr->shadings = shadings; -+ } -+ -+ /* search shading-object from shading-resource */ -+ key = HPDF_Dict_GetKeyByObj (attr->shadings, shading); -+ if (!key) { -+ /* if the shading is not registered in shadings resource, register -+ * to shadings resource. -+ */ -+ char shading_str[HPDF_LIMIT_MAX_NAME_LEN + 1]; -+ char *ptr; -+ char *end_ptr = shading_str + HPDF_LIMIT_MAX_NAME_LEN; -+ -+ ptr = (char *)HPDF_StrCpy (shading_str, "Sh", end_ptr); -+ HPDF_IToA (ptr, attr->shadings->list->count, end_ptr); -+ -+ if (HPDF_Dict_Add (attr->shadings, shading_str, shading) != HPDF_OK) -+ return NULL; -+ -+ key = HPDF_Dict_GetKeyByObj (attr->shadings, shading); -+ } -+ -+ return key; -+} - - static HPDF_STATUS - AddAnnotation (HPDF_Page page, -diff --git a/src/hpdf_shading.c b/src/hpdf_shading.c -new file mode 100644 -index 0000000..53204c0 ---- /dev/null -+++ b/src/hpdf_shading.c -@@ -0,0 +1,231 @@ -+/* -+ * << Haru Free PDF Library >> -- hpdf_shading.c -+ * -+ * URL: http://libharu.org -+ * -+ * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> -+ * Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org> -+ * Copyright (c) 2017 Kitware <kitware@kitware.com> -+ * -+ * Permission to use, copy, modify, distribute and sell this software -+ * and its documentation for any purpose is hereby granted without fee, -+ * provided that the above copyright notice appear in all copies and -+ * that both that copyright notice and this permission notice appear -+ * in supporting documentation. -+ * It is provided "as is" without express or implied warranty. -+ * -+ */ -+ -+#include "hpdf.h" -+#include "hpdf_utils.h" -+ -+#include "assert.h" -+ -+typedef struct _RGBVertex -+{ -+ HPDF_UINT8 EdgeFlag; -+ HPDF_UINT32 X; -+ HPDF_UINT32 Y; -+ HPDF_UINT8 RGB[3]; -+} RGBVertex; -+ -+static const char *COL_CMYK = "DeviceCMYK"; -+static const char *COL_RGB = "DeviceRGB"; -+static const char *COL_GRAY = "DeviceGray"; -+ -+/* bbox is filled with xMin, xMax, yMin, yMax */ -+static HPDF_BOOL _GetDecodeArrayVertexValues(HPDF_Shading shading, -+ HPDF_REAL *bbox) -+{ -+ HPDF_Array decodeArray; -+ HPDF_Real r; -+ int i; -+ -+ if (!shading) { -+ return HPDF_FALSE; -+ } -+ -+ decodeArray = (HPDF_Array)(HPDF_Dict_GetItem(shading, "Decode", -+ HPDF_OCLASS_ARRAY)); -+ if (!decodeArray) { -+ return HPDF_FALSE; -+ } -+ -+ for (i = 0; i < 4; ++i) -+ { -+ r = HPDF_Array_GetItem(decodeArray, i, HPDF_OCLASS_REAL); -+ if (!r) { -+ return HPDF_FALSE; -+ } -+ -+ bbox[i] = r->value; -+ } -+ -+ return HPDF_TRUE; -+} -+ -+static void UINT32Swap (HPDF_UINT32 *value) -+{ -+ HPDF_BYTE b[4]; -+ -+ HPDF_MemCpy (b, (HPDF_BYTE *)value, 4); -+ *value = (HPDF_UINT32)((HPDF_UINT32)b[0] << 24 | -+ (HPDF_UINT32)b[1] << 16 | -+ (HPDF_UINT32)b[2] << 8 | -+ (HPDF_UINT32)b[3]); -+} -+ -+/* Encode a position coordinate for writing */ -+static HPDF_UINT32 _EncodeValue(HPDF_REAL x, HPDF_REAL xMin, HPDF_REAL xMax) -+{ -+ HPDF_DOUBLE norm = (x - xMin) / (xMax - xMin); -+ HPDF_DOUBLE max = (HPDF_DOUBLE)(0xFFFFFFFF); -+ HPDF_UINT32 enc = (HPDF_UINT32)(norm * max); -+ UINT32Swap(&enc); -+ return enc; -+} -+ -+HPDF_EXPORT(HPDF_Shading) -+HPDF_Shading_New (HPDF_Doc pdf, -+ HPDF_ShadingType type, -+ HPDF_ColorSpace colorSpace, -+ HPDF_REAL xMin, HPDF_REAL xMax, -+ HPDF_REAL yMin, HPDF_REAL yMax) -+{ -+ HPDF_Shading shading; -+ HPDF_Array decodeArray; -+ HPDF_STATUS ret = HPDF_OK; -+ int i; -+ -+ HPDF_PTRACE((" HPDF_Shading_New\n")); -+ -+ if (!HPDF_HasDoc(pdf)) { -+ return NULL; -+ } -+ -+ /* Validate shading type: */ -+ switch (type) -+ { -+ case HPDF_SHADING_FREE_FORM_TRIANGLE_MESH: -+ break; -+ -+ default: -+ HPDF_SetError (pdf->mmgr->error, HPDF_INVALID_SHADING_TYPE, 0); -+ return NULL; -+ } -+ -+ decodeArray = HPDF_Array_New(pdf->mmgr); -+ if (!decodeArray) { -+ return NULL; -+ } -+ -+ /* X-range */ -+ ret += HPDF_Array_AddReal(decodeArray, xMin); -+ ret += HPDF_Array_AddReal(decodeArray, xMax); -+ -+ /* Y-range */ -+ ret += HPDF_Array_AddReal(decodeArray, yMin); -+ ret += HPDF_Array_AddReal(decodeArray, yMax); -+ -+ const char *colName = NULL; -+ switch (colorSpace) { -+ case HPDF_CS_DEVICE_RGB: -+ colName = COL_RGB; -+ for (i = 0; i < 3; ++i) { -+ ret += HPDF_Array_AddReal(decodeArray, 0.0); -+ ret += HPDF_Array_AddReal(decodeArray, 1.0); -+ } -+ break; -+ -+ default: -+ HPDF_SetError(pdf->mmgr->error, HPDF_INVALID_COLOR_SPACE, 0); -+ return NULL; -+ } -+ -+ if (ret != HPDF_OK) { -+ return NULL; -+ } -+ -+ shading = HPDF_DictStream_New(pdf->mmgr, pdf->xref); -+ if (!shading) { -+ return NULL; -+ } -+ -+ shading->header.obj_class |= HPDF_OSUBCLASS_SHADING; -+ ret += HPDF_Dict_AddNumber(shading, "ShadingType", type); -+ ret += HPDF_Dict_AddName(shading, "ColorSpace", colName); -+ -+ switch (type) -+ { -+ case HPDF_SHADING_FREE_FORM_TRIANGLE_MESH: -+ ret += HPDF_Dict_AddNumber(shading, "BitsPerCoordinate", 32); -+ ret += HPDF_Dict_AddNumber(shading, "BitsPerComponent", 8); -+ ret += HPDF_Dict_AddNumber(shading, "BitsPerFlag", 8); -+ ret += HPDF_Dict_Add(shading, "Decode", decodeArray); -+ break; -+ -+ default: -+ HPDF_SetError (pdf->mmgr->error, HPDF_INVALID_SHADING_TYPE, 0); -+ return NULL; -+ } -+ -+ if (ret != HPDF_OK) { -+ return NULL; -+ } -+ -+ return shading; -+} -+ -+HPDF_EXPORT(HPDF_STATUS) -+HPDF_Shading_AddVertexRGB(HPDF_Shading shading, -+ HPDF_Shading_FreeFormTriangleMeshEdgeFlag edgeFlag, -+ HPDF_REAL x, HPDF_REAL y, -+ HPDF_UINT8 r, HPDF_UINT8 g, HPDF_UINT8 b) -+{ -+ HPDF_STATUS ret = HPDF_OK; -+ RGBVertex vert; -+ float bbox[4]; -+ -+ HPDF_PTRACE((" HPDF_Shading_AddVertexRGB\n")); -+ -+ if (!shading) { -+ return HPDF_INVALID_OBJECT; -+ } -+ -+ if (_GetDecodeArrayVertexValues(shading, bbox) != HPDF_TRUE) { -+ return HPDF_SetError(shading->error, HPDF_INVALID_OBJECT, 0); -+ } -+ -+ vert.EdgeFlag = (HPDF_UINT8)edgeFlag; -+ vert.X = _EncodeValue(x, bbox[0], bbox[1]); -+ vert.Y = _EncodeValue(y, bbox[2], bbox[3]); -+ vert.RGB[0] = r; -+ vert.RGB[1] = g; -+ vert.RGB[2] = b; -+ -+ ret = HPDF_Stream_Write(shading->stream, -+ (HPDF_BYTE*)(&vert.EdgeFlag), sizeof(vert.EdgeFlag)); -+ if (ret != HPDF_OK) -+ { -+ return ret; -+ } -+ -+ ret = HPDF_Stream_Write(shading->stream, -+ (HPDF_BYTE*)(&vert.X), sizeof(vert.X)); -+ if (ret != HPDF_OK) -+ { -+ return ret; -+ } -+ -+ ret = HPDF_Stream_Write(shading->stream, -+ (HPDF_BYTE*)(&vert.Y), sizeof(vert.Y)); -+ if (ret != HPDF_OK) -+ { -+ return ret; -+ } -+ -+ ret = HPDF_Stream_Write(shading->stream, -+ (HPDF_BYTE*)(&vert.RGB), sizeof(vert.RGB)); -+ -+ return ret; -+} --- -2.16.0 - diff --git a/media-libs/libharu/libharu-2.3.0-r3.ebuild b/media-libs/libharu/libharu-2.3.0-r3.ebuild deleted file mode 100644 index 60153140f9a5..000000000000 --- a/media-libs/libharu/libharu-2.3.0-r3.ebuild +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -MYP=RELEASE_${PV//./_} -inherit cmake - -DESCRIPTION="C/C++ library for PDF generation" -HOMEPAGE="http://www.libharu.org/" -SRC_URI="https://github.com/${PN}/${PN}/archive/${MYP}.tar.gz -> ${P}.tar.gz" - -LICENSE="ZLIB" -SLOT="0/${PV}" -KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86 ~amd64-linux ~x86-linux" - -DEPEND=" - media-libs/libpng:= - sys-libs/zlib:= -" -RDEPEND="${DEPEND}" - -S="${WORKDIR}/${PN}-${MYP}" - -PATCHES=( - "${FILESDIR}"/${P}-1-Included-necessary-char-widths-in-generated-PDF.patch - "${FILESDIR}"/${P}-2-Avoid-issue-with-libtiff-duplicate-symbols.patch - "${FILESDIR}"/${P}-3-cmake-fixes.patch - "${FILESDIR}"/${P}-4-Add-support-for-free-form-triangle-Shading-objects.patch -) - -src_configure() { - local mycmakeargs=( - -DLIBHPDF_EXAMPLES=NO # Doesn't work - -DLIBHPDF_STATIC=NO - ) - cmake_src_configure -} |