aboutsummaryrefslogtreecommitdiff
path: root/games/gtkradiant/files
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2015-04-18 16:29:01 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2015-04-18 16:29:01 +0000
commitc3b4f43e44fc33956e72fa7cda281ab333a70084 (patch)
tree0b6a97220ec7ac4851459f66ced5536edb373efa /games/gtkradiant/files
parent2b04bc4791f57971ee34ae75e4ce6228f7d503ed (diff)
downloadports-c3b4f43e44fc33956e72fa7cda281ab333a70084.tar.gz
ports-c3b4f43e44fc33956e72fa7cda281ab333a70084.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
Notes
Notes: svn path=/head/; revision=384239
Diffstat (limited to 'games/gtkradiant/files')
-rw-r--r--games/gtkradiant/files/patch-SConstruct24
-rw-r--r--games/gtkradiant/files/patch-makeversion.py16
-rw-r--r--games/gtkradiant/files/patch-radiant_treemodel.cpp39
-rw-r--r--games/gtkradiant/files/patch-tools__quake3__q3map2__image.c15
4 files changed, 68 insertions, 26 deletions
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 ) )