diff options
Diffstat (limited to 'scripts/build-homebrew-formula.py')
-rwxr-xr-x | scripts/build-homebrew-formula.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/build-homebrew-formula.py b/scripts/build-homebrew-formula.py index 54cdcae..852b4b6 100755 --- a/scripts/build-homebrew-formula.py +++ b/scripts/build-homebrew-formula.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Yes, this is a Python program writing a Ruby program. @@ -32,7 +32,7 @@ template = '''\ # code, however, is what Homebrew considers "bindings", so we install # 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. +# of which copy of Python 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 @@ -54,6 +54,8 @@ class {classname} < Formula url "{url}" sha256 "{sha256}" + depends_on "python@3.8" + {conflicts} resource "pyserial" do @@ -88,11 +90,13 @@ class {classname} < Formula def install - ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages" + xy = Language::Python.major_minor_version "python3" + + ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages" resources.each do |r| r.stage do - system "python", *Language::Python.setup_install_args(libexec/"vendor") + system "python3", *Language::Python.setup_install_args(libexec/"vendor") end end @@ -103,7 +107,7 @@ 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" + ln_s lib/"python#{xy}/site-packages/cryptech", libexec/"vendor/lib/python#{xy}/site-packages/cryptech" share.install "cryptech-alpha-firmware.tar.gz" lib.install "sw/pkcs11/libcryptech-pkcs11.dylib" |