[DRE-maint] Bug#893501: ruby2.5 FTCBFS: configures for the build architecture

Helmut Grohne helmut at subdivi.de
Mon Mar 19 13:08:05 UTC 2018


Source: ruby2.5
Version: 2.5.0-6
Tags: patch
User: helmutg at debian.org
Usertags: rebootstrap

ruby2.5 fails to cross build from source, because it fails passing
--host to ./configure. The simple solution to this problem is deferring
the task to dh_auto_configure. After doing so, one needs to pass
--libdir, because ruby uses a very non-standard approach to multiarch.
For performing an actual cross build, you also need --with-baseruby.
Please consider applying the attached patch.

Helmut
-------------- next part --------------
diff --minimal -Nru ruby2.5-2.5.0/debian/changelog ruby2.5-2.5.0/debian/changelog
--- ruby2.5-2.5.0/debian/changelog	2018-03-04 17:30:49.000000000 +0100
+++ ruby2.5-2.5.0/debian/changelog	2018-03-19 13:50:27.000000000 +0100
@@ -1,3 +1,13 @@
+ruby2.5 (2.5.0-6.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_configure pass --host to ./configure.
+    + Pass --libdir, because ruby uses that in a non-standard way.
+    + Pass --with-baseruby for cross compilation.
+
+ -- Helmut Grohne <helmut at subdivi.de>  Mon, 19 Mar 2018 13:50:27 +0100
+
 ruby2.5 (2.5.0-6) unstable; urgency=medium
 
   * debian/rules: explicitly pass --runstatedir, --localstatedir, and
diff --minimal -Nru ruby2.5-2.5.0/debian/control ruby2.5-2.5.0/debian/control
--- ruby2.5-2.5.0/debian/control	2018-03-04 17:30:49.000000000 +0100
+++ ruby2.5-2.5.0/debian/control	2018-03-19 13:50:27.000000000 +0100
@@ -20,6 +20,7 @@
                netbase,
                openssl,
                procps,
+               ruby:native <cross>,
                rubygems-integration (>= 1.6),
                systemtap-sdt-dev [linux-any],
                zlib1g-dev
diff --minimal -Nru ruby2.5-2.5.0/debian/rules ruby2.5-2.5.0/debian/rules
--- ruby2.5-2.5.0/debian/rules	2018-03-04 17:30:49.000000000 +0100
+++ ruby2.5-2.5.0/debian/rules	2018-03-19 13:50:27.000000000 +0100
@@ -18,7 +18,7 @@
 export RUBY_VERSION       := $(patsubst ruby%,%,$(DEB_SOURCE))
 export RUBY_API_VERSION   := $(RUBY_VERSION).0
 
-configure_options += --prefix=/usr
+configure_options += --libdir=/usr/lib
 configure_options += --enable-multiarch
 configure_options += --target=$(DEB_HOST_MULTIARCH)
 configure_options += --program-suffix=$(RUBY_VERSION)
@@ -27,14 +27,15 @@
 configure_options += --disable-rpath
 configure_options += --with-sitedir='/usr/local/lib/site_ruby'
 configure_options += --with-sitearchdir="/usr/local/lib/$(DEB_HOST_MULTIARCH)/site_ruby"
-configure_options += --runstatedir=/var/run
-configure_options += --localstatedir=/var
-configure_options += --sysconfdir=/etc
 
 # the following are ignored by ./configure, but used by some extconf.rb scripts
 configure_options += --enable-ipv6
 configure_options += --with-dbm-type=gdbm_compat
 
+ifneq ($(filter cross,$(DEB_BUILD_PROFILES)),)
+configure_options += --with-baseruby=/usr/bin/ruby
+endif
+
 # hardening and other standard Debian build flags
 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
 configure_options += $(shell dpkg-buildflags --export=configure)
@@ -48,7 +49,7 @@
 override_dh_auto_configure:
 	cp /usr/share/misc/config.guess tool
 	cp /usr/share/misc/config.sub tool
-	./configure $(configure_options)
+	dh_auto_configure -- $(configure_options)
 
 override_dh_auto_clean:
 	dh_auto_clean


More information about the Pkg-ruby-extras-maintainers mailing list