diff options
author | danfe <danfe@FreeBSD.org> | 2015-04-19 00:29:01 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2015-04-19 00:29:01 +0800 |
commit | 2b7981cf5d9ffec9417f63a27024f188f71453d8 (patch) | |
tree | 0b6a97220ec7ac4851459f66ced5536edb373efa /games | |
parent | e7b63522dfa732def78071d33d78816d175b4f5a (diff) | |
download | freebsd-ports-gnome-2b7981cf5d9ffec9417f63a27024f188f71453d8.tar.gz freebsd-ports-gnome-2b7981cf5d9ffec9417f63a27024f188f71453d8.tar.zst freebsd-ports-gnome-2b7981cf5d9ffec9417f63a27024f188f71453d8.zip |
- Fix the build against modern libpng (do not try to access private data)
- Clang insists that reference cannot be bound to dereferenced null pointer
in well-defined C++ code (that is correct) and evaluates comparisons like
&foo == 0 to false, which breaks GtkRadiant; "fix" this with a dirty hack
by casting those "bad" references to a local volatile int variable
- Remove no longer required and no-op -lpthread vs. -pthread patch hunk
- Report operating system and correct compiler version in the About dialog
- When fixing annoying "GtkSpinButton: setting an adjustment with non-zero
page size is deprecated" warnings, replace find(1) with grep(1) to narrow
down initial search results and, subsequently, sed(1) furiousness
- Omit port revision bump as the port was BROKEN for quite some time
Diffstat (limited to 'games')
-rw-r--r-- | games/gtkradiant/Makefile | 10 | ||||
-rw-r--r-- | games/gtkradiant/files/patch-SConstruct | 24 | ||||
-rw-r--r-- | games/gtkradiant/files/patch-makeversion.py | 16 | ||||
-rw-r--r-- | games/gtkradiant/files/patch-radiant_treemodel.cpp | 39 | ||||
-rw-r--r-- | games/gtkradiant/files/patch-tools__quake3__q3map2__image.c | 15 |
5 files changed, 72 insertions, 32 deletions
diff --git a/games/gtkradiant/Makefile b/games/gtkradiant/Makefile index 8f421de4f80d..0f0c77d240af 100644 --- a/games/gtkradiant/Makefile +++ b/games/gtkradiant/Makefile @@ -5,7 +5,7 @@ PORTNAME= gtkradiant PORTVERSION= 1.5.0 PORTREVISION= 13 CATEGORIES= games cad -MASTER_SITES= ${MASTER_SITE_IDSOFTWARE:S|$|source/:id|} \ +MASTER_SITES= IDSOFTWARE/source/:id \ http://www.bsd-geek.de/FreeBSD/distfiles/:fb DISTNAME= GtkRadiant-GPL DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:id \ @@ -16,16 +16,14 @@ COMMENT= Map editor for FPS games, by id Software and Loki Software LICENSE= GPLv2 -BROKEN= Does not support modern png - LIB_DEPENDS= libgtkglext-x11-1.0.so:${PORTSDIR}/x11-toolkits/gtkglext \ libmhash.so:${PORTSDIR}/security/mhash \ libpng.so:${PORTSDIR}/graphics/png -SSP_UNSAFE= yes USES= pkgconfig python:build scons zip USE_GNOME= gtk20 libxml2 MAKE_ARGS= ${MAKE_ENV} BUILD=release +SSP_UNSAFE= yes DATADIR= ${PREFIX}/lib/${PORTNAME} WRKSRC= ${WRKDIR}/GPL/GtkRadiant @@ -56,8 +54,8 @@ post-patch: ${WRKSRC}/plugins/mapq3/parse.h # Fix warnings of "GtkSpinButton: setting an adjustment with non-zero # page size is deprecated" (very annoying) - @${FIND} ${WRKSRC} -name '*.cpp' | ${XARGS} ${REINPLACE_CMD} \ - -E 's|(gtk_adjustment_new[^)]*,)[^)]*|\1 0|' + @${GREP} -Rl --null gtk_adjustment_new ${WRKSRC} | ${XARGS} -0 \ + ${REINPLACE_CMD} -E 's|(gtk_adjustment_new[^)]*,)[^)]*|\1 0|' pre-install: cd ${WRKSRC} && ${PYTHON_CMD} install.py diff --git a/games/gtkradiant/files/patch-SConstruct b/games/gtkradiant/files/patch-SConstruct index c85919527dcc..64c22e9411c4 100644 --- a/games/gtkradiant/files/patch-SConstruct +++ b/games/gtkradiant/files/patch-SConstruct @@ -73,15 +73,6 @@ def useGtkGLExt(self): self['CXXFLAGS'] += '`pkg-config gtkglext-1.0 --cflags` ' -@@ -269,6 +265,8 @@ - def usePThread(self): - if ( OS == 'Darwin' ): - self['LINKFLAGS'] += '-lpthread -Wl,-stack_size,0x400000 ' -+ elif ( OS == 'FreeBSD' ): -+ self['LINKFLAGS'] += '-pthread ' - else: - self['LINKFLAGS'] += '-lpthread ' - @@ -278,7 +276,7 @@ print('ERROR: CheckLDD: target %s not found\n' % target[0]) Exit(1) @@ -91,3 +82,18 @@ stdout_lines = ldd.fromchild.readlines() stderr_lines = ldd.childerr.readlines() ldd_ret = ldd.wait() +@@ -317,7 +313,13 @@ + # export the globals + GLOBALS = 'g_env INSTALL SETUP g_cpu' + +-radiant_makeversion('\\ngcc version: %s.%s.%s' % ( ver_cc[0], ver_cc[1], ver_cc[2] ) ) ++def get_compiler_info(cxx): ++ ret = commands.getstatusoutput('%s -v' % cxx) ++ if (ret[0] != 0): return None ++ info = re.search('(gcc|clang) version [0-9.]+', ret[1]) ++ return info.group(0) if info else None ++ ++radiant_makeversion('\\n%s' % get_compiler_info(CXX)) + + # end general configuration ---------------------- + diff --git a/games/gtkradiant/files/patch-makeversion.py b/games/gtkradiant/files/patch-makeversion.py index 1b23145d7418..371c1f05da2f 100644 --- a/games/gtkradiant/files/patch-makeversion.py +++ b/games/gtkradiant/files/patch-makeversion.py @@ -1,20 +1,22 @@ --- ./makeversion.py.orig Sun Feb 12 16:47:01 2006 +++ ./makeversion.py Thu Mar 16 16:09:46 2006 -@@ -39,8 +39,6 @@ +@@ -37,9 +37,7 @@ + # ouput: + # include/aboutmsg.h - import sys, re, string, os - --import svn +-import sys, re, string, os - +-import svn ++import sys, re, string, os, platform + def get_version(): # version - f = open('include/version.default', 'r') -@@ -82,7 +80,7 @@ def radiant_makeversion(append_about): +@@ -82,7 +80,7 @@ line = f.readline() f.close() else: - line = "Custom build based on revision " + str(svn.getRevision(os.getcwd())) -+ line = "Custom build based on revision 1.0" ++ line = "Custom build for %s (%s)" % (platform.system(), platform.machine()) # optional additional message if ( not append_about is None ): line += append_about diff --git a/games/gtkradiant/files/patch-radiant_treemodel.cpp b/games/gtkradiant/files/patch-radiant_treemodel.cpp new file mode 100644 index 000000000000..bffe327ae1af --- /dev/null +++ b/games/gtkradiant/files/patch-radiant_treemodel.cpp @@ -0,0 +1,39 @@ +--- radiant/treemodel.cpp.orig 2006-02-10 22:01:20 UTC ++++ radiant/treemodel.cpp +@@ -1243,7 +1243,13 @@ const char* node_get_name(scene::Node& n + + const char* node_get_name_safe(scene::Node& node) + { +- if(&node == 0) ++ // Reference cannot be bound to dereferenced null pointer in well-defined ++ // C++ code, and Clang will assume that comparison below always evaluates ++ // to false, resulting in segmentation fault. Use a dirty hack to insist ++ // that Clang checks it for null. ++ volatile int n = (int)&node; ++ ++ if(n == 0) + { + return ""; + } +@@ -1264,7 +1270,9 @@ GraphTreeNode* graph_tree_model_find_par + + void node_attach_name_changed_callback(scene::Node& node, const NameCallback& callback) + { +- if(&node != 0) ++ volatile int n = (int)&node; // see the comment on line 1246 ++ ++ if(n != 0) + { + Nameable* nameable = Node_getNameable(node); + if(nameable != 0) +@@ -1275,7 +1283,9 @@ void node_attach_name_changed_callback(s + } + void node_detach_name_changed_callback(scene::Node& node, const NameCallback& callback) + { +- if(&node != 0) ++ volatile int n = (int)&node; // see the comment on line 1246 ++ ++ if(n != 0) + { + Nameable* nameable = Node_getNameable(node); + if(nameable != 0) diff --git a/games/gtkradiant/files/patch-tools__quake3__q3map2__image.c b/games/gtkradiant/files/patch-tools__quake3__q3map2__image.c index 4b5d3d74507f..81d2860f45a1 100644 --- a/games/gtkradiant/files/patch-tools__quake3__q3map2__image.c +++ b/games/gtkradiant/files/patch-tools__quake3__q3map2__image.c @@ -1,15 +1,10 @@ --- tools/quake3/q3map2/image.c.orig 2006-02-10 23:01:20.000000000 +0100 +++ tools/quake3/q3map2/image.c 2012-05-26 20:56:51.000000000 +0200 -@@ -35,6 +35,7 @@ - - /* dependencies */ - #include "q3map2.h" -+#include "pngpriv.h" - - - -@@ -180,7 +181,7 @@ - png->io_ptr = &pb; /* hack! */ +@@ -177,10 +177,9 @@ static void LoadPNGBuffer( byte *buffer, + pb.size = size; + pb.offset = 0; + png_set_read_fn( png, &pb, PNGReadData ); +- png->io_ptr = &pb; /* hack! */ /* set error longjmp */ - if( setjmp( png->jmpbuf ) ) |