3 This file is part of builder
4 Copyright © 2006-2007 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 /// Loads a package from a file.
37 class Loader: public Package::Loader
41 SourcePackage &get_object() { return static_cast<SourcePackage &>(pkg); }
43 void feature(const std::string &, const std::string &);
44 void condition(const std::string &);
45 void program(const std::string &);
46 void library(const std::string &);
47 void module(const std::string &);
48 void headers(const std::string &);
50 void tar_file(const std::string &);
53 SourcePackage(Builder &, const std::string &, const Msp::FS::Path &);
54 const std::string &get_name() const { return name; }
55 const std::string &get_version() const { return version; }
56 const std::string &get_description() const { return description; }
57 const Msp::FS::Path &get_source() const { return source; }
58 Msp::FS::Path get_temp_dir() const;
59 Msp::FS::Path get_out_dir() const;
60 const ComponentList &get_components() const { return components; }
61 const Config &get_config() const { return config; }
62 const BuildInfo &get_build_info() const { return build_info; }
63 const BuildInfo &get_exported_binfo() const { return export_binfo; }
64 Builder &get_builder() const { return builder; }
65 unsigned get_install_flags();
66 LibMode get_library_mode() const;
67 const PathList &get_tar_files() const { return tar_files; }
68 DependencyCache &get_deps_cache() const { return deps_cache; }
71 std::string description;
74 PackageList base_reqs;
77 ConditionList conditions;
78 ComponentList components;
81 mutable DependencyCache deps_cache;
84 //Package(Builder &, const std::string &, const std::vector<std::string> &);
85 virtual void do_configure(const StringMap &, unsigned);
87 virtual void create_build_info();