[Cryptech-Commits] [user/sra/alpha-releng/omnibus] 02/02: Add dependencies for sqlite3 and pyserial to Homebrew formula.

git at cryptech.is git at cryptech.is
Sun Jul 3 21:35:33 UTC 2016


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

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

commit 2d4f18558898417ee03e0b702aa9de758166f427
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Sun Jul 3 17:35:24 2016 -0400

    Add  dependencies for sqlite3 and pyserial to Homebrew formula.
---
 build-homebrew-formula.py | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/build-homebrew-formula.py b/build-homebrew-formula.py
index 8f29720..26a587c 100755
--- a/build-homebrew-formula.py
+++ b/build-homebrew-formula.py
@@ -26,17 +26,30 @@ class CryptechAlpha < Formula
   url      "{url}"
   sha256   "{sha256}"
 
-  # Eventually we'll want resource clauses here to pull in stuff we
-  # need from pypi, see brew doc for that, but skip it initially.
+  # See https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md#specifying-other-formulae-as-dependencies
+  # for details on handling dependencies on other homebrew packages (eg, sqlite3).
 
-  # We should also specify a dependency on sqlite3, and perhaps other
-  # packages.  Skip that for now too.
+  # See https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Python-for-Formula-Authors.md
+  # for details on handling dependencies on Python libraries (eg, pyserial).
 
-  # If we get really ambitous, it would be nice to have "bottled"
-  # (precompiled binary) versions, but that requires either a build
-  # farm or some kind of cross-compilation.
+  depends_on "sqlite3"
+
+  resource "pyserial" do
+    url    "https://pypi.python.org/packages/3c/d8/a9fa247ca60b02b3bebbd61766b4f321393b57b13c53b18f6f62cf172c08/pyserial-3.1.1.tar.gz"
+    sha256 "d657051249ce3cbd0446bcfb2be07a435e1029da4d63f53ed9b4cdde7373364c"
+  end
 
   def install
+    # Homebrew voodoo for installing Python dependencies without depending on pip.
+    # In theory, this handles any number of (Python) resource specifications.
+    ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
+    resources.each do |r|
+      r.stage do
+        system "python", *Language::Python.setup_install_args(libexec/"vendor")
+      end
+    end
+
+    ohai "Building PKCS #11 code (including crypto and bignum libraries) from source, this is slow, sorry..."
     ENV.deparallelize
     system "make", "-C", "sw/pkcs11"
     share.install "cryptech-alpha-firmware.tar.gz"



More information about the Commits mailing list