mirror of
https://github.com/mistydemeo/tigerbrew.git
synced 2026-11-27 11:29:53 -05:00
New `depends_on :python` Dependency.
New `depends_on :python3` Dependency.
To avoid having multiple formulae with endings -py2 and -py3,
we will handle support for different pythons (2.x vs. 3.x)
in the same formula.
Further brewed vs. external python will be transparently supported.
The formula also gets a new object `python`, which is false if
no Python is available or the user has disabled it. Otherwise
it is defined and provides several support methods:
python.site_packages # the site-packages in the formula's Cellar
python.global_site_packages
python.binary # the full path to the python binary
python.prefix
python.version
python.version.major
python.version.minor
python.xy # => e.g. "python2.7"
python.incdir # includes of python
python.libdir # the python dylib library
python.pkg_config_path # used internally by brew
python.from_osx?
python.framework?
python.universal?
python.pypy?
python.standard_caveats # Text to set PYTHONPATH for python.from_osx?
python.if3then3 # => "" for 2.x and to "3" for 3.x.
Further, to avoid code duplication, `python` takes an optional
block that is run twice if the formula defines depends_on
:python AND :python3.
python do
system python, 'setup.py', "--prefix=#{prefix}"
end
Read more in the Homebrew wiki.
75 lines
2.4 KiB
Ruby
75 lines
2.4 KiB
Ruby
require 'formula'
|
|
|
|
class Disco < Formula
|
|
homepage 'http://discoproject.org/'
|
|
url 'https://github.com/discoproject/disco/archive/0.4.5.tar.gz'
|
|
sha1 'c098ad91aa1a0676944c5548f8f860fb9b223002'
|
|
# Periods in the install path cause disco-worker to complain so change to underscores.
|
|
version '0_4_5'
|
|
|
|
depends_on :python
|
|
depends_on 'erlang'
|
|
depends_on 'simplejson' => :python if MacOS.version == :leopard
|
|
depends_on 'libcmph'
|
|
|
|
def patches
|
|
# Modifies config for single-node operation
|
|
DATA
|
|
end
|
|
|
|
def install
|
|
inreplace "Makefile" do |s|
|
|
s.change_make_var! "prefix", prefix
|
|
s.change_make_var! "sysconfdir", etc
|
|
s.change_make_var! "localstatedir", var
|
|
end
|
|
|
|
python do
|
|
# Disco's "rebar" build tool refuses to build unless it's in a git repo, so
|
|
# make a dummy one
|
|
system "git init && git add master/rebar && git commit -a -m 'dummy commit'"
|
|
|
|
system "make"
|
|
system "make install"
|
|
prefix.install %w[contrib doc examples]
|
|
|
|
# Fix the config file to point at the linked files, not in to cellar
|
|
# This isn't ideal - if there's a settings.py file left over from a previous disco
|
|
# installation, it'll issue a Warning
|
|
inreplace "#{etc}/disco/settings.py" do |s|
|
|
s.gsub!("Cellar/disco/"+version+"/", "")
|
|
end
|
|
end
|
|
end
|
|
|
|
def caveats
|
|
s = ''
|
|
s += python.standard_caveats if python
|
|
s += <<-EOS.undent
|
|
Please copy #{etc}/disco/settings.py to ~/.disco and edit it if necessary.
|
|
The DDFS_*_REPLICA settings have been set to 1 assuming a single-machine install.
|
|
Please see http://discoproject.org/doc/disco/start/install.html for further instructions.
|
|
EOS
|
|
end
|
|
end
|
|
|
|
__END__
|
|
diff -rupN disco-0.4.5/conf/gen.settings.sh my-edits/disco-0.4.5/conf/gen.settings.sh
|
|
--- disco-0.4.5/conf/gen.settings.sh 2013-03-28 12:21:30.000000000 -0400
|
|
+++ my-edits/disco-0.4.5/conf/gen.settings.sh 2013-04-10 23:10:00.000000000 -0400
|
|
@@ -23,8 +23,11 @@ DISCO_PORT = 8989
|
|
# DISCO_PROXY_ENABLED = "on"
|
|
# DISCO_HTTPD = "/usr/sbin/varnishd -a 0.0.0.0:\$DISCO_PROXY_PORT -f \$DISCO_PROXY_CONFIG -P \$DISCO_PROXY_PID -n/tmp -smalloc"
|
|
|
|
-DDFS_TAG_MIN_REPLICAS = 3
|
|
-DDFS_TAG_REPLICAS = 3
|
|
-DDFS_BLOB_REPLICAS = 3
|
|
+# Settings appropriate for single-node operation
|
|
+DDFS_TAG_MIN_REPLICAS = 1
|
|
+DDFS_TAG_REPLICAS = 1
|
|
+DDFS_BLOB_REPLICAS = 1
|
|
+
|
|
+DISCO_MASTER_HOST = "localhost"
|
|
|
|
EOF
|