Merged in KapiX/haikuports/gnash-broken (pull request #168)

Update agg and gnash, both still broken
This commit is contained in:
Jerome Duval
2014-04-30 18:03:08 +02:00
7 changed files with 390 additions and 91 deletions

View File

@@ -7,23 +7,23 @@ SRC_URI="ftp://ftp.gnu.org/pub/gnu/gnash/0.8.10/gnash-0.8.10.tar.bz2"
CHECKSUM_SHA256="9625072e45df92baa2c28fc9999d4e2deb66bc827530baedfad2e4e2292d1224"
COPYRIGHT="2005-2012 Free Software Foundation"
LICENSE="GNU GPL v3"
REVISION="1"
REVISION="2"
ARCHITECTURES="!x86 !x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
ARCHITECTURES="$ARCHITECTURES !x86_gcc2"
else
ARCHITECTURES="$ARCHITECTURES !x86_gcc2"
ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="!x86 !x86_64"
SECONDARY_ARCHITECTURES="!x86"
PROVIDES="
gnash$secondaryArchSuffix = $portVersion
app:Gnash = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
lib:libsdl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
lib:libbz2$secondaryArchSuffix
lib:libpng$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libgif$secondaryArchSuffix
@@ -36,18 +36,21 @@ REQUIRES="
lib:libboost_iostreams$secondaryArchSuffix
lib:libboost_serialization$secondaryArchSuffix
lib:libboost_date_time$secondaryArchSuffix
lib:libboost_system$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libsdl_sound$secondaryArchSuffix
lib:libagg$secondaryArchSuffix
#lib:libfreetype$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
#lib:libfontconfig$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
devel:libsdl$secondaryArchSuffix
devel:libz$secondaryArchSuffix
devel:libbz2$secondaryArchSuffix
devel:libpng$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:libgif$secondaryArchSuffix
@@ -61,43 +64,51 @@ BUILD_REQUIRES="
devel:libboost_iostreams$secondaryArchSuffix
devel:libboost_serialization$secondaryArchSuffix
devel:libboost_date_time$secondaryArchSuffix
devel:libboost_system$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libcrypto$secondaryArchSuffix
devel:libsdl_sound$secondaryArchSuffix
devel:libagg$secondaryArchSuffix
#devel:libfontconfig$secondaryArchSuffix
#devel:libfreetype$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:pkg_config
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:awk
cmd:sed
cmd:libtoolize
cmd:aclocal
cmd:autoconf
cmd:automake
cmd:pkg_config$secondaryArchSuffix
cmd:sdl_config$secondaryArchSuffix
cmd:xargs
"
SOURCE_DIR="gnash-0.8.10"
PATCHES="
GnashImageGif.patch
utility.patch
"
PATCHES="gnash-0.8.10.patchset"
BUILD()
{
INCLUDE_DIR=`finddir B_SYSTEM_DIRECTORY`/$relativeIncludeDir
{
INCLUDE_DIR=`finddir B_SYSTEM_DIRECTORY`/$relativeIncludeDir
LIB_DIR=`finddir B_SYSTEM_DIRECTORY`/$relativeDevelopLibDir
export PKG_CONFIG_LIBDIR="`finddir B_SYSTEM_DIRECTORY`/$relativeDevelopLibDir/pkgconfig"
./configure --enable-renderer=agg --enable-media=ffmpeg \
--enable-gui=sdl --enable-sound=sdl --without-gconf --disable-extensions \
--with-agg-incl=$INCLUDE_DIR/agg \
--with-agg-lib=$LIB_DIR
--includedir=$INCLUDE_DIR
--bindir=$appsDir
--libdir=$LIB_DIR
make
libtoolize --force --copy --install
aclocal
autoconf
automake
runConfigure ./configure --enable-renderer=agg --enable-media=ffmpeg \
--enable-gui=sdl --enable-sound=sdl --without-gconf \
--disable-extensions \
--with-boost-incl=$INCLUDE_DIR/boost \
--with-boost-lib=$LIB_DIR \
--includedir=$includeDir \
--bindir=$appsDir \
--libdir=$libDir
make $jobArgs
}
INSTALL()
{

View File

@@ -1,14 +0,0 @@
diff --git a/libbase/GnashImageGif.cpp b/libbase/GnashImageGif.cpp
index eeba4b7..bddb452 100644
--- a/libbase/GnashImageGif.cpp
+++ b/libbase/GnashImageGif.cpp
@@ -269,7 +269,8 @@ GifInput::processRecord(GifRecordType record)
void
GifInput::read()
{
- _gif = DGifOpen(_inStream.get(), &readData);
+ int error_code;
+ _gif = DGifOpen(_inStream.get(), &readData, &error_code);
GifRecordType record;

View File

@@ -0,0 +1,49 @@
From 27ea051c05dcc53eb9ea2359f7e71eaacc8c2ada Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Thu, 24 Apr 2014 22:18:34 +0000
Subject: fix Haiku build
diff --git a/libbase/GnashImageGif.cpp b/libbase/GnashImageGif.cpp
index eeba4b7..bddb452 100644
--- a/libbase/GnashImageGif.cpp
+++ b/libbase/GnashImageGif.cpp
@@ -269,7 +269,8 @@ GifInput::processRecord(GifRecordType record)
void
GifInput::read()
{
- _gif = DGifOpen(_inStream.get(), &readData);
+ int error_code;
+ _gif = DGifOpen(_inStream.get(), &readData, &error_code);
GifRecordType record;
diff --git a/libbase/utility.h b/libbase/utility.h
index 8b9f48c..51ea858 100644
--- a/libbase/utility.h
+++ b/libbase/utility.h
@@ -61,7 +61,7 @@ namespace std
};
#endif
-#if defined(__HAIKU__)
+#if defined(__HAIKU_OLD)
namespace std {
class wstring : public std::basic_string<char>
{
diff --git a/macros/boost.m4 b/macros/boost.m4
index 845aaae..5788f57 100644
--- a/macros/boost.m4
+++ b/macros/boost.m4
@@ -37,7 +37,7 @@ AC_DEFUN([GNASH_PATH_BOOST],
boost_headers="detail/lightweight_mutex.hpp thread/thread.hpp multi_index_container.hpp multi_index/key_extractors.hpp thread/mutex.hpp program_options/options_description.hpp iostreams/stream.hpp"
dnl this is a list of *required* libraries. If any of these are missing, this
dnl test will return a failure, and Gnash won't build.
- boost_libs="thread program_options iostreams"
+ boost_libs="thread program_options iostreams system"
dnl this is a list of *recommended* libraries. If any of these are missing, this
dnl test will return a warning, and Gnash will build, but testing won't work.
--
1.8.3.4

View File

@@ -1,13 +0,0 @@
diff --git a/libbase/utility.h b/libbase/utility.h
index 8b9f48c..51ea858 100644
--- a/libbase/utility.h
+++ b/libbase/utility.h
@@ -61,7 +61,7 @@ namespace std
};
#endif
-#if defined(__HAIKU__)
+#if defined(__HAIKU_OLD)
namespace std {
class wstring : public std::basic_string<char>
{

View File

@@ -3,67 +3,103 @@ DESCRIPTION="
Anti-Grain Geometry (AGG) is an Open Source, free of charge graphic library, \
written in industrially standard C++.
"
HOMEPAGE="http://antigrain.com"
SRC_URI="http://www.antigrain.com/agg-2.5.tar.gz"
HOMEPAGE="http://en.wikipedia.org/wiki/Anti-Grain_Geometry"
SRC_URI="http://gnashdev.org/tools/ltib/agg-2.5.tar.gz"
CHECKSUM_SHA256="ab1edc54cc32ba51a62ff120d501eecd55fceeedf869b9354e7e13812289911f"
REVISION="1"
REVISION="2"
LICENSE="GNU GPL v2"
COPYRIGHT="2002-2006 Maxim Shemanarev"
ARCHITECTURES="?x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86"
ARCHITECTURES="!x86_gcc2 !x86"
SECONDARY_ARCHITECTURES="!x86_gcc2 !x86"
PROVIDES="
lib:libagg$secondaryArchSuffix = $portVersion
agg$secondaryArchSuffix = $portVersion
lib:libagg$secondaryArchSuffix = 2.0.4 compat >= 2
lib:libaggfontfreetype$secondaryArchSuffix = 2.0.4 compat >= 2
lib:libagggpc$secondaryArchSuffix = 2.0.4 compat >= 2
lib:libaggplatformHaiku$secondaryArchSuffix = 2.0.4 compat >= 2
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
lib:libsdl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
lib:libbz2$secondaryArchSuffix
lib:libpng$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
devel:libsdl$secondaryArchSuffix
devel:libsdl_1.2$secondaryArchSuffix
devel:libz$secondaryArchSuffix
devel:libbz2$secondaryArchSuffix
devel:libpng$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:autoconf
cmd:autoheader
cmd:automake
cmd:ld$secondaryArchSuffix
cmd:libtoolize
cmd:sed
cmd:pkg_config$secondaryArchSuffix
"
SOURCE_DIR="agg-2.5"
PATCHES="agg-2.5.patchset"
BUILD()
{
#libtoolize --force --copy --install
#aclocal
#autoheader
#autoconf
#automake --foreign --add-missing --ignore-deps
#./configure --prefix=$prefix
#make
cd src
g++ -o libagg.so -shared -fPIC *.cpp ctrl/*.cpp -I../include -lbe -ltranslation
if [ -d src/platform/BeOS ]; then
mv src/platform/BeOS src/platform/Haiku
fi
aclocal
autoheader
autoconf
libtoolize --force
automake --foreign --add-missing --ignore-deps
runConfigure ./configure \
--enable-ctrl \
--enable-gpc \
--enable-platform \
--enable-examples
make $jobArgs
}
INSTALL()
{
mkdir -p $libDir
mkdir -p $includeDir/agg
mkdir -p $developLibDir
make install
cp src/libagg.so $libDir
cp src/libagg.so $developLibDir
cp -r include/* $includeDir/agg/
packageEntries devel \
$developDir
prepareInstalledDevelLibs libagg libagggpc libaggfontfreetype \
libaggplatformHaiku libaggplatformsdl
fixPkgconfig
# fix include path in pkgconfig
sed -i -e 's#^includedir=\(.*\)#includedir=\1/agg2#g' \
$developLibDir/pkgconfig/libagg.pc
packageEntries devel $developDir $dataRootDir/aclocal
packageEntries sdl $libDir/libaggplatformsdl*
}
PROVIDES_devel="
devel:libagg$secondaryArchSuffix = $portVersion
agg${secondaryArchSuffix}_devel = $portVersion
devel:libagg$secondaryArchSuffix = 2.0.4 compat >= 2
devel:libaggfontfreetype$secondaryArchSuffix = 2.0.4 compat >= 2
devel:libagggpc$secondaryArchSuffix = 2.0.4 compat >= 2
devel:libaggplatformHaiku$secondaryArchSuffix = 2.0.4 compat >= 2
devel:libaggplatformsdl$secondaryArchSuffix = 2.0.4 compat >= 2
"
REQUIRES_devel="
lib:libagg$secondaryArchSuffix == $portVersion base
agg$secondaryArchSuffix == $portVersion base
"
PROVIDES_sdl="
agg${secondaryArchSuffix}_sdl = $portVersion
lib:libaggplatformsdl$secondaryArchSuffix = 2.0.4 compat >= 2
"
REQUIRES_sdl="
agg$secondaryArchSuffix == $portVersion base
haiku$secondaryArchSuffix >= $haikuVersion
lib:libsdl_1.2$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
"

View File

@@ -1,9 +0,0 @@
diff -urN agg-2.5/Makefile.am agg-2.5-haiku/Makefile.am
--- agg-2.5/Makefile.am 2006-10-09 04:06:36.031719424 +0000
+++ agg-2.5-haiku/Makefile.am 2011-01-05 16:03:11.000000000 +0000
@@ -1,4 +1,4 @@
-SUBDIRS = gpc src font_freetype font_win32_tt include examples
+SUBDIRS = gpc src font_freetype font_win32_tt include
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libagg.pc

View File

@@ -0,0 +1,239 @@
From 7a5199ab842d8aa425590ffc5419ad3015abbc10 Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Thu, 24 Apr 2014 20:00:29 +0000
Subject: Haiku support
diff --git a/configure.in b/configure.in
index fceca82..d06dc7f 100644
--- a/configure.in
+++ b/configure.in
@@ -8,7 +8,7 @@ dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_ISC_POSIX
-AM_C_PROTOTYPES
+
if test "x$U" != "x"; then
AC_MSG_ERROR(Compiler not ANSI compliant)
fi
@@ -58,9 +58,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]),
@@ -154,7 +163,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
diff --git a/src/platform/BeOS/Makefile.am b/src/platform/BeOS/Makefile.am
index 474153c..2095717 100644
--- a/src/platform/BeOS/Makefile.am
+++ b/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/src/platform/Makefile.am b/src/platform/Makefile.am
index ebe5e7e..c6622bc 100644
--- a/src/platform/Makefile.am
+++ b/src/platform/Makefile.am
@@ -1 +1 @@
-SUBDIRS = X11 sdl win32 AmigaOS BeOS mac
+SUBDIRS = X11 sdl win32 AmigaOS Haiku mac
--
1.8.3.4
From 6aadf8ccb0db0ba33c33220ed9c70d078163ee02 Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Fri, 25 Apr 2014 12:52:34 +0000
Subject: fix unsigned integer overflows
diff --git a/include/agg_array.h b/include/agg_array.h
index 5c6d390..c25947a 100644
--- a/include/agg_array.h
+++ b/include/agg_array.h
@@ -366,9 +366,10 @@ namespace agg
void add_array(const T* ptr, unsigned num_elem)
{
- while(num_elem--)
+ while(num_elem > 0)
{
add(*ptr++);
+ --num_elem;
}
}
@@ -526,10 +527,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<T>::deallocate(*blk, block_size);
--blk;
+ --m_num_blocks;
}
}
pod_allocator<T*>::deallocate(m_blocks, m_max_blocks);
@@ -802,10 +804,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<int8u>::deallocate(blk->data, blk->size);
--blk;
+ --m_num_blocks;
}
pod_allocator<block_type>::deallocate(m_blocks, m_max_blocks);
}
diff --git a/include/agg_pixfmt_rgba.h b/include/agg_pixfmt_rgba.h
index 79d10dc..73937d0 100644
--- a/include/agg_pixfmt_rgba.h
+++ b/include/agg_pixfmt_rgba.h
@@ -703,9 +703,9 @@ namespace agg
}
if(sa)
{
- calc_type dr = p[Order::R] - sr;
- calc_type dg = p[Order::G] - sg;
- calc_type db = p[Order::B] - sb;
+ calc_type dr = (sr > p[Order::R]) ? 0 : p[Order::R] - sr;
+ calc_type dg = (sg > p[Order::G]) ? 0 : p[Order::G] - sg;
+ calc_type db = (sb > p[Order::B]) ? 0 : p[Order::B] - sb;
p[Order::R] = (dr > base_mask) ? 0 : dr;
p[Order::G] = (dg > base_mask) ? 0 : dg;
p[Order::B] = (db > base_mask) ? 0 : db;
diff --git a/include/agg_rasterizer_cells_aa.h b/include/agg_rasterizer_cells_aa.h
index d3bb138..6aa3852 100644
--- a/include/agg_rasterizer_cells_aa.h
+++ b/include/agg_rasterizer_cells_aa.h
@@ -140,10 +140,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<cell_type>::deallocate(*ptr, cell_block_size);
ptr--;
+ --m_num_blocks;
}
pod_allocator<cell_type*>::deallocate(m_cells, m_max_blocks);
}
@@ -666,23 +667,26 @@ namespace agg
cell_type* cell_ptr;
unsigned nb = m_num_cells >> cell_block_shift;
unsigned i;
- while(nb--)
+ while(nb > 0)
{
cell_ptr = *block_ptr++;
i = cell_block_size;
- while(i--)
+ while(i > 0)
{
m_sorted_y[cell_ptr->y - m_min_y].start++;
++cell_ptr;
+ --i;
}
+ --nb;
}
cell_ptr = *block_ptr++;
i = m_num_cells & cell_block_mask;
- while(i--)
+ while(i > 0)
{
m_sorted_y[cell_ptr->y - m_min_y].start++;
++cell_ptr;
+ --i;
}
// Convert the Y-histogram into the array of starting indexes
@@ -697,27 +701,30 @@ namespace agg
// Fill the cell pointer array sorted by Y
block_ptr = m_cells;
nb = m_num_cells >> cell_block_shift;
- while(nb--)
+ while(nb > 0)
{
cell_ptr = *block_ptr++;
i = cell_block_size;
- 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;
}
+ --nb;
}
cell_ptr = *block_ptr++;
i = m_num_cells & cell_block_mask;
- 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;
}
// Finally arrange the X-arrays
diff --git a/include/agg_rendering_buffer.h b/include/agg_rendering_buffer.h
index 3a39caa..1fddb4e 100644
--- a/include/agg_rendering_buffer.h
+++ b/include/agg_rendering_buffer.h
@@ -191,10 +191,11 @@ namespace agg
T** rows = &m_rows[0];
- while(height--)
+ while(height > 0)
{
*rows++ = row_ptr;
row_ptr += stride;
+ --height;
}
}
--
1.8.3.4