From: Mikko Rasa Date: Mon, 16 Jul 2012 09:33:50 +0000 (+0300) Subject: Having to specify package paths manually is stupid and un-modern X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ef97eadef58922f45e1ba86a1d009db5ea41dd50;hp=3f541fceb5aeb5d685ceb2363ebbca1cb1c3eb84;p=builder.git Having to specify package paths manually is stupid and un-modern --- diff --git a/builderrc b/builderrc index 2d9361f..311be8d 100644 --- a/builderrc +++ b/builderrc @@ -41,7 +41,6 @@ binary_package "fmod4" libpath "@/api/lib"; library "fmodex"; }; - need_path true; }; binary_package "xlib" diff --git a/source/binarypackage.cpp b/source/binarypackage.cpp index 514481f..381e792 100644 --- a/source/binarypackage.cpp +++ b/source/binarypackage.cpp @@ -7,26 +7,20 @@ using namespace std; using namespace Msp; BinaryPackage::BinaryPackage(Builder &b, const string &n): - Package(b, n), - need_path(false) + Package(b, n) { use_pkgconfig = false; } -void BinaryPackage::set_path(const FS::Path &p) -{ - path = builder.get_cwd()/p; -} - void BinaryPackage::create_build_info() { for(BuildInfo::PathList::iterator i=export_binfo.incpath.begin(); i!=export_binfo.incpath.end(); ++i) if((*i)[0]=="@") - *i = path/i->subpath(1); + *i = builder.get_prefix()/i->subpath(1); for(BuildInfo::PathList::iterator i=export_binfo.libpath.begin(); i!=export_binfo.libpath.end(); ++i) if((*i)[0]=="@") - *i = path/i->subpath(1); + *i = builder.get_prefix()/i->subpath(1); } BinaryPackage *BinaryPackage::from_flags(Builder &builder, const string &name, const vector &flags) @@ -62,7 +56,6 @@ BinaryPackage *BinaryPackage::from_flags(Builder &builder, const string &name, c BinaryPackage::Loader::Loader(BinaryPackage &p): DataFile::DerivedObjectLoader(p) { - add("need_path", &BinaryPackage::need_path); add("build_info", &Loader::build_info); } diff --git a/source/binarypackage.h b/source/binarypackage.h index b47d468..cb05405 100644 --- a/source/binarypackage.h +++ b/source/binarypackage.h @@ -18,21 +18,8 @@ public: void build_info(); }; -private: - bool need_path; - Msp::FS::Path path; - -public: BinaryPackage(Builder &, const std::string &); - /** - Sets the path where the package's files were installed. This is only useful - if the package doesn't use pkg-config. - */ - void set_path(const Msp::FS::Path &); - - bool get_need_path() const { return need_path; } - static BinaryPackage *from_flags(Builder &, const std::string &, const std::vector &); private: virtual void create_build_info(); diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index bb239b2..44faa07 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -118,13 +118,6 @@ void SourcePackage::do_configure(const StringMap &opts, unsigned flag) config.finish(); - for(PackageList::iterator i=requires.begin(); i!=requires.end(); ++i) - { - BinaryPackage *bpkg = dynamic_cast(*i); - if(bpkg && bpkg->get_need_path()) - bpkg->set_path(config.get_option(bpkg->get_name()+"_path").value); - } - deps_cache.load(); for(ComponentList::iterator i=components.begin(); i!=components.end(); ++i) @@ -133,12 +126,6 @@ void SourcePackage::do_configure(const StringMap &opts, unsigned flag) void SourcePackage::init_config() { - for(PackageList::const_iterator i=requires.begin(); i!=requires.end(); ++i) - { - BinaryPackage *bpkg = dynamic_cast(*i); - if(bpkg && bpkg->get_need_path()) - config.add_option(bpkg->get_name()+"_path", "/usr", "Path for "+bpkg->get_name()); - } } void SourcePackage::create_build_info()