mirror of
https://github.com/linux-msm/qdl.git
synced 2026-02-25 13:12:25 -08:00
The Windows builds suddenly fails with: Cannot find path 'C:\a\_temp\msys64\mingw64\bin\liblzma-5.dll' because it does not exist. The internet indicates that this is caused by the lack of mingw-w64-x86_64-xz, so let's introduce this. Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
177 lines
4.5 KiB
YAML
177 lines
4.5 KiB
YAML
name: Buildtest
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
|
|
jobs:
|
|
build-linux:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- { arch: x64, os: 24, runner: ubuntu-24.04 }
|
|
- { arch: arm64, os: 24, runner: ubuntu-24.04-arm }
|
|
- { arch: x64, os: 22, runner: ubuntu-22.04 }
|
|
- { arch: arm64, os: 22, runner: ubuntu-22.04-arm }
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libxml2-dev libusb-1.0-0-dev help2man
|
|
|
|
- name: Build
|
|
run: make
|
|
|
|
- name: Run tests
|
|
run: make tests
|
|
|
|
- name: Generate man pages
|
|
run: make manpages
|
|
|
|
- name: Package
|
|
run: |
|
|
mkdir dist
|
|
cp `pkg-config --variable=libdir libusb-1.0`/libusb-1.0.so.0 dist
|
|
chmod 0644 dist/*
|
|
cp qdl dist
|
|
patchelf --set-rpath '$ORIGIN' dist/qdl
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: qdl-binary-ubuntu-${{matrix.os}}-${{ matrix.arch }}
|
|
path: dist/*
|
|
|
|
|
|
build-mac:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- { sys: macos-14, arch: arm64 }
|
|
- { sys: macos-15-intel, arch: intel }
|
|
runs-on: ${{ matrix.sys }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Dependencies
|
|
run: |
|
|
brew install libxml2 help2man
|
|
|
|
- name: Build
|
|
run: make
|
|
|
|
- name: Generate man pages
|
|
run: make manpages
|
|
|
|
- name: Run tests
|
|
run: make tests
|
|
|
|
- name: Package
|
|
run: |
|
|
set -x
|
|
mkdir dist
|
|
cp `pkg-config --variable=libdir libusb-1.0`/libusb-1.0.0.dylib dist
|
|
cp `pkg-config --variable=libdir liblzma`/liblzma.5.dylib dist
|
|
chmod 0644 dist/*
|
|
cp qdl dist
|
|
|
|
if uname -a | grep -q arm64; then
|
|
LIBUSB_DIR=/opt/homebrew/opt/libusb/lib
|
|
LIBLZMA_DIR=/usr/lib
|
|
else
|
|
LIBUSB_DIR=/usr/local/opt/libusb/lib
|
|
LIBLZMA_DIR=/usr/local/opt/xz/lib
|
|
fi
|
|
|
|
install_name_tool -add_rpath @executable_path dist/qdl
|
|
install_name_tool -change $LIBUSB_DIR/libusb-1.0.0.dylib @rpath/libusb-1.0.0.dylib dist/qdl
|
|
install_name_tool -change $LIBLZMA_DIR/liblzma.5.dylib @rpath/liblzma.5.dylib dist/qdl
|
|
otool -L dist/qdl
|
|
dist/qdl || true
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: qdl-binary-macos-${{ matrix.arch }}
|
|
path: dist/*
|
|
|
|
build-windows:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- { sys: windows-latest, arch: x64 }
|
|
- { sys: windows-11-arm, arch: arm64 }
|
|
runs-on: ${{ matrix.sys }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup MSYS2
|
|
id: msys2
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: MINGW64
|
|
install: >
|
|
base-devel
|
|
git
|
|
help2man
|
|
mingw-w64-x86_64-gcc
|
|
mingw-w64-x86_64-make
|
|
mingw-w64-x86_64-pkg-config
|
|
mingw-w64-x86_64-libxml2
|
|
mingw-w64-x86_64-libusb
|
|
mingw-w64-x86_64-xz
|
|
|
|
- name: Build
|
|
run: |
|
|
git config --global core.autocrlf true
|
|
make
|
|
shell: msys2 {0}
|
|
|
|
- name: Generate man pages
|
|
run: make manpages
|
|
shell: msys2 {0}
|
|
|
|
- name: Run tests
|
|
run: make tests
|
|
shell: msys2 {0}
|
|
|
|
- name: Package
|
|
shell: pwsh
|
|
run: |
|
|
$MSYS2_LOCATION = "${{ steps.msys2.outputs.msys2-location }}"
|
|
$BIN_DIR = Join-Path $MSYS2_LOCATION "mingw64\bin"
|
|
$DistDir = "dist"
|
|
New-Item -ItemType Directory -Path $DistDir | Out-Null
|
|
|
|
Copy-Item (Join-Path $BIN_DIR "zlib1.dll") $DistDir
|
|
Copy-Item (Join-Path $BIN_DIR "libxml2-16.dll") $DistDir
|
|
Copy-Item (Join-Path $BIN_DIR "libusb-1.0.dll") $DistDir
|
|
Copy-Item (Join-Path $BIN_DIR "liblzma-5.dll") $DistDir
|
|
Copy-Item (Join-Path $BIN_DIR "libiconv-2.dll") $DistDir
|
|
|
|
Copy-Item "qdl.exe" $DistDir
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: qdl-binary-windows-${{ matrix.arch }}
|
|
path: dist/*
|
|
|