Install gmtl.pc. https://sourceforge.net/p/ggt/code/1264 Because gmtl*.fpc and gmtl.pc get built at install time, not at build time, and because at install time we have to use prefix=${destroot}${prefix} because this build system doesn't support DESTDIR, gmtl*.fpc and gmtl.pc contain the path to the destroot, which we have to remove in a post-destroot block in the Portfile. --- SConstruct.orig +++ SConstruct @@ -701,14 +701,15 @@ base_inst_paths['lib'] = pj(base_inst_paths['base'], 'lib') base_inst_paths['share'] = pj(base_inst_paths['base'], 'share') base_inst_paths['flagpoll'] = pj(base_inst_paths['share'], 'flagpoll') + base_inst_paths['pkgconfig'] = pj(base_inst_paths['lib'], 'pkgconfig') base_inst_paths['bin'] = pj(base_inst_paths['base'], 'bin') include_dir = pj(base_inst_paths['base'], 'include') - base_inst_paths['include'] = pj('${fp_file_cwd}' ,'..' ,'..', 'include') + base_inst_paths['include'] = pj(base_inst_paths['base'], 'include') if baseEnv['versioning'] == 'yes' and not sys.platform.startswith("win"): include_version = "gmtl-%s.%s.%s" % GetGMTLVersion() include_dir = pj(include_dir, include_version) - base_inst_paths['include'] = pj('${fp_file_cwd}' ,'..' ,'..', 'include', + base_inst_paths['include'] = pj(base_inst_paths['base'], 'include', include_version) print "using prefix:", base_inst_paths['base'] @@ -743,7 +744,7 @@ # Build up substitution map submap = { '@provides@' : provides, - '@prefix@' : pj('${fp_file_cwd}', '..', '..'), + '@prefix@' : base_inst_paths['base'], '@exec_prefix@' : '${prefix}', '@gmtl_cxxflags@' : '', '@includedir@' : base_inst_paths['include'], @@ -760,9 +761,14 @@ 'gmtl.fpc.in', submap = submap) env.AddPostAction(gmtl_fpc, Chmod('$TARGET', 0644)) env.Depends(gmtl_fpc, 'gmtl/Version.h') + gmtl_pc = env.SubstBuilder(pj(base_inst_paths['pkgconfig'], "gmtl.pc"), + 'gmtl.fpc.in', submap = submap) + env.AddPostAction(gmtl_pc, Chmod('$TARGET', 0o644)) + env.Depends(gmtl_pc, 'gmtl/Version.h') installed_targets += env.Install(base_inst_paths['bin'], 'gmtl-config') installed_targets += gmtl_fpc + installed_targets += gmtl_pc pkg.build() installed_targets += pkg.getInstalledTargets() --- gmtl.fpc.in.orig +++ gmtl.fpc.in @@ -1,3 +1,4 @@ +prefix=@prefix@ exec_prefix=@exec_prefix@ cxxflags=@gmtl_cxxflags@ includedir=@includedir@ @@ -11,4 +12,4 @@ Libs: Cflags: -I${includedir} Arch: @arch@ -prefix: @prefix@ +prefix: ${prefix}