summaryrefslogtreecommitdiffhomepage
path: root/ext
diff options
context:
space:
mode:
authorTom Black <[email protected]>2015-12-29 01:15:43 -0600
committerTom Black <[email protected]>2015-12-29 01:15:43 -0600
commit7f749675095383ca816b8469ae53d65c73d708d7 (patch)
treedc37e597fed553a9515c5e5d3e62702a41c38b2b /ext
parent80856a94243ebeeb04977f241d559c85441cf151 (diff)
downloadruby2d-7f749675095383ca816b8469ae53d65c73d708d7.tar.gz
ruby2d-7f749675095383ca816b8469ae53d65c73d708d7.zip
Update Simple 2D using Homebrew when installed
Also more extconf.rb cleanup
Diffstat (limited to 'ext')
-rw-r--r--ext/ruby2d/extconf.rb27
1 files changed, 17 insertions, 10 deletions
diff --git a/ext/ruby2d/extconf.rb b/ext/ruby2d/extconf.rb
index 6786fd8..9368d47 100644
--- a/ext/ruby2d/extconf.rb
+++ b/ext/ruby2d/extconf.rb
@@ -16,17 +16,16 @@ def print_errors(errors)
#{errors.join("\n ")}
-#{"============================================================".bold}
-
-"
+#{"============================================================".bold}"
end
# OS X
if RUBY_PLATFORM =~ /darwin/
- # If Simple 2D not installed
+
+ # Simple 2D not installed
if `which simple2d`.empty?
- # If Homebrew not installed, print and quit
+ # Homebrew not installed, print and quit
if `which brew`.empty?
errors << "Ruby 2D uses a library called Simple 2D." <<
"On OS X, this can be installed using Homebrew." <<
@@ -39,14 +38,21 @@ if RUBY_PLATFORM =~ /darwin/
`brew tap simple2d/tap`
`brew install simple2d`
end
- # Simple 2D is installed, update to latest version
+
+ # Simple 2D installed, update to latest version
else
+ # Homebrew not installed
if `which brew`.empty?
- # TODO: Check for latest version manually
+ # TODO: Check for latest version manually and update
+ # Homebrew installed, get latest version of Simple 2D
else
- # TODO: Get latest version of Simple 2D
- # `brew update`
- # `brew upgrade simple2d`
+ # An alternative, but slower and updates all formulas:
+ # `brew update`
+ # `brew upgrade simple2d`
+
+ `brew untap simple2d/tap`
+ `brew tap simple2d/tap`
+ `brew upgrade simple2d`
end
end
@@ -68,6 +74,7 @@ elsif RUBY_PLATFORM =~ /mingw/
exit
end
+
$LDFLAGS << ' ' << `simple2d --libs`
$LDFLAGS.gsub!(/\n/, ' ') # remove newlines in flags, they cause problems