1 #ifndef SOURCEPACKAGE_H_
2 #define SOURCEPACKAGE_H_
10 #include "dependencycache.h"
16 class bad_expansion: public std::runtime_error
19 bad_expansion(const std::string &w): std::runtime_error(w) { }
20 virtual ~bad_expansion() throw() { }
24 A package that can be built by Builder.
26 class SourcePackage: public Package
29 class Loader: public Msp::DataFile::DerivedObjectLoader<SourcePackage, Package>
32 std::map<std::string, std::string> install_map;
35 Loader(SourcePackage &);
37 virtual void finish();
38 void feature(const std::string &, const std::string &);
39 template<Component::Type>
40 void component(const std::string &);
41 void condition(const std::string &);
43 void headers(const std::string &);
44 void tarball(const std::string &);
45 void tar_file(const std::string &);
50 std::string description;
55 ConditionList conditions;
56 ComponentList components;
58 mutable DependencyCache deps_cache;
61 SourcePackage(Builder &, const std::string &, const Msp::FS::Path &);
62 const std::string &get_version() const { return version; }
63 const std::string &get_description() const { return description; }
64 const Msp::FS::Path &get_source() const { return source; }
65 Msp::FS::Path get_temp_dir() const;
66 Msp::FS::Path get_out_dir() const;
67 const ComponentList &get_components() const { return components; }
68 const Config &get_config() const { return config; }
69 const BuildInfo &get_build_info() const { return build_info; }
70 Builder &get_builder() const { return builder; }
72 LibMode get_library_mode() const;
73 DependencyCache &get_deps_cache() const { return deps_cache; }
74 std::string expand_string(const std::string &) const;
76 virtual void do_configure(const StringMap &, unsigned);
78 /** Initializes configuration options. */
81 /** Fills in build info based on configuration. All required packages must be
82 configured when this is called. */
83 virtual void create_build_info();
85 virtual void create_targets();
87 virtual void save_caches();