Shipwri...ngFlags(3)
β¨ NAME β¨
Shipwri...ngFlags β it's the Shipwright::Manual::UsingFlags page bestie, aka the one where we talk about using flags π (yes it's a perl manual page, section 3, user-contributed perl docs, we're fancy like that π)
πΈ DESCRIPTION πΈ
okay so Shipwright flags is a whole method for making one single shipyard support multiple variants of vessels. one yard, many girlies. iconic. π
imagine you wanna create a project that needs a database. you want to support several database types in the same shipyard, but you also want each built vessel to only support one type. (sometimes you literally have to pick just one because some dists get confused if you hand them more than one type β like for RT, you have to supply the database type when running ./configure.) no cap.
this is exactly the task you can use Shipwright flags for. slay.
say you want to support both mysql and postgresql, and you've already imported mysql, DBD::mysql, postgresql and DBD::Pg into the repository. step one: done, queen.
next step is marking dists with flags β let's use "mysql" and "postgresql" for this example:
$ shipwright flags -r ... mysql --set mysql
$ shipwright flags -r ... cpan-DBD-mysql --set mysql
$ shipwright flags -r ... postgresql --set postgresql
$ shipwright flags -r ... cpan-DBD-Pg --set postgresql
$ shipwright flags -r ... --mandatory --set mysql,postgresql db
flags data gets stored in shipwright/flags.yml πΎ
when you're building, you can set --flags to mysql or postgresql and it'll install support for that database only. vibe check passed. β
if a dist needs this info to configure itself (RT, looking at you π), you'll need to customize the build script β go read Shipwright::Manual::CustomizeBuild for how to do that, iykyk.
if no flags are specified during build, then both mysql and postgresql get installed to the vessel. which one RT picks to configure for? that's between RT and its build script honestly. π
and if necessary, you can also specify certain flags as mandatory. for example, you can say a database flag is mandatory β so if no flag labelled "db" is specified when you invoke the build script, the first one gets used as a default (mysql in this case) rather than the repository being built with no flags at all. this lets shipyards support different variants or versions of a program. very main character of them. π¦
Note: π«Ά Shipwright will automatically add"default"to--flags, and if a dist has no flags set (i.e. it doesn't appear inshipwright/flags.yml), it gets given the"default"flag and will be installed by default. periodt.
π SEE ALSO π
- Shipwright
- Shipwright::Manual
π AUTHORS π
- sunnavy
<sunnavy@bestpractical.com>β the icon, the legend π
π LICENCE AND COPYRIGHT π
Shipwright is Copyright 2007-2015 Best Practical Solutions, LLC. π’β¨
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. πͺ
and that's the whole page bestie!! this little cutie lives in perl v5.42.0 and got its last glow-up on 2025-07-25 π mwah, go build something gorgeous π«ΆπΈ
π¦ where this page comes from
- fedora 43: perl-Shipwright 2.4.42-24.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms