diff --git a/x11-libs/agg/agg-2.7.0~r138.recipe b/x11-libs/agg/agg-2.7.0~r138.recipe index ec6b625e9..54d026db8 100644 --- a/x11-libs/agg/agg-2.7.0~r138.recipe +++ b/x11-libs/agg/agg-2.7.0~r138.recipe @@ -1,14 +1,27 @@ -SUMMARY="Anti-Grain Geometry (AGG)" -DESCRIPTION="Anti-Grain Geometry (AGG) is an Open Source, free of charge \ -graphic library, written in industrially standard C++." +SUMMARY="Anti-Grain Geometry (AGG) Library" +DESCRIPTION="an Open Source, free of charge 2D vector graphics library, +written in industrially standard C++. AGG doesn't depend on any graphic API or +technology. Basically, you can think of AGG as of a rendering engine that +produces pixel images in memory from some vectorial data. But of course, AGG can +do much more than that. The ideas and the philosophy of AGG are: + + * Anti-Aliasing. + * Subpixel Accuracy. + * The highest possible quality. + * High performance. + * Platform independence and compatibility. + * Flexibility and extensibility. + * Lightweight design. + * Reliability and stability (including numerical stability)." HOMEPAGE="https://en.wikipedia.org/wiki/Anti-Grain_Geometry" COPYRIGHT="2002-2006 Maxim Shemanarev - 2021 John Horigan" + 2009-2021 John Horigan + 1994-2021 Free Software Foundation" LICENSE="GNU GPL v2" REVISION="1" SOURCE_URI="https://sourceforge.net/code-snapshots/svn/a/ag/agg/svn/agg-svn-r138.zip" -CHECKSUM_SHA256="d111ccf4f983b01ab18b19e3689b665d6b8a179ccc6ed945db2287b8084a557f" -PATCHES="agg-2.7.patchset" +CHECKSUM_SHA256="83bb36ab8a542e637f1e95b65028e07bf929d40097f7e4354b87762095e6497b" +PATCHES="agg-$portVersion.patchset" SOURCE_DIR="agg-svn-r138" ARCHITECTURES="all" @@ -120,3 +133,9 @@ INSTALL() packageEntries sdl \ $libDir/libaggplatformsdl* } + +TEST() +{ + cd agg-2.4 + make check +} diff --git a/x11-libs/agg/patches/agg-2.7.0~r138.patchset b/x11-libs/agg/patches/agg-2.7.0~r138.patchset new file mode 100644 index 000000000..dc983b0d4 --- /dev/null +++ b/x11-libs/agg/patches/agg-2.7.0~r138.patchset @@ -0,0 +1,286 @@ +From 64b76b6f9244ecb65a610e435aef2096a1221cf6 Mon Sep 17 00:00:00 2001 +From: Kacper Kasper +Date: Thu, 24 Apr 2014 20:00:29 +0000 +Subject: Haiku support + + +diff --git a/agg-2.4/configure.ac b/agg-2.4/configure.ac +index 4e1cb48..995c641 100644 +--- a/agg-2.4/configure.ac ++++ b/agg-2.4/configure.ac +@@ -9,7 +9,7 @@ dnl Checks for programs. + AC_PROG_CC + AC_PROG_CXX + AC_ISC_POSIX +-dnl AM_C_PROTOTYPES ++ + dnl if test "x$U" != "x"; then + dnl AC_MSG_ERROR(Compiler not ANSI compliant) + dnl fi +@@ -59,9 +59,18 @@ dnl #### Check if we are compiling for win32 ##### + AC_SUBST(WINDOWS_LIBS) + PREFERED_PLATFORM=win32 + ;; ++ *haiku*) ++ haiku_host=yes ++ HAIKU_LIBS="-lbe -ltranslation" ++ HAIKU_CFLAGS= ++ AC_SUBST(HAIKU_CFLAGS) ++ AC_SUBST(HAIKU_LIBS) ++ PREFERED_PLATFORM=Haiku ++ ;; + esac + AM_CONDITIONAL(ENABLE_WIN32,[test x$win32_host = xyes -a x$enable_platform != xno ]) + AM_CONDITIONAL(ENABLE_OSX,[test x$osx_host = xyes -a x$enable_platform != xno ]) ++AM_CONDITIONAL(ENABLE_HAIKU,[test x$haiku_host = xyes -a x$enable_platform != xno ]) + dnl then enable font_win32tt + AC_ARG_ENABLE(win32tt, + AC_HELP_STRING([--enable-win32tt],[Win32 TrueType font support library]), +@@ -155,7 +164,7 @@ AC_OUTPUT( + src/platform/sdl/Makefile + src/platform/mac/Makefile + src/platform/win32/Makefile +- src/platform/BeOS/Makefile ++ src/platform/Haiku/Makefile + src/platform/AmigaOS/Makefile + include/Makefile + include/ctrl/Makefile +-- +2.37.3 + + +From 8c039f4ccfffd7d1ea2adef387f990595e1e3a13 Mon Sep 17 00:00:00 2001 +From: Jonathan Schleifer +Date: Thu, 19 Dec 2013 01:45:04 +0100 +Subject: Fix the agg headers to be proper C++. + + +diff --git a/agg-2.4/include/agg_array.h b/agg-2.4/include/agg_array.h +index b48010b..c5eec01 100644 +--- a/agg-2.4/include/agg_array.h ++++ b/agg-2.4/include/agg_array.h +@@ -356,9 +356,10 @@ namespace agg + + void add_array(const T* ptr, unsigned num_elem) + { +- while(num_elem--) ++ while(num_elem > 0) + { + add(*ptr++); ++ --num_elem; + } + } + +@@ -516,10 +517,11 @@ namespace agg + if(m_num_blocks) + { + T** blk = m_blocks + m_num_blocks - 1; +- while(m_num_blocks--) ++ while(m_num_blocks > 0) + { + pod_allocator::deallocate(*blk, block_size); + --blk; ++ --m_num_blocks; + } + } + pod_allocator::deallocate(m_blocks, m_max_blocks); +@@ -792,10 +794,11 @@ namespace agg + if(m_num_blocks) + { + block_type* blk = m_blocks + m_num_blocks - 1; +- while(m_num_blocks--) ++ while(m_num_blocks > 0) + { + pod_allocator::deallocate(blk->data, blk->size); + --blk; ++ --m_num_blocks; + } + pod_allocator::deallocate(m_blocks, m_max_blocks); + } +diff --git a/agg-2.4/include/agg_rasterizer_cells_aa.h b/agg-2.4/include/agg_rasterizer_cells_aa.h +index 4dd905f..bc229e4 100644 +--- a/agg-2.4/include/agg_rasterizer_cells_aa.h ++++ b/agg-2.4/include/agg_rasterizer_cells_aa.h +@@ -131,10 +131,11 @@ namespace agg + if(m_num_blocks) + { + cell_type** ptr = m_cells + m_num_blocks - 1; +- while(m_num_blocks--) ++ while(m_num_blocks > 0) + { + pod_allocator::deallocate(*ptr, cell_block_size); + ptr--; ++ --m_num_blocks; + } + pod_allocator::deallocate(m_cells, m_max_blocks); + } +@@ -665,10 +666,11 @@ namespace agg + cell_ptr = *block_ptr++; + i = (nb > cell_block_size) ? unsigned(cell_block_size) : nb; + nb -= i; +- while(i--) ++ while(i > 0) + { + m_sorted_y[cell_ptr->y - m_min_y].start++; + ++cell_ptr; ++ --i; + } + } + +@@ -689,12 +691,13 @@ namespace agg + cell_ptr = *block_ptr++; + i = (nb > cell_block_size) ? unsigned(cell_block_size) : nb; + nb -= i; +- while(i--) ++ while(i > 0) + { + sorted_y& curr_y = m_sorted_y[cell_ptr->y - m_min_y]; + m_sorted_cells[curr_y.start + curr_y.num] = cell_ptr; + ++curr_y.num; + ++cell_ptr; ++ --i; + } + } + +diff --git a/agg-2.4/include/agg_renderer_outline_aa.h b/agg-2.4/include/agg_renderer_outline_aa.h +index a1a248c..ca48577 100644 +--- a/agg-2.4/include/agg_renderer_outline_aa.h ++++ b/agg-2.4/include/agg_renderer_outline_aa.h +@@ -1366,7 +1366,7 @@ namespace agg + //--------------------------------------------------------------------- + void profile(line_profile_aa& prof) { m_profile = &prof; } + const line_profile_aa& profile() const { return *m_profile; } +- line_profile_aa& profile() { return *m_profile; } ++ line_profile_aa& profile() { return *(line_profile_aa*)m_profile; } + + //--------------------------------------------------------------------- + int subpixel_width() const { return m_profile->subpixel_width(); } +diff --git a/agg-2.4/include/agg_rendering_buffer.h b/agg-2.4/include/agg_rendering_buffer.h +index 175bcd8..c89308b 100644 +--- a/agg-2.4/include/agg_rendering_buffer.h ++++ b/agg-2.4/include/agg_rendering_buffer.h +@@ -187,10 +187,11 @@ namespace agg + + T** rows = &m_rows[0]; + +- while(height--) ++ while(height > 0) + { + *rows++ = row_ptr; + row_ptr += stride; ++ --height; + } + } + +-- +2.37.3 + + +From bfe220f68f89a3b17fcd8c4112bc26bd7e73f3b7 Mon Sep 17 00:00:00 2001 +From: Kacper Kasper +Date: Thu, 24 Apr 2014 20:00:29 +0000 +Subject: Haiku support + + +diff --git a/agg-2.4/src/platform/BeOS/Makefile.am b/agg-2.4/src/platform/BeOS/Makefile.am +index 474153c..2095717 100644 +--- a/agg-2.4/src/platform/BeOS/Makefile.am ++++ b/agg-2.4/src/platform/BeOS/Makefile.am +@@ -1 +1,10 @@ +-EXTRA_DIST=agg_platform_support.cpp ++if ENABLE_HAIKU ++ ++lib_LTLIBRARIES = libaggplatformHaiku.la ++ ++libaggplatformHaiku_la_LDFLAGS = -version-info @AGG_LIB_VERSION@ ++libaggplatformHaiku_la_SOURCES = agg_platform_support.cpp ++libaggplatformHaiku_la_CXXFLAGS = -I$(top_srcdir)/include @HAIKU_CFLAGS@ ++libaggplatformHaiku_la_LIBADD = @HAIKU_LIBS@ ++endif ++ +diff --git a/agg-2.4/src/platform/Makefile.am b/agg-2.4/src/platform/Makefile.am +index ebe5e7e..c6622bc 100644 +--- a/agg-2.4/src/platform/Makefile.am ++++ b/agg-2.4/src/platform/Makefile.am +@@ -1 +1 @@ +-SUBDIRS = X11 sdl win32 AmigaOS BeOS mac ++SUBDIRS = X11 sdl win32 AmigaOS Haiku mac +-- +2.37.3 + + +From 37106be514d71e0c85536161746cfe8d5f02efb0 Mon Sep 17 00:00:00 2001 +From: Zardshard +Date: Tue, 8 Aug 2023 06:13:29 +0000 +Subject: Fix multiple definitions linker error + + +diff --git a/agg-2.4/include/agg_trans_perspective.h b/agg-2.4/include/agg_trans_perspective.h +index 1c650aa..05fd7a6 100644 +--- a/agg-2.4/include/agg_trans_perspective.h ++++ b/agg-2.4/include/agg_trans_perspective.h +@@ -502,7 +502,7 @@ namespace agg + } + + //------------------------------------------------------------------------ +- const trans_perspective& ++ inline const trans_perspective& + trans_perspective::multiply_inv(const trans_perspective& m) + { + trans_perspective t = m; +@@ -511,7 +511,7 @@ namespace agg + } + + //------------------------------------------------------------------------ +- const trans_perspective& ++ inline const trans_perspective& + trans_perspective::multiply_inv(const trans_affine& m) + { + trans_affine t = m; +@@ -520,7 +520,7 @@ namespace agg + } + + //------------------------------------------------------------------------ +- const trans_perspective& ++ inline const trans_perspective& + trans_perspective::premultiply_inv(const trans_perspective& m) + { + trans_perspective t = m; +@@ -529,7 +529,7 @@ namespace agg + } + + //------------------------------------------------------------------------ +- const trans_perspective& ++ inline const trans_perspective& + trans_perspective::premultiply_inv(const trans_affine& m) + { + trans_perspective t(m); +@@ -697,14 +697,14 @@ namespace agg + } + + //------------------------------------------------------------------------ +- void trans_perspective::translation(double* dx, double* dy) const ++ inline void trans_perspective::translation(double* dx, double* dy) const + { + *dx = tx; + *dy = ty; + } + + //------------------------------------------------------------------------ +- void trans_perspective::scaling(double* x, double* y) const ++ inline void trans_perspective::scaling(double* x, double* y) const + { + double x1 = 0.0; + double y1 = 0.0; +@@ -719,7 +719,7 @@ namespace agg + } + + //------------------------------------------------------------------------ +- void trans_perspective::scaling_abs(double* x, double* y) const ++ inline void trans_perspective::scaling_abs(double* x, double* y) const + { + *x = std::sqrt(sx * sx + shx * shx); + *y = std::sqrt(shy * shy + sy * sy); +-- +2.37.3 +