3 This file is part of builder
4 Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef SOURCEPACKAGE_H_
9 #define SOURCEPACKAGE_H_
12 #include "buildinfo.h"
13 #include "component.h"
14 #include "condition.h"
16 #include "dependencycache.h"
23 A package that can be built by Builder.
25 class SourcePackage: public Package
36 class Loader: public Package::Loader
40 SourcePackage &get_object() { return static_cast<SourcePackage &>(pkg); }
42 virtual void finish();
43 void feature(const std::string &, const std::string &);
44 template<Component::Type>
45 void component(const std::string &);
46 void condition(const std::string &);
48 void tarball(const std::string &);
49 void tar_file(const std::string &);
54 std::string description;
57 PackageList base_reqs;
60 ConditionList conditions;
61 ComponentList components;
64 mutable DependencyCache deps_cache;
67 SourcePackage(Builder &, const std::string &, const Msp::FS::Path &);
68 const std::string &get_name() const { return name; }
69 const std::string &get_version() const { return version; }
70 const std::string &get_description() const { return description; }
71 const Msp::FS::Path &get_source() const { return source; }
72 Msp::FS::Path get_temp_dir() const;
73 Msp::FS::Path get_out_dir() const;
74 const ComponentList &get_components() const { return components; }
75 const Config &get_config() const { return config; }
76 const BuildInfo &get_build_info() const { return build_info; }
77 const BuildInfo &get_exported_binfo() const { return export_binfo; }
78 Builder &get_builder() const { return builder; }
80 /** Returns a bitmask indicating which kinds of things the components of
81 this package install. */
82 unsigned get_install_flags();
84 LibMode get_library_mode() const;
85 DependencyCache &get_deps_cache() const { return deps_cache; }
87 virtual void do_configure(const StringMap &, unsigned);
89 /** Initializes configuration options. */
92 /** Fills in build info based on configuration. All required packages must be
93 configured when this is called. */
94 virtual void create_build_info();