Migrate casks from homebrew/cask-drivers. (#145132)

This commit is contained in:
Markus Reiter 2023-04-16 13:30:04 +02:00 committed by GitHub
parent adb44afc4f
commit 4cac845a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 161 additions and 0 deletions

82
Casks/ftdi-vcp-driver.rb Normal file
View File

@ -0,0 +1,82 @@
cask "ftdi-vcp-driver" do
on_mojave :or_older do
version "2.4.4"
sha256 "f3343fc223f667e1dab0ecf9fd8fade525c261f120a1cd6b29f8806fa6bc4d8b"
url "https://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v#{version.dots_to_underscores}.dmg"
pkg "FTDIUSBSerial.pkg"
uninstall pkgutil: [
"com.FTDI.ftdiusbserialdriverinstaller.*",
"com.FTDI.driver.FTDIUSBSerialDriver",
],
kext: "com.FTDI.driver.FTDIUSBSerialDriver",
delete: "/Library/Extensions/FTDIUSBSerialDriver.kext"
caveats do
reboot
<<~EOS
If you don't want to reboot, you can load the driver using the following
command:
sudo /sbin/kextload -b com.FTDI.driver.FTDIUSBSerialDriver
Once you've rebooted or loaded the driver, you can (re)connect your FTDI
device and it will show up in /dev, usually like this:
/dev/tty.usbserial-XXXXXXXX
where XXXXXXXX is a random ID, based on the serial number.
EOS
end
end
on_catalina :or_newer do
version "1.5.0"
sha256 "f535d604d5098c4ecde0f213a80732cd45906339472ae30c0723959336a50b9c"
url "https://ftdichip.com/wp-content/uploads/2022/06/FTDIUSBSerialDextInstaller_#{version.dots_to_underscores}.dmg"
# App must be installed in `/Applications`.
app "FTDIUSBSerialDextInstaller_#{version.dots_to_underscores}.app",
target: "/Applications/FTDIUSBSerialDextInstaller.app"
installer manual: "/Applications/FTDIUSBSerialDextInstaller.app"
# `systemextensionsctl` currently only works when SIP is disabled and there
# doesn't seem to be any other way to uninstall a driver extension.
# uninstall script: {
# executable: "systemextensionsctl",
# args: ["uninstall", "-", "com.ftdi.vcp.dext"],
# }
uninstall delete: [
"~/Library/Containers/com.ftdi.vcp.dext",
"~/Library/Application Scripts/com.ftdi.vcp.dext",
]
caveats do
reboot
<<~EOS
Once you've rebooted, you can (re)connect your FTDI
device and it will show up in /dev, usually like this:
/dev/tty.usbserial-XXXXXXXX
where XXXXXXXX is a random ID, based on the serial number.
To uninstall the driver, you must use the GUI to move the
application from /Applications/FTDIUSBSerialDextInstaller.app to Trash,
otherwise the system extension will not be removed.
EOS
end
end
name "FTDI VCP Driver"
desc "Virtual COM port driver"
homepage "https://www.ftdichip.com/Drivers/VCP.htm"
livecheck do
skip "No reliable way to get version info"
end
end

29
Casks/prolific-pl2303.rb Normal file
View File

@ -0,0 +1,29 @@
cask "prolific-pl2303" do
version "2.1.0_20210311"
sha256 "02b83dc67c06edc6908cd56dc5032689aff39666b27e8c8b9ad83d3f013cc14d"
url "https://www.prolific.com.tw/UserFiles/files/PL2303HXD_G_Mac%20Driver_v#{version.dots_to_underscores}.zip"
name "Prolific USB to Serial Cable driver"
desc "PL2303 USB-to-serial driver"
homepage "https://www.prolific.com.tw/US/"
livecheck do
url "https://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41"
regex(/PL2303HXD_G_Mac\s*Driver_v?(\d+(?:\.\d+)*_\d+)\.zip/i)
end
pkg "PL2303HXD&G_Mac Driver_v#{version}.pkg"
uninstall kext: "com.prolific.driver.PL2303",
pkgutil: [
"com.Susteen.driver.PL2303",
"com.prolific.driver.PL2303",
"com.prolific.pkg.PLVCDriver",
],
quit: "com.prolific.PLVCDriver",
delete: [
"/Library/Extensions/ProlificUsbSerial.kext",
"/var/db/receipts/*PL2303*.*",
"/var/db/receipts/*ProlificUSbSerial*.*",
]
end

View File

@ -0,0 +1,23 @@
cask "silicon-labs-vcp-driver" do
version "6.0.2"
sha256 :no_check
url "https://www.silabs.com/documents/public/software/Mac_OSX_VCP_Driver.zip"
name "Silicon Labs VCP Driver"
desc "CP210x USB to UART Bridge VCP Driver"
homepage "https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers"
livecheck do
url "https://www.silabs.com/documents/public/release-notes/Mac_OSX_VCP_Driver_Release_Notes.txt"
regex(/Version\s+(\d+(?:\.\d+)+)/i)
end
container nested: "macOS_VCP_Driver/SiLabsUSBDriverDisk.dmg"
installer manual: "Install CP210x VCP Driver.app"
uninstall script: {
executable: "uninstaller.sh",
sudo: true,
}
end

View File

@ -0,0 +1,27 @@
cask "wch-ch34x-usb-serial-driver" do
version "1.8"
sha256 :no_check
url "https://www.wch.cn/downloads/file/369.html"
name "WCH USB serial driver for CH340/CH341/CH342/CH343/CH344/CH9101/CH9102/CH9103/CH9143"
desc "USB serial driver"
homepage "https://www.wch.cn/download/CH34XSER_MAC_ZIP.html"
livecheck do
url :homepage
regex(%r{<td>(\d+(?:\.\d+)+)</td>}i)
end
pkg "CH341SER_MAC/CH34xVCPDriver.pkg"
uninstall quit: "cn.wch.CH34xVCPDriver",
pkgutil: "cn.wch.pkg.CH34xVCPDriver",
kext: [
"cn.wch.CH34xVCPDriver",
"cn.wch.CH34xVCPControlDriver",
]
caveats do
reboot
end
end