From owner-svn-ports-all@FreeBSD.ORG Sat Apr 18 16:29:03 2015 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 354DCB31; Sat, 18 Apr 2015 16:29:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 185181C7; Sat, 18 Apr 2015 16:29:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IGT2aY029688; Sat, 18 Apr 2015 16:29:02 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IGT1eP029667; Sat, 18 Apr 2015 16:29:01 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201504181629.t3IGT1eP029667@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Sat, 18 Apr 2015 16:29:01 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r384239 - in head/games/gtkradiant: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 16:29:03 -0000 Author: danfe Date: Sat Apr 18 16:29:01 2015 New Revision: 384239 URL: https://svnweb.freebsd.org/changeset/ports/384239 Log: - 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 Added: head/games/gtkradiant/files/patch-radiant_treemodel.cpp (contents, props changed) Modified: head/games/gtkradiant/Makefile head/games/gtkradiant/files/patch-SConstruct head/games/gtkradiant/files/patch-makeversion.py head/games/gtkradiant/files/patch-tools__quake3__q3map2__image.c Modified: head/games/gtkradiant/Makefile ============================================================================== --- head/games/gtkradiant/Makefile Sat Apr 18 16:12:48 2015 (r384238) +++ head/games/gtkradiant/Makefile Sat Apr 18 16:29:01 2015 (r384239) @@ -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 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 Modified: head/games/gtkradiant/files/patch-SConstruct ============================================================================== --- head/games/gtkradiant/files/patch-SConstruct Sat Apr 18 16:12:48 2015 (r384238) +++ head/games/gtkradiant/files/patch-SConstruct Sat Apr 18 16:29:01 2015 (r384239) @@ -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 ---------------------- + Modified: head/games/gtkradiant/files/patch-makeversion.py ============================================================================== --- head/games/gtkradiant/files/patch-makeversion.py Sat Apr 18 16:12:48 2015 (r384238) +++ head/games/gtkradiant/files/patch-makeversion.py Sat Apr 18 16:29:01 2015 (r384239) @@ -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 Added: head/games/gtkradiant/files/patch-radiant_treemodel.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/gtkradiant/files/patch-radiant_treemodel.cpp Sat Apr 18 16:29:01 2015 (r384239) @@ -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) Modified: head/games/gtkradiant/files/patch-tools__quake3__q3map2__image.c ============================================================================== --- head/games/gtkradiant/files/patch-tools__quake3__q3map2__image.c Sat Apr 18 16:12:48 2015 (r384238) +++ head/games/gtkradiant/files/patch-tools__quake3__q3map2__image.c Sat Apr 18 16:29:01 2015 (r384239) @@ -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 ) )