Brewtarget / brewtarget

Main brewtarget source code repository.
GNU General Public License v3.0
313 stars 134 forks source link

Add Meson/bt as alternative build and packaging system; make enum deserialisation more robust #722

Closed matty0ung closed 1 year ago

matty0ung commented 1 year ago

The enum deserialisation is just adding a fallback for case-insensitive matching.

The Meson build stuff is mostly in two new files at the top-level directory: bt and meson.build. The former is a Python script that can:

Note that the current CMake/CPack build is pretty much unaffected by this new work. You can still run all the regular CMake stuff in the build subdirectory. CMake/CPack builds should continue to function as correctly as they do now (ie just fine on Windows and Linux, and fine except for package building on Mac).

penguinpee commented 1 year ago

Nice! I'll give that a try as the build backend for the Fedora package. Are there plans for switching to Meson completely?

matty0ung commented 1 year ago

Nice! I'll give that a try as the build backend for the Fedora package. Are there plans for switching to Meson completely?

There are still a few glitches to iron out, but once things seem like they are working, we'll see what folks think.

Personally I think using Meson simplifies the build, partly because Meson doesn't try to do all the things that CMake does, so you end up doing all the "not-build" things in a regular scripting language. And, for non-trivial scripting, I think Python is nicer than bash. Of course moving away from CPack it makes packaging less automagical, but CPack has been far from trouble-free, and the upside of doing things more explicitly is that we then have more control over library dependency and other packaging joys. Certainly doing the scripting has helped me understand a lot better how packaging works on Windows and Mac!