Index: head/astro/xplanet/Makefile =================================================================== --- head/astro/xplanet/Makefile (revision 459624) +++ head/astro/xplanet/Makefile (revision 459625) @@ -1,42 +1,42 @@ # Created by: darius@dons.net.au # $FreeBSD$ PORTNAME= xplanet PORTVERSION= 1.3.0 -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= astro geography MASTER_SITES= SF MAINTAINER= novel@FreeBSD.org COMMENT= Draw pictures of the earth textured by an image GNU_CONFIGURE= yes USES= iconv localbase USE_XORG= xt xscrnsaver CONFIGURE_ARGS= --with-map-extension=jpg CPPFLAGS+= -I${LOCALBASE}/include/netpbm LIBS+= -lm OPTIONS_DEFINE= FREETYPE PANGO GIF JPEG PNG PNM TIFF OPTIONS_DEFAULT= FREETYPE PANGO GIF JPEG PNG PNM TIFF FREETYPE_CONFIGURE_WITH= --with-freetype FREETYPE_LIB_DEPENDS= libfreetype.so:print/freetype2 PANGO_CONFIGURE_WITH= pango PANGO_USE= GNOME=pango GIF_CONFIGURE_WITH= gif GIF_LIB_DEPENDS= libgif.so:graphics/giflib JPEG_CONFIGURE_WITH= jpeg JPEG_USES= jpeg PNG_CONFIGURE_WITH= png PNG_LIB_DEPENDS+= libpng.so:graphics/png PNM_CONFIGURE_WITH= pnm PNM_LIB_DEPENDS= libnetpbm.so:graphics/netpbm TIFF_CONFIGURE_WITH= tiff TIFF_LIB_DEPENDS= libtiff.so:graphics/tiff post-extract: @${REINPLACE_CMD} -e "s/default/default.sample/g" ${WRKSRC}/Makefile.in @${MV} ${WRKSRC}/xplanet/config/default ${WRKSRC}/xplanet/config/default.sample .include Index: head/astro/xplanet/files/patch-src_readConfig.cpp =================================================================== --- head/astro/xplanet/files/patch-src_readConfig.cpp (revision 459624) +++ head/astro/xplanet/files/patch-src_readConfig.cpp (revision 459625) @@ -1,10 +1,87 @@ ---- src/readConfig.cpp.orig 2012-03-03 03:20:05 UTC +The later chunks (using i2b) are compile fixes on aarch64 (presumably with +clang6 as well). Typical error message reads + + readConfig.cpp:407:54: error: non-constant-expression cannot be narrowed + from type 'int' to 'unsigned char' in initializer list [-Wc++11-narrowing] + unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; + ^~~~~~~~ + readConfig.cpp:407:54: note: insert an explicit cast to silence this issue + unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; + ^~~~~~~~ + static_cast( ) + +Since it happens in a half-dozen places, introduce a trivial helper function. + +--- src/readConfig.cpp.orig 2018-01-21 16:58:09 UTC +++ src/readConfig.cpp @@ -4,6 +4,7 @@ #include #include #include +#include using namespace std; #include "body.h" +@@ -20,6 +21,8 @@ using namespace std; + static PlanetProperties *defaultProperties; + static PlanetProperties *currentProperties; + ++static inline unsigned char i2b( int x ) { return static_cast(x) & 0xffU; } ++ + static void + readConfig(const char *line, PlanetProperties *planetProperties[]) + { +@@ -49,7 +52,7 @@ readConfig(const char *line, PlanetPrope + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->ArcColor(color); + } + else +@@ -179,7 +182,7 @@ readConfig(const char *line, PlanetPrope + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->Color(color); + } + else +@@ -244,7 +247,7 @@ readConfig(const char *line, PlanetPrope + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->GridColor(color); + } + else +@@ -296,7 +299,7 @@ readConfig(const char *line, PlanetPrope + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->MarkerColor(color); + } + else +@@ -403,7 +406,7 @@ readConfig(const char *line, PlanetPrope + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->OrbitColor(color); + } + else +@@ -473,7 +476,7 @@ readConfig(const char *line, PlanetPrope + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->TextColor(color); + } + else