lifepillar / homebrew-appleii

Homebrew formulae for anything related to Apple I, Apple II, Apple ///, and Apple IIGS emulators.
54 stars 5 forks source link

AppleCommander formula needs to distinguish url based on cpu architecture #27

Closed bernstbj closed 2 years ago

bernstbj commented 2 years ago

While the SHA256 is keyed to ARM vs x86_64, the URL to download from is not. As such, on an Intel machine it will end up downloading the ARM build but fail brew update/upgrade operations because it is using the wrong SHA256 hash.

Corrected snippet (with incorrect url hashed out):

  desc "Move data between Apple ][ disk images and native filesystem"
  homepage "https://applecommander.github.io/"
##  url "https://github.com/AppleCommander/AppleCommander/releases/download/1.8.0/AppleCommander-macosx-aarch64-1.8.0.jar"
  if Hardware::CPU.intel?
    url "https://github.com/AppleCommander/AppleCommander/releases/download/1.8.0/AppleCommander-macosx-x86_64-1.8.0.jar"
  else
    url "https://github.com/AppleCommander/AppleCommander/releases/download/1.8.0/AppleCommander-macosx-aarch64-1.8.0.jar"
  end
  depends_on "openjdk"
bernstbj commented 2 years ago

It looks like the breaking change is here: https://github.com/lifepillar/homebrew-appleii/commit/4e8d3575e35fdf5e1711af5ca0e25a9e24a8ff9b

lifepillar commented 2 years ago

Ah, good catch! This should be fixed in master. Please reopen if that is not the case.