diff options
author | Hans de Graaff <graaff@gentoo.org> | 2016-07-04 20:41:45 +0200 |
---|---|---|
committer | Hans de Graaff <graaff@gentoo.org> | 2016-07-04 20:44:20 +0200 |
commit | c6726d0acaddd1fb67d9fbc547a36548ef43ed2e (patch) | |
tree | ff13fb51b7fbb9242bb814609e51d9f1c0706702 | |
parent | sci-physics/geant: update cmake min version (diff) | |
download | gentoo-c6726d0acaddd1fb67d9fbc547a36548ef43ed2e.tar.gz gentoo-c6726d0acaddd1fb67d9fbc547a36548ef43ed2e.tar.bz2 gentoo-c6726d0acaddd1fb67d9fbc547a36548ef43ed2e.zip |
dev-ruby/concurrent-ruby: add patch for alpha, bug 587986
Add a patch for alpha to determine processor_count.
Package-Manager: portage-2.2.28
-rw-r--r-- | dev-ruby/concurrent-ruby/concurrent-ruby-1.0.2-r1.ebuild | 38 | ||||
-rw-r--r-- | dev-ruby/concurrent-ruby/files/concurrent-ruby-1.0.2-alpha.patch | 50 |
2 files changed, 88 insertions, 0 deletions
diff --git a/dev-ruby/concurrent-ruby/concurrent-ruby-1.0.2-r1.ebuild b/dev-ruby/concurrent-ruby/concurrent-ruby-1.0.2-r1.ebuild new file mode 100644 index 000000000000..2be2bcaafd03 --- /dev/null +++ b/dev-ruby/concurrent-ruby/concurrent-ruby-1.0.2-r1.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 +USE_RUBY="ruby20 ruby21 ruby22 ruby23" + +RUBY_FAKEGEM_RECIPE_TEST="rspec3" + +RUBY_FAKEGEM_RECIPE_DOC="" + +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" + +inherit ruby-fakegem + +DESCRIPTION="Modern concurrency tools including agents, futures, promises, thread pools, more" +HOMEPAGE="https://github.com/ruby-concurrency/concurrent-ruby" +SRC_URI="https://github.com/ruby-concurrency/concurrent-ruby/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="1" +KEYWORDS="~amd64 ~arm ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="" + +RUBY_PATCHES=( ${P}-alpha.patch ) + +all_ruby_prepare() { + # Remove edge files as defined in support/file_map.rb + rm -rf {lib,spec}/concurrent/{actor,channel,edge}* \ + lib/concurrent/{concurrent-edge,lazy_register.rb} \ + spec/concurrent/lazy_register_spec.rb || die + sed -i -e '/concurrent-edge/ s:^:#:' spec/spec_helper.rb || die + + # Remove specs for the ext gem + rm -rf spec/concurrent/atomic || die + + sed -i -e '/file_map/d' -e '/s.files/d' ${RUBY_FAKEGEM_GEMSPEC} || die +} diff --git a/dev-ruby/concurrent-ruby/files/concurrent-ruby-1.0.2-alpha.patch b/dev-ruby/concurrent-ruby/files/concurrent-ruby-1.0.2-alpha.patch new file mode 100644 index 000000000000..a1a97ece2b16 --- /dev/null +++ b/dev-ruby/concurrent-ruby/files/concurrent-ruby-1.0.2-alpha.patch @@ -0,0 +1,50 @@ +commit af059a7ac7815d1edac67b21e5c1bd6b805d4493 +Author: Hans de Graaff <hans@degraaff.org> +Date: Mon Jul 4 20:09:25 2016 +0200 + + Support Alpha architecture for processor_count + + Alpha machines with Linux do have /proc/cpuinfo but its format is + different from normal Linux machines, and most specifically the + processor entry is missing. Moreover, Alpha machines can be configured + to compartimentalize their CPUs into different machines leading to + further confusion when reading /proc/cpuinfo. + + Using /usr/bin/nproc seems to be the most reliable method of determining + the number of processors on Alpha. Since reading /proc/cpuinfo is not + reliable this patch places the nproc method before trying /proc/cpuinfo. + + For futher reference see our downstream bug report at + https://bugs.gentoo.org/show_bug.cgi?id=587986 + +diff --git a/CHANGELOG.md b/CHANGELOG.md +index e84c683..18dd8cc 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -1,3 +1,5 @@ ++* Support Alpha with `Concurrent::processor_count` ++ + ## Current Release v1.0.2 (2 May 2016) + + * Fix bug with `Concurrent::Map` MRI backend `#inspect` method +diff --git a/lib/concurrent/utility/processor_counter.rb b/lib/concurrent/utility/processor_counter.rb +index d18b0bb..e82c0a6 100644 +--- a/lib/concurrent/utility/processor_counter.rb ++++ b/lib/concurrent/utility/processor_counter.rb +@@ -28,6 +28,7 @@ module Concurrent + # processor", which taked into account hyperthreading. + # + # * AIX: /usr/sbin/pmcycles (AIX 5+), /usr/sbin/lsdev ++ # * Alpha: /usr/bin/nproc (/proc/cpuinfo exists but cannot be used) + # * BSD: /sbin/sysctl + # * Cygwin: /proc/cpuinfo + # * Darwin: /usr/bin/hwprefs, /usr/sbin/sysctl +@@ -84,6 +85,8 @@ module Concurrent + result = WIN32OLE.connect("winmgmts://").ExecQuery( + "select NumberOfLogicalProcessors from Win32_Processor") + result.to_enum.collect(&:NumberOfLogicalProcessors).reduce(:+) ++ elsif File.executable?("/usr/bin/nproc") ++ IO.popen("/usr/bin/nproc --all").read.to_i + elsif File.readable?("/proc/cpuinfo") + IO.read("/proc/cpuinfo").scan(/^processor/).size + elsif File.executable?("/usr/bin/hwprefs") |