6 #include <msp/parser/loader.h>
10 #include "packageref.h"
15 typedef std::list<Package *> PackageList;
18 A package is a distributable piece of software. They consist of one or more
19 Components and may depend on other packages. Packages also have configuration
20 to determine where files are installed and which features to include (features
26 /// Loads a package from a file.
27 class Loader: public Msp::Parser::Loader
31 Package &get_object() { return pkg; }
35 void require(const std::string &);
36 void program(const std::string &);
37 void library(const std::string &);
38 void headers(const std::string &);
42 Package(Builder &, const std::string &, const Msp::Path::Path &);
43 void set_path(const Msp::Path::Path &);
44 const std::string &get_name() const { return name; }
45 const Msp::Path::Path &get_source() const { return source; }
46 const ComponentList &get_components() const { return components; }
47 bool get_buildable() const { return buildable; }
48 const Config &get_config() const { return config; }
49 const PkgRefList &get_requires() const { return requires; }
50 const BuildInfo &get_build_info() const { return build_info; }
51 const BuildInfo &get_exported_binfo() const { return export_binfo; }
52 Builder &get_builder() const { return builder; }
53 bool get_need_path() const { return need_path; }
55 void configure(const RawOptionMap &, unsigned);
57 static Package *create(Builder &, const std::string &);
71 std::string description;
74 Msp::Path::Path source;
78 BuildInfo export_binfo;
79 ComponentList components;
86 Package(Builder &, const std::string &, const std::vector<std::string> &);
88 void create_build_info();
89 unsigned get_install_flags();