diff options
-rwxr-xr-x | scripts/build-homebrew-formula.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/scripts/build-homebrew-formula.py b/scripts/build-homebrew-formula.py index d386142..a8e387c 100755 --- a/scripts/build-homebrew-formula.py +++ b/scripts/build-homebrew-formula.py @@ -30,25 +30,19 @@ template = '''\ # Homebrew's hack to run our executable Python scripts with PYTHONPATH # pointing to our private library directory. Our own Python library # code, however, is what Homebrew considers "bindings", so we install -# those where user scripts as well as our own can find them. +# those where user scripts as well as our own can find them...then we +# add a symlink so that our scripts can find our bindings regardless +# of which copy of Python 2.7 Homebrew decides we should use this week. # # We have to build our own software before installing our Python code, # because at least one of the Python modules we install # (cryptech.py11.attribute_map) is generated during the build. - -# The declared dependency on "python" (NOT :python) is undocumented -# Homebrew voodoo to force our scripts to use Homebrew's version of -# Python so that they can see the libraries we install. Not really -# sure why this is necessary given what the documentation does say, -# but without this, at least on Sierra, I end up with scripts using -# /usr/bin/python trying to load libraries which were installed -# under /usr/local/..., which doesn't work. # -# Reference for all the Python documented voodoo: +# Reference for all the documented Python Homebrew voodoo: # # http://docs.brew.sh/Python-for-Formula-Authors.html # -# Reference for the undocuemnted Python voodoo: +# Reference for undocumented Python Homebrew voodoo: # # /usr/local/Homebrew/Library/Homebrew/language/python.rb @@ -62,8 +56,6 @@ class {classname} < Formula {conflicts} - depends_on "python" - resource "pyserial" do url "https://pypi.python.org/packages/3c/d8/a9fa247ca60b02b3bebbd61766b4f321393b57b13c53b18f6f62cf172c08/pyserial-3.1.1.tar.gz" sha256 "d657051249ce3cbd0446bcfb2be07a435e1029da4d63f53ed9b4cdde7373364c" @@ -106,6 +98,8 @@ class {classname} < Formula system "python", *Language::Python.setup_install_args(prefix) bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"]) + ln_s lib/"python2.7/site-packages/cryptech", libexec/"vendor/lib/python2.7/site-packages/cryptech" + share.install "cryptech-alpha-firmware.tar.gz" lib.install "sw/pkcs11/libcryptech-pkcs11.dylib" |