fix(cpn): add dfu-util and libusb to windows build (#6516)
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
co-authored by
raphaelcoeffic
parent
65f1987d6d
commit
89e57df285
@@ -71,6 +71,46 @@ jobs:
|
|||||||
echo $PATH
|
echo $PATH
|
||||||
$Python3_ROOT_DIR/python3.exe -m pip install clang jinja2 lz4 pillow
|
$Python3_ROOT_DIR/python3.exe -m pip install clang jinja2 lz4 pillow
|
||||||
|
|
||||||
|
- name: Setup dfu-util and libusb
|
||||||
|
run: |
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Setting up dfu-util and libusb..."
|
||||||
|
|
||||||
|
# Create target directory
|
||||||
|
mkdir -p dfu-util-0.11
|
||||||
|
|
||||||
|
# Download and extract dfu-util
|
||||||
|
echo "Downloading dfu-util binaries..."
|
||||||
|
curl -LO https://dfu-util.sourceforge.net/releases/dfu-util-0.11-binaries.tar.xz
|
||||||
|
tar -xf dfu-util-0.11-binaries.tar.xz
|
||||||
|
cp dfu-util-0.11-binaries/win64/dfu-util.exe dfu-util-0.11/
|
||||||
|
|
||||||
|
# Install 7zip if not available
|
||||||
|
if ! command -v 7z &> /dev/null; then
|
||||||
|
echo "Installing 7zip..."
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install -y p7zip-full
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Download and extract libusb
|
||||||
|
echo "Downloading libusb..."
|
||||||
|
curl -LO https://github.com/libusb/libusb/releases/download/v1.0.29/libusb-1.0.29.7z
|
||||||
|
7z x -olibusb-1.0.29 libusb-1.0.29.7z > /dev/null
|
||||||
|
cp libusb-1.0.29/VS2022/MS64/dll/* dfu-util-0.11/
|
||||||
|
|
||||||
|
# Clean up temporary files
|
||||||
|
rm -f dfu-util-0.11-binaries.tar.xz libusb-1.0.29.7z
|
||||||
|
rm -rf dfu-util-0.11-binaries libusb-1.0.29
|
||||||
|
|
||||||
|
echo "Setup complete. Contents of dfu-util-0.11:"
|
||||||
|
ls -la dfu-util-0.11/
|
||||||
|
|
||||||
|
echo "LIBUSB1_ROOT_DIR=$(pwd)/dfu-util-0.11" >> $GITHUB_ENV
|
||||||
|
echo "DFU_UTIL_ROOT_DIR=$(pwd)/dfu-util-0.11" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
|
||||||
- name: Setup MSVC
|
- name: Setup MSVC
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ if(Qt6Core_FOUND AND NOT DISABLE_COMPANION)
|
|||||||
find_package(Libusb1)
|
find_package(Libusb1)
|
||||||
|
|
||||||
if(LIBUSB1_FOUND)
|
if(LIBUSB1_FOUND)
|
||||||
|
if(DEFINED ENV{DFU_UTIL_ROOT_DIR})
|
||||||
|
set(DFU_UTIL_ROOT_DIR "$ENV{DFU_UTIL_ROOT_DIR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(Dfuutil)
|
find_package(Dfuutil)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ void burnConfigDialog::getSettings()
|
|||||||
if ( sambaLoc.isEmpty())
|
if ( sambaLoc.isEmpty())
|
||||||
sambaLoc = QFileInfo("sam-ba.exe").absoluteFilePath();
|
sambaLoc = QFileInfo("sam-ba.exe").absoluteFilePath();
|
||||||
if ( dfuLoc.isEmpty())
|
if ( dfuLoc.isEmpty())
|
||||||
dfuLoc = QFileInfo("dfu-util.exe").absoluteFilePath();
|
dfuLoc = QFileInfo("bin/dfu-util.exe").absoluteFilePath();
|
||||||
#elif defined __APPLE__
|
#elif defined __APPLE__
|
||||||
if ( sambaLoc.isEmpty())
|
if ( sambaLoc.isEmpty())
|
||||||
sambaLoc = "/usr/local/bin/sam-ba";
|
sambaLoc = "/usr/local/bin/sam-ba";
|
||||||
|
|||||||
Reference in New Issue
Block a user