mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-07-19 00:37:07 +00:00
Feat: Added homebrew casks for both Macos and Linux
This commit is contained in:
parent
962979c70e
commit
40382d2a12
18
Casks/lce-emerald-launcher-experimental.rb
Normal file
18
Casks/lce-emerald-launcher-experimental.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
cask "lce-emerald-launcher-experimental" do
|
||||
version "1.5.1-experimental"
|
||||
sha256 intel: "7826e105f283f22cb5784b7e0dd3c90b8fc493a636ca11333a4b867f3e1a9891",
|
||||
arm: "e1c392213e0d34546f55971a1e381b942d2c896671576a18ab1db4ff1d4270b9"
|
||||
|
||||
url "https://github.com/LCE-Hub/LCE-Emerald-Launcher-cask/releases/download/experimental/LCE.Emerald.Launcher_#{version.to_s.split("-").first}_#{arch}.dmg"
|
||||
name "LCE Emerald Launcher Experimental"
|
||||
desc "Minecraft Legacy Console Edition Launcher (Experimental)"
|
||||
homepage "https://github.com/HuntedRaven7/LCE-Emerald-Launcher-cask"
|
||||
|
||||
app "LCE Emerald Launcher/LCE Emerald Launcher.app"
|
||||
|
||||
zap trash: [
|
||||
"~/Library/Application Support/com.emerald.legacy",
|
||||
"~/Library/Preferences/com.emerald.legacy.plist",
|
||||
"~/Library/Saved Application State/com.emerald.legacy.savedState",
|
||||
]
|
||||
end
|
||||
18
Casks/lce-emerald-launcher.rb
Normal file
18
Casks/lce-emerald-launcher.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
cask "lce-emerald-launcher" do
|
||||
version "1.5.1"
|
||||
sha256 intel: "7826e105f283f22cb5784b7e0dd3c90b8fc493a636ca11333a4b867f3e1a9891",
|
||||
arm: "e1c392213e0d34546f55971a1e381b942d2c896671576a18ab1db4ff1d4270b9"
|
||||
|
||||
url "https://github.com/LCE-Hub/LCE-Emerald-Launcher-cask/releases/download/v#{version}/LCE.Emerald.Launcher_#{version}_#{arch}.dmg"
|
||||
name "LCE Emerald Launcher"
|
||||
desc "Minecraft Legacy Console Edition Launcher"
|
||||
homepage "https://github.com/HuntedRaven7/LCE-Emerald-Launcher-cask"
|
||||
|
||||
app "LCE Emerald Launcher/LCE Emerald Launcher.app"
|
||||
|
||||
zap trash: [
|
||||
"~/Library/Application Support/com.emerald.legacy",
|
||||
"~/Library/Preferences/com.emerald.legacy.plist",
|
||||
"~/Library/Saved Application State/com.emerald.legacy.savedState",
|
||||
]
|
||||
end
|
||||
19
Formula/lce-emerald-launcher.rb
Normal file
19
Formula/lce-emerald-launcher.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class LceEmeraldLauncher < Formula
|
||||
desc "Minecraft Legacy Console Edition Launcher"
|
||||
homepage "https://github.com/HuntedRaven7/LCE-Emerald-Launcher-cask"
|
||||
url "https://github.com/HuntedRaven7/LCE-Emerald-Launcher-cask/releases/download/v#{version}/LCE.Emerald.Launcher_#{version}_amd64.AppImage"
|
||||
sha256 "541271f927249fdfc4ada03b72110cdacaef388ed33b7d75724545145b8c412f"
|
||||
version "1.5.0"
|
||||
license "GPL-3.0-only"
|
||||
|
||||
depends_on :linux
|
||||
|
||||
def install
|
||||
# Rename and install the AppImage
|
||||
bin.install "LCE.Emerald.Launcher_#{version}_amd64.AppImage" => "lce-emerald-launcher"
|
||||
end
|
||||
|
||||
test do
|
||||
assert_predicate bin/"lce-emerald-launcher", :exist?
|
||||
end
|
||||
end
|
||||
|
|
@ -9,13 +9,13 @@ APP_PATH="$1"
|
|||
BUNDLE_ID="com.emerald.legacy"
|
||||
|
||||
if [ -z "$APP_PATH" ]; then
|
||||
echo "Usage: $0 <path-to-app-bundle>"
|
||||
exit 1
|
||||
echo "Usage: $0 <path-to-app-bundle>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$APP_PATH" ]; then
|
||||
echo "Error: App bundle not found at $APP_PATH"
|
||||
exit 1
|
||||
echo "Error: App bundle not found at $APP_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Fixing macOS quarantine for: $APP_PATH"
|
||||
|
|
@ -25,8 +25,8 @@ xattr -cr "$APP_PATH"
|
|||
|
||||
# Add basic code signing (ad-hoc signature)
|
||||
codesign --force --deep --sign - "$APP_PATH" 2>/dev/null || {
|
||||
echo "Warning: Code signing failed, but quarantine removal should work"
|
||||
echo "Warning: Code signing failed, but quarantine removal should work"
|
||||
}
|
||||
|
||||
echo "✅ macOS quarantine fix completed"
|
||||
echo "macOS quarantine fix completed"
|
||||
echo "The app should now launch without 'damaged' error"
|
||||
|
|
|
|||
81
scripts/update-homebrew.py
Normal file
81
scripts/update-homebrew.py
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
import argparse
|
||||
import re
|
||||
import os
|
||||
|
||||
def update_stable(version, intel_hash, arm_hash, linux_hash):
|
||||
cask_path = "Casks/lce-emerald-launcher.rb"
|
||||
formula_path = "Formula/lce-emerald-launcher.rb"
|
||||
|
||||
# Update Cask
|
||||
if os.path.exists(cask_path):
|
||||
with open(cask_path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Replace version
|
||||
content = re.sub(r'^\s*version\s+"[^"]+"', f' version "{version}"', content, flags=re.MULTILINE)
|
||||
# Replace sha256 block
|
||||
content = re.sub(r'sha256\s+intel:\s+"[a-f0-9]+",\r?\n\s+arm:\s+"[a-f0-9]+"',
|
||||
f'sha256 intel: "{intel_hash}",\n arm: "{arm_hash}"',
|
||||
content)
|
||||
|
||||
with open(cask_path, 'w') as f:
|
||||
f.write(content)
|
||||
print(f"Updated {cask_path}")
|
||||
else:
|
||||
print(f"Error: {cask_path} not found")
|
||||
|
||||
# Update Formula
|
||||
if os.path.exists(formula_path):
|
||||
with open(formula_path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Replace version
|
||||
content = re.sub(r'^\s*version\s+"[^"]+"', f' version "{version}"', content, flags=re.MULTILINE)
|
||||
# Replace sha256
|
||||
content = re.sub(r'^\s*sha256\s+"[a-f0-9]+"', f' sha256 "{linux_hash}"', content, flags=re.MULTILINE)
|
||||
|
||||
with open(formula_path, 'w') as f:
|
||||
f.write(content)
|
||||
print(f"Updated {formula_path}")
|
||||
else:
|
||||
print(f"Error: {formula_path} not found")
|
||||
|
||||
def update_experimental(version, intel_hash, arm_hash):
|
||||
cask_path = "Casks/lce-emerald-launcher-experimental.rb"
|
||||
|
||||
if os.path.exists(cask_path):
|
||||
with open(cask_path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Replace version
|
||||
content = re.sub(r'^\s*version\s+"[^"]+"', f' version "{version}"', content, flags=re.MULTILINE)
|
||||
# Replace sha256 block
|
||||
content = re.sub(r'sha256\s+intel:\s+"[a-f0-9]+",\r?\n\s+arm:\s+"[a-f0-9]+"',
|
||||
f'sha256 intel: "{intel_hash}",\n arm: "{arm_hash}"',
|
||||
content)
|
||||
|
||||
with open(cask_path, 'w') as f:
|
||||
f.write(content)
|
||||
print(f"Updated {cask_path}")
|
||||
else:
|
||||
print(f"Error: {cask_path} not found")
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Update Homebrew Formula/Cask files")
|
||||
parser.add_argument("--type", choices=["stable", "experimental"], required=True)
|
||||
parser.add_argument("--version", required=True)
|
||||
parser.add_argument("--intel-hash", required=True)
|
||||
parser.add_argument("--arm-hash", required=True)
|
||||
parser.add_argument("--linux-hash")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.type == "stable":
|
||||
if not args.linux_hash:
|
||||
raise ValueError("--linux-hash is required for stable update")
|
||||
update_stable(args.version, args.intel_hash, args.arm_hash, args.linux_hash)
|
||||
elif args.type == "experimental":
|
||||
update_experimental(args.version, args.intel_hash, args.arm_hash)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Reference in a new issue