update cask and add betterdummy

This commit is contained in:
YuanHui
2025-12-25 11:06:10 +08:00
parent 1efe59c858
commit 354aed8046
3 changed files with 39 additions and 10 deletions

29
Casks/betterdummy.rb Normal file
View File

@@ -0,0 +1,29 @@
cask "betterdummy" do
version "1.1.24"
sha256 "5d02657f3aa77017f5a94af16d042cef011094b58f19b4d0f4a79e090311cfb3"
url "https://jihulab.com/1024town/china-speed/-/package_files/1431/download"
name "betterdummy"
desc "Dummy Display for Apple Silicon Macs to achieve custom resolutions"
homepage "https://github.com/waydabber/BetterDummy"
auto_updates true
app "BetterDummy.app"
zap trash: [
"~/Library/Application Scripts/me.waydabber.BetterDummyHelper",
"~/Library/Application Scripts/me.waydabber.BetterDummy",
"~/Library/Containers/me.waydabber.BetterDummyHelper",
"~/Library/Containers/me.waydabber.BetterDummy",
"~/Library/Preferences/me.waydabber.BetterDummy.plist",
]
# 修复后的 caveats 部分
caveats <<~EOS
#{token} has been renamed 'betterdisplay',
install betterdisplay to continue receiving updates;
brew install --cask betterdisplay
EOS
end

View File

@@ -1,9 +1,9 @@
cask 'ima-copilot' do
version '2.0.1'
sha256 'bbcd99ebc805e5a05a8d707feb9080224c7b61b6f78afee2cf6b66e62e06a6c1'
version '2.0.3'
sha256 '48f1c3c89b86d2beb29a0c25eb55f6a9de278dc582c569bc3e9e9a0eaf993c6f'
# 应用程序的下载 URL
url 'https://ima-app.image.myqcloud.com/mac_channel/ima.copilot_universal_10000074_2.0.1_3375.dmg'
url 'https://ima-app.image.myqcloud.com/mac_channel/ima.copilot_universal_10000074_2.0.3_3440.dmg'
# 应用程序的名称
name 'ima.copilot'

View File

@@ -25,9 +25,9 @@ class SenseVoice < Formula
#!/bin/bash
set -e
if [[ $# -lt 1 ]]; then
echo "Usage: sense-voice [audio_file] [other_options]"
exit 1
# 如果没有参数,或第一个参数是选项(以-开头),直接传给原程序
if [[ $# -eq 0 ]] || [[ "$1" == -* ]]; then
exec #{bin}/sense-voice-real "$@"
fi
INPUT="$1"
@@ -75,10 +75,10 @@ class SenseVoice < Formula
# 安装lib动态库保证运行时找到
lib.install Dir["build/lib/*.dylib"]
# 修复 sense-voice 中对 dylib 的引用
# 修复 sense-voice-real (实际二进制文件) 中对 dylib 的引用
dylibs = Dir["#{lib}/*.dylib"]
dylibs.each do |dylib|
system "install_name_tool", "-change", "@rpath/#{File.basename(dylib)}", "@loader_path/../lib/#{File.basename(dylib)}", "#{bin}/sense-voice"
system "install_name_tool", "-change", "@rpath/#{File.basename(dylib)}", "@loader_path/../lib/#{File.basename(dylib)}", "#{bin}/sense-voice-real"
end
# 修复各个 dylib 之间的引用
@@ -89,8 +89,8 @@ class SenseVoice < Formula
end
end
# 给 sense-voice 增加 rpath
system "install_name_tool", "-add_rpath", "@loader_path/../lib", "#{bin}/sense-voice"
# 给 sense-voice-real (实际二进制文件) 增加 rpath
system "install_name_tool", "-add_rpath", "@loader_path/../lib", "#{bin}/sense-voice-real"
end
test do