Skip to content

Commit

Permalink
Merge pull request #64 from MikeMcQuaid/portable-ruby-2.3.7
Browse files Browse the repository at this point in the history
portable-ruby 2.3.7
  • Loading branch information
MikeMcQuaid authored Jul 13, 2018
2 parents 4b163b3 + 6e51967 commit 5cec698
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 48 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ matrix:
fast_finish: true
include:
- os: osx
osx_image: xcode8.3
osx_image: xcode9.4
rvm: system
- os: linux
sudo: required
dist: trusty
rvm: 2.3.3
rvm: 2.3.7

before_install:
- export HOMEBREW_DEVELOPER=1
Expand All @@ -31,6 +31,7 @@ before_install:
PATH=$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH;
export HOMEBREW_BUILD_FROM_SOURCE=1;
fi
- brew update
- HOMEBREW_TAP_DIR="$(brew --repo "$TRAVIS_REPO_SLUG")"
- mkdir -p "$HOMEBREW_TAP_DIR"
- rm -rf "$HOMEBREW_TAP_DIR"
Expand Down
7 changes: 4 additions & 3 deletions Formula/portable-berkeley-db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
class PortableBerkeleyDb < PortableFormula
desc "High performance key/value database"
homepage "https://www.oracle.com/technology/products/berkeley-db/index.html"
url "https://download.oracle.com/berkeley-db/db-6.2.32.tar.gz"
sha256 "a9c5e2b004a5777aa03510cfe5cd766a4a3b777713406b02809c17c8e0e7a8fb"
# Requires registration to download so we mirror it
url "https://dl.bintray.com/homebrew/mirror/berkeley-db-18.1.25.tar.gz"
sha256 "2ea8b8bc0611d9b4c2b9fee84a4a312dddfec007067af6e02ed46a26354181bb"

def install
# BerkeleyDB dislikes parallel builds
ENV.deparallelize

# --enable-compat185 is necessary because our build shadows
# the system berkeley db 1.x
args = %W[
Expand Down
15 changes: 10 additions & 5 deletions Formula/portable-libyaml.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
require File.expand_path("../../Abstract/portable-formula", __FILE__)

class PortableLibyaml < PortableFormula
desc "Portable libyaml"
homepage "http://pyyaml.org/wiki/LibYAML"
url "http://pyyaml.org/download/libyaml/yaml-0.1.7.tar.gz"
mirror "https://mirrors.kernel.org/debian/pool/main/liby/libyaml/libyaml_0.1.7.orig.tar.gz"
sha256 "8088e457264a98ba451a90b8661fcb4f9d6f478f7265d48322a196cec2480729"
desc "YAML Parser"
homepage "https://github.com/yaml/libyaml"
url "https://github.com/yaml/libyaml/archive/0.2.1.tar.gz"
mirror "https://mirrors.kernel.org/debian/pool/main/liby/libyaml/libyaml_0.2.1.orig.tar.gz"
sha256 "1d2aeb87f7d317f1496e4c39410d913840714874a354970300f375eec9303dc4"

depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build

def install
ENV.universal_binary if build.with? "universal"
system "./bootstrap"
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--enable-static",
Expand Down
2 changes: 1 addition & 1 deletion Formula/portable-ncurses.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path("../../Abstract/portable-formula", __FILE__)

class PortableNcurses < PortableFormula
desc "Portable ncurses"
desc "Text-based UI library"
homepage "https://www.gnu.org/s/ncurses/"
url "https://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz"
mirror "https://ftpmirror.gnu.org/ncurses/ncurses-6.1.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion Formula/portable-openssl.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path("../../Abstract/portable-formula", __FILE__)

class PortableOpenssl < PortableFormula
desc "Portable OpenSSL"
desc "SSL/TLS cryptography library"
homepage "https://openssl.org/"
url "https://www.openssl.org/source/openssl-1.0.2o.tar.gz"
mirror "https://dl.bintray.com/homebrew/mirror/openssl-1.0.2o.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion Formula/portable-readline.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path("../../Abstract/portable-formula", __FILE__)

class PortableReadline < PortableFormula
desc "Portable readline"
desc "Library for command-line editing"
homepage "https://tiswww.case.edu/php/chet/readline/rltop.html"
url "https://ftpmirror.gnu.org/readline/readline-7.0.tar.gz"
mirror "https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz"
Expand Down
42 changes: 8 additions & 34 deletions Formula/portable-ruby.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
require File.expand_path("../../Abstract/portable-formula", __FILE__)

class PortableRuby < PortableFormula
desc "Portable ruby"
desc "Powerful, clean, object-oriented scripting language"
homepage "https://www.ruby-lang.org/"
# This isn't the latest 2.3.3 but is the version shipped in macOS 10.13.
url "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.bz2"
mirror "http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.bz2"
sha256 "882e6146ed26c6e78c02342835f5d46b86de95f0dc4e16543294bc656594cc5b"
revision 2
# This is the version shipped in macOS 10.13.6.
url "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.7.tar.bz2"
mirror "http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.7.tar.bz2"
sha256 "18b12fafaf37d5f6c7139c1b445355aec76baa625a40300598a6c8597fc04d8e"

bottle do
cellar :any_skip_relocation
Expand All @@ -28,23 +27,6 @@ class PortableRuby < PortableFormula
depends_on "portable-zlib" => :build
end

# Fixes the static build: https://bugs.ruby-lang.org/issues/13413
# This has been backported into the 2.3 branch, but isn't in the
# release we're building.
patch do
url "https://github.com/ruby/ruby/commit/b3dbeb6e90f316584f70e33f6bfb9d83fa5f30d3.patch?full_index=1"
sha256 "17a6a37e500f3455bb85e6bd4b077228d7a32f63bf07ecf67248acbd3a5ea724"
end

# Fixes the build of dir.c on 10.5 due to missing fgetattrlist:
# https://bugs.ruby-lang.org/issues/13573
# This has been backported into the 2.3 branch, but isn't in the
# release we're building.
patch do
url "https://github.com/ruby/ruby/commit/1c80c388d5bd48018c419a2ea3ed9f7b7514dfa3.patch?full_index=1"
sha256 "8ba0a24a36702d2cbc94aa73cb6f0b11793348b0158c11c8608e073c71601bb5"
end

def install
# mcontext types had a member named `ss` instead of `__ss`
# prior to Leopard; see
Expand All @@ -57,8 +39,8 @@ def install
end

inreplace "vm_dump.c" do |s|
s.gsub! /uc_mcontext->__(ss)\.__(r\w\w)/,
"uc_mcontext->\1.\2"
s.gsub!(/uc_mcontext->__(ss)\.__(r\w\w)/,
"uc_mcontext->\1.\2")
s.gsub! "mctx->__ss.__##reg",
"mctx->ss.reg"
# missing include in vm_dump; this is an ugly solution
Expand All @@ -67,14 +49,6 @@ def install
end
end

# Fixes includedir inappropriately prefixed with SDKROOT:
# https://bugs.ruby-lang.org/issues/13572
# This has been backported into the 2.3 branch, but isn't in the
# release we're building and can't be cherry-picked cleanly.
inreplace "tool/mkconfig.rb",
"when /^includedir$/",
"when /^oldincludedir$/"

readline = Formula["portable-readline"]
libyaml = Formula["portable-libyaml"]
openssl = Formula["portable-openssl"]
Expand Down Expand Up @@ -167,7 +141,7 @@ def install
shell_output("#{ruby} -ropenssl -e 'puts OpenSSL::Digest::SHA256.hexdigest(\"\")'").strip
assert_match "200",
shell_output("#{ruby} -ropen-uri -e 'open(\"https://google.com\") { |f| puts f.status.first }'").strip
system "#{ruby}", "-rdbm", "-e", "DBM.new('test')"
system ruby, "-rdbm", "-e", "DBM.new('test')"
system testpath/"bin/gem", "environment"
system testpath/"bin/gem", "install", "bundler"
system testpath/"bin/bundle", "init"
Expand Down
2 changes: 1 addition & 1 deletion Formula/portable-zlib.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path("../../Abstract/portable-formula", __FILE__)

class PortableZlib < PortableFormula
desc "Portable zlib"
desc "General-purpose lossless data-compression library"
homepage "http://www.zlib.net/"
url "http://zlib.net/zlib-1.2.11.tar.gz"
mirror "https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz"
Expand Down

0 comments on commit 5cec698

Please sign in to comment.