diff options
author | alepulver <alepulver@FreeBSD.org> | 2006-05-31 09:51:05 +0800 |
---|---|---|
committer | alepulver <alepulver@FreeBSD.org> | 2006-05-31 09:51:05 +0800 |
commit | 2630d48525e01deda7c749a4b1e139a74ba22172 (patch) | |
tree | 5c7ebb6cd5580c13d2f3c91a0555e86a9712cbd7 /games | |
parent | 482f664a4787402d9ecd14657b30afa3917be1be (diff) | |
download | freebsd-ports-gnome-2630d48525e01deda7c749a4b1e139a74ba22172.tar.gz freebsd-ports-gnome-2630d48525e01deda7c749a4b1e139a74ba22172.tar.zst freebsd-ports-gnome-2630d48525e01deda7c749a4b1e139a74ba22172.zip |
- Fix building on non-i386 architectures.
- Avoid hacking the SConstruct file, pass information through the environment.
Diffstat (limited to 'games')
-rw-r--r-- | games/gtkradiant/Makefile | 9 | ||||
-rw-r--r-- | games/gtkradiant/files/patch-SConstruct | 77 | ||||
-rw-r--r-- | games/gtkradiant/pkg-plist | 6 |
3 files changed, 55 insertions, 37 deletions
diff --git a/games/gtkradiant/Makefile b/games/gtkradiant/Makefile index c458b278c578..1fb149a5ebfd 100644 --- a/games/gtkradiant/Makefile +++ b/games/gtkradiant/Makefile @@ -30,8 +30,10 @@ USE_GCC= 3.4+ USE_GNOME= gtk20 libxml2 USE_PYTHON_BUILD= yes -SUB_FILES= ${PORTNAME} +MAKE_ENV+= CC="${CC}" CXX="${CXX}" CCFLAGS="${CFLAGS}" BUILD=release \ + LINKFLAGS="${LDFLAGS}" PTHREAD_LIBS="${PTHREAD_LIBS}" \ +SUB_FILES= ${PORTNAME} DATADIR= ${PREFIX}/lib/${PORTNAME} .include <bsd.port.pre.mk> @@ -42,16 +44,13 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-patch-libs__bytestreamutils.h \ .endif post-patch: -.for f in CC CXX CFLAGS LOCALBASE PTHREAD_CFLAGS PTHREAD_LIBS X11BASE - @${REINPLACE_CMD} -i '' -e 's|%%${f}%%|${${f}}|g' ${WRKSRC}/SConstruct -.endfor @${REINPLACE_CMD} -e 's/-ldl//' ${WRKSRC}/SConscript @${GREP} -Rl 'defined[[:blank:]]*([[:blank:]]*__linux__[[:blank:]]*) || defined[[:blank:]]*([[:blank:]]*__APPLE__[[:blank:]]*)' ${WRKSRC} | \ ${XARGS} ${REINPLACE_CMD} -e \ 's/\(defined[[:blank:]]*([[:blank:]]*__linux__[[:blank:]]*) || defined[[:blank:]]*([[:blank:]]*__APPLE__[[:blank:]]*)\)/\1 || defined (__FreeBSD__)/' do-build: - cd ${WRKSRC} && scons && ${PYTHON_CMD} install.py + cd ${WRKSRC} && scons ${MAKE_ENV} && ${PYTHON_CMD} install.py ${CP} -R ${WRKDIR}/${PORTNAME}_gamepacks/* ${WRKSRC}/install do-install: diff --git a/games/gtkradiant/files/patch-SConstruct b/games/gtkradiant/files/patch-SConstruct index ace60750ecd9..8e8575e0600e 100644 --- a/games/gtkradiant/files/patch-SConstruct +++ b/games/gtkradiant/files/patch-SConstruct @@ -1,5 +1,5 @@ --- SConstruct.orig Fri Feb 10 19:01:20 2006 -+++ SConstruct Tue Feb 21 12:46:47 2006 ++++ SConstruct Tue May 30 22:35:47 2006 @@ -3,7 +3,6 @@ import commands, re, sys, os, pickle, string, popen2 @@ -8,54 +8,73 @@ # to access some internal stuff import SCons -@@ -85,10 +84,10 @@ +@@ -11,7 +10,7 @@ + conf_filename='site.conf' + # there is a default hardcoded value, you can override on command line, those are saved between runs + # we only handle strings +-serialized=['CC', 'CXX', 'JOBS', 'BUILD', 'SETUP'] ++serialized=['CC', 'CXX', 'CCFLAGS', 'CXXFLAGS', 'LINKFLAGS', 'PTHREAD_LIBS', 'LOCALBASE', 'X11BASE', 'JOBS', 'BUILD', 'SETUP'] - # default settings ------------------------------- + # help ------------------------------------------- --CC='gcc' --CXX='g++' -+CC='%%CC%%' -+CXX='%%CXX%%' - JOBS='1' --BUILD='debug' -+BUILD='release' - INSTALL='#install' - SETUP='0' - g_build_root = 'build' -@@ -172,9 +171,9 @@ +@@ -64,14 +63,7 @@ + # TODO: detect Darwin / OSX + + # CPU type +-g_cpu = commands.getoutput('uname -m') +-exp = re.compile('.*i?86.*') +-if (g_cpu == 'Power Macintosh' or g_cpu == 'ppc'): +- g_cpu = 'ppc' +-elif exp.match(g_cpu): +- g_cpu = 'x86' +-else: +- g_cpu = 'cpu' ++g_cpu = 'cpu' + + # OS + OS = commands.getoutput('uname') +@@ -172,8 +164,8 @@ # common flags warningFlags = '-W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter ' warningFlagsCXX = '-Wno-non-virtual-dtor -Wreorder ' # -Wold-style-cast -CCFLAGS = '' + warningFlags -CXXFLAGS = '-pipe -DQ_NO_STLPORT ' + warningFlags + warningFlagsCXX --CPPPATH = [] -+CCFLAGS = '%%CFLAGS%% ' -+CXXFLAGS = '%%CFLAGS%% -pipe -DQ_NO_STLPORT ' -+CPPPATH = ['%%LOCALBASE%%/include', '%%X11BASE%%/include'] ++CCFLAGS += ' ' ++CXXFLAGS += ' -pipe -DQ_NO_STLPORT ' + CPPPATH = [] if (BUILD == 'debug'): CXXFLAGS += '-g -D_DEBUG ' - CCFLAGS += '-g -D_DEBUG ' -@@ -190,7 +189,7 @@ +@@ -190,7 +182,6 @@ print 'Unknown build configuration ' + BUILD sys.exit( 0 ) -LINKFLAGS = '' -+LINKFLAGS = '-L%%LOCALBASE%%/lib -L%%X11BASE%%/lib ' if ( OS == 'Linux' ): # static -@@ -270,7 +269,9 @@ +@@ -218,6 +209,12 @@ + CPPPATH.append('/sw/include') + CPPPATH.append('/usr/X11R6/include') + LINKFLAGS += '-L/sw/lib -L/usr/lib -L/usr/X11R6/lib ' ++elif ( OS == 'FreeBSD' ): ++ CCFLAGS += '-fPIC ' ++ CXXFLAGS += '-fPIC ' ++ CPPPATH.append(LOCALBASE + '/include') ++ CPPPATH.append(X11BASE + '/include') ++ LINKFLAGS += '-L' + LOCALBASE + '/lib ' + '-L' + X11BASE + '/lib ' + + CPPPATH.append('libs') + +@@ -269,6 +266,8 @@ + def usePThread(self): if ( OS == 'Darwin' ): self['LINKFLAGS'] += '-lpthread -Wl,-stack_size,0x400000 ' ++ elif ( OS == 'FreeBSD' ): ++ self['LINKFLAGS'] += PTHREAD_LIBS else: -- self['LINKFLAGS'] += '-lpthread ' -+ self['CCFLAGS'] += '%%PTHREAD_CFLAGS%% ' -+ self['CXXFLAGS'] += '%%PTHREAD_CFLAGS%% ' -+ self['LINKFLAGS'] += '%%PTHREAD_LIBS%% ' + self['LINKFLAGS'] += '-lpthread ' - def CheckLDD(self, target, source, env): - file = target[0] -@@ -278,7 +279,7 @@ +@@ -278,7 +277,7 @@ print('ERROR: CheckLDD: target %s not found\n' % target[0]) Exit(1) # not using os.popen3 as I want to check the return code diff --git a/games/gtkradiant/pkg-plist b/games/gtkradiant/pkg-plist index 30cde7ff801c..7f6a52639c6b 100644 --- a/games/gtkradiant/pkg-plist +++ b/games/gtkradiant/pkg-plist @@ -153,12 +153,12 @@ bin/gtkradiant %%DATADIR%%/q3bp.game/default_build_menu.xml %%DATADIR%%/q3bp.game/game.xlink %%DATADIR%%/q3data.qdt -%%DATADIR%%/q3data.x86 -%%DATADIR%%/q3map2.x86 +%%DATADIR%%/q3data.cpu +%%DATADIR%%/q3map2.cpu %%DATADIR%%/q4.game/default_build_menu.xml %%DATADIR%%/q4.game/q4base/default_shaderlist.txt %%DATADIR%%/qdata3 -%%DATADIR%%/radiant.x86 +%%DATADIR%%/radiant.cpu %%DATADIR%%/sof2.game/BehavEd.bhc %%DATADIR%%/sof2.game/ChangeLog.txt %%DATADIR%%/sof2.game/base/default_shaderlist.txt |