if(component->get_type()==Component::MODULE)
install_location /= package->get_name();
- const string &version = component->get_package().get_version();
+ const string &version = component->get_package().get_interface_version();
if(!version.empty())
{
- string::size_type i = 0;
- for(unsigned dots=0; i<version.size(); ++i)
- if(version[i]=='.' && ++dots>=2)
- break;
-
const Architecture &arch = builder.get_current_arch();
const Pattern &pattern = arch.get_shared_library_patterns().front();
if(arch.get_system()=="windows")
- soname = pattern.apply(format("%s-%s", component->get_name(), version.substr(0, i)));
+ soname = pattern.apply(format("%s-%s", component->get_name(), version));
else
- soname = format("%s.%s", pattern.apply(component->get_name()), version.substr(0, i));
+ soname = format("%s.%s", pattern.apply(component->get_name()), version);
install_filename = soname;
}
void SourcePackage::Loader::init(const Config::InputOptions *o)
{
options = o;
- add("version", &SourcePackage::version);
add("description", &SourcePackage::description);
add("build_info", &Loader::build_info);
add("feature", &Loader::feature);
add("module", &Loader::component<Component::MODULE>);
add("headers", &Loader::headers);
add("install", &Loader::component<Component::INSTALL>);
+ add("interface_version", &Loader::interface_version);
add("datafile", &Loader::component<Component::DATAFILE>);
add("source_tarball", &Loader::source_tarball);
add("tarball", &Loader::tarball);
add("tar_file", &Loader::tar_file);
+ add("version", &Loader::version);
}
void SourcePackage::Loader::finish()
load_sub_with(*this);
}
+void SourcePackage::Loader::interface_version(const string &v)
+{
+ obj.interface_version = v;
+ if(obj.version.empty())
+ obj.version = v;
+}
+
void SourcePackage::Loader::source_tarball()
{
load_sub(*obj.source_tarball);
if(i->get_type()==Component::TARBALL && i->get_name()=="@src")
const_cast<Component::SourceList &>(i->get_sources()).push_back((obj.source_dir/f).str());
}
+
+void SourcePackage::Loader::version(const string &v)
+{
+ obj.version = v;
+
+ string::size_type i = 0;
+ for(unsigned dots=0; i<obj.version.size(); ++i)
+ if(obj.version[i]=='.' && ++dots>=2)
+ break;
+ obj.interface_version = obj.version.substr(0, i);
+}
void build_info();
void headers(const std::string &);
void if_feature(const std::string &);
+ void interface_version(const std::string &);
void source_tarball();
void tarball(const std::string &);
void tar_file(const std::string &);
+ void version(const std::string &);
};
typedef std::list<Component> ComponentList;
typedef std::list<Feature> FeatureList;
std::string version;
+ std::string interface_version;
std::string description;
FileTarget *build_file;
SourcePackage(Builder &, const std::string &, const Msp::FS::Path &);
const std::string &get_version() const { return version; }
+ const std::string &get_interface_version() const { return interface_version; }
const std::string &get_description() const { return description; }
FileTarget &get_build_file() const { return *build_file; }
const Msp::FS::Path &get_source_directory() const { return source_dir; }