From 5c8c02fbe73566dd4e17908167098a70c1dca8bd Mon Sep 17 00:00:00 2001 From: Petr Tichý Date: Tue, 19 Aug 2014 14:40:44 +0200 Subject: moreutils: add --without-parallel option Allows moreutils to coexist with 'parallel' formula --- Library/Formula/moreutils.rb | 12 ++++++++++-- Library/Formula/parallel.rb | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'Library') diff --git a/Library/Formula/moreutils.rb b/Library/Formula/moreutils.rb index 7a7bd3662..fd1247eb6 100644 --- a/Library/Formula/moreutils.rb +++ b/Library/Formula/moreutils.rb @@ -15,8 +15,12 @@ class Moreutils < Formula depends_on "docbook-xsl" => :build - conflicts_with 'parallel', - :because => "both install a 'parallel' executable." + option "without-parallel", "Omit the 'parallel' tool. Allows installation of GNU parallel from 'parallel' formula." + + if build.with? "parallel" + conflicts_with "parallel", + :because => "both install a 'parallel' executable. See the '--without-parallel' option" + end conflicts_with 'task-spooler', :because => "both install a 'ts' executable." @@ -49,6 +53,10 @@ class Moreutils < Formula inreplace "Makefile", "/usr/share/xml/docbook/stylesheet/docbook-xsl", "#{Formula["docbook-xsl"].opt_prefix}/docbook-xsl" + if build.without? "parallel" + inreplace "Makefile", /^BINS=.*\Kparallel/, "" + inreplace "Makefile", /^MANS=.*\Kparallel\.1/, "" + end system "make", "all" system "make", "check" system "make", "install", "PREFIX=#{prefix}" diff --git a/Library/Formula/parallel.rb b/Library/Formula/parallel.rb index cb29e55eb..fd864afce 100644 --- a/Library/Formula/parallel.rb +++ b/Library/Formula/parallel.rb @@ -7,7 +7,7 @@ class Parallel < Formula sha256 "8a146a59bc71218921d561f2c801b85e06fe3a21571083b58e6e0966dd397fd4" conflicts_with "moreutils", - :because => "both install a 'parallel' executable." + :because => "both install a 'parallel' executable. See the --without-parallel option for 'moreutils'" def install system "./configure", "--prefix=#{prefix}" -- cgit v1.2.3