mbox series

[bug#64137,0/2] Build catch2@3 with CMake and update to 3.3.2

Message ID cover.1687020412.git.david.elsing@posteo.net
Headers show
Series Build catch2@3 with CMake and update to 3.3.2 | expand

Message

David Elsing June 17, 2023, 7:27 p.m. UTC
Currently, the catch2-3.1 package is built with Meson. I think this was done
to build both static and shared libraries together, which is not supported by
CMake. Unfortunately, several CMake files (in lib/cmake/Catch2) are not
installed and to install them, CMake would be necessary as build dependency
anyway. Only the clingo package depends on this package and the static output
is not used in another package.

Would it be acceptable to build it with CMake instead, like the catch2 package
(for version 2)? I also included a separate package for the static version. Of
course, the documentation and headers are then installed in both packages.

David Elsing (2):
  gnu: catch2-3.1: Rename to catch2-3.3.
  gnu: Add catch2-static-3.3.

 gnu/packages/check.scm    | 81 ++++++++++-----------------------------
 gnu/packages/potassco.scm |  2 +-
 2 files changed, 21 insertions(+), 62 deletions(-)


base-commit: 6e1215fb9c03ccb4a2d4440990aee5a66a935268

Comments

Liliana Marie Prikler June 18, 2023, 6:55 a.m. UTC | #1
Am Samstag, dem 17.06.2023 um 19:27 +0000 schrieb David Elsing:
> Currently, the catch2-3.1 package is built with Meson. I think this
> was done to build both static and shared libraries together, which is
> not supported by CMake. Unfortunately, several CMake files (in
> lib/cmake/Catch2) are not installed and to install them, CMake would
> be necessary as build dependency anyway. Only the clingo package
> depends on this package and the static output is not used in another
> package.
> 
> Would it be acceptable to build it with CMake instead, like the
> catch2 package (for version 2)?  I also included a separate package
> for the static version.  Of course, the documentation and headers are
> then installed in both packages.
If you actually get clingo to build, that'd be one thing, but there
shouldn't be any issue getting our catch2 to work in CMake-based
projects to begin with.  After all, we do provide a catch2-config that
simply invokes pkg-config.  I'd hazard a guess that whatever project
you're trying to build pokes at internals it's not really supposed to
see.

As for the upgrade to 3.3.2, I'd take that in solitude if clingo still
builds with it.  If not, you'd have to make it an extra version.

Cheers
David Elsing June 18, 2023, 8:47 p.m. UTC | #2
Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> If you actually get clingo to build, that'd be one thing, but there
> shouldn't be any issue getting our catch2 to work in CMake-based
> projects to begin with.  After all, we do provide a catch2-config that
> simply invokes pkg-config.  I'd hazard a guess that whatever project
> you're trying to build pokes at internals it's not really supposed to
> see.
I see, what is missing are the "extras" like catch_discover_tests, but
it seems they can just be copied to lib/cmake/Catch2.
>
> As for the upgrade to 3.3.2, I'd take that in solitude if clingo still
> builds with it.  If not, you'd have to make it an extra version.
To build clingo with 3.3.2, the find_package(Catch2 3.1 ...) command
just needed to be adjusted, but I went ahead and unbundled the remaining
dependencies as well. Should this be a separate issue?
For catch2, it seems simpler to me to build it with CMake, as I don't
see the use case for the static library (as a second output). If you
prefer, I can change it back to Meson though and just copy the files
from the extras directory as well (provided it works).
David Elsing June 25, 2023, 10:01 a.m. UTC | #3
Thanks for your comments, here are the updated patches. I removed the
cmake-static package as I also don't have any need for it.
Liliana Marie Prikler June 25, 2023, 4:06 p.m. UTC | #4
Am Sonntag, dem 25.06.2023 um 10:01 +0000 schrieb David Elsing:
> Thanks for your comments, here are the updated patches. I removed the
> cmake-static package as I also don't have any need for it.
Thanks for the updates.  I do have some minor changes for the synopses
and descriptions, but nothing major.  I'll push them once CI lights
green or next weekend :)
Liliana Marie Prikler July 1, 2023, 10:41 a.m. UTC | #5
Am Mittwoch, dem 28.06.2023 um 16:50 +0000 schrieb David Elsing:
> Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
> 
> > Am Sonntag, dem 25.06.2023 um 10:01 +0000 schrieb David Elsing:
> > > Thanks for your comments, here are the updated patches. I removed
> > > the
> > > cmake-static package as I also don't have any need for it.
> > Thanks for the updates.  I do have some minor changes for the
> > synopses and descriptions, but nothing major.  I'll push them once
> > CI lights green or next weekend :)
> Ok, thanks!
> On armhf-linux, there is an error (warning) from -Werror=cast-align
> because an unsigned char* is cast to std::string*, but this is fine
> because the unsigned char array it points to is declared with
> alignas. I accidentally set -DENABLE_WERROR=OFF instead of
> -DCATCH_ENABLE_WERROR=OFF, but now the build succeeds.
Pushed and followed up with a commit that does that.

Cheers