cctbx and pkgconfig

PICCA Frédéric-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Mon Aug 6 20:46:06 UTC 2012


Hello, I am reading your pkgconfig patch

+usr/lib/pkgconfig/cctbx.pc
+usr/lib/pkgconfig/cctbx_sgtbx_asu.pc
+usr/lib/pkgconfig/iotbx_mtz.pc
+usr/lib/pkgconfig/iotbx_pdb.pc
+usr/lib/pkgconfig/mmtbx_masks.pc
+usr/lib/pkgconfig/omptbx.pc
+usr/lib/pkgconfig/rstbx.pc
+usr/lib/pkgconfig/scitbx_boost_python-py*.pc
+usr/lib/pkgconfig/scitbx_minpack.pc
+usr/lib/pkgconfig/scitbx_slatec.pc
+usr/lib/pkgconfig/smtbx_refinement_constraints.pc
+usr/lib/pkgconfig/spotfinder.pc

you should summerize this like
usr/lib/pkgconfig

but with multiarch the path should be
usr/lib/*/pkgconfig/

then you propose this

++def create_pc_file(name, version, desc, requires=None, requires_private=None,
++                   conflicts=None, libs_private=None):
++  """ Create pkg-config file. """
++  fpath = '%s/%s.pc'%(abs(libtbx.env.lib_path), name)
++  pc = open(fpath, 'w')
++  pc.write('prefix=%s\n'%env_etc.prefix)
++  pc.write('exec_prefix=${PREFIX}\n')
++  pc.write('libdir=${PREFIX}/%s\n'%env_etc.libdir)
++  pc.write('includedir=${PREFIX}/include\n\n')
++  pc.write('Name: %s\n'%name)
++  pc.write('Description: %s\n'%desc)
++  pc.write('Version: %s\n'%version)
++  if requires != None:
++    pc.write('Requires: %s\n'%requires)
++  if requires_private != None:
++    pc.write('Requires.private: %s\n'%requires_private)
++  if conflicts != None:
++    pc.write('Conflicts: %s\n'%conflicts)
++  pc.write('Libs: -L${libdir} -l%s\n'%name)
++  if libs_private != None:
++    pc.write('Libs.private: %s\n'%libs_private)
++  pc.write('Cflags: -I${includedir}')
++  pc.close()
++env_etc.create_pc_file = create_pc_file

Usually the pc files are generated from a .pc.in file. [1] or even better [2].
maybe providing this kind of xxx.in -> xxx file generator would be valuable for their build tool and then easier to
sell ;)

the advantage I see with the .in file is that it is easier to review and it can be versionned in a vcs instead of a generated file.

but this is just me :)

if you want to use you code it would be nice to use the with construction but beware the python version...

>>> with open('/tmp/workfile', 'r') as f:
...     read_data = f.read()


do we know about the upstream python supported versions ? 

Cheers

Frederic

[1] http://www.scons.org/wiki/ReplacementBuilder
[2] http://www.scons.org/wiki/SubstInFileBuilder


More information about the debian-science-maintainers mailing list