]> git.tdb.fi Git - builder.git/commitdiff
Having to specify package paths manually is stupid and un-modern
authorMikko Rasa <tdb@tdb.fi>
Mon, 16 Jul 2012 09:33:50 +0000 (12:33 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 16 Jul 2012 19:27:35 +0000 (22:27 +0300)
builderrc
source/binarypackage.cpp
source/binarypackage.h
source/sourcepackage.cpp

index 2d9361f5e3aef22826a0eacc8a92547e91853bee..311be8d21a8fe586071d744dd5d15d9e66cc7a9d 100644 (file)
--- a/builderrc
+++ b/builderrc
@@ -41,7 +41,6 @@ binary_package "fmod4"
                libpath "@/api/lib";
                library "fmodex";
        };
-       need_path true;
 };
 
 binary_package "xlib"
index 514481f0066c56a3febb253a81708d3ff51c16da..381e792681abfbee7e78163753e397c6f5a68d5a 100644 (file)
@@ -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<string> &flags)
@@ -62,7 +56,6 @@ BinaryPackage *BinaryPackage::from_flags(Builder &builder, const string &name, c
 BinaryPackage::Loader::Loader(BinaryPackage &p):
        DataFile::DerivedObjectLoader<BinaryPackage, Package>(p)
 {
-       add("need_path", &BinaryPackage::need_path);
        add("build_info", &Loader::build_info);
 }
 
index b47d468fe138ccf761c64d88b1f3169c2b3a51f6..cb054053b62d56d98eb65bc401a12ddbf01b988d 100644 (file)
@@ -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<std::string> &);
 private:
        virtual void create_build_info();
index bb239b22b7d60cc83e1486aa1860aa4666a37258..44faa071512280cec93c9ee8e8348e51c63333a0 100644 (file)
@@ -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<BinaryPackage *>(*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<BinaryPackage *>(*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()