ports/devel/jsoncpp/files/patch-SConstruct
Dimitry Andric 747850b808 With libc++ 8.0, which is in the projects/clang800-import branch, and
which will soon be merged to head, compilation of devel/jsoncpp fails
due to a conflict between the new C++ <version> header, and a local file
"version" which is produced by jsoncpp during its configure phase.

This is due to the initial test runner being compiled with "-I.", even
though it does not need any file from the port's working directory root.
Therefore, it seems to be easiest to comment out the line from the
SConstruct script that adds the "-I." option.

Approved by:	yuri (maintainer)
PR:		236061
MFH:		2019Q1
2019-02-26 19:08:42 +00:00

72 lines
2.9 KiB
Text

--- SConstruct.orig 2016-05-09 23:15:49 UTC
+++ SConstruct
@@ -26,7 +26,7 @@ try:
if platform == 'linux-gcc':
CXX = 'g++' # not quite right, but env is not yet available.
import commands
- version = commands.getoutput('%s -dumpversion' %CXX)
+ version = 'FreeBSD'
platform = 'linux-gcc-%s' %version
print "Using platform '%s'" %platform
LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '')
@@ -65,7 +65,7 @@ def make_environ_vars():
return vars
-env = Environment( ENV = make_environ_vars(),
+env = Environment( ENV = os.environ,
toolpath = ['scons-tools'],
tools=[] ) #, tools=['default'] )
@@ -121,6 +121,7 @@ elif platform.startswith('linux-gcc'):
env.Tool( 'default' )
env.Append( LIBS = ['pthread'], CCFLAGS = os.environ.get("CXXFLAGS", "-Wall"), LINKFLAGS=os.environ.get("LDFLAGS", "") )
env['SHARED_LIB_ENABLED'] = True
+ env['CXX'] = os.environ['CXX']
else:
print "UNSUPPORTED PLATFORM."
env.Exit(1)
@@ -147,6 +148,11 @@ env['JSONCPP_VERSION'] = JSONCPP_VERSION
env['BUILD_DIR'] = env.Dir(build_dir)
env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir)
env['DIST_DIR'] = DIST_DIR
+
+# Set SHLIBVERSION for env.InstallVersionedLib(). We use the version number
+# without the "-rcXX" part.
+env['SHLIBVERSION'] = JSONCPP_VERSION.partition('-')[0]
+
if 'TarGz' in env['BUILDERS']:
class SrcDistAdder:
def __init__( self, env ):
@@ -164,11 +170,11 @@ env['SRCDIST_ADD'] = SrcDistAdder( env )
env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] )
env_testing = env.Clone( )
-env_testing.Append( LIBS = ['json_${LIB_NAME_SUFFIX}'] )
+env_testing.Append( LIBS = ['jsoncpp'] )
def buildJSONExample( env, target_sources, target_name ):
env = env.Clone()
- env.Append( CPPPATH = ['#'] )
+ #env.Append( CPPPATH = ['#'] )
exe = env.Program( target=target_name,
source=target_sources )
env['SRCDIST_ADD']( source=[target_sources] )
@@ -187,14 +193,14 @@ def buildUnitTests( env, target_sources,
env.AlwaysBuild( check_alias_target )
def buildLibrary( env, target_sources, target_name ):
- static_lib = env.StaticLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
+ static_lib = env.StaticLibrary( target=target_name,
source=target_sources )
global lib_dir
env.Install( lib_dir, static_lib )
if env['SHARED_LIB_ENABLED']:
- shared_lib = env.SharedLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
+ shared_lib = env.SharedLibrary( target=target_name,
source=target_sources )
- env.Install( lib_dir, shared_lib )
+ env.InstallVersionedLib( lib_dir, shared_lib )
env['SRCDIST_ADD']( source=[target_sources] )
Export( 'env env_testing buildJSONExample buildLibrary buildJSONTests buildUnitTests' )