aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2012-08-09 22:00:06 -0700
committerAdam Vandenberg2012-08-09 22:00:54 -0700
commit73b62d0206cd0de52049bf9c661cc64fb3ae7c08 (patch)
treecc312e83d13f190108ea5013a9f163e2bb933820 /Library
parentcf6a2ac783291c1bcb6e76fda75fb90d284052db (diff)
downloadhomebrew-73b62d0206cd0de52049bf9c661cc64fb3ae7c08.tar.bz2
glib: use options dsl
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/glib.rb20
1 files changed, 7 insertions, 13 deletions
diff --git a/Library/Formula/glib.rb b/Library/Formula/glib.rb
index a94189d1b..e1340803f 100644
--- a/Library/Formula/glib.rb
+++ b/Library/Formula/glib.rb
@@ -1,12 +1,13 @@
require 'formula'
-def build_tests?; ARGV.include? '--test'; end
-
class Glib < Formula
homepage 'http://developer.gnome.org/glib/'
url 'ftp://ftp.gnome.org/pub/gnome/sources/glib/2.32/glib-2.32.4.tar.xz'
sha256 'a5d742a4fda22fb6975a8c0cfcd2499dd1c809b8afd4ef709bda4d11b167fae2'
+ option :universal
+ option 'test', 'Build a debug build and run tests. NOTE: Not all tests succeed yet'
+
depends_on 'pkg-config' => :build
depends_on 'xz' => :build
depends_on 'gettext'
@@ -28,19 +29,12 @@ class Glib < Formula
]}
p[:p0] = %W[
https://trac.macports.org/export/95596/trunk/dports/devel/glib2/files/patch-configure.diff
- ] if ARGV.build_universal?
+ ] if build.universal?
p
end
- def options
- [
- ['--universal', 'Build universal binaries.'],
- ['--test', 'Build a debug build and run tests. NOTE: Not all tests succeed yet.']
- ]
- end
-
def install
- ENV.universal_binary if ARGV.build_universal?
+ ENV.universal_binary if build.universal?
# -w is said to causes gcc to emit spurious errors for this package
ENV.enable_warnings if ENV.compiler == :gcc
@@ -56,13 +50,13 @@ class Glib < Formula
system "./configure", *args
- if ARGV.build_universal?
+ if build.universal?
system "curl 'https://trac.macports.org/export/95596/trunk/dports/devel/glib2/files/config.h.ed' | ed - config.h"
end
system "make"
# the spawn-multithreaded tests require more open files
- system "ulimit -n 1024; make check" if build_tests?
+ system "ulimit -n 1024; make check" if build.include? 'test'
system "make install"
# This sucks; gettext is Keg only to prevent conflicts with the wider