aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorDominyk Tiller2015-04-19 20:30:18 +0100
committerMike McQuaid2015-04-20 10:03:14 +0100
commitda810f94b26ca4ff79bc216d2619635a9dd8dc2a (patch)
tree0d16140dcf5571155f770541a9cba72164bfd51c /Library
parent0a1765b99b9798c6673fdceb744aa4ae98b6d348 (diff)
downloadhomebrew-da810f94b26ca4ff79bc216d2619635a9dd8dc2a.tar.bz2
onepass: fix openssl linkage
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/onepass.rb51
1 files changed, 38 insertions, 13 deletions
diff --git a/Library/Formula/onepass.rb b/Library/Formula/onepass.rb
index 763bdf55f..7e9e7424d 100644
--- a/Library/Formula/onepass.rb
+++ b/Library/Formula/onepass.rb
@@ -1,10 +1,9 @@
-require "formula"
-
class Onepass < Formula
homepage "https://github.com/georgebrock/1pass"
url "https://github.com/georgebrock/1pass/archive/0.2.1.tar.gz"
- sha1 "47adac676208d83e9c9eca089894165868147547"
+ sha256 "44efacfd88411e3405afcabb98c6bb03b15ca6e5a735fd561653379b880eb946"
head "https://github.com/georgebrock/1pass.git"
+ revision 1
bottle do
cellar :any
@@ -14,29 +13,55 @@ class Onepass < Formula
end
depends_on :python if MacOS.version <= :snow_leopard
- depends_on "swig" => :build
+ depends_on "openssl" # For M2Crypto
+
+ # For vendored Swig
+ depends_on "pcre" => :build
+
+ # Homebrew's swig breaks M2Crypto due to upstream's undermaintained status.
+ # https://github.com/swig/swig/issues/344
+ # https://github.com/martinpaljak/M2Crypto/issues/60
+ resource "swig304" do
+ url "https://downloads.sourceforge.net/project/swig/swig/swig-3.0.4/swig-3.0.4.tar.gz"
+ sha256 "410ffa80ef5535244b500933d70c1b65206333b546ca5a6c89373afb65413795"
+ end
resource "M2Crypto" do
url "https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz"
- sha1 "c5e39d928aff7a47e6d82624210a7a31b8220a50"
+ sha256 "6071bfc817d94723e9b458a010d565365104f84aa73f7fe11919871f7562ff72"
end
resource "fuzzywuzzy" do
url "https://pypi.python.org/packages/source/f/fuzzywuzzy/fuzzywuzzy-0.2.tar.gz"
- sha1 "ef080ced775dee1669150ebe4bd93c69f51af16f"
+ sha256 "3e241144737adca0628b1da90ec1634b6e792fb320b02ad4147ea2895a155222"
end
def install
- ENV.prepend_create_path "PYTHONPATH", "#{libexec}/lib/python2.7/site-packages"
+ resource("swig304").stage do
+ system "./configure", "--disable-dependency-tracking", "--prefix=#{buildpath}/swig"
+ system "make"
+ system "make", "install"
+ end
+
+ ENV.prepend_path "PATH", buildpath/"swig/bin"
+
+ ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
+ resource("fuzzywuzzy").stage do
+ system "python", *Language::Python.setup_install_args(libexec/"vendor")
+ end
+
+ # M2Crypto always has to be done individually as we have to inreplace OpenSSL path
+ resource("M2Crypto").stage do
+ inreplace "setup.py", "self.openssl = '/usr'", "self.openssl = '#{Formula["openssl"].opt_prefix}'"
+ system "python", *Language::Python.setup_install_args(libexec/"vendor")
+ end
- install_args = [ "setup.py", "install", "--prefix=#{libexec}" ]
- resource("M2Crypto").stage { system "python", *install_args }
- resource("fuzzywuzzy").stage { system "python", *install_args }
+ ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
+ system "python", *Language::Python.setup_install_args(libexec)
- system "python", "setup.py", "install", "--prefix=#{libexec}"
- bin.install Dir[libexec/"bin/*"]
+ bin.install Dir["#{libexec}/bin/*"]
+ bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
(share+"tests").install Dir["tests/data/*"]
- bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do