svn commit: r476312 - in head/games/freeorion: . files
Jan Beich
jbeich at FreeBSD.org
Fri Aug 3 17:36:24 UTC 2018
Author: jbeich
Date: Fri Aug 3 17:36:22 2018
New Revision: 476312
URL: https://svnweb.freebsd.org/changeset/ports/476312
Log:
games/freeorion: unbreak with boost 1.68
In file included from GG/src/GUI.cpp:44:
GG/src/gilext/io/png_io.hpp:39:10: fatal error: 'boost/gil/extension/io/io_error.hpp' file not found
#include <boost/gil/extension/io/io_error.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GG/src/gilext/io/png_io_private.hpp:46:37: error: use of undeclared identifier 'bits8'
template <> struct png_is_supported<bits8,gray_t> {BOOST_STATIC_CONSTANT(bool,value=true);};
^
In file included from GG/src/Texture.cpp:39:
GG/src/gilext/io/png_dynamic_io.hpp:37:10: fatal error: 'boost/gil/extension/io/dynamic_io.hpp' file not found
#include <boost/gil/extension/io/dynamic_io.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from GG/src/gilext/io/png_dynamic_io.hpp:43:
In file included from GG/src/gilext/io/png_io.hpp:38:
In file included from GG/src/gilext/io/png_io_private.hpp:30:
GG/src/gilext/io/../typedefs.hpp:30:40: error: too few arguments provided to function-like macro invocation
GIL_DEFINE_BASE_TYPEDEFS(8, gray_alpha)
^
/usr/local/include/boost/gil/typedefs.hpp:86:9: note: macro 'GIL_DEFINE_BASE_TYPEDEFS' defined here
#define GIL_DEFINE_BASE_TYPEDEFS(B, CM, CS) \
^
In file included from GG/src/GUI.cpp:44:
In file included from GG/src/gilext/io/png_io.hpp:40:
GG/src/gilext/io/png_io_private.hpp:167:27: error: expected class name
class png_reader : public file_mgr {
^
PR: 229699
Obtained from: upstream
Approved by: maintainer timeout (2 weeks)
Added:
head/games/freeorion/files/patch-boost168 (contents, props changed)
Modified:
head/games/freeorion/Makefile (contents, props changed)
Modified: head/games/freeorion/Makefile
==============================================================================
--- head/games/freeorion/Makefile Fri Aug 3 17:13:49 2018 (r476311)
+++ head/games/freeorion/Makefile Fri Aug 3 17:36:22 2018 (r476312)
@@ -4,6 +4,7 @@
PORTNAME= freeorion
DISTVERSIONPREFIX= v
DISTVERSION= 0.4.8-rc1
+PORTREVISION= 1
CATEGORIES= games
MAINTAINER= amdmi3 at FreeBSD.org
Added: head/games/freeorion/files/patch-boost168
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/freeorion/files/patch-boost168 Fri Aug 3 17:36:22 2018 (r476312)
@@ -0,0 +1,168 @@
+https://github.com/freeorion/freeorion/pull/2221
+
+--- GG/CMakeLists.txt.orig 2018-06-14 14:12:09 UTC
++++ GG/CMakeLists.txt
+@@ -144,6 +144,16 @@ if(USE_STATIC_LIBS)
+ )
+ endif()
+
++target_compile_definitions(GiGi
++ PRIVATE
++
++ # Starting with boost 1.68 boost::gil integrates support for
++ # grayscale-alpha png images, so prefer their implementation
++ # instead of our hacky gilext code.
++ $<$<VERSION_LESS:${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION},1.68>:GIGI_CONFIG_USE_OLD_IMPLEMENTATION_OF_GIL_PNG_IO>
++ $<$<VERSION_GREATER:${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION},1.67>:BOOST_GIL_IO_ENABLE_GRAY_ALPHA>
++)
++
+ target_include_directories(GiGi SYSTEM
+ PRIVATE
+ ${Boost_INCLUDE_DIRS}
+--- GG/src/GUI.cpp.orig 2018-06-14 14:12:09 UTC
++++ GG/src/GUI.cpp
+@@ -37,14 +37,19 @@
+ #include <GG/ZList.h>
+
+ #if GG_HAVE_LIBPNG
+-# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
+-# pragma GCC diagnostic push
+-# pragma GCC diagnostic ignored "-Wunused-local-typedefs"
++# if GIGI_CONFIG_USE_OLD_IMPLEMENTATION_OF_GIL_PNG_IO
++# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wunused-local-typedefs"
++# endif
++# include "gilext/io/png_io.hpp"
++# include "gilext/io/png_io_v2_compat.hpp"
++# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
++# pragma GCC diagnostic pop
++# endif
++# else
++# include <boost/gil/extension/io/png.hpp>
+ # endif
+-# include "gilext/io/png_io.hpp"
+-# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
+-# pragma GCC diagnostic pop
+-# endif
+ #endif
+
+ #include <boost/algorithm/string/predicate.hpp>
+@@ -132,12 +137,15 @@ namespace {
+ glPopClientAttrib();
+
+ using namespace boost::gil;
+- png_write_view(filename,
+- flipped_up_down_view(
+- interleaved_view(Value(size.x),
+- Value(size.y),
+- static_cast<rgba8_pixel_t*>(static_cast<void*>(&bytes[0])),
+- Value(size.x) * sizeof(rgba8_pixel_t))));
++ write_view(
++ filename,
++ flipped_up_down_view(
++ interleaved_view(
++ Value(size.x),
++ Value(size.y),
++ static_cast<rgba8_pixel_t*>(static_cast<void*>(&bytes[0])),
++ Value(size.x) * sizeof(rgba8_pixel_t))),
++ png_tag());
+ #endif
+ }
+ }
+--- GG/src/Texture.cpp.orig 2018-06-14 14:12:09 UTC
++++ GG/src/Texture.cpp
+@@ -36,7 +36,12 @@
+ #include <boost/algorithm/string/case_conv.hpp>
+
+ #if GG_HAVE_LIBPNG
+-# include "gilext/io/png_dynamic_io.hpp"
++# if GIGI_CONFIG_USE_OLD_IMPLEMENTATION_OF_GIL_PNG_IO
++# include "gilext/io/png_dynamic_io.hpp"
++# include "gilext/io/png_io_v2_compat.hpp"
++# else
++# include <boost/gil/extension/io/png.hpp>
++# endif
+ #endif
+
+ #include <iostream>
+@@ -241,12 +246,12 @@ void Texture::Load(const boost::filesystem::path& path
+ // formats above.
+ #if GG_HAVE_LIBPNG
+ if (extension == ".png")
+- gil::png_read_image(path, image);
++ gil::read_image(filename, image, gil::image_read_settings<gil::png_tag>());
+ else
+ #endif
+ #if GG_HAVE_LIBTIFF
+ if (extension == ".tif" || extension == ".tiff")
+- gil::tiff_read_image(filename, image);
++ gil::read_image(filename, image, gil::image_read_settings<gil::tiff_tag>());
+ else
+ #endif
+ throw BadFile("Texture file \"" + filename + "\" does not have a supported file extension");
+@@ -256,14 +261,14 @@ void Texture::Load(const boost::filesystem::path& path
+ #if GG_HAVE_LIBPNG
+ if (extension == ".png") {
+ gil::rgba8_image_t rgba_image;
+- gil::png_read_and_convert_image(path, rgba_image);
++ gil::read_and_convert_image(filename, rgba_image, gil::image_read_settings<gil::png_tag>());
+ image.move_in(rgba_image);
+ }
+ #endif
+ #if GG_HAVE_LIBTIFF
+ if (extension == ".tif" || extension == ".tiff") {
+ gil::rgba8_image_t rgba_image;
+- gil::tiff_read_and_convert_image(filename, rgba_image);
++ gil::read_and_convert_image(filename, rgba_image, gil::image_read_settings<gil::tiff_tag>());
+ image.move_in(rgba_image);
+ }
+ #endif
+--- GG/src/gilext/io/png_io_v2_compat.hpp.orig 2018-07-20 13:44:48 UTC
++++ GG/src/gilext/io/png_io_v2_compat.hpp
+@@ -0,0 +1,45 @@
++#ifndef GILEXT_PNG_IO_V2_COMPAT_H
++#define GILEXT_PNG_IO_V2_COMPAT_H
++
++namespace boost { namespace gil {
++
++struct png_tag {};
++
++template< typename Tag>
++struct image_read_settings {};
++
++template< typename String
++ , typename Image
++ , typename FormatTag
++ >
++inline
++void read_image( const String& file_name
++ , Image& image
++ , const FormatTag& tag
++ )
++{ boost::gil::png_read_image(file_name, image); }
++
++template< typename String
++ , typename Image
++ , typename FormatTag
++ >
++inline
++void read_and_convert_image( const String& file_name
++ , Image& image
++ , const FormatTag& tag
++ )
++{ boost::gil::png_read_and_convert_image(file_name, image); }
++} }
++
++template< typename String
++ , typename View
++ , typename FormatTag
++ >
++inline
++void write_view( const String& file_name
++ , const View& view
++ , const FormatTag& tag
++ )
++{ boost::gil::png_write_view( file_name, view); }
++
++#endif
More information about the svn-ports-all
mailing list