Add support for Linux to visual-studio-code cask#228061
Add support for Linux to visual-studio-code cask#228061daegalus wants to merge 2 commits intoHomebrew:mainfrom
Conversation
|
Thanks for the work here so far @daegalus but we don't currently support Casks on Linux apart from simple binary packages. There is some preliminary work to enable the use of AppImages in future Homebrew/brew#20334 |
Well, i have it working locally. And i figured i could use post install with File to write the desktop files to the right place. I plan to add Flatpak support in the future to honebrew. Im just learning by writing done Casks first. I think the current state can support most UI Linux apps actually |
|
You're welcome to host a version with your working code in a local tap for now, but we'd need to have these kind of changes supported in https://github.com/homebrew/brew before we'd consider adding them to specific casks. |
Ok, Ill start my own tap for these and slowly add the necessary functionality to brew, so we can eventually merge these mainline. |
|
Thanks @daegalus! Looking forward to your contributions 😄. Closing this out for now. |
Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.
In the following questions
<cask>is the token of the cask you're submitting.After making any changes to a cask, existing or new, verify:
brew audit --cask --online <cask>is error-free.brew style --fix <cask>reports no offenses.Additionally, if adding a new cask: (since linux support is new, I tested this also)
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask>worked successfully.brew uninstall --cask <cask>worked successfully.I wanted to add Linux support to this cask. It can be quite useful for Immutable systems and other linux usecases that can't use the DEB/RPM route.
I am new to making homebrew recipes and cask, and I am sure I have made many mistakes, so I would appreciate any feedback.
I am particularly concerned if it is ok to even use the
if os ==code, or if there is a better way to organize the file, as I am also concerned about the order of directives. Maybe I do a bit more duplication and put more stuff inon_linuxand move the macos stuff toon_macos?Also I don't know if there is a variable or function i can use to get
/home/linuxbrew/.linuxbrew/Caskroom/<cask>as a path, instead of hardcoding it.I also had to use some methods to handle the difference in naming for linux and macos on the VSCode URLs. For macos it is
darwinanddarwin-arm64while linux islinux-x64andlinux-arm64The Cask cookbook docs were a little incorrect, as it instructed me to put the
module Utilsinside thecaskblock, and usedself.methods, while the stylecheck changed things up. Let me know if there is a different way to do this.EDIT: I forgot to ask, is there a way to add one-off files that are not part of the package? There are 2
.desktopfiles I need to add to~/.local/share/applicationso that this app shows up in the Launchers in linux, but they are not included in thetar.gzfile option on the vscode download, only in therpmanddeb. Or a way to download extra files?EDIT2: I also don't have a mac to test the mac side of things.