-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
iconsur: prepare virtualenv to avoid issues with [email protected]
#165617
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,58 @@ | ||
require "language/node" | ||
|
||
class Iconsur < Formula | ||
include Language::Python::Virtualenv | ||
|
||
desc "macOS Big Sur Adaptive Icon Generator" | ||
homepage "https://github.com/rikumi/iconsur" | ||
# Keep extra_packages in pypi_formula_mappings.json aligned with | ||
# https://github.com/rikumi/iconsur/blob/#{version}/src/fileicon.sh#L230 | ||
url "https://registry.npmjs.org/iconsur/-/iconsur-1.7.0.tgz" | ||
sha256 "d732df6bbcaf1418c6f46f9148002cbc1243814692c1c0e5c0cebfcff001c4a1" | ||
license "MIT" | ||
|
||
bottle do | ||
sha256 cellar: :any_skip_relocation, arm64_sonoma: "34926c4bd6b066a9ca422ad09daa4a04c7b3ac40e6e094eec10a74a3f3ffce9c" | ||
sha256 cellar: :any_skip_relocation, arm64_ventura: "8c89a0bafa76e65252ca37540e7e80079894ef63150c4d29fdbaa2f92ce04359" | ||
sha256 cellar: :any_skip_relocation, arm64_monterey: "304d38f9248f8979b2b483280cac76690c14b61ff87f08484c0dc2a9387c21b8" | ||
sha256 cellar: :any_skip_relocation, arm64_big_sur: "304d38f9248f8979b2b483280cac76690c14b61ff87f08484c0dc2a9387c21b8" | ||
sha256 cellar: :any_skip_relocation, sonoma: "a5755fcf3326e667794b2cec721d12d5488c34da0ba53b977d7c5431e079ed7b" | ||
sha256 cellar: :any_skip_relocation, ventura: "eaf5ee9a4bc080056cf6ea44e633660b90309b201d17b4b7165eaa3e62656d63" | ||
sha256 cellar: :any_skip_relocation, monterey: "77884a43974a1b6a917d415b12d2b6fe476dee4215e986e7123b9d911b0a95cc" | ||
sha256 cellar: :any_skip_relocation, big_sur: "77884a43974a1b6a917d415b12d2b6fe476dee4215e986e7123b9d911b0a95cc" | ||
sha256 cellar: :any_skip_relocation, catalina: "77884a43974a1b6a917d415b12d2b6fe476dee4215e986e7123b9d911b0a95cc" | ||
rebuild 1 | ||
sha256 cellar: :any_skip_relocation, arm64_sonoma: "7e67e0fa5d12b5598bb3f6755547a50e20da472da57a7df5c68d2ca3380f7140" | ||
sha256 cellar: :any_skip_relocation, arm64_ventura: "cdfdf024544f90244bfefea1697a7100c7e2adde6a05fd51a4e4e54c5f3ebc98" | ||
sha256 cellar: :any_skip_relocation, arm64_monterey: "11889c0c42c2a044fe9dc081f50cf332f606e922837b5a765141ef2340e0cdb6" | ||
sha256 cellar: :any_skip_relocation, sonoma: "488565e07e909605382b2ed833216e8b87ac499225443e2b2ace61f1508b6a6b" | ||
sha256 cellar: :any_skip_relocation, ventura: "1a1f49255b7376a223d04e38c2dbd0ef278376e161670b0fca923b94e4d12227" | ||
sha256 cellar: :any_skip_relocation, monterey: "f9a727a3148a71fdda8a537c85028002fb33f7ff9a91db86a4d50971db5b4a42" | ||
end | ||
|
||
depends_on :macos | ||
depends_on "node" | ||
|
||
# Uses /usr/bin/python on older macOS. Otherwise, it will use python3 from PATH. | ||
# Since fileicon.sh runs `pip3 install --user` to install any missing packages, | ||
# this causes issues if a user has Homebrew Python installed (EXTERNALLY-MANAGED). | ||
# We instead prepare a virtualenv with all missing packages. | ||
on_monterey :or_newer do | ||
depends_on "[email protected]" | ||
end | ||
|
||
resource "pyobjc-core" do | ||
url "https://files.pythonhosted.org/packages/50/d5/0b93cb9dc94ab4b78b2b7aa54c80f037e4de69897fff81a5ededa91d2704/pyobjc-core-10.1.tar.gz" | ||
sha256 "1844f1c8e282839e6fdcb9a9722396c1c12fb1e9331eb68828a26f28a3b2b2b1" | ||
end | ||
|
||
resource "pyobjc-framework-cocoa" do | ||
url "https://files.pythonhosted.org/packages/5d/1d/964a0da846d49511489bd99ed705f9d85c5081fc832d0dba384c4c0d2fb2/pyobjc-framework-Cocoa-10.1.tar.gz" | ||
sha256 "8faaf1292a112e488b777d0c19862d993f3f384f3927dc6eca0d8d2221906a14" | ||
end | ||
|
||
def install | ||
system "npm", "install", *Language::Node.std_npm_install_args(libexec) | ||
bin.install_symlink Dir["#{libexec}/bin/*"] | ||
|
||
if MacOS.version >= :monterey | ||
venv = virtualenv_create(libexec/"venv", "python3.12") | ||
venv.pip_install resources | ||
bin.install Dir["#{libexec}/bin/*"] | ||
bin.env_script_all_files libexec/"bin", PATH: "#{venv.root}/bin:${PATH}" | ||
else | ||
bin.install_symlink Dir["#{libexec}/bin/*"] | ||
end | ||
end | ||
|
||
test do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's special
brew
logic I added to allowbrew update-python-resources iconsur
to work (sinceiconsur
is not a Python package).Once I finish Homebrew/brew#16780,
bump
/bump-formula-pr
will automatically update resources.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, good to know 👍