aboutsummaryrefslogtreecommitdiff
path: root/games/megaglest
diff options
context:
space:
mode:
authorJohn Marino <marino@FreeBSD.org>2015-04-13 07:06:08 +0000
committerJohn Marino <marino@FreeBSD.org>2015-04-13 07:06:08 +0000
commitad62adf9040c9b2856994fe950e1743b1b3d3355 (patch)
tree4d596923556a03b851bebe5352dabc70d8c8c87b /games/megaglest
parent2a61f4fbe1f982f9d493a18957cc605b541b4f36 (diff)
games/megaglest: Fix code to allow Clang to build it again
Not only was the previous commit unsavory, it didn't work due to conflict between libc++ and libstdc++. The added patch from miniz upstream fixes the breakage. Suggested by: jbeich
Notes
Notes: svn path=/head/; revision=383899
Diffstat (limited to 'games/megaglest')
-rw-r--r--games/megaglest/Makefile9
-rw-r--r--games/megaglest/files/patch-source_shared__lib_sources_miniz_miniz.c19
2 files changed, 22 insertions, 6 deletions
diff --git a/games/megaglest/Makefile b/games/megaglest/Makefile
index 065867b00f63..969811bd192f 100644
--- a/games/megaglest/Makefile
+++ b/games/megaglest/Makefile
@@ -3,7 +3,7 @@
PORTNAME= megaglest
PORTVERSION= 3.9.0.4
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= games
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}_3.9.0/
DISTNAME= ${PORTNAME}-source-${PORTVERSION}
@@ -23,11 +23,8 @@ RUN_DEPENDS= ${DATADIR}/tutorials/2_basic_tutorial/2_basic_tutorial.xml:${PORTSD
SUB_FILES= pkg-message
-# Clang catches a c++11 violation that older GCC misses, so until the
-# code is fixed, remove USES+=compiler:c++11-lib and set USE_GCC=yes
-USES= cmake display:build dos2unix lua openal:al,alut pkgconfig \
- tar:xz
-USE_GCC= yes
+USES= cmake compiler:c++11-lib display:build dos2unix lua \
+ openal:al,alut pkgconfig tar:xz
USE_GL= glew gl glu
USE_SDL= yes
USE_WX= 3.0
diff --git a/games/megaglest/files/patch-source_shared__lib_sources_miniz_miniz.c b/games/megaglest/files/patch-source_shared__lib_sources_miniz_miniz.c
new file mode 100644
index 000000000000..4f91feb21783
--- /dev/null
+++ b/games/megaglest/files/patch-source_shared__lib_sources_miniz_miniz.c
@@ -0,0 +1,19 @@
+--- source/shared_lib/sources/miniz/miniz.c.orig 2015-04-13 04:50:02 UTC
++++ source/shared_lib/sources/miniz/miniz.c
+@@ -2765,6 +2765,7 @@ mz_uint tdefl_create_comp_flags_from_zip
+ // http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/.
+ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out)
+ {
++ static const mz_uint8 chans[] = {0x00, 0x00, 0x04, 0x02, 0x06};
+ tdefl_compressor *pComp = (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor)); tdefl_output_buffer out_buf; int i, bpl = w * num_chans, y, z; mz_uint32 c; *pLen_out = 0;
+ if (!pComp) return NULL;
+ MZ_CLEAR_OBJ(out_buf); out_buf.m_expandable = MZ_TRUE; out_buf.m_capacity = 57+MZ_MAX(64, (1+bpl)*h); if (NULL == (out_buf.m_pBuf = (mz_uint8*)MZ_MALLOC(out_buf.m_capacity))) { MZ_FREE(pComp); return NULL; }
+@@ -2778,7 +2779,7 @@ void *tdefl_write_image_to_png_file_in_m
+ *pLen_out = out_buf.m_size-41;
+ {
+ mz_uint8 pnghdr[41]={0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,
+- 0,0,(mz_uint8)(w>>8),(mz_uint8)w,0,0,(mz_uint8)(h>>8),(mz_uint8)h,8,"\0\0\04\02\06"[num_chans],0,0,0,0,0,0,0,
++ 0,0,(mz_uint8)(w>>8),(mz_uint8)w,0,0,(mz_uint8)(h>>8),(mz_uint8)h,8,chans[num_chans],0,0,0,0,0,0,0,
+ (mz_uint8)(*pLen_out>>24),(mz_uint8)(*pLen_out>>16),(mz_uint8)(*pLen_out>>8),(mz_uint8)*pLen_out,0x49,0x44,0x41,0x54};
+ c=(mz_uint32)mz_crc32(MZ_CRC32_INIT,pnghdr+12,17); for (i=0; i<4; ++i, c<<=8) ((mz_uint8*)(pnghdr+29))[i]=(mz_uint8)(c>>24);
+ memcpy(out_buf.m_pBuf, pnghdr, 41);