Attempt to fix gcc builds on powerpc, that were broken by a boost upgrade.

Clang builds using -std=gnu++98 can use the STL headers in
/usr/include/c++/v1, but recent versions of the gcc headers forbid this.
As a fallback, OpenOffice tries to use the TR1 headers supplied by boost,
but recent versions of boost no longer have those headers.  In theory
the gcc TR1 headers should work, but I was not able to make those work.
Solve this problem by doing gcc builds using the "bundled" version of
boost which is much older rather that boost from ports.

Patch the "bundled" boost to fix the compiler feature detection logic
to get rid of a bunch of compiler warnings.

The headers in the ports version of vigra has some C++11 stuff that
gcc also complains about, so use the "bundled" version of vigra for
gcc builds as well.

The icu patch may only be needed for non-default values of LOCALBASE.

Comment out an unused method in basebmp/inc/basebmp/packedpixeliterator.hxx
that contains some broken code that causes gcc to error out.

Add a missing include to l10ntools/source/inireader.cxx to resolve
a compile error.

Add a missing include to scripting/source/protocolhandler/scripthandler.cxx
to resolve a compile error.

No PORTREVISION bump since amd64 and i386 builds should be unchanged.

Tested by:	Curtis Hamilton clhamilto AT gmail.com
This commit is contained in:
Don Lewis 2019-12-08 22:49:11 +00:00
parent 261a97c7e6
commit 12e233de82
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=519580
8 changed files with 121 additions and 9 deletions

View File

@ -7,7 +7,8 @@ PORTREVISION= 1
CATEGORIES= editors java
MASTER_SITES= APACHE/openoffice/${PORTVERSION}/source \
http://tools.openoffice.org/unowinreg_prebuild/680/:unoreg \
LOCAL/truckman/openoffice:extsrc
LOCAL/truckman/openoffice:extsrc \
SF/oooextras.mirror/:sf
.if defined(LANG_PKGNAME)
PKGNAMEPREFIX= ${LANG_PKGNAME}-
.endif
@ -54,14 +55,12 @@ BUILD_DEPENDS= \
${LOCALBASE}/bin/unzip:archivers/unzip \
zip:archivers/zip \
ant:devel/apache-ant \
${LOCALBASE}/include/boost/shared_ptr.hpp:devel/boost-libs \
dmake:devel/dmake \
epm:devel/epm \
${LOCALBASE}/bin/gperf:devel/gperf \
imake:devel/imake \
gpatch:devel/patch \
${LOCALBASE}/include/sane/sane.h:graphics/sane-backends \
${LOCALBASE}/bin/vigra-config:graphics/vigra \
${JAVALIBDIR}/commons-lang.jar:java/apache-commons-lang \
${JAVALIBDIR}/junit.jar:java/junit \
${JAVALIBDIR}/bsh.jar:lang/bsh \
@ -206,13 +205,26 @@ CONFIGURE_ARGS+= --enable-symbols
.include <${FILESDIR}/Makefile.localized>
GCC_EXTRA_DISTFILES= d6eef4b4cacb2183f2bf265a5a03a354-boost_1_55_0.tar.bz2 \
d62650a6f908e85643e557a236ea989c-vigra1.6.0.tar.gz
.if ${CHOSEN_COMPILER_TYPE} == clang
CPPFLAGS+= -I${LOCALBASE}/include
CONFIGURE_ARGS+= --with-system-boost --with-system-vigra
BUILD_DEPENDS+= ${LOCALBASE}/include/boost/shared_ptr.hpp:devel/boost-libs \
${LOCALBASE}/bin/vigra-config:graphics/vigra
. if ${ARCH} == amd64
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-align16
. endif
.endif
# These extra distfiles are needed to use the bundled versions of
# boost and vigra for compatiblity with gcc. Also include them
# for the makesum target so they are included in distinfo
.if ${CHOSEN_COMPILER_TYPE} == gcc || make(makesum) || make(distclean)
DISTFILES+= ${GCC_EXTRA_DISTFILES:C/.*/&:sf/g}
.endif
.if ${ARCH} == amd64
FREEBSD_ENV_SET= FreeBSDAMDEnv.Set.sh
PACKAGE_MIDDLE= ${PORTVERSION}_${OPSYS}_x86-64
@ -246,7 +258,6 @@ CONFIGURE_ARGS+= \
--with-system-apr-util \
--with-system-beanshell \
--with-beanshell-jar=${JAVALIBDIR}/bsh.jar \
--with-system-boost \
--enable-category-b \
--with-system-cairo --enable-cairo \
--with-system-coinmp \
@ -289,7 +300,6 @@ CONFIGURE_ARGS+= \
--with-vendor="FreeBSD ports system" \
--with-build-version="PKGNAME: ${PKGNAME:S/,/@/g}" \
--enable-verbose \
--with-system-vigra \
--with-system-xrender \
--with-system-zlib
@ -324,6 +334,11 @@ do-extract-SDK-on:
post-extract:
${TAR} -C ${WRKSUBDIR} -xzf ${DISTDIR}/${DIST_SUBDIR}/${EXTSRC}
.if ${CHOSEN_COMPILER_TYPE} == gcc
. for f in ${GCC_EXTRA_DISTFILES}
${CP} ${DISTDIR}/${DIST_SUBDIR}/${f} ${WRKSUBDIR}/ext_sources/${f}
. endfor
.endif
${CP} ${FILESDIR}/freebsd-aoo-intro.png \
${WRKSRC}/default_images/introabout/intro.png
${CP} ${FILESDIR}/freebsd-aoo-about.png \

View File

@ -1,7 +1,11 @@
TIMESTAMP = 1568248262
TIMESTAMP = 1572844235
SHA256 (openoffice/apache-openoffice-4.1.7-46059c9192-src.tar.bz2) = 512952c78b3ec22b15bc1a444b4fa7e7c76c25c985a75b6977e62c6ddae2e3ed
SIZE (openoffice/apache-openoffice-4.1.7-46059c9192-src.tar.bz2) = 220014716
SHA256 (openoffice/ApacheOpenOffice.ext_sources.4.x.x.20150707.tar.gz) = 966a8333c83a18ddd84401389006d6e0b52b8175924b808b54b88211669985fa
SIZE (openoffice/ApacheOpenOffice.ext_sources.4.x.x.20150707.tar.gz) = 28957004
SHA256 (openoffice/unowinreg.dll) = f563e522922133db9340b0306711c2d8767cc3481dd9e7d9b0d059906d12653c
SIZE (openoffice/unowinreg.dll) = 6144
SHA256 (openoffice/d6eef4b4cacb2183f2bf265a5a03a354-boost_1_55_0.tar.bz2) = fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52
SIZE (openoffice/d6eef4b4cacb2183f2bf265a5a03a354-boost_1_55_0.tar.bz2) = 58146647
SHA256 (openoffice/d62650a6f908e85643e557a236ea989c-vigra1.6.0.tar.gz) = 1f188ac03a8aa4663223eca8c82f91a55293d066d67127082e29a7dba1a98c9f
SIZE (openoffice/d62650a6f908e85643e557a236ea989c-vigra1.6.0.tar.gz) = 16525605

View File

@ -0,0 +1,20 @@
--- basebmp/inc/basebmp/packedpixeliterator.hxx.orig 2019-08-14 17:37:07 UTC
+++ basebmp/inc/basebmp/packedpixeliterator.hxx
@@ -606,14 +606,17 @@ template< typename Valuetype, (public)
>> get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder));
}
+/***** XXX - This appears to be unused and fails to compile with gcc9
value_type get(difference_type const & d) const
{
+// XXX - should x(d.x) be (x + dx)?
const int remainder( x(d.x) % num_intraword_positions );
return (unsigned_cast<value_type>(*current(d.x,d.y) &
get_mask<value_type, bits_per_pixel, MsbFirst>(remainder))
>> get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder));
}
+******/
void set( value_type v ) const
{

View File

@ -0,0 +1,39 @@
--- boost/boost_1_55_0.patch.orig 2019-08-14 17:37:07 UTC
+++ boost/boost_1_55_0.patch
@@ -162,3 +162,36 @@
}
////////////////////////////////////////////////////////////////////////
+diff -ur misc/boost_1_55_0/boost/config/compiler/gcc.hpp misc/build/boost_1_55_0/boost/config/compiler/gcc.hpp
+--- misc/boost_1_55_0/boost/config/compiler/gcc.hpp 2013-09-17 09:55:51.000000000 -0700
++++ misc/build/boost_1_55_0/boost/config/compiler/gcc.hpp
+@@ -137,14 +137,18 @@
+
+ // C++0x features in 4.3.n and later
+ //
+-#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
++#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (__cplusplus >= 201103L)
+ // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
+ // passed on the command line, which in turn defines
+ // __GXX_EXPERIMENTAL_CXX0X__.
+ # define BOOST_HAS_DECLTYPE
+ # define BOOST_HAS_RVALUE_REFS
+ # define BOOST_HAS_STATIC_ASSERT
+-# define BOOST_HAS_VARIADIC_TMPL
++# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))
++# define BOOST_HAS_VARIADIC_TMPL
++# else
++# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
++# endif
+ #else
+ # define BOOST_NO_CXX11_DECLTYPE
+ # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+@@ -153,7 +157,7 @@
+
+ // Variadic templates compiler:
+ // http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
+-# if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__))
++# if defined(__VARIADIC_TEMPLATES)
+ # define BOOST_HAS_VARIADIC_TMPL
+ # else
+ # define BOOST_NO_CXX11_VARIADIC_TEMPLATES

View File

@ -1,6 +1,6 @@
--- configure.in.orig 2015-10-09 07:11:14 UTC
--- configure.in.orig 2019-11-12 05:10:21 UTC
+++ configure.in
@@ -369,11 +369,11 @@ AC_ARG_WITH(bundled-extension-blobs,
@@ -367,11 +367,11 @@ AC_ARG_WITH(bundled-extension-blobs,
and comply with their distribution requirements by updating the
files LICENSE_aggregated and NOTICE_aggregated accordingly
],,)
@ -17,7 +17,7 @@
AC_ARG_ENABLE(bundled-dictionaries,
[ --enable-bundled-dictionaries Download dictionaries (spelling, hyphenation, thesaurus)
according to main/extensions.lst and bundle them. Make sure to
@@ -1540,9 +1540,9 @@ else
@@ -1538,9 +1538,9 @@ else
fi
AC_SUBST(BUNDLED_EXTENSION_BLOBS)

View File

@ -0,0 +1,14 @@
--- icu/makefile.mk.orig 2019-08-14 17:37:09 UTC
+++ icu/makefile.mk
@@ -85,6 +85,11 @@ LDFLAGSADD += -Wl,--hash-style=both
LDFLAGSADD += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
.ENDIF
+# FreeBSD with gcc from ports needs -Wl,-rpath= to find the matching libstdc++
+.IF "$(OS)"=="FREEBSD"
+LDFLAGSADD+=$(FBSD_GCC_RPATH)
+.ENDIF
+
CONFIGURE_DIR=source
CONFIGURE_ACTION+=sh -c 'CFLAGS="$(icu_CFLAGS)" CXXFLAGS="$(icu_CXXFLAGS)" LDFLAGS="$(icu_LDFLAGS) $(LDFLAGSADD)" ./configure --enable-layout --enable-static --enable-shared=yes $(DISABLE_64BIT)'

View File

@ -0,0 +1,10 @@
--- l10ntools/source/inireader.cxx.orig 2019-08-14 17:32:51 UTC
+++ l10ntools/source/inireader.cxx
@@ -21,6 +21,7 @@
#include <unicode/regex.h>
#include <unicode/unistr.h>
+#include <cstdlib>
#include <string>
#include <fstream>
#include <iostream>

View File

@ -0,0 +1,10 @@
--- scripting/source/protocolhandler/scripthandler.cxx.orig 2019-08-20 18:18:17 UTC
+++ scripting/source/protocolhandler/scripthandler.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
#include <com/sun/star/script/provider/ScriptFrameworkErrorType.hpp>
+#include <cstdio>
#include <rtl/uri.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/frame.hxx>