3 This file is part of builder
4 Copyright © 2006-2007, 2009 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
13 #include <msp/datafile/loader.h>
14 #include "buildinfo.h"
19 typedef std::list<Package *> PackageList;
22 A package is a distributable piece of software. Package information may be
23 obtained in several ways: Build files of source packages, pkg-config for binary
24 packages and the builderrc file for binary packages with no pkg-config support.
29 class Loader: public Msp::DataFile::Loader
33 Package &get_object() { return pkg; }
37 void require(const std::string &);
46 BuildInfo export_binfo;
51 Package(Builder &, const std::string &);
53 virtual ~Package() { }
55 const std::string &get_name() const { return name; }
56 Builder &get_builder() const { return builder; }
57 const PackageList &get_requires() const { return requires; }
59 /** Returns a list of all directly and indirectly required packages,
60 including the package itself. */
61 PackageList collect_requires();
63 const BuildInfo &get_exported_binfo() const { return export_binfo; }
65 /// Indicates whether or not this package supports pkg-config
66 bool get_use_pkgconfig() const { return use_pkgconfig; }
68 /** Processes configuration options that were most likely obtained from the
70 void configure(const StringMap &, unsigned);
72 virtual void do_configure(const StringMap &, unsigned) { }
73 virtual void create_build_info() { }