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

Homebrew cask for macOS, help wanted #1141

Closed
simonengelbot opened this issue Sep 13, 2023 · 4 comments
Closed

Homebrew cask for macOS, help wanted #1141

simonengelbot opened this issue Sep 13, 2023 · 4 comments
Labels
help wanted PR welcomed. macOS Like most cross-platform projects, this one also lacks macOS developers. Help wanted.

Comments

@simonengelbot
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@xiaoyifang xiaoyifang added the macOS Like most cross-platform projects, this one also lacks macOS developers. Help wanted. label Sep 17, 2023
@shenlebantongying shenlebantongying changed the title Need a homebrew formula installation option for macOS, which would be convenient for macOS users. Homebrew cask for macOS, help wanted Sep 17, 2023
@shenlebantongying
Copy link
Collaborator

shenlebantongying commented Sep 17, 2023

Someone already did one https://github.com/ivaquero/homebrew-chinese/blob/93c5a32c51b31e6b33b171151b6ac122883b09b5/Casks/goldendict-ng.rb AND https://github.com/hantang/homebrew-tribe/blob/main/Casks/goldendict-ng.rb

But it cannot be submitted to homebrew-cask repo because it does not meet homebrew's regulations. https://docs.brew.sh/Adding-Software-to-Homebrew

The hardcoded version has to be replaced with something automatic checks https://docs.brew.sh/Brew-Livecheck

Also, as of right now, the app name inside the .dmg is goldendict.app which conflicts with the existing https://formulae.brew.sh/cask/goldendict#default

@shenlebantongying shenlebantongying added the help wanted PR welcomed. label Sep 17, 2023
@IlIllIl
Copy link

IlIllIl commented Apr 15, 2024

It would be better if you can create an official repo named homebrew-abc under your profile @xiaoyifang, and only need to create a file named Casks/goldendict-ng.rb in it. And you can add github workflow to automatically change its version and sha256 field. It is recommended that you use a more concise version number.
Then add brew install xiaoyifang/homebrew-abc/goldendict-ng in user guide.

@shenlebantongying
Copy link
Collaborator

shenlebantongying commented May 12, 2024

I created one intended to be upstream to offical homebrew cask. https://github.com/shenlebantongying/homebrew-cask/blob/goldendict-ng/Casks/g/goldendict-ng.rb

Current problem: Homebrew for Arm requires proper codesign & notarize 😅

Cannot pass the check:

> brew audit --cask --new goldendict-ng
==> Downloading https://github.com/xiaoyifang/goldendict-ng/releases/download/v24.05.05-LiXia.ecd1138c/GoldenDict-24.05.05-
Already downloaded: /Users/slbtty/Library/Caches/Homebrew/downloads/baf4264ab51bd174e9fd2091051c062ca89cb1e33bcb6c4e447ed9e149b756d8--GoldenDict-24.05.05-Qt6.7.0-arm64.dmg
==> Downloading and extracting artifacts
==> Downloading https://github.com/xiaoyifang/goldendict-ng/releases/download/v24.05.05-LiXia.ecd1138c/GoldenDict-24.05.05-
Already downloaded: /Users/slbtty/Library/Caches/Homebrew/downloads/baf4264ab51bd174e9fd2091051c062ca89cb1e33bcb6c4e447ed9e149b756d8--GoldenDict-24.05.05-Qt6.7.0-arm64.dmg
audit for goldendict-ng: failed
 - Signature verification failed:
/private/tmp/cask-audit20240512-22279-nd5lm/GoldenDict-ng.app: rejected

macOS on ARM requires software to be signed.
Please contact the upstream developer to let them know they should sign and notarize their software.
goldendict-ng
  * line 7, col 4: Signature verification failed:
    /private/tmp/cask-audit20240512-22279-nd5lm/GoldenDict-ng.app: rejected

    macOS on ARM requires software to be signed.
    Please contact the upstream developer to let them know they should sign and notarize their software.
Error: 1 problem in 1 cask detected.

@shenlebantongying
Copy link
Collaborator

shenlebantongying commented May 12, 2024

Submitting to Homebrew cask need to pay Apple $99 USD per year for notarization. Also need a lot of work to set up CI.

Related code for creating a Cask.

cask "goldendict-ng" do
  version "24.05.05"
  sha256 arm:   "f6ab0bd998f9eca2e141b64be2c804067e546810d813b7bf3972f4ab593258db",
         intel: "3869f3b6311456aa0904f64f75e68a15fa28f87716bad4cc4a29676b45c6d602"

  on_arm do
    url "https://github.com/xiaoyifang/goldendict-ng/releases/download/v#{version}-LiXia.ecd1138c/GoldenDict-#{version}-Qt6.7.0-arm64.dmg",
        verified: "https://github.com/xiaoyifang/goldendict-ng/"
  end
  on_intel do
    url "https://github.com/xiaoyifang/goldendict-ng/releases/download/v#{version}-LiXia.ecd1138c/GoldenDict-#{version}-Qt6.7.0-x86_64.dmg",
        verified: "https://github.com/xiaoyifang/goldendict-ng/"
  end

  name "Goldendict-ng"
  desc "Feature-rich dictionary lookup program"
  homepage "https://xiaoyifang.github.io/goldendict-ng/"

  livecheck do
    url "https://github.com/xiaoyifang/goldendict-ng"
    regex(/^v(\d\d.\d\d.\d\d)-.*/i)
  end

  depends_on macos: ">= :monterey"

  app "GoldenDict-ng.app"

  zap trash: [
    "~/.goldendict",
    "~/Library/Caches/GoldenDict-ng",
    "~/Library/Preferences/org.xiaoyifang.plist",
    "~/Library/Saved Application State/org.xiaoyifang.savedState",
  ]
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted PR welcomed. macOS Like most cross-platform projects, this one also lacks macOS developers. Help wanted.
Projects
None yet
Development

No branches or pull requests

4 participants