aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-04 07:40:31 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-04 07:40:31 +0000
commit2aed9e2f0ac8be11d8216bddfa57c3a51fc6d2bb (patch)
tree446aa44816985304c01fc922c0d3fff0cb0e0da8
parent3a1fb9dce16fd93cb16dffe3ec6d237e68386c7d (diff)
downloadpaludis-2aed9e2f0ac8be11d8216bddfa57c3a51fc6d2bb.tar.gz
paludis-2aed9e2f0ac8be11d8216bddfa57c3a51fc6d2bb.tar.xz
Make the Ruby Makefile suck a lot less. Fixes: ticket:49.
-rw-r--r--ruby/Makefile.am175
-rw-r--r--ruby/paludis_ruby.cc147
-rw-r--r--ruby/paludis_ruby.hh2
-rw-r--r--ruby/paludis_ruby_so.cc29
4 files changed, 136 insertions, 217 deletions
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index 0a974d3..5dbfa45 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -12,7 +12,7 @@ DEFS= \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DLIBDIR=\"$(libdir)\"
-CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda *.o *.so .libs/*.so
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda *.o Paludis.so .libs/Paludis.so
MAINTAINERCLEANFILES = Makefile.in
IF_RUBY_TESTS = \
@@ -63,6 +63,7 @@ IF_RUBY_QA_SOURCES = \
EXTRA_DIST = $(IF_RUBY_TESTS) $(IF_RUBY_SOURCES) \
$(IF_RUBY_QA_TESTS) $(IF_RUBY_QA_SOURCES) \
+ paludis_ruby_so.cc \
environment_TEST_setup.sh environment_TEST_cleanup.sh \
package_database_TEST_setup.sh package_database_TEST_cleanup.sh \
repository_TEST_setup.sh repository_TEST_cleanup.sh \
@@ -85,180 +86,70 @@ TESTS_ENVIRONMENT = env \
\`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/paludis/environment/no_config/.libs\`: \
\`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/paludis/dep_list/.libs\`: \
\`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/.libs\`: \
- \`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/paludis/qa/.libs\`" \
+ \`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/paludis/qa/.libs\`: \
+ \`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/ruby/.libs\`" \
| tr -d ' '` \
bash $(top_srcdir)/test/run_test.sh "$(RUBY) -I ./.libs/"
if ENABLE_RUBY
-BASE_OBJECTS = \
- environment.o \
- dep_atom.o \
- log.o \
- mask_reasons.o \
- package_database.o \
- package_database_entry.o \
- version_spec.o \
- repository.o \
- version_metadata.o \
- portage_dep_parser.o \
- qualified_package_name.o \
- contents.o \
- dep_list.o \
- paludis_ruby.o
+lib_LTLIBRARIES = libpaludisruby.la
+
+libpaludisruby_la_CXXFLAGS = $(AM_CXXFLAGS) -I. -I@RUBY_SITEARCHDIR@ -I@RUBY_ARCHDIR@
+
+paludis_ruby_so.o : paludis_ruby_so.cc
+ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) \
+ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) -I$(RUBY_SITEARCHDIR) -I$(RUBY_ARCHDIR) -c \
+ -o $@ $(srcdir)/paludis_ruby_so.cc
if ENABLE_QA
-OUR_OBJECTS = $(BASE_OBJECTS)\
- paludis_ruby.o \
- message.o \
- check.o \
- check_result.o \
- qa_environment.o \
- metadata_file.o
+libpaludisruby_la_SOURCES = $(IF_RUBY_SOURCES) $(IF_RUBY_QA_SOURCES)
+libpaludisruby_la_LIBADD = \
+ $(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/repositories/portage/libpaludisportagerepository.la \
+ $(top_builddir)/paludis/environment/no_config/libpaludisnoconfigenvironment.la \
+ $(top_builddir)/paludis/environment/default/libpaludisdefaultenvironment.la \
+ $(top_builddir)/paludis/qa/libpaludisqa.la
TESTS = $(IF_RUBY_TESTS) $(IF_RUBY_QA_TESTS)
else
-OUR_OBJECTS = $(BASE_OBJECTS)
+libpaludisruby_la_SOURCES = $(IF_RUBY_SOURCES)
+libpaludisruby_la_LIBADD = \
+ $(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/repositories/portage/libpaludisportagerepository.la \
+ $(top_builddir)/paludis/environment/no_config/libpaludisnoconfigenvironment.la \
+ $(top_builddir)/paludis/environment/default/libpaludisdefaultenvironment.la
TESTS = $(IF_RUBY_TESTS)
endif
-noinst_DATA = $(OUR_OBJECTS)
check_DATA = .libs/Paludis.so
rubylibdir = @RUBY_INSTALL_DIR@
rubylib_DATA = Paludis.so
-OUR_CXXCOMPILE = $(CXX) -fPIC $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
- -I. -I@RUBY_SITEARCHDIR@ -I@RUBY_ARCHDIR@ -c
-
-paludis_ruby.o : paludis_ruby.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/paludis_ruby.cc
-
-environment.o : environment.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/environment.cc
-
-dep_atom.o : dep_atom.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/dep_atom.cc
-
-package_database_entry.o : package_database_entry.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/package_database_entry.cc
-
-package_database.o : package_database.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/package_database.cc
-
-version_spec.o : version_spec.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/version_spec.cc
-
-version_metadata.o : version_metadata.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/version_metadata.cc
-
-mask_reasons.o : mask_reasons.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/mask_reasons.cc
-
-log.o : log.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/log.cc
-
-repository.o : repository.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/repository.cc
-
-portage_dep_parser.o : portage_dep_parser.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/portage_dep_parser.cc
-
-qualified_package_name.o : qualified_package_name.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/qualified_package_name.cc
-
-contents.o : contents.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/contents.cc
-
-dep_list.o : dep_list.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/dep_list.cc
-
-message.o : message.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/message.cc
-
-check.o : check.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/check.cc
-
-check_result.o : check_result.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/check_result.cc
-
-qa_environment.o : qa_environment.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/qa_environment.cc
-
-metadata_file.o : metadata_file.cc paludis_ruby.hh
- $(OUR_CXXCOMPILE) -o $@ $(srcdir)/metadata_file.cc
-
-if ENABLE_QA
-
-.libs/Paludis.so : $(OUR_OBJECTS)
+.libs/Paludis.so : libpaludisruby.la paludis_ruby_so.o
mkdir -p .libs
$(CXX) -fPIC -shared $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) \
-I@RUBY_SITEARCHDIR@ -l@RUBY_SONAME@ \
-o $@ \
- $^ \
- $(top_builddir)/paludis/util/.libs/libpaludisutil.so \
- $(top_builddir)/paludis/.libs/libpaludis.so \
- $(top_builddir)/paludis/environment/default/.libs/libpaludisdefaultenvironment.so \
- $(top_builddir)/paludis/environment/no_config/.libs/libpaludisnoconfigenvironment.so \
- $(top_builddir)/paludis/dep_list/.libs/libpaludisdeplist.so \
- $(top_builddir)/paludis/repositories/.libs/libpaludisrepositories.so \
- $(top_builddir)/paludis/qa/.libs/libpaludisqa.so \
- $(PCREPLUSPLUS_LIBS)
+ .libs/paludis_ruby_so.o \
+ -L$(top_builddir)/ruby/.libs -lpaludisruby
-Paludis.so : $(OUR_OBJECTS)
+Paludis.so : libpaludisruby.la paludis_ruby_so.o
$(CXX) -fPIC -shared $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) \
-I@RUBY_SITEARCHDIR@ -l@RUBY_SONAME@ \
-o $@ \
- $^ \
- -L$(top_builddir)/paludis/util/.libs/ -lpaludisutil \
- -L$(top_builddir)/paludis/.libs/ -lpaludis \
- -L$(top_builddir)/paludis/environment/default/.libs/ -lpaludisdefaultenvironment \
- -L$(top_builddir)/paludis/environment/no_config/.libs/ -lpaludisnoconfigenvironment \
- -L$(top_builddir)/paludis/dep_list/.libs -lpaludisdeplist \
- -L$(top_builddir)/paludis/repositories/.libs -lpaludisrepositories \
- -L$(top_builddir)/paludis/qa/.libs/ -lpaludisqa \
- $(PCREPLUSPLUS_LIBS)
-
-else
-
-.libs/Paludis.so : $(OUR_OBJECTS)
- mkdir -p .libs
- $(CXX) -fPIC -shared $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) \
- -I@RUBY_SITEARCHDIR@ -l@RUBY_SONAME@ \
- -o $@ \
- $^ \
- $(top_builddir)/paludis/util/.libs/libpaludisutil.so \
- $(top_builddir)/paludis/.libs/libpaludis.so \
- $(top_builddir)/paludis/environment/default/.libs/libpaludisdefaultenvironment.so \
- $(top_builddir)/paludis/environment/no_config/.libs/libpaludisnoconfigenvironment.so \
- $(top_builddir)/paludis/dep_list/.libs/libpaludisdeplist.so \
- $(top_builddir)/paludis/repositories/.libs/libpaludisrepositories.so
-
-Paludis.so : $(OUR_OBJECTS)
- $(CXX) -fPIC -shared $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) \
- -I@RUBY_SITEARCHDIR@ -l@RUBY_SONAME@ \
- -o $@ \
- $^ \
- -L$(top_builddir)/paludis/util/.libs/ -lpaludisutil \
- -L$(top_builddir)/paludis/.libs/ -lpaludis \
- -L$(top_builddir)/paludis/environment/default/.libs/ -lpaludisdefaultenvironment \
- -L$(top_builddir)/paludis/environment/no_config/.libs/ -lpaludisnoconfigenvironment \
- -L$(top_builddir)/paludis/dep_list/.libs -lpaludisdeplist \
- -L$(top_builddir)/paludis/repositories/.libs -lpaludisrepositories
-
-endif
+ .libs/paludis_ruby_so.o \
+ -L$(top_builddir)/ruby/.libs -lpaludisruby
endif
diff --git a/ruby/paludis_ruby.cc b/ruby/paludis_ruby.cc
index 5cda214..8510e8f 100644
--- a/ruby/paludis_ruby.cc
+++ b/ruby/paludis_ruby.cc
@@ -271,83 +271,80 @@ has_query_property_error_query(VALUE self)
return rb_attr_get(self, rb_intern("query"));
}
-extern "C"
+void paludis::ruby::init()
{
- void Init_Paludis()
- {
- /*
- * Document-module: Paludis
- *
- * <b>Paludis</b> is the other package mangler, this is the doc to the ruby binding. The C++ library
- * documentation[http://paludis.pioto.org/doxygen/html/] may also help.
- *
- */
- c_paludis_module = rb_define_module("Paludis");
- c_environment = rb_define_class_under(paludis_module(), "Environment", rb_cObject);
- c_no_config_environment = rb_define_class_under(paludis_module(), "NoConfigEnvironment", c_environment);
- c_name_error = rb_define_class_under(c_paludis_module, "NameError", rb_eRuntimeError);
- c_set_name_error = rb_define_class_under(c_paludis_module, "SetNameError", c_name_error);
- c_category_name_part_error = rb_define_class_under(c_paludis_module, "CategoryNamePartError", c_name_error);
- c_package_name_part_error = rb_define_class_under(c_paludis_module, "PackageNamePartError", c_name_error);
- c_bad_version_spec_error = rb_define_class_under(c_paludis_module, "BadVersionSpecError", c_name_error);
- c_package_dep_atom_error = rb_define_class_under(c_paludis_module, "PackageDepAtomError", rb_eRuntimeError);
- c_package_database_error = rb_define_class_under(c_paludis_module, "PackageDatabaseError", rb_eRuntimeError);
- c_package_database_lookup_error = rb_define_class_under(c_paludis_module, "PackageDatabaseLookupError", c_package_database_error);
- c_ambiguous_package_name_error = rb_define_class_under(c_paludis_module, "AmbiguousPackageNameError", c_package_database_lookup_error);
- c_no_such_package_error = rb_define_class_under(c_paludis_module, "NoSuchPackageError", c_package_database_lookup_error);
- c_no_such_repository_error = rb_define_class_under(c_paludis_module, "NoSuchRepositoryError", c_package_database_lookup_error);
- c_dep_string_error = rb_define_class_under(c_paludis_module, "DepStringError", rb_eRuntimeError);
- c_dep_string_parse_error = rb_define_class_under(c_paludis_module, "DepStringParseError", c_dep_string_error);
- c_dep_string_nesting_error = rb_define_class_under(c_paludis_module, "DepStringNestingError", c_dep_string_parse_error);
- c_configuration_error = rb_define_class_under(c_paludis_module, "ConfigurationError", rb_eRuntimeError);
- c_config_file_error = rb_define_class_under(c_paludis_module, "ConfigFileError", c_configuration_error);
- c_dep_list_error = rb_define_class_under(c_paludis_module, "DepListError", rb_eRuntimeError);
-
- /*
- * Document-class: Paludis::AllMaskedError
- *
- * Thrown if all versions of a particular atom are masked.
- */
- c_all_masked_error = rb_define_class_under(c_paludis_module, "AllMaskedError", c_dep_list_error);
- rb_define_method(c_all_masked_error, "initialize", RUBY_FUNC_CAST(&has_query_property_error_init), -1);
- rb_define_method(c_all_masked_error, "query", RUBY_FUNC_CAST(&has_query_property_error_query), 0);
-
- /*
- * Document-class: Paludis::BlockError
- *
- * Thrown if a block is encountered.
- */
- c_block_error = rb_define_class_under(c_paludis_module, "BlockError", c_dep_list_error);
-
- /*
- * Document-class: Paludis::AllMaskedError
- *
- * Thrown if a circular dependency is encountered.
- */
- c_circular_dependency_error = rb_define_class_under(c_paludis_module, "CircularDependencyError", c_dep_list_error);
-
- /*
- * Document-class: Paludis::AllMaskedError
- *
- * Thrown if all versions of a particular atom are masked, but would not be if use requirements were not in effect.
- */
- c_use_requirements_not_met_error = rb_define_class_under(c_paludis_module, "UseRequirementsNotMetError", c_dep_list_error);
- rb_define_method(c_use_requirements_not_met_error, "initialize", RUBY_FUNC_CAST(&has_query_property_error_init), -1);
- rb_define_method(c_use_requirements_not_met_error, "query", RUBY_FUNC_CAST(&has_query_property_error_query), 0);
- c_downgrade_not_allowed_error = rb_define_class_under(c_paludis_module, "DowngradeNotAllowedError", c_dep_list_error);
-
- rb_define_module_function(c_paludis_module, "match_package", RUBY_FUNC_CAST(&paludis_match_package), 3);
-
- rb_define_const(c_paludis_module, "Version", rb_str_new2((stringify(PALUDIS_VERSION_MAJOR) + "."
- + stringify(PALUDIS_VERSION_MINOR) + "." + stringify(PALUDIS_VERSION_MICRO)).c_str()));
+ /*
+ * Document-module: Paludis
+ *
+ * <b>Paludis</b> is the other package mangler, this is the doc to the ruby binding. The C++ library
+ * documentation[http://paludis.pioto.org/doxygen/html/] may also help.
+ *
+ */
+ c_paludis_module = rb_define_module("Paludis");
+ c_environment = rb_define_class_under(paludis_module(), "Environment", rb_cObject);
+ c_no_config_environment = rb_define_class_under(paludis_module(), "NoConfigEnvironment", c_environment);
+ c_name_error = rb_define_class_under(c_paludis_module, "NameError", rb_eRuntimeError);
+ c_set_name_error = rb_define_class_under(c_paludis_module, "SetNameError", c_name_error);
+ c_category_name_part_error = rb_define_class_under(c_paludis_module, "CategoryNamePartError", c_name_error);
+ c_package_name_part_error = rb_define_class_under(c_paludis_module, "PackageNamePartError", c_name_error);
+ c_bad_version_spec_error = rb_define_class_under(c_paludis_module, "BadVersionSpecError", c_name_error);
+ c_package_dep_atom_error = rb_define_class_under(c_paludis_module, "PackageDepAtomError", rb_eRuntimeError);
+ c_package_database_error = rb_define_class_under(c_paludis_module, "PackageDatabaseError", rb_eRuntimeError);
+ c_package_database_lookup_error = rb_define_class_under(c_paludis_module, "PackageDatabaseLookupError", c_package_database_error);
+ c_ambiguous_package_name_error = rb_define_class_under(c_paludis_module, "AmbiguousPackageNameError", c_package_database_lookup_error);
+ c_no_such_package_error = rb_define_class_under(c_paludis_module, "NoSuchPackageError", c_package_database_lookup_error);
+ c_no_such_repository_error = rb_define_class_under(c_paludis_module, "NoSuchRepositoryError", c_package_database_lookup_error);
+ c_dep_string_error = rb_define_class_under(c_paludis_module, "DepStringError", rb_eRuntimeError);
+ c_dep_string_parse_error = rb_define_class_under(c_paludis_module, "DepStringParseError", c_dep_string_error);
+ c_dep_string_nesting_error = rb_define_class_under(c_paludis_module, "DepStringNestingError", c_dep_string_parse_error);
+ c_configuration_error = rb_define_class_under(c_paludis_module, "ConfigurationError", rb_eRuntimeError);
+ c_config_file_error = rb_define_class_under(c_paludis_module, "ConfigFileError", c_configuration_error);
+ c_dep_list_error = rb_define_class_under(c_paludis_module, "DepListError", rb_eRuntimeError);
+
+ /*
+ * Document-class: Paludis::AllMaskedError
+ *
+ * Thrown if all versions of a particular atom are masked.
+ */
+ c_all_masked_error = rb_define_class_under(c_paludis_module, "AllMaskedError", c_dep_list_error);
+ rb_define_method(c_all_masked_error, "initialize", RUBY_FUNC_CAST(&has_query_property_error_init), -1);
+ rb_define_method(c_all_masked_error, "query", RUBY_FUNC_CAST(&has_query_property_error_query), 0);
+
+ /*
+ * Document-class: Paludis::BlockError
+ *
+ * Thrown if a block is encountered.
+ */
+ c_block_error = rb_define_class_under(c_paludis_module, "BlockError", c_dep_list_error);
+
+ /*
+ * Document-class: Paludis::AllMaskedError
+ *
+ * Thrown if a circular dependency is encountered.
+ */
+ c_circular_dependency_error = rb_define_class_under(c_paludis_module, "CircularDependencyError", c_dep_list_error);
+
+ /*
+ * Document-class: Paludis::AllMaskedError
+ *
+ * Thrown if all versions of a particular atom are masked, but would not be if use requirements were not in effect.
+ */
+ c_use_requirements_not_met_error = rb_define_class_under(c_paludis_module, "UseRequirementsNotMetError", c_dep_list_error);
+ rb_define_method(c_use_requirements_not_met_error, "initialize", RUBY_FUNC_CAST(&has_query_property_error_init), -1);
+ rb_define_method(c_use_requirements_not_met_error, "query", RUBY_FUNC_CAST(&has_query_property_error_query), 0);
+ c_downgrade_not_allowed_error = rb_define_class_under(c_paludis_module, "DowngradeNotAllowedError", c_dep_list_error);
+
+ rb_define_module_function(c_paludis_module, "match_package", RUBY_FUNC_CAST(&paludis_match_package), 3);
+
+ rb_define_const(c_paludis_module, "Version", rb_str_new2((stringify(PALUDIS_VERSION_MAJOR) + "."
+ + stringify(PALUDIS_VERSION_MINOR) + "." + stringify(PALUDIS_VERSION_MICRO)).c_str()));
#ifdef ENABLE_RUBY_QA
- c_paludis_qa_module = rb_define_module_under(c_paludis_module,"QA");
- c_profiles_desc_error = rb_define_class_under(c_paludis_qa_module, "ProfilesDescError", c_configuration_error);
- c_no_such_file_check_type_error = rb_define_class_under(c_paludis_qa_module, "NoSuchFileCheckTypeError", rb_eTypeError);
- c_no_such_package_dir_check_type_error = rb_define_class_under(c_paludis_qa_module, "NoSuchPackageDirCheckTypeError", rb_eTypeError);
- c_no_such_ebuild_check_type_error = rb_define_class_under(c_paludis_qa_module, "NoSuchEbuildCheckTypeError", rb_eTypeError);
+ c_paludis_qa_module = rb_define_module_under(c_paludis_module,"QA");
+ c_profiles_desc_error = rb_define_class_under(c_paludis_qa_module, "ProfilesDescError", c_configuration_error);
+ c_no_such_file_check_type_error = rb_define_class_under(c_paludis_qa_module, "NoSuchFileCheckTypeError", rb_eTypeError);
+ c_no_such_package_dir_check_type_error = rb_define_class_under(c_paludis_qa_module, "NoSuchPackageDirCheckTypeError", rb_eTypeError);
+ c_no_such_ebuild_check_type_error = rb_define_class_under(c_paludis_qa_module, "NoSuchEbuildCheckTypeError", rb_eTypeError);
#endif
- RegisterRubyClass::get_instance()->execute();
- }
+ RegisterRubyClass::get_instance()->execute();
}
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 0670e53..1f08745 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -188,6 +188,8 @@ namespace paludis
return rb_str_new2(stringify(**self_ptr).c_str());
}
};
+
+ void init();
}
}
diff --git a/ruby/paludis_ruby_so.cc b/ruby/paludis_ruby_so.cc
new file mode 100644
index 0000000..284bb0b
--- /dev/null
+++ b/ruby/paludis_ruby_so.cc
@@ -0,0 +1,29 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "paludis_ruby.hh"
+
+extern "C"
+{
+ void Init_Paludis()
+ {
+ paludis::ruby::init();
+ }
+}
+