[Cryptech-Commits] [releng/alpha] 01/02: Scripts need to use same version of Python as libraries.

git at cryptech.is git at cryptech.is
Sat May 20 16:22:59 UTC 2017


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch master
in repository releng/alpha.

commit fae977eda154f8283aa0e45af9f70079c10c9d1c
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Sat May 20 11:00:22 2017 -0400

    Scripts need to use same version of Python as libraries.
---
 scripts/build-homebrew-formula.py | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/scripts/build-homebrew-formula.py b/scripts/build-homebrew-formula.py
index adffa10..d386142 100755
--- a/scripts/build-homebrew-formula.py
+++ b/scripts/build-homebrew-formula.py
@@ -35,10 +35,22 @@ template = '''\
 # 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 Python voodoo:
+# http://docs.brew.sh/Python-for-Formula-Authors.html
 #
-# https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Python-for-Formula-Authors.md
+# Reference for the undocuemnted Python voodoo:
+#
+# /usr/local/Homebrew/Library/Homebrew/language/python.rb
 
 class {classname} < Formula
 
@@ -50,6 +62,8 @@ 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"



More information about the Commits mailing list