Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove embedded flasher binaries #474

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ jobs:

- uses: actions/checkout@v4

- name: Check binary permissions
working-directory: ./macos/QMK Toolbox/Resources
env:
QMK_BINARIES: avrdude bootloadHID dfu-programmer dfu-util mdloader teensy_loader_cli wb32-dfu-updater_cli
run: |
status=0
for b in $QMK_BINARIES; do
perm=$(stat -f "%Lp" $b)
echo "$b: $perm"
[[ $perm == "755" ]] || status=1
done
exit $status

- name: Build
working-directory: ./macos
run: |
Expand Down
24,686 changes: 0 additions & 24,686 deletions common/avrdude.conf

This file was deleted.

111 changes: 0 additions & 111 deletions macos/QMK Toolbox.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file removed macos/QMK Toolbox/Resources/avrdude
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/bootloadHID
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/dfu-programmer
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/dfu-util
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/hid_bootloader_cli
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/libavrdude.1.0.0.dylib
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/libftdi1.2.5.0.dylib
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/libhidapi.0.14.0.dylib
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/libusb-0.1.4.dylib
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/libusb-1.0.0.dylib
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/mdloader
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/teensy_loader_cli
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/wb32-dfu-updater_cli
Binary file not shown.
18 changes: 16 additions & 2 deletions macos/QMK Toolbox/USB/Bootloader/BootloaderDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,26 @@ class BootloaderDevice: USBDeviceProtocol, CustomStringConvertible {

func reset(_ mcu: String) {}

func resolveHomebrewBinary(for command: String) -> URL? {
let fileManager = FileManager()
if fileManager.fileExists(atPath: "/opt/homebrew/bin/\(command)") {
return URL(fileURLWithPath: "/opt/homebrew/bin/\(command)")
} else if fileManager.fileExists(atPath: "/usr/local/bin/\(command)") {
return URL(fileURLWithPath: "/usr/local/bin/\(command)")
}
return nil
}

func runProcess(_ command: String, args: [String]) {
print(message: "\(command) \(args.joined(separator: " "))", type: .command)

guard let resolvedCommand = resolveHomebrewBinary(for: command) else {
print(message: "\(command) does not seem to be installed!", type: .error)
return
}

let task = Process()
task.executableURL = Bundle.main.url(forResource: command, withExtension: nil)
task.currentDirectoryURL = Bundle.main.resourceURL
task.executableURL = resolvedCommand
task.arguments = args

let outPipe = Pipe()
Expand Down
16 changes: 1 addition & 15 deletions windows/QMK Toolbox/Helpers/EmbeddedResourceHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,9 @@ public static class EmbeddedResourceHelper
{
public static readonly string[] Resources =
{
"avrdude.conf",
"reset.eep",
"reset_left.eep",
"reset_right.eep",
"avrdude.exe",
"bootloadHID.exe",
"dfu-programmer.exe",
"dfu-util.exe",
"hid_bootloader_cli.exe",
"mdloader.exe",
"teensy_loader_cli.exe",
"wb32-dfu-updater_cli.exe",
"libftdi1.dll",
"libhidapi-0.dll",
"libusb-0-1-4.dll",
"libusb-1.0.dll",
"libwinpthread-1.dll"
"reset_right.eep"
};

public static void ExtractResource(string file)
Expand Down
16 changes: 0 additions & 16 deletions windows/QMK Toolbox/QMK Toolbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
</ItemGroup>
<ItemGroup>
<Content Include="Resources\output.ico" />
<EmbeddedResource Include="..\..\common\avrdude.conf">
<Link>Resources\avrdude.conf</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\common\mcu-list.txt">
<Link>Resources\mcu-list.txt</Link>
</EmbeddedResource>
Expand All @@ -69,20 +66,7 @@
<EmbeddedResource Include="..\..\common\reset_right.eep">
<Link>Resources\reset_right.eep</Link>
</EmbeddedResource>
<EmbeddedResource Include="Resources\avrdude.exe" />
<EmbeddedResource Include="Resources\bootloadHID.exe" />
<EmbeddedResource Include="Resources\dfu-programmer.exe" />
<EmbeddedResource Include="Resources\dfu-util.exe" />
<EmbeddedResource Include="Resources\hid_bootloader_cli.exe" />
<EmbeddedResource Include="Resources\mdloader.exe" />
<EmbeddedResource Include="Resources\qmk_driver_installer.exe" />
<EmbeddedResource Include="Resources\teensy_loader_cli.exe" />
<EmbeddedResource Include="Resources\wb32-dfu-updater_cli.exe" />
<EmbeddedResource Include="Resources\libftdi1.dll" />
<EmbeddedResource Include="Resources\libhidapi-0.dll" />
<EmbeddedResource Include="Resources\libusb-0-1-4.dll" />
<EmbeddedResource Include="Resources\libusb-1.0.dll" />
<EmbeddedResource Include="Resources\libwinpthread-1.dll" />
<EmbeddedResource Include="Resources\drivers.txt" />
</ItemGroup>
<ItemGroup>
Expand Down
Binary file removed windows/QMK Toolbox/Resources/avrdude.exe
Binary file not shown.
Binary file removed windows/QMK Toolbox/Resources/bootloadHID.exe
Binary file not shown.
Binary file removed windows/QMK Toolbox/Resources/dfu-programmer.exe
Binary file not shown.
Binary file removed windows/QMK Toolbox/Resources/dfu-util.exe
Binary file not shown.
Binary file not shown.
Binary file removed windows/QMK Toolbox/Resources/libftdi1.dll
Binary file not shown.
Binary file removed windows/QMK Toolbox/Resources/libhidapi-0.dll
Binary file not shown.
Binary file removed windows/QMK Toolbox/Resources/libusb-0-1-4.dll
Binary file not shown.
Binary file removed windows/QMK Toolbox/Resources/libusb-1.0.dll
Binary file not shown.
Binary file removed windows/QMK Toolbox/Resources/libwinpthread-1.dll
Binary file not shown.
Binary file removed windows/QMK Toolbox/Resources/mdloader.exe
Binary file not shown.
Binary file removed windows/QMK Toolbox/Resources/teensy_loader_cli.exe
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions windows/QMK Toolbox/Usb/Bootloader/BootloaderDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ protected async Task<int> RunProcessAsync(string command, string args)
{
StartInfo =
{
FileName = Path.Combine(Application.LocalUserAppDataPath, command),
FileName = Path.Combine("C:\\QMK_MSYS\\mingw64\\bin", command),
Arguments = args,
WorkingDirectory = Application.LocalUserAppDataPath,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
Expand Down