debian/0000755000000000000000000000000012256146025007171 5ustar debian/ruby-mkrf.docs0000644000000000000000000000000712133040001011733 0ustar README debian/copyright0000644000000000000000000001532012176035372011130 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: mkrf Source: http://mkrf.rubyforge.org/ Comment: the source has been repacked to exclude the binary file test/fixtures/some_binary, which is an executable for i386, distributed without source, and not needed for a working package anyway. Files: * Copyright: 2006 Kevin Clark License: Expat Files: lib/mkrf/rakehelper.rb Copyright: 2005 Zed A. Shaw 2006 Kevin Clark License: Ruby or GPL-2 Files: test/sample_files/libxml-ruby-0.3.8/* Copyright: 2002-2006 Sean Chittenden and contributors 2001 Wai-Sun "Squidster" Chia License: Expat Files: test/sample_files/syck-0.55/* Copyright: 2003 why the lucky stiff License: Expat or DeathRepudiation Comment: Expat wrongly entitled BSD in ext/sample_files/syck-0.55/COPYING Files: debian/* Copyright: 2011-2013 Cédric Boutillier License: Expat License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. License: GPL-2 This program 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. . This program 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. License: Ruby You can redistribute it and/or modify it under either the terms of the GPL version 2 (see the file GPL), or the conditions below: . 1. You may make and give away verbatim copies of the source form of the software without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. . 2. You may modify your copy of the software in any way, provided that you do at least ONE of the following: . a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or by allowing the author to include your modifications in the software. . b) use the modified software only within your corporation or organization. . c) give non-standard binaries non-standard names, with instructions on where to get the original software distribution. . d) make other distribution arrangements with the author. . 3. You may distribute the software in object code or binary form, provided that you do at least ONE of the following: . a) distribute the binaries and library files of the software, together with instructions (in the manual page or equivalent) on where to get the original distribution. . b) accompany the distribution with the machine-readable source of the software. . c) give non-standard binaries non-standard names, with instructions on where to get the original software distribution. . d) make other distribution arrangements with the author. . 4. You may modify and include the part of the software into any other software (possibly commercial). But some files in the distribution are not written by the author, so that they are not under these terms. . For the list of those files and their copying conditions, see the file LEGAL. . 5. The scripts and library files supplied as input to or produced as output from the software do not automatically fall under the copyright of the software, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this software. . 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. License: DeathRepudiation This software may not be used directly by any living being. ANY use of this software (even perfectly legitimate and non-commercial uses) until after death is explicitly restricted. Any living being using (or attempting to use) this software will be punished to the fullest extent of the law. . For your protection, corpses will not be punished. We respectfully request that you submit your uses (revisions, uses, distributions, uses, etc.) to your children, who may vicariously perform these uses on your behalf. If you use this software and you are found to be not dead, you will be punished to the fullest extent of the law. . If you are found to be a ghost or angel, you will be punished to the fullest extent of the law. . After your following the terms of this license, the author has vowed to repudiate your claim, meaning that the validity of this contract will no longer be recognized. This license will be unexpectedly revoked (at a time which is designated to be most inconvenient) and involved heirs will be punished to the fullest extent of the law. . Furthermore, if any parties (related or non-related) escape the punishments outlined herein, they will be severely punished to the fullest extent of a new revised law that (1) expands the statement "fullest extent of the law" to encompass an infinite duration of infinite punishments and (2) exacts said punishments upon all parties (related or non-related). debian/rules0000755000000000000000000000275612133040001010240 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) #export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec %: dh $@ --buildsystem=ruby --with ruby override_dh_auto_clean: #cleaning the files built during the tests for x in libtrivial/ext libxml-ruby-0.3.8/ext/xml syck-0.55/ext/ruby/ext/syck ; do \ cd test/sample_files/$$x ; \ pwd ; \ [ -e Rakefile ] && rake clean && rake clobber ; \ cd - ; \ done dh_auto_clean override_dh_auto_install: touch test/fixtures/some_binary chmod +x test/fixtures/some_binary dh_auto_install DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's/^Version: ([^+]+).*/\1/p') get-orig-source: uscan --noconf --force-download --rename --download-current-version --destdir=. rm -rf ruby-mkrf-$(DEB_UPSTREAM_VERSION) tar -xf ruby-mkrf_$(DEB_UPSTREAM_VERSION).orig.tar.gz rm ruby-mkrf_$(DEB_UPSTREAM_VERSION).orig.tar.gz rm mkrf-$(DEB_UPSTREAM_VERSION)/test/fixtures/some_binary mv mkrf-$(DEB_UPSTREAM_VERSION) ruby-mkrf-$(DEB_UPSTREAM_VERSION).orig GZIP=--best tar -cz --owner root --group root --mode a+rX -f \ ../ruby-mkrf_$(DEB_UPSTREAM_VERSION)+dfsg.orig.tar.gz ruby-mkrf-$(DEB_UPSTREAM_VERSION).orig rm -r ruby-mkrf-$(DEB_UPSTREAM_VERSION).orig debian/clean0000644000000000000000000000027112133040001010153 0ustar mkrf.log test/sample_files/libtrivial/ext/Rakefile test/sample_files/libxml-ruby-0.3.8/ext/xml/Rakefile test/sample_files/syck-0.55/ext/ruby/ext/syck/Rakefile test/fixtures/some_binary debian/source/0000755000000000000000000000000012133040001010446 5ustar debian/source/format0000644000000000000000000000001412133040001011654 0ustar 3.0 (quilt) debian/control0000644000000000000000000000215112256143047010574 0ustar Source: ruby-mkrf Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Cédric Boutillier Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.6.0~), rake, zlib1g-dev, libxml2-dev, libxslt1-dev Standards-Version: 3.9.5 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-mkrf.git Vcs-Browser: http://anonscm.debian.org/gitweb?p=pkg-ruby-extras/ruby-mkrf.git;a=summary Homepage: http://mkrf.rubyforge.org/ XS-Ruby-Versions: all Package: ruby-mkrf Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter, rake Description: Ruby library generating Rakefiles to build C extensions to Ruby The mkrf Ruby library generates Rakefilesto build extensions to Ruby written in C. Rakefiles are Ruby analogs of Makefiles, describing tasks for the Rake utility (Ruby make). . This library is an alternative to the mkmf Ruby library, provided in the ruby-*-dev packages, the main difference being that mkmf generates Makefiles for the make utility instead. debian/README.source0000644000000000000000000000051412133040001011325 0ustar This package uses the 3.0 quilt source format. The source has been repacked to exclude the file test/fixtures/some_binary, which is a executable built for the i386 architecture, with no source available. It is replaced with an emply file created with the executable bit set just before tests are run, and deleted right afterwards. debian/ruby-tests.rb0000644000000000000000000000010012133040001011603 0ustar Dir['test/{integration,unit}/test_*.rb'].each { |f| require f } debian/watch0000644000000000000000000000020012133040001010167 0ustar version=3 opts=dversionmangle=s/\+dfsg// \ http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/mkrf .*/mkrf-(.*).tar.gz debian/changelog0000644000000000000000000000530312256145762011053 0ustar ruby-mkrf (0.2.3+dfsg-5) unstable; urgency=medium * Team upload. * Build for Ruby 2.0 and 1.9.1: * Remove rcov support (unsupported on 1.9+) * Update Build-Depends for ruby2.0, drop ruby1.8 * Unconditionally apply patches for Ruby 1.9+ * Add patch for multiarch header dirs (new in Ruby 2.0) * Update Standards-Version to 3.9.5 (no changes) -- Christian Hofstaedtler Tue, 24 Dec 2013 00:48:29 +0100 ruby-mkrf (0.2.3+dfsg-4) unstable; urgency=medium * Set urgency to medium as an RC bug is closed. * debian/control: + remove obsolete DM-Upload-Allowed flag + use canonical URI in Vcs-* fields + update my email address + bump Standards-Version to 3.9.4 (no changes needed) * debian/copyright: + use DEP5 copyright-format/1.0 official URL for Format field + update my email and years * debian/patches: + add 0150_updatkefile.patch: comment out obsolete commands in Rakefile, wich caused FTBFS (Closes: #713149) + add 0601_disable_docbCreateFileParserCtxt_check.patch removing a check for test failing with libxml2 >= 2.9 -- Cédric Boutillier Mon, 24 Jun 2013 22:17:21 +0200 ruby-mkrf (0.2.3+dfsg-3) unstable; urgency=low * Add 0700_fix_link_command_order.patch, solving FTBFS with --as-needed linker flag. Thanks Felix Geyer for the patch (Closes: #684198). -- Cédric Boutillier Tue, 04 Sep 2012 11:56:34 +0200 ruby-mkrf (0.2.3+dfsg-2) unstable; urgency=low * Add 0400_use_correct_ruby_version_in_tests.patch: Use the same Ruby binary to run the tests and to build test Rakefiles. This is needed to test the library correctly against the different versions of the Ruby interpreter in Debian. * Add 0500_replace_config_by_rbconfig.patch Use RbConfig:: instead of Config:: deprecated in Ruby 1.8 and 1.9. Making this slight change avoids avoid annoying warnings. * Add 0600_fix_test_libxml.patch 0610_fix_test_syck.patch Port code built during tests to Ruby1.9 (Closes: #676204). Although this is not part of the mkrf library itself, this is needed to test the library correctly with the various Ruby interpreter. * Add 9900_debug_test_failures.patch Make the test suite output more verbose, to get enough info if something goes wrong during the build. * Bump Standards-Version: to 3.9.3 (no changes needed) -- Cédric Boutillier Wed, 04 Jul 2012 13:34:26 +0200 ruby-mkrf (0.2.3+dfsg-1) unstable; urgency=low * Initial release (Closes: #584886) * repack to remove binary code in test/ directory -- Cédric Boutillier Tue, 13 Dec 2011 21:20:51 +0100 debian/compat0000644000000000000000000000000212133040001010344 0ustar 7 debian/patches/0000755000000000000000000000000012256145555010627 5ustar debian/patches/0400_use_correct_ruby_version_in_tests.patch0000644000000000000000000000262112133040001021315 0ustar Description: Use the same Ruby binary to run the tests and to create Rakefiles Gem2deb defines the RUBY_TEST_BIN environment variable. Use it to call the correct version of the Ruby binary during tests on extconf.rb to generate Rakefiles. Author: Cédric Boutillier Last-Update: 2012-07-04 --- a/Rakefile +++ b/Rakefile @@ -18,6 +18,8 @@ RUBY_FORGE_PROJECT = "mkrf" RUBY_FORGE_USER = "kevinclark" +RUBY_TEST_BIN = ENV['RUBY_TEST_BIN'] + task :default => ["test:units"] @@ -55,22 +57,22 @@ desc "Try to compile a trivial extension" task :trivial do - sh "cd #{SAMPLE_DIRS[:trivial]}; ruby extconf.rb; rake" + sh "cd #{SAMPLE_DIRS[:trivial]}; #{RUBY_TEST_BIN} extconf.rb; rake" end desc "Try to compile libxml" task :libxml do - sh "cd #{SAMPLE_DIRS[:libxml]}; ruby extconf.rb; rake" + sh "cd #{SAMPLE_DIRS[:libxml]}; #{RUBY_TEST_BIN} extconf.rb; rake" end desc "Try to compile syck" task :syck do - sh "cd #{SAMPLE_DIRS[:syck]}; ruby extconf.rb; rake" + sh "cd #{SAMPLE_DIRS[:syck]}; #{RUBY_TEST_BIN} extconf.rb; rake" end desc "Try to compile cpp_bang" task :cpp_bang do - sh "cd #{SAMPLE_DIRS[:cpp_bang]}; ruby mkrf_config.rb; rake" + sh "cd #{SAMPLE_DIRS[:cpp_bang]}; #{RUBY_TEST_BIN} mkrf_config.rb; rake" end desc "Clean up after sample tests" debian/patches/0900_multiarch.patch0000644000000000000000000000514312256145555014313 0ustar Index: ruby-mkrf/lib/mkrf/availability.rb =================================================================== --- ruby-mkrf.orig/lib/mkrf/availability.rb 2013-12-24 00:39:20.045251620 +0100 +++ ruby-mkrf/lib/mkrf/availability.rb 2013-12-24 00:39:20.041251633 +0100 @@ -9,15 +9,15 @@ module Mkrf # which need to determine functionality based on what libraries are available # on the current system. class Availability - # ruby 1.9+ - if RbConfig::CONFIG['rubyhdrdir'] - DEFAULT_INCLUDES = [RbConfig::CONFIG['rubyhdrdir'], + # ruby 2.0+ + if RbConfig::CONFIG['rubyarchhdrdir'] + DEFAULT_INCLUDES = [RbConfig::CONFIG['rubyarchhdrdir'],RbConfig::CONFIG['rubyhdrdir'], RbConfig::CONFIG['rubyhdrdir'] + "/" + RbConfig::CONFIG['arch'], RbConfig::CONFIG["archdir"],RbConfig::CONFIG['sitelibdir'], "."] - else - DEFAULT_INCLUDES = [RbConfig::CONFIG['includedir'], RbConfig::CONFIG["archdir"], - RbConfig::CONFIG['sitelibdir'], "."] + DEFAULT_INCLUDES = [RbConfig::CONFIG['rubyhdrdir'], + RbConfig::CONFIG['rubyhdrdir'] + "/" + RbConfig::CONFIG['arch'], + RbConfig::CONFIG["archdir"],RbConfig::CONFIG['sitelibdir'], "."] end # These really shouldn't be static like this.. Index: ruby-mkrf/test/unit/test_availability.rb =================================================================== --- ruby-mkrf.orig/test/unit/test_availability.rb 2013-12-24 00:39:19.817252417 +0100 +++ ruby-mkrf/test/unit/test_availability.rb 2013-12-24 00:40:20.193079805 +0100 @@ -137,13 +137,14 @@ class TestAvailabilityDefaults < Test::U def test_default_include_dir_should_be_from_rbconfig #Fix to correspond to the definition in lib/mkrf/availability.rb (Debian patch) - if Config::CONFIG['rubyhdrdir'] - expected = [Config::CONFIG['rubyhdrdir'], + if Config::CONFIG['rubyarchhdrdir'] + expected = [Config::CONFIG['rubyarchhdrdir'],Config::CONFIG['rubyhdrdir'], Config::CONFIG['rubyhdrdir'] + "/" + Config::CONFIG['arch'], Config::CONFIG["archdir"],Config::CONFIG['sitelibdir'], "."] else - expected = [Config::CONFIG['includedir'], Config::CONFIG["archdir"], - Config::CONFIG['sitelibdir'], "."] + expected = [Config::CONFIG['rubyhdrdir'], + Config::CONFIG['rubyhdrdir'] + "/" + Config::CONFIG['arch'], + Config::CONFIG["archdir"],Config::CONFIG['sitelibdir'], "."] end assert_equal expected, @avail.send(:instance_variable_get, :@includes) debian/patches/0700_fix_link_command_order.patch0000644000000000000000000000155212133040001016763 0ustar Description: Fix link command order so it works with ld --as-needed. Author: Felix Geyer Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684198 --- ruby-mkrf-0.2.3+dfsg.orig/lib/mkrf/availability.rb +++ ruby-mkrf-0.2.3+dfsg/lib/mkrf/availability.rb @@ -279,9 +279,9 @@ module Mkrf def link_command # This current implementation just splats the library_paths in # unconditionally. Is this problematic? - "#{@compiler} -o #{TEMP_EXECUTABLE} #{library_paths_compile_string}" + - " #{library_compile_string} #{includes_compile_string}" + - " #{TEMP_SOURCE_FILE}" + "#{@compiler} -o #{TEMP_EXECUTABLE}" + + " #{includes_compile_string} #{TEMP_SOURCE_FILE}" + + " #{library_paths_compile_string} #{library_compile_string}" end # Creates a temporary source file with the string passed debian/patches/0800_remove_rcov.patch0000644000000000000000000000112012256142764014636 0ustar Index: ruby-mkrf/lib/mkrf/rakehelper.rb =================================================================== --- ruby-mkrf.orig/lib/mkrf/rakehelper.rb 2013-12-24 00:23:06.732672527 +0100 +++ ruby-mkrf/lib/mkrf/rakehelper.rb 2013-12-24 00:23:30.608588122 +0100 @@ -109,15 +109,3 @@ def sub_project(project, *targets) end end end - -# Conditional require rcov/rcovtask if present -begin - require 'rcov/rcovtask' - - Rcov::RcovTask.new do |t| - t.test_files = FileList['test/test*.rb'] - t.rcov_opts << "-x /usr" - t.output_dir = "test/coverage" - end -rescue Object -end debian/patches/0100_remove_rubygems.patch0000644000000000000000000000145212133040001015472 0ustar Description: remove requirement on rubygems Author: Cédric Boutillier Last-Update: 2011-12-15 --- a/lib/mkrf/generator.rb +++ b/lib/mkrf/generator.rb @@ -1,4 +1,3 @@ -require 'rubygems' require 'rbconfig' require 'rake/tasklib' --- a/test/sample_files/cpp_bang/ext/mkrf_config.rb +++ b/test/sample_files/cpp_bang/ext/mkrf_config.rb @@ -1,6 +1,6 @@ -require 'rubygems' +#require 'rubygems' require 'mkrf' Mkrf::Generator.new('bang', ["*.cpp"]) do |g| g.ldshared << ' -L/usr/lib -lgcc -lstdc++' -end \ No newline at end of file +end --- a/Rakefile +++ b/Rakefile @@ -3,7 +3,8 @@ require 'rake/packagetask' require 'rake/gempackagetask' require 'rake/rdoctask' -require 'rubygems' +#require 'rubygems' + $:.unshift(File.dirname(__FILE__) + "/lib") require 'mkrf' debian/patches/0600_fix_test_libxml.patch0000644000000000000000000001143212133040001015460 0ustar Description: Port code from libxml example to Ruby1.9 Author: Cédric Boutillier Last-Update: 2012-07-04 --- a/test/sample_files/libxml-ruby-0.3.8/ext/xml/extconf.rb +++ b/test/sample_files/libxml-ruby-0.3.8/ext/xml/extconf.rb @@ -5,7 +5,7 @@ exit 1 end -Mkrf::Generator.new('libxml_so', '*.c') do |g| +Mkrf::Generator.new('libxml_so', ['*.c']) do |g| g.include_library('socket','socket') g.include_library('nsl','gethostbyname') @@ -46,4 +46,4 @@ crash('Need docbCreateFileParserCtxt') end -end \ No newline at end of file +end --- a/test/sample_files/libxml-ruby-0.3.8/ext/xml/libxml.h +++ b/test/sample_files/libxml-ruby-0.3.8/ext/xml/libxml.h @@ -13,8 +13,13 @@ #define RUBY_LIBXML_VER_MIC 8 #include +#if RUBY_INTERN_H +#include +#include +#else #include #include +#endif #include #include #include --- a/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_document.c +++ b/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_document.c @@ -138,7 +138,7 @@ */ VALUE ruby_xml_document_dump(int argc, VALUE *argv, VALUE self) { - OpenFile *fptr; + rb_io_t *fptr; VALUE io; FILE *out; ruby_xml_document *rxd; @@ -177,7 +177,7 @@ VALUE ruby_xml_document_debug_dump(int argc, VALUE *argv, VALUE self) { #ifdef LIBXML_DEBUG_ENABLED - OpenFile *fptr; + rb_io_t *fptr; VALUE io; FILE *out; ruby_xml_document *rxd; @@ -221,7 +221,7 @@ VALUE ruby_xml_document_debug_dump_head(int argc, VALUE *argv, VALUE self) { #ifdef LIBXML_DEBUG_ENABLED - OpenFile *fptr; + rb_io_t *fptr; VALUE io; FILE *out; ruby_xml_document *rxd; @@ -266,7 +266,7 @@ */ VALUE ruby_xml_document_format_dump(int argc, VALUE *argv, VALUE self) { - OpenFile *fptr; + rb_io_t *fptr; VALUE bool, io; FILE *out; ruby_xml_document *rxd; --- a/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpath.c +++ b/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpath.c @@ -163,31 +163,31 @@ ruby_xml_xpath_context_register_namespace(xxpc, rprefix, ruri); break; case T_ARRAY: - for (i = 0; i < RARRAY(argv[2])->len; i++) { - switch (TYPE(RARRAY(argv[2])->ptr[i])) { + for (i = 0; i < RARRAY_LEN(argv[2]); i++) { + switch (TYPE(RARRAY_PTR(argv[2])[i])) { case T_STRING: - cp = strchr(StringValuePtr(RARRAY(argv[2])->ptr[i]), (int)':'); + cp = strchr(StringValuePtr(RARRAY_PTR(argv[2])[i]), (int)':'); if (cp == NULL) { - rprefix = RARRAY(argv[2])->ptr[i]; + rprefix = RARRAY_PTR(argv[2])[i]; ruri = Qnil; } else { - rprefix = rb_str_new(StringValuePtr(RARRAY(argv[2])->ptr[i]), (int)((long)cp - (long)StringValuePtr(RARRAY(argv[2])->ptr[i]))); + rprefix = rb_str_new(StringValuePtr(RARRAY_PTR(argv[2])[i]), (int)((long)cp - (long)StringValuePtr(RARRAY_PTR(argv[2])[i]))); ruri = rb_str_new2(&cp[1]); } /* Should test the results of this */ ruby_xml_xpath_context_register_namespace(xxpc, rprefix, ruri); break; case T_ARRAY: - if (RARRAY(RARRAY(argv[2])->ptr[i])->len == 2) { - rprefix = RARRAY(RARRAY(argv[2])->ptr[i])->ptr[0]; - ruri = RARRAY(RARRAY(argv[2])->ptr[i])->ptr[1]; + if (RARRAY_LEN(RARRAY_PTR(argv[2])[i]) == 2) { + rprefix = RARRAY_PTR(RARRAY_PTR(argv[2])[i])[0]; + ruri = RARRAY_PTR(RARRAY_PTR(argv[2])[i])[1]; ruby_xml_xpath_context_register_namespace(xxpc, rprefix, ruri); } else { rb_raise(rb_eArgError, "nested array must be an array of strings, prefix and href/uri"); } break; default: - if (rb_obj_is_kind_of(RARRAY(argv[2])->ptr[i], cXMLNS) == Qtrue) { + if (rb_obj_is_kind_of(RARRAY_PTR(argv[2])[i], cXMLNS) == Qtrue) { Data_Get_Struct(argv[2], ruby_xml_ns, rxns); rprefix = rb_str_new2((const char*)rxns->ns->prefix); ruri = rb_str_new2((const char*)rxns->ns->href); --- a/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_parser.c +++ b/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_parser.c @@ -895,7 +895,7 @@ ruby_xml_parser *rxp; ruby_xml_parser_context *rxpc; rx_io_data *data; - OpenFile *fptr; + rb_io_t *fptr; FILE *f; if (!rb_obj_is_kind_of(io, rb_cIO)) @@ -1214,7 +1214,7 @@ data->str = str; Data_Get_Struct(rxp->ctxt, ruby_xml_parser_context, rxpc); - rxpc->ctxt = xmlCreateMemoryParserCtxt(StringValuePtr(data->str), RSTRING(data->str)->len); + rxpc->ctxt = xmlCreateMemoryParserCtxt(StringValuePtr(data->str), RSTRING_LEN(data->str)); return(data->str); } --- a/test/sample_files/libxml-ruby-0.3.8/ext/xml/libxml.c +++ b/test/sample_files/libxml-ruby-0.3.8/ext/xml/libxml.c @@ -5,7 +5,7 @@ #include "libxml.h" /* Ruby's util.h has ruby_strdup */ -#include "util.h" +//#include "util.h" #ifdef xmlMalloc #undef xmlMalloc debian/patches/0610_fix_test_syck.patch0000644000000000000000000001505512256144142015171 0ustar Description: Port syck example to Ruby1.9 Author: Cédric Boutillier Last-Update: 2012-07-04 --- a/test/sample_files/syck-0.55/ext/ruby/ext/syck/extconf.rb +++ b/test/sample_files/syck-0.55/ext/ruby/ext/syck/extconf.rb @@ -5,5 +5,5 @@ end Mkrf::Generator.new('syck') do |g| - g.include_header("st.h") + g.include_header("ruby/backward/st.h") end --- a/test/sample_files/syck-0.55/lib/syck.h +++ b/test/sample_files/syck-0.55/lib/syck.h @@ -20,6 +20,8 @@ #include #ifdef HAVE_ST_H #include +#elif HAVE_RUBY_BACKWARD_ST_H +#include #else #include "syck_st.h" #endif --- a/test/sample_files/syck-0.55/ext/ruby/ext/syck/rubyext.c +++ b/test/sample_files/syck-0.55/ext/ruby/ext/syck/rubyext.c @@ -154,8 +154,8 @@ if (!NIL_P(str2)) { StringValue(str2); - len = RSTRING(str2)->len; - memcpy( buf + skip, RSTRING(str2)->ptr, len ); + len = RSTRING_LEN(str2); + memcpy( buf + skip, RSTRING_PTR(str2), len ); } } len += skip; @@ -177,7 +177,7 @@ if (!NIL_P(tmp = rb_check_string_type(port))) { taint = OBJ_TAINTED(port); /* original taintedness */ port = tmp; - syck_parser_str( parser, RSTRING(port)->ptr, RSTRING(port)->len, NULL ); + syck_parser_str( parser, RSTRING_PTR(port), RSTRING_LEN(port), NULL ); } else if (rb_respond_to(port, s_read)) { if (rb_respond_to(port, s_binmode)) { @@ -634,7 +634,7 @@ if ( bonus->taint) OBJ_TAINT( obj ); if ( bonus->proc != 0 ) rb_funcall(bonus->proc, s_call, 1, obj); - rb_hash_aset(bonus->data, INT2FIX(RHASH(bonus->data)->tbl->num_entries), obj); + rb_hash_aset(bonus->data, INT2FIX(RHASH_TBL(bonus->data)->num_entries), obj); return obj; } @@ -1032,10 +1032,10 @@ VALUE ivname = rb_ary_entry( vars, 0 ); char *ivn; StringValue( ivname ); - ivn = S_ALLOC_N( char, RSTRING(ivname)->len + 2 ); + ivn = S_ALLOC_N( char, RSTRING_LEN(ivname) + 2 ); ivn[0] = '@'; ivn[1] = '\0'; - strncat( ivn, RSTRING(ivname)->ptr, RSTRING(ivname)->len ); + strncat( ivn, RSTRING_PTR(ivname), RSTRING_LEN(ivname) ); rb_iv_set( obj, ivn, rb_ary_entry( vars, 1 ) ); S_FREE( ivn ); return Qnil; @@ -1051,7 +1051,7 @@ VALUE tclass = rb_cObject; VALUE tparts = rb_str_split( const_name, "::" ); int i = 0; - for ( i = 0; i < RARRAY(tparts)->len; i++ ) { + for ( i = 0; i < RARRAY_LEN(tparts); i++ ) { VALUE tpart = rb_to_id( rb_ary_entry( tparts, i ) ); if ( !rb_const_defined( tclass, tpart ) ) return Qnil; tclass = rb_const_get( tclass, tpart ); @@ -1066,12 +1066,12 @@ syck_resolver_transfer( self, type, val ) VALUE self, type, val; { - if (NIL_P(type) || RSTRING(StringValue(type))->len == 0) + if (NIL_P(type) || RSTRING_LEN(StringValue(type)) == 0) { type = rb_funcall( self, s_detect_implicit, 1, val ); } - if ( ! (NIL_P(type) || RSTRING(StringValue(type))->len == 0) ) + if ( ! (NIL_P(type) || RSTRING_LEN(StringValue(type)) == 0) ) { VALUE str_xprivate = rb_str_new2( "x-private" ); VALUE colon = rb_str_new2( ":" ); @@ -1088,7 +1088,7 @@ VALUE subclass_parts = rb_ary_new(); VALUE parts = rb_str_split( type, ":" ); - while ( RARRAY(parts)->len > 1 ) + while ( RARRAY_LEN(parts) > 1 ) { VALUE partial; rb_ary_unshift( subclass_parts, rb_ary_pop( parts ) ); @@ -1106,7 +1106,7 @@ if ( ! NIL_P( target_class ) ) { subclass = target_class; - if ( RARRAY(subclass_parts)->len > 0 && rb_respond_to( target_class, s_tag_subclasses ) && + if ( RARRAY_LEN(subclass_parts) > 0 && rb_respond_to( target_class, s_tag_subclasses ) && RTEST( rb_funcall( target_class, s_tag_subclasses, 0 ) ) ) { VALUE subclass_v; @@ -1121,7 +1121,7 @@ else if ( rb_cObject == target_class && subclass_v == Qnil ) { // StringValue(subclass); - // printf( "No class: %s\n", RSTRING(subclass)->ptr ); + // printf( "No class: %s\n", RSTRING_PTR(subclass) ); target_class = cYObject; type = subclass; subclass = cYObject; @@ -1194,7 +1194,7 @@ { char *taguri; val = tmp; - taguri = syck_type_id_to_uri( RSTRING(val)->ptr ); + taguri = syck_type_id_to_uri( RSTRING_PTR(val) ); return rb_str_new2( taguri ); } @@ -1214,7 +1214,7 @@ if ( !NIL_P(tmp) ) { val = tmp; - type_id = syck_match_implicit( RSTRING(val)->ptr, RSTRING(val)->len ); + type_id = syck_match_implicit( RSTRING_PTR(val), RSTRING_LEN(val) ); return rb_str_new2( type_id ); } @@ -1517,8 +1517,8 @@ Data_Get_Struct( self, SyckNode, node ); StringValue( val ); - node->data.str->ptr = RSTRING(val)->ptr; - node->data.str->len = RSTRING(val)->len; + node->data.str->ptr = RSTRING_PTR(val); + node->data.str->len = RSTRING_LEN(val); node->data.str->style = scalar_none; rb_iv_set( self, "@value", val ); @@ -1571,7 +1571,7 @@ if ( !NIL_P( val ) ) { int i; syck_seq_empty( node ); - for ( i = 0; i < RARRAY( val )->len; i++ ) + for ( i = 0; i < RARRAY_LEN( val ); i++ ) { syck_seq_add( node, rb_ary_entry(val, i) ); } @@ -1660,7 +1660,7 @@ } keys = rb_funcall( hsh, s_keys, 0 ); - for ( i = 0; i < RARRAY(keys)->len; i++ ) + for ( i = 0; i < RARRAY_LEN(keys); i++ ) { VALUE key = rb_ary_entry(keys, i); syck_map_add( node, key, rb_hash_aref(hsh, key) ); @@ -1696,7 +1696,7 @@ syck_map_empty( node ); keys = rb_funcall( hsh, s_keys, 0 ); - for ( i = 0; i < RARRAY(keys)->len; i++ ) + for ( i = 0; i < RARRAY_LEN(keys); i++ ) { VALUE key = rb_ary_entry(keys, i); syck_map_add( node, key, rb_hash_aref(hsh, key) ); --- a/test/sample_files/syck-0.55/ext/ruby/ext/syck/syck.h +++ b/test/sample_files/syck-0.55/ext/ruby/ext/syck/syck.h @@ -20,6 +20,8 @@ #include #ifdef HAVE_ST_H #include +#elif HAVE_RUBY_BACKWARD_ST_H +#include #else #include "syck_st.h" #endif debian/patches/9900_debug_test_failures.patch0000644000000000000000000000147212133040001016322 0ustar Description: Make the output of the test suite more verbose Author: Cédric Boutillier Last-Update: 2012-07-04 --- a/test/integration/test_sample_projects.rb +++ b/test/integration/test_sample_projects.rb @@ -10,18 +10,18 @@ } # Set to true for full command line output - @@debug = false + @@debug = true SAMPLE_LIBS.each do |k,v| define_method("test_that_#{k}_compiles") do - silence_command_line do +# silence_command_line do system("rake test:samples:clobber PROJECT=#{k}") - end +# end assert_creates_file(SAMPLES_DIR + v) do - silence_command_line do +# silence_command_line do system("rake test:samples:#{k}") - end +# end end end end -end \ No newline at end of file +end debian/patches/0150_update_rakefile.patch0000644000000000000000000000217612176035372015443 0ustar Description: comment all obsolete commands in Rakefile Fixes FTBFS with newer rake Author: Cédric Boutillier Origin: vendor Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=713149 Last-Update: 2013-06-23 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,8 @@ require 'rake' require 'rake/testtask' require 'rake/packagetask' -require 'rake/gempackagetask' -require 'rake/rdoctask' +#require 'rake/gempackagetask' +#require 'rake/rdoctask' #require 'rubygems' @@ -91,10 +91,10 @@ end -Rake::RDocTask.new do |rd| - rd.main = "README" - rd.rdoc_files.include("README", "lib/**/*.rb") -end +#Rake::RDocTask.new do |rd| +# rd.main = "README" +# rd.rdoc_files.include("README", "lib/**/*.rb") +#end # Create compressed packages spec = Gem::Specification.new do |s| @@ -122,8 +122,8 @@ s.files = s.files + Dir.glob( "test/**/*" ).delete_if { |item| item.include?( "\.svn" ) } end -Rake::GemPackageTask.new(spec) do |p| - p.gem_spec = spec - p.need_tar = true - p.need_zip = true -end +#Rake::GemPackageTask.new(spec) do |p| +# p.gem_spec = spec +# p.need_tar = true +# p.need_zip = true +#end debian/patches/0500_replace_config_by_rbconfig.patch0000644000000000000000000000577012133040001017576 0ustar Description: Replace deprecated Config:: by RbConfig:: Author: Cédric Boutillier Last-Update: 2012-07-04 --- a/lib/mkrf/availability.rb +++ b/lib/mkrf/availability.rb @@ -10,14 +10,14 @@ # on the current system. class Availability # ruby 1.9+ - if Config::CONFIG['rubyhdrdir'] - DEFAULT_INCLUDES = [Config::CONFIG['rubyhdrdir'], - Config::CONFIG['rubyhdrdir'] + "/" + Config::CONFIG['arch'], - Config::CONFIG["archdir"],Config::CONFIG['sitelibdir'], "."] + if RbConfig::CONFIG['rubyhdrdir'] + DEFAULT_INCLUDES = [RbConfig::CONFIG['rubyhdrdir'], + RbConfig::CONFIG['rubyhdrdir'] + "/" + RbConfig::CONFIG['arch'], + RbConfig::CONFIG["archdir"],RbConfig::CONFIG['sitelibdir'], "."] else - DEFAULT_INCLUDES = [Config::CONFIG['includedir'], Config::CONFIG["archdir"], - Config::CONFIG['sitelibdir'], "."] + DEFAULT_INCLUDES = [RbConfig::CONFIG['includedir'], RbConfig::CONFIG["archdir"], + RbConfig::CONFIG['sitelibdir'], "."] end # These really shouldn't be static like this.. @@ -35,11 +35,11 @@ # * :compiler -- which compiler to use when determining availability # * :includes -- directories that should be searched for include files def initialize(options = {}) - @loaded_libs = [(options[:loaded_libs] || Config::CONFIG["LIBS"].gsub('-l', '').split)].flatten + @loaded_libs = [(options[:loaded_libs] || RbConfig::CONFIG["LIBS"].gsub('-l', '').split)].flatten @library_paths = [(options[:library_paths] || [])].flatten # Not sure what COMMON_HEADERS looks like when populated - @headers = options[:headers] || [] # Config::CONFIG["COMMON_HEADERS"] - @compiler = options[:compiler] || Config::CONFIG["CC"] + @headers = options[:headers] || [] # RbConfig::CONFIG["COMMON_HEADERS"] + @compiler = options[:compiler] || RbConfig::CONFIG["CC"] @includes = [(options[:includes] || DEFAULT_INCLUDES)].flatten @logger = Logger.new('mkrf.log') @defines = [] @@ -167,7 +167,7 @@ if RUBY_PLATFORM =~ /mswin/ "link -nologo -incremental:no -debug -opt:ref -opt:icf -dll" else - Config::CONFIG['LDSHARED'] + RbConfig::CONFIG['LDSHARED'] end end --- a/lib/mkrf/generator.rb +++ b/lib/mkrf/generator.rb @@ -40,7 +40,7 @@ class Generator include Rake - CONFIG = Config::CONFIG + CONFIG = RbConfig::CONFIG # Any extra code, given as a string, to be appended to the Rakefile. attr_accessor :additional_code --- a/lib/mkrf/rakehelper.rb +++ b/lib/mkrf/rakehelper.rb @@ -41,7 +41,7 @@ def setup_extension(dir, extension) ext = "ext/#{dir}" - ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}" + ext_so = "#{ext}/#{extension}.#{RbConfig::CONFIG['DLEXT']}" ext_files = FileList[ "#{ext}/*.c", "#{ext}/*.h", debian/patches/0601_disable_docbCreateFileParserCtxt_check.patch0000644000000000000000000000127612176035372022013 0ustar Description: skip check of docbCreateFileParserCtxt presence This is marked as deprecated in libxml2 and has been removed from 2.9 Author: Cédric Boutillier Origin: vendor Last-Update: 2013-06-24 --- a/test/sample_files/libxml-ruby-0.3.8/ext/xml/extconf.rb +++ b/test/sample_files/libxml-ruby-0.3.8/ext/xml/extconf.rb @@ -42,8 +42,9 @@ crash('Your version of libxml2 is too old. Please upgrade.') end - unless g.has_function? 'docbCreateFileParserCtxt' - crash('Need docbCreateFileParserCtxt') - end + # this module is deprecated in recent libxml2 + #unless g.has_function? 'docbCreateFileParserCtxt' + # crash('Need docbCreateFileParserCtxt') + #end end debian/patches/0200_remove_load_path_manipulations.rb0000644000000000000000000000153012133040001020035 0ustar Description: do not override $LOAD_PATH This ensures that the lib we require is the one installed in debian/ruby-mkrf Author: Cédric Boutillier Last-Update: 2011-12-15 --- a/test/abstract_unit.rb +++ b/test/abstract_unit.rb @@ -1,7 +1,8 @@ -$:.unshift(File.dirname(__FILE__) + '/../lib') +#$:.unshift(File.dirname(__FILE__) + '/../lib') require 'test/unit' -require File.dirname(__FILE__) + '/../lib/mkrf' +#require File.dirname(__FILE__) + '/../lib/mkrf' +require 'mkrf' $debug = false @@ -41,4 +42,4 @@ assert File.exist?(file), "#{file} wasn't created!" end -end \ No newline at end of file +end --- a/Rakefile +++ b/Rakefile @@ -6,7 +6,7 @@ #require 'rubygems' -$:.unshift(File.dirname(__FILE__) + "/lib") +#$:.unshift(File.dirname(__FILE__) + "/lib") require 'mkrf' PKG_NAME = 'mkrf' debian/patches/series0000644000000000000000000000070312256144452012037 0ustar 0100_remove_rubygems.patch 0150_update_rakefile.patch 0200_remove_load_path_manipulations.rb 0300_fix_test_default_include_dir_should_be_from_rbconfig.patch 0400_use_correct_ruby_version_in_tests.patch 0500_replace_config_by_rbconfig.patch 0600_fix_test_libxml.patch 0601_disable_docbCreateFileParserCtxt_check.patch 0610_fix_test_syck.patch 0700_fix_link_command_order.patch 9900_debug_test_failures.patch 0800_remove_rcov.patch 0900_multiarch.patch debian/patches/0300_fix_test_default_include_dir_should_be_from_rbconfig.patch0000644000000000000000000000241412133040001025073 0ustar Description: fix test to reflect the full definition of DEFAULT_INCLUDES A modification has been made to the library has been made in lib/mkrf/availability.rb to take into account the change of include directories for Ruby 1.9+ This patch brings the modification to the tests. Author: Cédric Boutillier Last-Update: 2011-12-15 Forwarded: http://rubyforge.org/pipermail/mkrf-users/2011-December/000070.html --- a/test/unit/test_availability.rb +++ b/test/unit/test_availability.rb @@ -136,9 +136,16 @@ end def test_default_include_dir_should_be_from_rbconfig - expected = [Config::CONFIG['includedir'], Config::CONFIG["archdir"], + #Fix to correspond to the definition in lib/mkrf/availability.rb (Debian patch) + if Config::CONFIG['rubyhdrdir'] + expected = [Config::CONFIG['rubyhdrdir'], + Config::CONFIG['rubyhdrdir'] + "/" + Config::CONFIG['arch'], + Config::CONFIG["archdir"],Config::CONFIG['sitelibdir'], "."] + else + expected = [Config::CONFIG['includedir'], Config::CONFIG["archdir"], Config::CONFIG['sitelibdir'], "."] - + end + assert_equal expected, @avail.send(:instance_variable_get, :@includes) end -end \ No newline at end of file +end