-
Notifications
You must be signed in to change notification settings - Fork 1
164 lines (144 loc) · 5.99 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Build
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { icon: '🟦', sys: mingw64, mode: dynamic }
- { icon: '🟦', sys: mingw64, mode: static }
name: 🚧${{ matrix.icon }} ${{ matrix.sys }} Build ${{ matrix.mode }}
defaults:
run:
shell: msys2 {0}
steps:
- name: '🧰 Checkout'
uses: actions/checkout@main
- name: '${{ matrix.icon }} Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: >-
git
make
bison
diffutils
flex
grep
sed
base-devel
python
python-setuptools
pacboy: >-
toolchain:p
binutils:p
capstone:p
ccache:p
curl:p
cyrus-sasl:p
dtc:p
gcc:p
glib2:p
gnutls:p
gtk3:p
libgcrypt:p
libjpeg-turbo:p
libnfs:p
libpng:p
libssh:p
libtasn1:p
libusb:p
lzo2:p
nettle:p
ninja:p
pixman:p
pkgconf:p
python:p
SDL2:p
SDL2_image:p
snappy:p
spice:p
usbredir:p
zstd:p
libslirp:p
- name: 'Modify pkgconfig to avoid linker issues'
if: ${{ matrix.mode == 'static' }}
run: |
PKGCONFIG_FILE="$MINGW_PREFIX/lib/pkgconfig/gpg-error.pc"
sed -i 's#'$MINGW_PREFIX'/lib/libintl.dll.a#-llibintl#g' "$PKGCONFIG_FILE"
sed -i 's#'$MINGW_PREFIX'/lib/libiconv.dll.a#-llibiconv#g' "$PKGCONFIG_FILE"
- name: '🚧 Build QEMU (arm & aarch64) ${{ matrix.mode }}'
env:
arg: ${{ matrix.mode == 'dynamic' && '--enable-gtk --enable-sdl --enable-fdt=system --enable-avx2 --target-list=arm-softmmu,aarch64-softmmu' || '--disable-gtk --disable-spice --disable-usb-redir --disable-smartcard --disable-gnutls --disable-libssh --enable-sdl --enable-fdt=system --enable-avx2 --target-list=arm-softmmu,aarch64-softmmu --static --extra-cflags="-DCURL_STATICLIB -DLIBSSH_STATIC -DLIBSLIRP_STATIC -DCAIRO_WIN32_STATIC_BUILD"' }}
run: |
./configure ${{ env.arg }}
make -j16
- name: Prepare Artifacts
shell: cmd
run: |
md ${{ github.workspace }}\artifacts
cd ${{ github.workspace }}\artifacts
move D:\a\qemu\qemu\build\*.exe
move D:\a\qemu\qemu\build\pc-bios share
robocopy D:\a\qemu\qemu\pc-bios share /xn /xo /mov
del share\*.bz2
- name: Prepare Artifacts (dynamic only)
shell: cmd
if: ${{ matrix.mode == 'dynamic' }}
run: |
cd ${{ github.workspace }}\artifacts
copy D:\a\_temp\msys64\mingw64\bin\*.dll
md lib\gdk-pixbuf-2.0\2.10.0
fsutil file createNew lib\gdk-pixbuf-2.0\2.10.0\loaders.cache 0
move D:\a\qemu\qemu\build\po share\locale
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: QEMU (${{ matrix.mode }} build)
path: ${{ github.workspace }}/artifacts
compression-level: 9
build_linux:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- { arch: x64 }
- { arch: aarch64 }
name: Build Linux ${{ matrix.arch }}
steps:
- name: '🧰 Checkout'
uses: actions/checkout@main
- name: 'Install software packages'
if: ${{ matrix.arch == 'x64' }}
run: sudo apt-get install libglib2.0-dev libfdt-dev libpixman-1-dev ninja-build libaio-dev libbluetooth-dev libcapstone-dev libbrlapi-dev libbz2-dev libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev libibverbs-dev libjpeg8-dev libnuma-dev librbd-dev librdmacm-dev libsasl2-dev libsdl2-dev libseccomp-dev libsnappy-dev libssh-dev libvde-dev libvdeplug-dev libvte-2.91-dev libxen-dev liblzo2-dev valgrind xfslibs-dev libnfs-dev libiscsi-dev
- name: 'Install software packages (for cross build)'
if: ${{ matrix.arch == 'aarch64' }}
run: |
sudo apt-get install gcc-aarch64-linux-gnu ninja-build
sudo dpkg --add-architecture arm64
sudo sed -i '/Types/{N;N;N;N;N;N;N;N;N;N;N;N;s/\(Types.*\n.*\)archive\(.*\)\/ubuntu\(.*\n.*\n.*\n.*gpg\)\(\n\n.*\n.*\n\)\(Types.*\n.*\)archive\(.*\)\/ubuntu\(.*\n.*\n.*\n.*gpg\)/\1archive\2\/ubuntu\3\nArchitectures: amd64\n\n\1ports\2\/ubuntu-ports\3\nArchitectures: arm64\4\5archive\6\/ubuntu\7\nArchitectures: amd64\n\n\5ports\6\/ubuntu-ports\7\nArchitectures: arm64/}' /etc/apt/sources.list.d/ubuntu.sources
sudo apt update
sudo apt-get install libglib2.0-dev:arm64 libfdt-dev:arm64 libpixman-1-dev:arm64 libaio-dev:arm64 libbluetooth-dev:arm64 libcapstone-dev:arm64 libbrlapi-dev:arm64 libbz2-dev:arm64 libcap-ng-dev:arm64 libcurl4-gnutls-dev:arm64 libgtk-3-dev:arm64 libibverbs-dev:arm64 libjpeg8-dev:arm64 libnuma-dev:arm64 librbd-dev:arm64 librdmacm-dev:arm64 libsasl2-dev:arm64 libsdl2-dev:arm64 libseccomp-dev:arm64 libsnappy-dev:arm64 libssh-dev:arm64 libvde-dev:arm64 libvdeplug-dev:arm64 libvte-2.91-dev:arm64 libxen-dev:arm64 liblzo2-dev:arm64 valgrind:arm64 xfslibs-dev:arm64 libnfs-dev:arm64 libiscsi-dev:arm64
- name: '🚧 Build QEMU Linux (arm & aarch64) ${{ matrix.mode }}'
env:
arg: ${{ matrix.arch == 'x64' && '--enable-gtk --enable-sdl --enable-avx2 --target-list=arm-softmmu,aarch64-softmmu' || '--enable-gtk --enable-sdl --enable-kvm --target-list=arm-softmmu,aarch64-softmmu --cross-prefix=aarch64-linux-gnu-' }}
run: |
./configure ${{ env.arg }}
make -j16
- name: Prepare Artifacts
run: |
mkdir artifacts
mv build/* artifacts/
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: QEMU Linux (${{ matrix.arch }} build)
path: ${{ github.workspace }}/artifacts
compression-level: 9