Date: Tue, 30 Jun 2015 21:43:05 +0000 (UTC) From: Raphael Kubo da Costa <rakuco@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r391009 - in head/devel/jsoncpp: . files Message-ID: <201506302143.t5ULh5w2049628@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rakuco Date: Tue Jun 30 21:43:04 2015 New Revision: 391009 URL: https://svnweb.freebsd.org/changeset/ports/391009 Log: Properly version libjsoncpp.so. Fix the problem described in bug 200969: currently, libjsoncpp.so is not properly versioned by SCons; in other words, there's no SONAME in the library's ELF header, which confuses the linker when creating binaries that link against it. Solve it by using InstallVersionedLib(), available since SCons 2.3.0: this call is able to properly version the shared library the way we need it. Since there is no support for actually installing the files outside the build directory, we have to recreate the required symlinks ourselves in the Makefile. Another related change is that we now create the libraries with the proper names instead of doing that in the Makefile. I'm (ab)using the maintainer's approval given to bug 200939, as swills's latest patch includes this change as well. PR: 200969 PR: 201057 Approved by: johan@stromnet.se (maintainer) Added: head/devel/jsoncpp/files/patch-src_lib__json_sconscript (contents, props changed) Modified: head/devel/jsoncpp/Makefile head/devel/jsoncpp/files/patch-SConstruct head/devel/jsoncpp/pkg-plist Modified: head/devel/jsoncpp/Makefile ============================================================================== --- head/devel/jsoncpp/Makefile Tue Jun 30 21:25:24 2015 (r391008) +++ head/devel/jsoncpp/Makefile Tue Jun 30 21:43:04 2015 (r391009) @@ -3,7 +3,7 @@ PORTNAME= jsoncpp DISTVERSION= 0.6.0-rc2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= SF/${PORTNAME}/jsoncpp/${DISTVERSION} DISTNAME= jsoncpp-src-${DISTVERSION} @@ -21,12 +21,11 @@ MAKE_ARGS= platform=linux-gcc do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/include/jsoncpp (cd ${WRKSRC}/include/ && ${COPYTREE_SHARE} json/ ${STAGEDIR}${PREFIX}/include/jsoncpp/) - (cd ${WRKSRC}/libs/linux-gcc-FreeBSD/ && \ - ${INSTALL_DATA} libjson_linux-gcc-FreeBSD_libmt.a \ - ${STAGEDIR}${PREFIX}/lib/libjsoncpp.a) - (cd ${WRKSRC}/libs/linux-gcc-FreeBSD/ && \ - ${INSTALL_LIB} libjson_linux-gcc-FreeBSD_libmt.so \ - ${STAGEDIR}${PREFIX}/lib/libjsoncpp.so.0) - (cd ${STAGEDIR}${PREFIX}/lib/ && ${LN} -sf libjsoncpp.so.0 libjsoncpp.so ) + ${INSTALL_DATA} ${WRKSRC}/libs/linux-gcc-FreeBSD/libjsoncpp.a \ + ${STAGEDIR}${PREFIX}/lib + ${INSTALL_LIB} ${WRKSRC}/libs/linux-gcc-FreeBSD/libjsoncpp.so.0.6.0 \ + ${STAGEDIR}${PREFIX}/lib + ${LN} -s libjsoncpp.so.0.6.0 ${STAGEDIR}${PREFIX}/lib/libjsoncpp.so.0 + ${LN} -s libjsoncpp.so.0.6.0 ${STAGEDIR}${PREFIX}/lib/libjsoncpp.so .include <bsd.port.mk> Modified: head/devel/jsoncpp/files/patch-SConstruct ============================================================================== --- head/devel/jsoncpp/files/patch-SConstruct Tue Jun 30 21:25:24 2015 (r391008) +++ head/devel/jsoncpp/files/patch-SConstruct Tue Jun 30 21:43:04 2015 (r391009) @@ -1,5 +1,5 @@ ---- SConstruct.orig 2014-12-02 06:28:17.000000000 +0300 -+++ SConstruct 2014-12-02 06:28:31.000000000 +0300 +--- SConstruct ++++ SConstruct @@ -26,7 +26,7 @@ if platform == 'linux-gcc': CXX = 'g++' # not quite right, but env is not yet available. @@ -26,3 +26,42 @@ else: print "UNSUPPORTED PLATFORM." env.Exit(1) +@@ -147,6 +148,11 @@ + 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,7 +170,7 @@ + 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() +@@ -187,14 +193,14 @@ + 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' ) Added: head/devel/jsoncpp/files/patch-src_lib__json_sconscript ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/jsoncpp/files/patch-src_lib__json_sconscript Tue Jun 30 21:43:04 2015 (r391009) @@ -0,0 +1,8 @@ +--- src/lib_json/sconscript.orig 2015-06-22 20:34:03 UTC ++++ src/lib_json/sconscript +@@ -5,4 +5,4 @@ buildLibrary( env, Split( """ + json_value.cpp + json_writer.cpp + """ ), +- 'json' ) ++ 'jsoncpp' ) Modified: head/devel/jsoncpp/pkg-plist ============================================================================== --- head/devel/jsoncpp/pkg-plist Tue Jun 30 21:25:24 2015 (r391008) +++ head/devel/jsoncpp/pkg-plist Tue Jun 30 21:43:04 2015 (r391009) @@ -1,3 +1,4 @@ +lib/libjsoncpp.so.0.6.0 lib/libjsoncpp.so.0 lib/libjsoncpp.so lib/libjsoncpp.a
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506302143.t5ULh5w2049628>