6 #include <msp/datafile/objectloader.h>
14 A package is a distributable piece of software. Package information may be
15 obtained in several ways: Build files of source packages, pkg-config for binary
16 packages and the builderrc file for binary packages with no pkg-config support.
21 class Loader: public Msp::DataFile::ObjectLoader<Package>
26 void if_arch(const std::string &);
27 void require(const std::string &);
30 typedef std::list<Package *> Requirements;
37 Requirements requires;
38 BuildInfo export_binfo;
40 std::list<std::string> problems;
44 Package(Builder &, const std::string &);
46 virtual ~Package() { }
48 Builder &get_builder() const { return builder; }
49 const std::string &get_name() const { return name; }
50 const Requirements &get_required_packages() const { return requires; }
52 const BuildInfo &get_exported_build_info() const { return export_binfo; }
54 /// Indicates whether or not this package supports pkg-config
55 bool uses_pkgconfig() const { return use_pkgconfig; }
57 /** Prepares the package for building. Recursively prepares all required
58 packages, populates build info and creates targets. */
62 virtual void do_prepare() { }
65 bool is_prepared() const { return prepared; }
67 const std::list<std::string> &get_problems() const { return problems; }
69 virtual void save_caches() { }