cask "mplab-xc32" do # NOTE: "32" is not a version number, but an intrinsic part of the product name version "4.60" sha256 "d87b13aedec1afa874a6888372cb4928aa6d6d2abca439afbcd93d0c10c912ca" url "https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc32-v#{version}-full-install-osx-installer.dmg" name "MPLab XC32 Compiler" desc "Compiler for 32-bit PIC and SAM MCUs and MPUs" homepage "https://www.microchip.com/mplab/compilers" livecheck do url "https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/xc32" regex(%r{href=.*?SoftwareTools/xc32[._-]v?(\d+(?:\.\d+)+)[._-]full[._-]install[._-]osx[._-]installer\.dmg}i) end depends_on arch: :x86_64 installer script: { executable: "xc32-v#{version}-osx-installer.app/Contents/MacOS/installbuilder.sh", args: [ "--mode", "unattended", "--unattendedmodeui", "none", "--ModifyAll", "0", "--netservername", '""', "--LicenseType", "FreeMode", "--prefix", staged_path.to_s ], input: ["y"], sudo: true, } binary "#{staged_path}/bin/xc32-addr2line" binary "#{staged_path}/bin/xc32-ar" binary "#{staged_path}/bin/xc32-as" binary "#{staged_path}/bin/xc32-bin2hex" binary "#{staged_path}/bin/xc32-c++" binary "#{staged_path}/bin/xc32-c++filt" binary "#{staged_path}/bin/xc32-cpp" binary "#{staged_path}/bin/xc32-elfedit" binary "#{staged_path}/bin/xc32-g++" binary "#{staged_path}/bin/xc32-gcc" binary "#{staged_path}/bin/xc32-ld" binary "#{staged_path}/bin/xc32-nm" binary "#{staged_path}/bin/xc32-objcopy" binary "#{staged_path}/bin/xc32-objdump" binary "#{staged_path}/bin/xc32-ranlib" binary "#{staged_path}/bin/xc32-readelf" binary "#{staged_path}/bin/xc32-size" binary "#{staged_path}/bin/xc32-strings" binary "#{staged_path}/bin/xc32-strip" postflight do set_ownership staged_path.to_s end uninstall script: { executable: "Uninstall-xc32-v#{version}.app/Contents/MacOS/installbuilder.sh", args: ["--mode", "unattended"], sudo: true, } # No zap stanza required end