[odb-users] ODB 2.5.0-b.19 available

Boris Kolpackov boris at codesynthesis.com
Thu Jul 23 10:32:38 EDT 2020

Wolfgang Haupt <haupt.wolfgang at gmail.com> writes:

> Is there a build2 way to create a classic source tarball?

It can create the source distribution which will use build2 as the
build system but it cannot convert the build2 build system to the
autotools build system.

> I'm bound to a large rather complicated autotools buildsystem where the
> easiest way is to use a tarball and `./configure`.
> I managed to create that by pulling the source and `make dist
> dist_prefix=/tmp/libodb-2.5.0-b.19`.

That works only accidentally since the autotools templates (which is
how the old make-based build system does this) are no longer maintained.

> Now I wonder if that should be done using the build2 toolchain by now?

If you cannot use build2 directly, then the next best option is probably
to create binary packages (so instead of ./configure && make you do dpkg
or rpm). I am not sure which distribution you are using but here are the
instructions on how to create the .deb package for the ODB compiler (for
the runtime libraries the steps would be similar), in case you or someone
else finds this useful (we plan to eventually make build2 generate such
distribution packages automatically).

The below instructions are based on the approach described on this page:


First build and install the ODB compiler using this configuration (instead
of the one in the install-build2 instructions):

$ bpkg create -d odb-gcc cc       \
  config.cxx=g++                  \
  config.cc.coptions=-O3          \
  config.install.root=/usr        \

With the result in /tmp/odb/, add the following DEBIAN/control file:

# mkdir -p /tmp/odb/DEBIAN
$ cat <<EOF >/tmp/odb/DEBIAN/control
Package: odb
Version: 2.5.0-b.19
Architecture: amd64
Maintainer: you at example.org
Description: ORM for C++
  ODB is an object-relational mapping (ORM) system for C++. It provides
  tools, APIs, and library support that allow you to persist C++ objects
  to a relational database (RDBMS) without having to deal with tables,
  columns, or SQL and without manually writing any of the mapping code.

Then, from /tmp/ run:

$ dpkg -b odb .
dpkg-deb: building package 'odb' in './odb_2.5.0-b.19_amd64.deb'.

You can then install/uninstall odb_2.5.0-b.19_amd64.deb using dpkg:

sudo dpkg -i odb_2.5.0-b.17_amd64.deb
sudo dpkg --purge odb

The binary package should work on any machine that has the same version
of GCC.

More information about the odb-users mailing list