jtroo / kanata

Improve keyboard comfort and usability with advanced customization
GNU Lesser General Public License v3.0
3.21k stars 131 forks source link

Feature request: homebrew #1140

Closed jjangga0214 closed 2 weeks ago

jjangga0214 commented 4 months ago

Is your feature request related to a problem? Please describe.

Hi! I think it'd be great if we can install kanata through homebrew.

Describe the solution you'd like.

Though the name kanata is already taken from homebrew, we still can name it slightly differently. Like jtroo/kanata, or kanata-keyboard etc.

Describe alternatives you've considered.

None.

Additional context

No response

tifandotme commented 4 months ago

Great suggestion. Although the name hasn't been taken, that would be katana

Screenshot 2024-07-28 at 12 43 15
jjangga0214 commented 4 months ago

@tifandotme Ah, right! I mistakenly searched katana, whose name is already taken, instead of kanata

dotzenith commented 4 months ago

Adding kanata to homebrew would also make it a lot easier to run in the background. Homebrew provides services that will use the system service/daemon manager to run kanata in the background and launch it on login as well.

Also, I see the PRs welcome label but homebrew formulae live in their own repo (assuming we want to set up a tap) so @jtroo would have to make one and then we can add the formula for it.

jtroo commented 4 months ago

I'd be happy for someone else to set up and own the repository; unless it has to be me that owns it for some permission reason?

dotzenith commented 4 months ago

Nah no requirement for you to own it, just figured it would make sense for you to do so. For example, if you want to set up something like cargo-dist, which has integration for homebrew, it'd probably be easier for you to have control over the tap and generate the token needed for the integration.

Also, having you as the owner for the tap as well as the application makes it harder for a threat actor to mess with the tap and change the formula without your knowledge.

It's completely up to you however :)

jjangga0214 commented 4 months ago

@jtroo In the case of tap, you should own it. That's not a requirement, but a convention. That gives more trust and consistency to users. (Think about jtroo/kanata vs someone/kanata)

@dotzenith

(assuming we want to set up a tap)

But why tap? I don't think it should be..?

matklad commented 2 months ago

The following formula worked for me locally:

$ cat kanata.rb
class Kanata < Formula
  desc "A cross-platform software keyboard remapper for Linux, macOS and Windows."
  homepage "https://github.com/jtroo/kanata"
  url "https://github.com/jtroo/kanata/archive/refs/tags/v1.7.0-prerelease-1.tar.gz"
  sha256 "f0e2ac2717c79b90d2a044257b1a13f8c734b0823458f00b123f8c267466e0c7"
  license "LGPL-3.0-only"

  depends_on "rust" => :build

  def install
    system "cargo", "install", *std_cargo_args
  end

  test do
    system "#{bin}/kanata", "--version"
  end
end

$ brew install --build-from-source ./kanata.rb
$ kanata --version
kanata 1.7.0-prerelease-1

I don't intend to upstream this at the time.

matklad commented 2 months ago

Ok, it seems like upstreaming that might be less of a hassle than maintaining locally.

@jtroo any chance you are ready to release a non-pre-release 1.7.0 version? Homebrew doesn't allow pre-releases, and 1.6.0 doesn't work due to time being broken there.

Other than pre-release, https://github.com/matklad/homebrew-core/commit/c46b262f1d5aa4a6456f2e808b11ecc42f0d9f84 should be ready for upstreaming

thomastthai commented 3 weeks ago

1.7.0 was released. What's the next step to allow homebrew to install kanata?

matklad commented 3 weeks ago

Thanks @thomastthai, PR's up!

https://github.com/Homebrew/homebrew-core/pull/196811

matklad commented 2 weeks ago

I believe this is fixed now, Kanata is available in home-brew!

Thanks again jtroo for building this awesome piece of software --- I've recently moved from Linux to MacOS and was delighted that Kanata just works on Mac as well!