aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-05-19 21:06:27 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-05-19 21:07:33 +0200
commit58231509ad305e2f8477d4ca63fc6a5ce72fbcd9 (patch)
treed9cb40620bb041f2a52d199958848edd9cdc6e35 /main
parent2a87688010b283f11294cc8a5ae277cd3692c6e1 (diff)
downloadaports-58231509ad305e2f8477d4ca63fc6a5ce72fbcd9.tar.bz2
aports-58231509ad305e2f8477d4ca63fc6a5ce72fbcd9.tar.xz
main/ruby: patch Rubygems to avoid fetching platform-specific gems
For more information see description in the patch file.
Diffstat (limited to 'main')
-rw-r--r--main/ruby/APKBUILD8
-rw-r--r--main/ruby/rubygems-avoid-platform-specific-gems.patch31
2 files changed, 36 insertions, 3 deletions
diff --git a/main/ruby/APKBUILD b/main/ruby/APKBUILD
index ff8d6657ad..0ef672536d 100644
--- a/main/ruby/APKBUILD
+++ b/main/ruby/APKBUILD
@@ -4,7 +4,7 @@
pkgname=ruby
pkgver=2.4.1
_abiver="${pkgver%.*}.0"
-pkgrel=2
+pkgrel=3
pkgdesc="An object-oriented language for quick and easy programming"
url="http://www.ruby-lang.org/en/"
arch="all"
@@ -28,7 +28,8 @@ subpackages="$pkgname-doc $pkgname-dev
$pkgname-xmlrpc::noarch
$pkgname-libs
"
-source="ftp://ftp.ruby-lang.org/pub/ruby/${pkgver%.*}/$pkgname-$pkgver.tar.bz2"
+source="ftp://ftp.ruby-lang.org/pub/ruby/${pkgver%.*}/$pkgname-$pkgver.tar.bz2
+ rubygems-avoid-platform-specific-gems.patch"
options="!fhs"
replaces="ruby-gems"
builddir="$srcdir/$pkgname-$pkgver"
@@ -225,4 +226,5 @@ _mvgem() {
done
}
-sha512sums="1c80d4c30ecb51758a193b26b76802a06d214de7f15570f1e85b5fae4cec81bda7237f086b81f6f2b5767f2e93d347ad1fa3f49d7b5c2e084d5f57c419503f74 ruby-2.4.1.tar.bz2"
+sha512sums="1c80d4c30ecb51758a193b26b76802a06d214de7f15570f1e85b5fae4cec81bda7237f086b81f6f2b5767f2e93d347ad1fa3f49d7b5c2e084d5f57c419503f74 ruby-2.4.1.tar.bz2
+cfdc5ea3b2e2ea69c51f38e8e2180cb1dc27008ca55cc6301f142ebafdbab31c3379b3b6bba9ff543153876dd98ed2ad194df3255b7ea77a62e931c935f80538 rubygems-avoid-platform-specific-gems.patch"
diff --git a/main/ruby/rubygems-avoid-platform-specific-gems.patch b/main/ruby/rubygems-avoid-platform-specific-gems.patch
new file mode 100644
index 0000000000..74a5365582
--- /dev/null
+++ b/main/ruby/rubygems-avoid-platform-specific-gems.patch
@@ -0,0 +1,31 @@
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Fri, 19 May 2017 19:56:00 +0200
+Subject: [PATCH] Rubygems: don't install platform-specific gems
+
+Gems with native extensions typically contain just source code that is
+built during installation on user's system. However, Rubygems allows to
+publish even platform-specific gems with prebuilt binaries for specific
+platform. The problem is that Rubygems uses only short platform
+identification like x86_64-linux; it does not identify used libc.
+And sadly platform-specific gems for linux are built against glibc, so
+they may not work on musl libc.
+
+This patch is a workaround for the aforesaid problem. It removes local
+platform from Rubygems' supported platforms to force it always pick
+a platform-agnostic (source) gem. Users can override it using
+`--platform` option.
+
+--- a/lib/rubygems.rb
++++ b/lib/rubygems.rb
+@@ -743,7 +743,10 @@
+ def self.platforms
+ @platforms ||= []
+ if @platforms.empty?
+- @platforms = [Gem::Platform::RUBY, Gem::Platform.local]
++ # XXX: Patched to avoid installing platform-specific gems with binaries
++ # linked against glibc.
++ @platforms = [Gem::Platform::RUBY]
++ #@platforms = [Gem::Platform::RUBY, Gem::Platform.local]
+ end
+ @platforms
+ end