debian/0000775000000000000000000000000012302657043007172 5ustar debian/rules0000775000000000000000000000125612302656663010265 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 ifneq (,$(filter $(shell dpkg-architecture -qDEB_BUILD_ARCH), arm64 ia64)) export DH_RUBY_IGNORE_TESTS=all endif # 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 platform_dir := debian/ruby-ffi/usr/lib/ruby/vendor_ruby/ffi/platform override_dh_auto_clean: dh_auto_clean rm -rf build/ gen_arch_config: (cd ext/ffi_c && ruby extconf.rb && make && cp ffi_c.so ../../lib) (cd gen && rake) debian/watch0000664000000000000000000000023612145310562010221 0ustar version=3 options="dversionmangle=s/debian//" \ http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/ffi .*/ffi-(.*).tar.gz debian sh debian/repack.sh debian/README.porting0000664000000000000000000000076712263242235011544 0ustar Before building this package for new architectures, you have first to generate a configuration for that architecture, which is used at runtime to determine size of data types. To do that, just run: $ debian/rules gen_arch_config This will create a new configuration directory in lib/ffi/platform/ for the new architecture, and a types.conf file inside it. Please submit that file to be included in the upstream sources. -- Antonio Terceiro Wed, 08 Jan 2014 09:26:30 -0300 debian/copyright0000664000000000000000000000527212145307265011136 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ffi Source: https://github.com/ffi/ffi Files: * Copyright: Copyright (c) 2008-2010 Ruby FFI contributors License: LGPL-3 All rights reserved. . This code is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 only, as published by the Free Software Foundation. . This code 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 Lesser General Public License version 3 for more details. . You should have received a copy of the GNU Lesser General Public License version 3 along with this work. If not, see . Comment: On Debian systems, a copy of the GNU Lesser General Public License version 3 can be found at /usr/share/common-licenses/LGPL-3 Files: ./ext/ffi_c/StructByReference.* Copyright: Copyright (c) 2010, Wayne Meissner License: All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The name of the author or authors may not be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: debian/* Copyright: Copyright (c) 2010, Micah Anderson Copyright (c) 2011, Antonio Terceiro License: The Debian packaging is distributed under the same terms as the original package. debian/ruby-tests.rb0000664000000000000000000000037611773576353011665 0ustar # build the test lib for this Ruby version system('make -f libtest/GNUmakefile') or raise("Failed to build test library") require 'rspec/autorun' Dir.glob('spec/*/*_spec.rb').each do |spec| require spec end # cleanup test library require 'fileutils' debian/README.source0000664000000000000000000000050311636161257011355 0ustar This package includes patches managed with the «quilt» patch management system. Changes to the upstream sources are stored as diffs in debian/patches and applied during the build. See /usr/share/doc/quilt/README.source for a detailed explanation. -- Micah Anderson , Thu, 4 Mar 2010 16:53:54 -0500 debian/tests/0000775000000000000000000000000012263242771010340 5ustar debian/tests/smoke0000775000000000000000000000036312263242751011404 0ustar #!/usr/bin/ruby # This is the most basic example of usage shown in upstream's README file. require 'ffi' module MyLib extend FFI::Library ffi_lib 'c' attach_function :puts, [ :string ], :int end MyLib.puts 'Hello, World using libc!' debian/tests/control0000664000000000000000000000001512263242612011731 0ustar Tests: smoke debian/post-install.rb0000664000000000000000000000157011636161257012161 0ustar require "fileutils" # Load the fresh installed ffi release # First ARGV is a custom Ruby version ruby_version = nil if ARGV.first ruby_version = ARGV.first else RUBY_MAJOR = RUBY_VERSION.match(/^\d+\.\d+/).to_s RUBY_MINOR = RUBY_MAJOR == "1.9" ? "." + RUBY_VERSION.match(/\d+$/).to_s : '' ruby_version = "#{RUBY_MAJOR}#{RUBY_MINOR}" end paths = ["./debian/libffi-ruby#{ruby_version}/usr/lib/ruby/#{ruby_version}/", "./debian/libffi-ruby#{ruby_version}/usr/lib/ruby/#{ruby_version}/#{RUBY_PLATFORM}/"] paths.each {|i| $:.unshift(i)} require "./debian/libffi-ruby#{ruby_version}/usr/lib/ruby/#{ruby_version}/ffi" require "./debian/libffi-ruby#{ruby_version}/usr/lib/ruby/#{ruby_version}/ffi/tools/types_generator" File.open(File.join("./debian/libffi-ruby#{ruby_version}/usr/lib/ruby/#{ruby_version}/ffi", 'types.conf'),'w') do |f| f.puts FFI::TypesGenerator.generate end debian/source/0000775000000000000000000000000012145322020010457 5ustar debian/source/format0000664000000000000000000000001411636161257011706 0ustar 3.0 (quilt) debian/ruby-ffi.docs0000664000000000000000000000001212263243337011563 0ustar README.md debian/patches/0000775000000000000000000000000012302652041010612 5ustar debian/patches/fix-for-variadic-float-double-values.diff0000664000000000000000000000302112302651646020454 0ustar Description: Fix for failing float/double variadic args test cases in ruby-ffi package This patch will fix the problem of passing float/double values as part of variadic argument list from ruby-ffi package. All the test cases related to float/double arguments passed as part of ruby variadic list were failing on ppc64le arch. Problem was due to incorrect way to call C method ffi_prep_cif_var, where third argument was passed as total number of arguments instead of fixed number of arguments Author: Anurag Gupta --- --- ruby-ffi-1.9.3debian.orig/ext/ffi_c/Variadic.c +++ ruby-ffi-1.9.3debian/ext/ffi_c/Variadic.c @@ -170,7 +170,7 @@ variadic_invoke(VALUE self, VALUE parame ffi_type* ffiReturnType; Type** paramTypes; VALUE* argv; - int paramCount = 0, i; + int paramCount = 0, fixedCount = 0, i; ffi_status ffiStatus; rbffi_frame_t frame = { 0 }; @@ -229,8 +229,12 @@ variadic_invoke(VALUE self, VALUE parame if (ffiReturnType == NULL) { rb_raise(rb_eArgError, "Invalid return type"); } + + /*Get the number of fixed args from @fixed array*/ + fixedCount = RARRAY_LEN(rb_iv_get(self, "@fixed")); + #ifdef HAVE_FFI_PREP_CIF_VAR - ffiStatus = ffi_prep_cif_var(&cif, invoker->abi, paramCount, paramCount, ffiReturnType, ffiParamTypes); + ffiStatus = ffi_prep_cif_var(&cif, invoker->abi, fixedCount, paramCount, ffiReturnType, ffiParamTypes); #else ffiStatus = ffi_prep_cif(&cif, invoker->abi, paramCount, ffiReturnType, ffiParamTypes); #endif debian/patches/series0000664000000000000000000000010612302652041012024 0ustar disable-rake-compiler.patch fix-for-variadic-float-double-values.diff debian/patches/disable-rake-compiler.patch0000664000000000000000000000051212215435160015770 0ustar --- a/Rakefile +++ b/Rakefile @@ -4,12 +4,6 @@ require 'rubygems/tasks' require 'rbconfig' require 'rake/clean' -USE_RAKE_COMPILER = (RUBY_PLATFORM =~ /java/) ? false : true -if USE_RAKE_COMPILER - gem 'rake-compiler', '>=0.6.0' - require 'rake/extensiontask' -end - require 'date' require 'fileutils' require 'rbconfig' debian/compat0000664000000000000000000000000211636161257010376 0ustar 7 debian/repack.sh0000775000000000000000000000204011636161257011000 0ustar #!/bin/sh # Repackage upstream source to exclude non-distributable files # should be called as "repack.sh --upstream-source # (for example, via uscan) set -e set -u VER="$2debian" FILE="$3" PKG=`dpkg-parsechangelog|grep ^Source:|sed 's/^Source: //'` REPACK_DIR="$PKG-$VER.orig" # DevRef § 6.7.8.2 DEST_DIR=$(dirname "$FILE") echo -e "\nRepackaging $FILE\n" DIR=`mktemp -d ./tmpRepackXXXXXX` trap "rm -rf \"$DIR\"" QUIT INT EXIT # Create an extra directory to cope with rootless tarballs UP_BASE="$DIR/unpack" mkdir "$UP_BASE" tar xzf "$FILE" -C "$UP_BASE" if [ `ls -1 "$UP_BASE" | wc -l` -eq 1 ]; then # Tarball does contain a root directory UP_BASE="$UP_BASE/`ls -1 "$UP_BASE"`" fi ## Remove stuff rm -vfr $UP_BASE/ext/ffi_c/libffi ## End mv "$UP_BASE" "$DIR/$REPACK_DIR" # Using a pipe hides tar errors! tar cfC "$DIR/repacked.tar" "$DIR" "$REPACK_DIR" gzip -9 < "$DIR/repacked.tar" > "$DIR/repacked.tar.gz" FILE="${DEST_DIR}/${PKG}_${VER}.orig.tar.gz" mv "$DIR/repacked.tar.gz" "$FILE" echo "*** $FILE repackaged" debian/changelog0000664000000000000000000001557512302657016011061 0ustar ruby-ffi (1.9.3debian-1ubuntu2) trusty; urgency=medium * Ignore test failure on AArch64. See LP: #1239171. -- Matthias Klose Mon, 24 Feb 2014 15:57:36 +0100 ruby-ffi (1.9.3debian-1ubuntu1) trusty; urgency=medium * Apply fix for failing float/double variadic args test cases. -- Matthias Klose Mon, 24 Feb 2014 15:16:15 +0100 ruby-ffi (1.9.3debian-1) unstable; urgency=medium * New upstream release * Add instructions for porters in debian/README.porting * add a simple smoke test to debian/tests * debian/control: add `XS-Testsuite: autopkgtest` -- Antonio Terceiro Wed, 08 Jan 2014 09:47:44 -0300 ruby-ffi (1.9.0debian-1) unstable; urgency=low * New upstream version * debian/control: + Remove Breaks/Replaces/Provides wrt transitional packages + bump Standards-Version to 3.9.4; no changes needed * debian/patches/disable-rake-compiler.patch: refreshed * debian/rules: drop temporary fix for #679782. Proper fix is included in this upstream version. -- Antonio Terceiro Fri, 17 May 2013 21:43:43 -0300 ruby-ffi (1.8.1debian-1) unstable; urgency=low [ Antonio Terceiro ] * New upstream release (Closes: #708512) * Drop transitional packages libffi-ruby, libffi-ruby1.8 and libffi-ruby1.9.1 * README.rdoc renamed to README.md * update debian/watch to point to gemwatch * debian/patches/disable-rake-compiler.patch: refreshed * pathes applied upstream and dropped: - debian/patches/0001-Add-types.conf-files-for-missing-Debian-architecture - debian/patches/0001-Fix-call-to-variadic-functions.patch - debian/patches/fix-test-on-sparc * debian/patches/ftbfs-gcc-4.7.diff: made obsolete by upstream change; not neeed anymore. * debian/rules: symlink i486-gnu to i386-gnu while the rename is not done upstream; see https://github.com/ffi/ffi/pull/269. This fixes a FTBFS on hurd-i386 (Closes: #679782) [ Cédric Boutillier ] * debian/control: remove obsolete DM-Upload-Allowed flag * use canonical URI in Vcs-* fields * debian/copyright: use DEP5 copyright-format/1.0 official URL for Format field -- Antonio Terceiro Fri, 17 May 2013 00:22:41 -0300 ruby-ffi (1.0.11debian-5) unstable; urgency=low * debian/patches/0001-Fix-call-to-variadic-functions.patch: fixes calls to variadic functions with floating point arguments, which currently only breaks on armhf (Closes: #656809), but would also break on other architectures with similar ABI for variadic functions. -- Antonio Terceiro Sat, 04 Aug 2012 16:42:56 -0300 ruby-ffi (1.0.11debian-4) unstable; urgency=low * Bump standards version * Bump build dependency on gem2deb to >= 0.3.0~ * debian/ruby-tests-rb: re-enable tests * debian/patches/disable-rake-compiler.patch: disable rake-compiler requirement in Rakefile, not needed. * debian/rules: generate gemspec with rake before dh_auto_install (added rake as build dependency) -- Antonio Terceiro Sat, 30 Jun 2012 10:47:57 -0300 ruby-ffi (1.0.11debian-3.1) unstable; urgency=low * Non maintainer upload. * Remove unknown GCC command line option. Closes: #672050. -- Matthias Klose Mon, 21 May 2012 01:11:56 +0000 ruby-ffi (1.0.11debian-3) unstable; urgency=low * debian/patches/fix-test-on-sparc: fixes crash while running test suite on sparc (Closes: #642266). Thanks to Jurij Smakov for the patch. * Ignore test results on ia64 for now. See #642267. -- Antonio Terceiro Sun, 22 Jan 2012 19:19:47 -0200 ruby-ffi (1.0.11debian-2) unstable; urgency=low * debian/patches/0001-Add-types.conf-files-for-missing-Debian-architecture.patch: This patch adds types.conf files to 7 missing Debian architectures. This should make the package build fine in most architectures. -- Antonio Terceiro Sun, 25 Dec 2011 22:24:47 -0200 ruby-ffi (1.0.11debian-1) unstable; urgency=low * New upstream release. + Should now build fine on ia64 (Closes: #642267). + Include fix platform detection that was pushed upstream (Closes: #643788) * debian/control: make transitional packages Priority: extra -- Antonio Terceiro Wed, 30 Nov 2011 22:54:33 -0200 ruby-ffi (1.0.9+git20110920debian-1) unstable; urgency=low * Upstream git snapshot + Adds portability patches submit by us (Closes: #641775, #642161) * Removing all Debian-specific patches. Upstream source should be portable enough already. -- Antonio Terceiro Tue, 20 Sep 2011 12:06:58 -0700 ruby-ffi (1.0.9debian-2) unstable; urgency=low [ Nobuhiro Iwamatsu ] * Remove non-portable -m{32,64} compilation flag (debian/patches/0002-Remove-non-portable-m-32-64-compilation-flag.patch) (Closes: #641775) -- Antonio Terceiro Fri, 16 Sep 2011 10:37:31 -0700 ruby-ffi (1.0.9debian-1) unstable; urgency=low * New upstream release - Apparently will build on all architectures, so I am changing the Architecture: field to 'any' * Migrate to new Ruby packaging practices - rename package - use gem2deb - added transitional packages -- Antonio Terceiro Wed, 14 Sep 2011 10:43:14 -0700 libffi-ruby (0.6.3debian-2) unstable; urgency=low * Team upload. * debian/post-install.rb: Fix problem with RUBY_VERSION on 1.9.2 (Closes: #593038) * Bump Standards-Version to 3.9.1 (no changes). -- Laurent Arnoud Thu, 23 Sep 2010 21:54:10 +0200 libffi-ruby (0.6.3debian-1) unstable; urgency=low * New upstream release * Set debian/control Architecture: amd64 i386 powerpc sparc until upstream supports more architectures (Closes: #575311) -- Micah Anderson Tue, 13 Apr 2010 12:58:06 -0400 libffi-ruby (0.6.2debian-5) unstable; urgency=low * Fix ruby1.9.1 Build-Depends (Closes: #574532) * Fix libffi-ruby binary dependency to be libffi-ruby1.8 * Add Dependency on ruby1.8 for libffi-ruby1.8 -- Micah Anderson Thu, 18 Mar 2010 23:51:04 -0400 libffi-ruby (0.6.2debian-4) unstable; urgency=low * Upstream confirmation of 1.9.1 support, so adding that back -- Micah Anderson Tue, 09 Mar 2010 13:08:48 -0500 libffi-ruby (0.6.2debian-3) unstable; urgency=low * Fix ruby path in types.conf generation -- Micah Anderson Sat, 06 Mar 2010 12:04:55 -0500 libffi-ruby (0.6.2debian-2) unstable; urgency=low * Generate missing types.conf during the package build * Seems to only support ruby 1.9 for now, so switch away from 1.9.1 -- Micah Anderson Fri, 05 Mar 2010 01:01:30 -0500 libffi-ruby (0.6.2debian-1) unstable; urgency=low * Repack upstream source to remove embedded libffi * Initial release (Closes: #572597) -- Micah Anderson Thu, 04 Mar 2010 15:45:17 -0500 debian/control0000664000000000000000000000217012263245656010606 0ustar Source: ruby-ffi Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Antonio Terceiro , Micah Anderson Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.3.0~), libffi-dev, ruby-rspec, rake Standards-Version: 3.9.5 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-ffi.git Vcs-Browser: http://anonscm.debian.org/gitweb?p=pkg-ruby-extras/ruby-ffi.git;a=summary Homepage: http://wiki.github.com/ffi/ffi XS-Ruby-Versions: all XS-Testsuite: autopkgtest Package: ruby-ffi Architecture: any XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter Description: load dynamic libraries, bind functions from within ruby code Ruby-FFI is a ruby extension for programmatically loading dynamic libraries, binding functions within them, and calling those functions from Ruby code. Moreover, a Ruby-FFI extension works without changes on Ruby and JRuby. Discover why should you write your next extension using Ruby-FFI here[http://wiki.github.com/ffi/ffi/why-use-ffi].