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
34 /// Loads a package from a file.
35 class Loader: public Msp::Parser::Loader
39 Package &get_object() { return pkg; }
43 void require(const std::string &);
44 void program(const std::string &);
45 void library(const std::string &);
46 void headers(const std::string &);
50 Package(Builder &, const std::string &, const Msp::Path::Path &);
51 void set_path(const Msp::Path::Path &);
52 const std::string &get_name() const { return name; }
53 const std::string &get_version() const { return version; }
54 const std::string &get_description() const { return description; }
55 const Msp::Path::Path &get_source() const { return source; }
56 const ComponentList &get_components() const { return components; }
57 bool get_buildable() const { return buildable; }
58 const Config &get_config() const { return config; }
59 const PkgRefList &get_requires() const { return requires; }
60 const BuildInfo &get_build_info() const { return build_info; }
61 const BuildInfo &get_exported_binfo() const { return export_binfo; }
62 Builder &get_builder() const { return builder; }
63 bool get_need_path() const { return need_path; }
64 unsigned get_install_flags();
65 bool get_use_pkgconfig() const { return use_pkgconfig; }
67 void configure(const RawOptionMap &, unsigned);
69 static Package *create(Builder &, const std::string &);
75 std::string description;
78 Msp::Path::Path source;
82 BuildInfo export_binfo;
83 ComponentList components;
91 Package(Builder &, const std::string &, const std::vector<std::string> &);
93 void create_build_info();