Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trezor-agent: update trezor dependency to 0.13.9 #183792

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 40 additions & 35 deletions Formula/t/trezor-agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ class TrezorAgent < Formula
revision 6

bottle do
sha256 cellar: :any_skip_relocation, arm64_sonoma: "6074b192bff562d58e4a7dabc122e7bd98e29aab254c73a035395f81a9bffcec"
sha256 cellar: :any_skip_relocation, arm64_ventura: "5b23b9d791faab2545672a6febaa5846dd52b918d0efb1fa098693973c4ad335"
sha256 cellar: :any_skip_relocation, arm64_monterey: "5709ae6ef2a2ebb063a08916aeaa419d6e6db9998ce83a14dc043839ae4d25ec"
sha256 cellar: :any_skip_relocation, sonoma: "90d1a1a3a0cfa7e735143c2a47f0ff0fb8bc25d6b3365f073d63bddcb2c8d4c1"
sha256 cellar: :any_skip_relocation, ventura: "9cb7a9fbbc0bc5131c9180084129aa015899004eb2e3c1701cdb3c53dbf0b5c9"
sha256 cellar: :any_skip_relocation, monterey: "d1dc18c59dd3e880e465312cbb74f5de380afdbf0e044aa1205eb9ecd6e5ca12"
sha256 cellar: :any_skip_relocation, x86_64_linux: "32bec446c5e6c475dc74139c45597da3eecc63ab093e33d90631ef7147640471"
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_sequoia: "3cf5dd8fd1c6dd007964f1e81ec9218e3dc1d5d9f1bb545fe84caf215856221b"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "4b921ca2520b8c663f0f7a281de0f80233ec71aeaa1e5f6cdffcf8248183d65c"
sha256 cellar: :any_skip_relocation, arm64_ventura: "4ab6e698fb20adc705a359d0c3385b39d6b98cce041e4609a3009de6da934c8d"
sha256 cellar: :any_skip_relocation, sonoma: "68a141cce758ffa8ff2f55c359d821d03786bcd6ed0fee2c72de57401c1cc6fc"
sha256 cellar: :any_skip_relocation, ventura: "dcf4a3c22308bec19c31bd8421416bd9d92a280b6e4bc447c4bdab60f37b307f"
sha256 cellar: :any_skip_relocation, x86_64_linux: "59269110bdfa3b35e7d8e7f9132916ab56fd010dec905625e00d25e942666799"
end

depends_on "certifi"
Expand Down Expand Up @@ -85,19 +85,13 @@ class TrezorAgent < Formula
end

resource "hidapi" do
url "https://files.pythonhosted.org/packages/95/0e/c106800c94219ec3e6b483210e91623117bfafcf1decaff3c422e18af349/hidapi-0.14.0.tar.gz"
sha256 "a7cb029286ced5426a381286526d9501846409701a29c2538615c3d1a612b8be"

# patch to build with Cython 3+, remove in next release
patch do
url "https://github.com/trezor/cython-hidapi/commit/749da6931f57c4c30596de678125648ccfd6e1cd.patch?full_index=1"
sha256 "e3d70eb9850c7be0fdb0c31bf575b33be5c5848def904760a6ca9f4c3824f000"
end
url "https://files.pythonhosted.org/packages/bf/6f/90c536b020a8e860f047a2839830a1ade3e1490e67336ecf489b4856eb7b/hidapi-0.14.0.post2.tar.gz"
sha256 "6c0e97ba6b059a309d51b495a8f0d5efbcea8756b640d98b6f6bb9fdef2458ac"
end

resource "idna" do
url "https://files.pythonhosted.org/packages/21/ed/f86a79a07470cb07819390452f178b3bef1d375f2ec021ecfc709fc7cf07/idna-3.7.tar.gz"
sha256 "028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"
url "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz"
sha256 "12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"
end

resource "keepkey" do
Expand All @@ -121,8 +115,8 @@ class TrezorAgent < Formula
end

resource "libagent" do
url "https://files.pythonhosted.org/packages/4e/0f/b48045dd9d12eea5c092aaad4c251443384da700c8d85349fc3c554a2320/libagent-0.14.7.tar.gz"
sha256 "8cea67fbe94216f61dbc22fac9d3d749b41b9cfc11393a76b0b0013c204adb98"
url "https://files.pythonhosted.org/packages/33/9f/d80eb0568f617d4041fd83b8b301fdb817290503ee4c1546024df916454e/libagent-0.15.0.tar.gz"
sha256 "c87caebdb932ed42bcd8a8cbe40ce3589587c71c3513ca79cadf7a040e24b4eb"
end

resource "libusb1" do
Expand Down Expand Up @@ -156,13 +150,13 @@ class TrezorAgent < Formula
end

resource "pycryptodome" do
url "https://files.pythonhosted.org/packages/b9/ed/19223a0a0186b8a91ebbdd2852865839237a21c74f1fbc4b8d5b62965239/pycryptodome-3.20.0.tar.gz"
sha256 "09609209ed7de61c2b560cc5c8c4fbf892f8b15b1faf7e4cbffac97db1fffda7"
url "https://files.pythonhosted.org/packages/13/52/13b9db4a913eee948152a079fe58d035bd3d1a519584155da8e786f767e6/pycryptodome-3.21.0.tar.gz"
sha256 "f7787e0d469bdae763b876174cf2e6c0f7be79808af26b1da96f1a64bcf47297"
end

resource "pycryptodomex" do
url "https://files.pythonhosted.org/packages/31/a4/b03a16637574312c1b54c55aedeed8a4cb7d101d44058d46a0e5706c63e1/pycryptodomex-3.20.0.tar.gz"
sha256 "7a710b79baddd65b806402e14766c721aee8fb83381769c27920f26476276c1e"
url "https://files.pythonhosted.org/packages/11/dc/e66551683ade663b5f07d7b3bc46434bf703491dbd22ee12d1f979ca828f/pycryptodomex-3.21.0.tar.gz"
sha256 "222d0bd05381dd25c32dd6065c071ebf084212ab79bab4599ba9e6a3e0009e6c"
end

resource "pydes" do
Expand Down Expand Up @@ -216,8 +210,8 @@ class TrezorAgent < Formula
end

resource "python-gnupg" do
url "https://files.pythonhosted.org/packages/b1/5d/4425390ad81d22b330a1b0df204c4d39fb3cb7c39e081d51e9f7426ce716/python-gnupg-0.5.2.tar.gz"
sha256 "01d8013931c9fa3f45824bbea7054c03d6e11f258a72e7e086e168dbcb91854c"
url "https://files.pythonhosted.org/packages/85/61/2df3cd6f49dbb2d4a6a567cac1d803e3a50d86207e196d0f9e67a48664f7/python-gnupg-0.5.3.tar.gz"
sha256 "290d8ddb9cd63df96cfe9284b9b265f19fd6e145e5582dc58fd7271f026d0a47"
end

resource "python-u2flib-host" do
Expand All @@ -236,8 +230,8 @@ class TrezorAgent < Formula
end

resource "setuptools" do
url "https://files.pythonhosted.org/packages/aa/60/5db2249526c9b453c5bb8b9f6965fcab0ddb7f40ad734420b3b421f7da44/setuptools-70.0.0.tar.gz"
sha256 "f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0"
url "https://files.pythonhosted.org/packages/27/b8/f21073fde99492b33ca357876430822e4800cdf522011f18041351dfa74b/setuptools-75.1.0.tar.gz"
sha256 "d59a21b17a275fb872a9c3dae73963160ae079f1049ed956880cd7c09b120538"
end

resource "six" do
Expand All @@ -246,8 +240,8 @@ class TrezorAgent < Formula
end

resource "trezor" do
url "https://files.pythonhosted.org/packages/8e/82/831de0a643401c4dcfbbc17c33de35b8c3d23281ac60a0831be5f10838d3/trezor-0.13.8.tar.gz"
sha256 "634d4eddf35603257c321618d8548c6a35b27384657b65e3b0bdbad635a57cff"
url "https://files.pythonhosted.org/packages/10/11/b80ffb168b3e1c41c96c7278693eb6421cf567181afea9514c1ccd11c1ed/trezor-0.13.9.tar.gz"
sha256 "9450bd7bb9d23e5e33a3c9e58e18f058b44c9d9c34ca664b4981a795aa9fb1ef"
end

resource "typing-extensions" do
Expand All @@ -261,8 +255,8 @@ class TrezorAgent < Formula
end

resource "urllib3" do
url "https://files.pythonhosted.org/packages/43/6d/fa469ae21497ddc8bc93e5877702dca7cb8f911e337aca7452b5724f1bb6/urllib3-2.2.2.tar.gz"
sha256 "dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"
url "https://files.pythonhosted.org/packages/ed/63/22ba4ebfe7430b76388e7cd448d5478814d3032121827c12a2cc287e2260/urllib3-2.2.3.tar.gz"
sha256 "e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"
end

resource "websocket-client" do
Expand All @@ -271,15 +265,26 @@ class TrezorAgent < Formula
end

resource "wheel" do
url "https://files.pythonhosted.org/packages/b8/d6/ac9cd92ea2ad502ff7c1ab683806a9deb34711a1e2bd8a59814e8fc27e69/wheel-0.43.0.tar.gz"
sha256 "465ef92c69fa5c5da2d1cf8ac40559a8c940886afcef87dcf14b9470862f1d85"
url "https://files.pythonhosted.org/packages/b7/a0/95e9e962c5fd9da11c1e28aa4c0d8210ab277b1ada951d2aee336b505813/wheel-0.44.0.tar.gz"
sha256 "a29c3f2817e95ab89aa4660681ad547c0e9547f20e75b0562fe7723c9a2a9d49"
end

def install
ENV.append "CFLAGS", "-I#{Formula["libusb"].include}/libusb-1.0"
# Help gcc to find libusb headers on Linux.
ENV.append "CFLAGS", "-I#{Formula["libusb"].opt_include}/libusb-1.0" unless OS.mac?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No linkage to libusb on macOS, so maybe this is still needed everywhere?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newer cython-hidapi doesn't use libusb by default anymore1. Though it will use a bundled hidapi2 unless corresponding environment variable is set and pkg-config is installed

Footnotes

  1. https://github.com/trezor/cython-hidapi/commit/5cae7c36f9cdcb9da792961e8ed78a64770401ea

  2. https://github.com/trezor/cython-hidapi/blob/0.14.0.post2/setup.py#L225-L232

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add to above, from other resources, libusb dependency is still used via libusb1 which finds it via dlopen (CDLL). So won't see linkage.

cython-hidapi did directly link to libusb so that may have been linked in an older bottle.


venv = virtualenv_create(libexec, "python3.12")
venv.pip_install resources.reject { |r| OS.mac? ? r.name == "dbus-fast" : r.name.start_with?("pyobjc") }
venv.pip_install resources.reject { |r|
r.name == "python-daemon" || (OS.mac? ? r.name == "dbus-fast" : r.name.start_with?("pyobjc"))
}
venv.pip_install_and_link buildpath

# Workaround breaking change in `setuptools`: https://pagure.io/python-daemon/issue/94
resource("python-daemon").stage do
inreplace "version.py", "import setuptools.extern.packaging.version", ""
inreplace "version.py", "self.validate_version(version)", ""
venv.pip_install Pathname.pwd
end
end

test do
Expand Down
Loading