Skip to content

Commit 7b64d17

Browse files
committed
Make multiarch behave in debian-standard way
1 parent 385e2bd commit 7b64d17

4 files changed

Lines changed: 34 additions & 13 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Description: Avoid multiarching bins and linking multiarch lib data to global dirs
2+
This reverts the effects of github.com/ruby/ruby/pull/10010 to remain in alignment with standard
3+
debian multiarch filesystem layout
4+
Origin: https://github.com/sorah-rbpkg/ruby/commit/f482d322a9490cee80ac6af4e08cdfb1f4b7abbc (cleaned up)
5+
Last-Update: 2025-02-10
6+
---
7+
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
8+
--- a/tool/rbinstall.rb
9+
+++ b/tool/rbinstall.rb
10+
@@ -366,9 +366,7 @@
11+
goruby_install_name = "go" + ruby_install_name
12+
13+
bindir = CONFIG["bindir", true]
14+
-if CONFIG["libdirname"] == "archlibdir"
15+
- archbindir = bindir.sub(%r[/\K(?=[^/]+\z)]) {CONFIG["config_target"] + "/"}
16+
-end
17+
+archbindir = nil
18+
libdir = CONFIG[CONFIG.fetch("libdirname", "libdir"), true]
19+
rubyhdrdir = CONFIG["rubyhdrdir", true]
20+
archhdrdir = CONFIG["rubyarchhdrdir"] || (rubyhdrdir + "/" + CONFIG['arch'])
21+
@@ -898,11 +896,6 @@
22+
if pc and File.file?(pc) and File.size?(pc)
23+
prepare "pkgconfig data", pkgconfigdir = File.join(libdir, "pkgconfig")
24+
install pc, pkgconfigdir, :mode => $data_mode
25+
- if (pkgconfig_base = CONFIG["libdir", true]) != libdir
26+
- prepare "pkgconfig data link", File.join(pkgconfig_base, "pkgconfig")
27+
- ln_sf(File.join("..", Path.relative(pkgconfigdir, pkgconfig_base), pc),
28+
- File.join(pkgconfig_base, "pkgconfig", pc))
29+
- end
30+
end
31+
end
32+

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
0007-Port-to-kfreebsd-amd64.patch
88
0009-Fix-FTBFS-on-x32-misdetected-as-i386-or-amd64.patch
99
0011-don-t-try-to-download-stuff-in-configure.patch
10+
0012-use-debian-standard-multiarch.patch

debian/rules

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,6 @@ endif
136136
override_dh_auto_install-arch:
137137
$(MAKE) install-nodoc V=1 DESTDIR=$(CURDIR)/debian/tmp
138138
find $(CURDIR)/debian/tmp -ls
139-
# restore previous behaviour from ruby 3.3
140-
# replace the symlink with the actual file - /usr/x86_64-pc-linux-gnu/bin
141-
if [ -L $(CURDIR)/debian/tmp/usr/bin/ruby$(RUBY_VERSION) ]; then \
142-
TARGET=$$(readlink -f $(CURDIR)/debian/tmp/usr/bin/ruby$(RUBY_VERSION)); \
143-
rm -f $(CURDIR)/debian/tmp/usr/bin/ruby$(RUBY_VERSION); \
144-
cp $$TARGET $(CURDIR)/debian/tmp/usr/bin/ruby$(RUBY_VERSION); \
145-
fi
146139
# handle embedded copy of jquery
147140
$(RM) $(CURDIR)/debian/tmp/usr/lib/ruby/$(RUBY_API_VERSION)/rdoc/generator/template/darkfish/js/jquery.js
148141
dh_link -plibruby$(RUBY_VERSION) /usr/share/javascript/jquery/jquery.min.js /usr/lib/ruby/$(RUBY_API_VERSION)/rdoc/generator/template/darkfish/js/jquery.js

debian/sanity_check

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ archlibdir=usr/lib/${arch}
99

1010
# files that should NOT exist
1111
test '!' -f debian/tmp/${libdir}/libruby-${RUBY_VERSION}.so.${RUBY_VERSION}
12-
13-
# only run if this is not a symbolic link
14-
# https://github.com/ruby/ruby/commit/120c291fafd438e2bc58f098023c669dadc64b08
15-
if [ ! -L "debian/tmp/${libdir}/pkgconfig/ruby-${RUBY_VERSION}.pc" ]; then
16-
test '!' -f "debian/tmp/${libdir}/pkgconfig/ruby-${RUBY_VERSION}.pc"
17-
fi
12+
test '!' -f "debian/tmp/${libdir}/pkgconfig/ruby-${RUBY_VERSION}.pc"
1813

1914
# files that should exist
2015
ls -1 debian/tmp/${archlibdir}/libruby-${RUBY_VERSION}.so.${RUBY_VERSION}

0 commit comments

Comments
 (0)