Skip to content

Commit 3a43522

Browse files
committed
ci: add rust support
1 parent d9dadf0 commit 3a43522

File tree

4 files changed

+29
-16
lines changed

4 files changed

+29
-16
lines changed

.github/workflows/build.yml

+26-13
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ jobs:
3636
CCACHE_BASEDIR: ${{ github.workspace }}
3737
CCACHE_DIR: ${{ github.workspace }}/.ccache
3838
CCACHE_MAXSIZE: 500M
39+
TARGET: ${{ matrix.arch }}-w64-mingw32
40+
RUST_TARGET: ${{ matrix.arch }}-pc-windows-gnu
3941
strategy:
4042
fail-fast: false
4143
matrix:
4244
include:
43-
- target: i686-w64-mingw32
45+
- arch: i686
4446
wine: wine32
45-
- target: x86_64-w64-mingw32
47+
- arch: x86_64
4648
wine: wine64
4749
steps:
4850
- uses: actions/checkout@v4
@@ -55,11 +57,12 @@ jobs:
5557
uses: actions/cache/restore@v4
5658
with:
5759
path: ${{ env.CCACHE_DIR }}
58-
key: ${{ matrix.target }}-${{ steps.get_time.outputs.timestamp }}
59-
restore-keys: ${{ matrix.target }}-
60+
key: ${{ env.TARGET }}-${{ steps.get_time.outputs.timestamp }}
61+
restore-keys: ${{ env.TARGET }}-
6062

6163
- name: Install dependencies
6264
run: |
65+
rustup target add ${{ env.RUST_TARGET }}
6366
sudo dpkg --add-architecture i386
6467
sudo apt-get update
6568
sudo apt-get install --no-install-recommends -y ccache g++-mingw-w64 gcc-multilib meson nasm ninja-build pkgconf ${{ matrix.wine }} wine
@@ -72,15 +75,11 @@ jobs:
7275
- name: Build libraries
7376
run: |
7477
./ci/build-mingw64.sh
75-
env:
76-
TARGET: ${{ matrix.target }}
7778
7879
- name: Build with meson
7980
id: build
8081
run: |
8182
./ci/build-mingw64.sh meson pack
82-
env:
83-
TARGET: ${{ matrix.target }}
8483
8584
- name: Print meson log
8685
if: ${{ failure() && steps.build.outcome == 'failure' }}
@@ -105,25 +104,27 @@ jobs:
105104
106105
- uses: actions/upload-artifact@v4
107106
with:
108-
name: mpv-${{ matrix.target }}
107+
name: mpv-${{ env.TARGET }}
109108
path: mpv-git-*.zip
110109

111110
- name: Save Cache
112111
uses: actions/cache/save@v4
113112
if: always()
114113
with:
115114
path: ${{ env.CCACHE_DIR }}
116-
key: ${{ matrix.target }}-${{ steps.get_time.outputs.timestamp }}
115+
key: ${{ env.TARGET }}-${{ steps.get_time.outputs.timestamp }}
117116

118117
win32:
119118
runs-on: windows-latest
120119
env:
121120
VS: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise"
122121
CC: "ccache clang"
123122
CXX: "ccache clang++"
124-
CC_LD: "lld"
125-
CXX_LD: "lld"
123+
CC_LD: "lld-link"
124+
CXX_LD: "lld-link"
126125
WINDRES: "llvm-rc"
126+
RUST_LD: "lld-link"
127+
RUSTC: "rustc --target x86_64-pc-windows-msvc"
127128
CCACHE_BASEDIR: ${{ github.workspace }}
128129
CCACHE_DIR: "${{ github.workspace }}\\.ccache"
129130
CCACHE_MAXSIZE: 500M
@@ -247,7 +248,7 @@ jobs:
247248
run: |
248249
brew update
249250
brew install -q autoconf automake pkgconf libtool python freetype fribidi little-cms2 \
250-
luajit libass ffmpeg meson uchardet mujs libplacebo molten-vk vulkan-loader vulkan-headers
251+
luajit libass ffmpeg meson rust uchardet mujs libplacebo molten-vk vulkan-loader vulkan-headers
251252
252253
- name: Build with meson
253254
id: build
@@ -305,6 +306,10 @@ jobs:
305306
steps:
306307
- uses: actions/checkout@v4
307308

309+
- name: Install dependencies
310+
run: |
311+
zypper --non-interactive install rust
312+
308313
- name: Build with meson
309314
id: build
310315
run: |
@@ -336,6 +341,10 @@ jobs:
336341
steps:
337342
- uses: actions/checkout@v4
338343

344+
- name: Install dependencies
345+
run: |
346+
zypper --non-interactive install rust
347+
339348
- name: Build with meson
340349
id: build
341350
run: |
@@ -379,6 +388,7 @@ jobs:
379388
libxscrnsaver-dev \
380389
meson \
381390
musl-dev \
391+
rust \
382392
samurai
383393
384394
- name: Build with meson
@@ -432,6 +442,7 @@ jobs:
432442
pulseaudio \
433443
python3 \
434444
rubberband \
445+
rust \
435446
sdl2 \
436447
shaderc \
437448
spirv-cross \
@@ -486,6 +497,7 @@ jobs:
486497
pulseaudio \
487498
python3 \
488499
rubberband \
500+
rust \
489501
sekrit-twc-zimg \
490502
sdl2 \
491503
sndio \
@@ -543,6 +555,7 @@ jobs:
543555
python:p
544556
rst2pdf:p
545557
rubberband:p
558+
rust:p
546559
shaderc:p
547560
spirv-cross:p
548561
uchardet:p

ci/build-linux-old.sh

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -e
44
. ./ci/build-common.sh
55

66
# clone exactly the oldest libplacebo we want to support
7-
rm -rf subprojects
87
mkdir -p subprojects
98
git clone https://code.videolan.org/videolan/libplacebo.git \
109
--recurse-submodules --shallow-submodules \

ci/build-mingw64.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ fam=x86_64
3838
cat >"$prefix_dir/crossfile" <<EOF
3939
[built-in options]
4040
buildtype = 'release'
41-
wrap_mode = 'nofallback'
41+
[properties]
42+
skip_sanity_check = true
4243
[binaries]
4344
c = ['ccache', '${CC}']
4445
cpp = ['ccache', '${CXX}']
46+
rust = ['rustc', '--target', '${RUST_TARGET}']
4547
ar = '${AR}'
4648
strip = '${TARGET}-strip'
4749
pkgconfig = 'pkg-config'

ci/build-openbsd.sh

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -e
44
. ./ci/build-common.sh
55

66
# FFmpeg on openBSD (4.4.4) is too old; use a subproject
7-
rm -rf subprojects
87
mkdir -p subprojects
98
cat <<EOF > subprojects/ffmpeg.wrap
109
[wrap-git]

0 commit comments

Comments
 (0)