-
Notifications
You must be signed in to change notification settings - Fork 3.3k
ci/mingw64-fat: add FAT mingw64 builds #17526
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
Open
kasper93
wants to merge
3
commits into
mpv-player:master
Choose a base branch
from
kasper93:mingw-fat
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| . ./ci/build-common.sh | ||
|
|
||
| CFLAGS="${CFLAGS/-I${FFBUILD_PREFIX}\/include/-isystem${FFBUILD_PREFIX}/include}" | ||
| CXXFLAGS="${CXXFLAGS/-I${FFBUILD_PREFIX}\/include/-isystem${FFBUILD_PREFIX}/include}" | ||
|
|
||
| gitclone="git clone --depth=1 --recursive --shallow-submodules" | ||
| group_start() { echo "::group::$1"; } | ||
| group_end() { echo "::endgroup::"; } | ||
|
|
||
|
|
||
| group_start "Building FFmpeg" | ||
| $gitclone https://github.com/FFmpeg/FFmpeg.git ffmpeg | ||
| pushd ffmpeg | ||
| ./configure --prefix="$FFBUILD_PREFIX" --pkg-config-flags="--static" \ | ||
| $FFBUILD_TARGET_FLAGS $FF_CONFIGURE \ | ||
| --extra-cflags="$FF_CFLAGS" \ | ||
| --extra-cxxflags="$FF_CXXFLAGS" \ | ||
| --extra-libs="$FF_LIBS" \ | ||
| --extra-ldflags="$FF_LDFLAGS" \ | ||
| --extra-ldexeflags="$FF_LDEXEFLAGS" \ | ||
| --cc="$CC" --cxx="$CXX" \ | ||
| --ar="$AR" --ranlib="$RANLIB" --nm="$NM" \ | ||
| --disable-librav1e --disable-openal \ | ||
| --enable-static --disable-shared \ | ||
| --disable-debug --disable-doc --disable-programs | ||
| make -j`nproc` && make install | ||
| popd | ||
| group_end | ||
|
|
||
| group_start "Building LuaJIT" | ||
| $gitclone -b v2.1 https://github.com/LuaJIT/LuaJIT.git | ||
| pushd LuaJIT | ||
| # LuaJIT's install target doesn't really support cross-compilation, apply minor patches. | ||
| sed -i "s|^prefix=/usr/local|prefix=${FFBUILD_PREFIX}|" etc/luajit.pc | ||
| # Strip -ldl, not needed for Windows. | ||
| sed -i "/^Libs\.private/d" etc/luajit.pc | ||
| # FILE_T and INSTALL_DEP are only needed to glue install target. | ||
| make TARGET_SYS=Windows PREFIX="$FFBUILD_PREFIX" HOST_CC="$HOST_CC" \ | ||
| CFLAGS="$HOST_CFLAGS" \CROSS="${FFBUILD_TOOLCHAIN}-" TARGET_CFLAGS="$CFLAGS" \ | ||
| BUILDMODE=static XCFLAGS=-DLUAJIT_ENABLE_LUA52COMPAT FILE_T=luajit.exe \ | ||
| INSTALL_DEP=src/luajit.exe amalg install | ||
| popd | ||
| group_end | ||
|
|
||
| group_start "Building subrandr" | ||
| build_subrandr "$FFBUILD_PREFIX" --target "$FFBUILD_RUST_TARGET" \ | ||
| --static-library true --shared-library false | ||
| group_end | ||
|
|
||
| group_start "Building cppwinrt" | ||
| cppwinrt_ver=2.0.250303.1 | ||
| windows_rs_ver=73 | ||
| wget -q "https://github.com/microsoft/cppwinrt/archive/${cppwinrt_ver}.tar.gz" -O cppwinrt.tar.gz | ||
| wget -q "https://github.com/microsoft/windows-rs/archive/${windows_rs_ver}.tar.gz" -O windows-rs.tar.gz | ||
| tar -xzf cppwinrt.tar.gz | ||
| tar -xzf windows-rs.tar.gz | ||
| mkdir -p "cppwinrt-$cppwinrt_ver/build" | ||
| pushd "cppwinrt-$cppwinrt_ver/build" | ||
| CFLAGS="$HOST_CFLAGS" CXXFLAGS="$HOST_CXXFLAGS" \ | ||
| cmake -GNinja -DCMAKE_CXX_COMPILER="$HOST_CXX" \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCPPWINRT_BUILD_VERSION="$cppwinrt_ver" .. | ||
| ninja cppwinrt | ||
| ./cppwinrt -input "../../windows-rs-$windows_rs_ver/crates/libs/bindgen/default" \ | ||
| -output "$FFBUILD_PREFIX/include" | ||
| popd | ||
| group_end | ||
|
|
||
| group_start "Setting up Meson wraps" | ||
| mkdir -p subprojects | ||
| meson wrap install mujs | ||
| meson subprojects download | ||
| group_end | ||
|
|
||
| group_start "Building mpv" | ||
| meson setup build --cross-file /cross.meson \ | ||
| $common_args \ | ||
| --buildtype=release \ | ||
| --prefer-static \ | ||
| --default-library=shared \ | ||
| --prefix="$FFBUILD_PREFIX" \ | ||
| -Dc_link_args="$FF_LIBS" \ | ||
| -Dcpp_link_args="$FF_LIBS" \ | ||
| -Dgpl=${GPL:-false} \ | ||
| --force-fallback-for=mujs \ | ||
| -Dmujs:werror=false \ | ||
| -Dmujs:default_library=static \ | ||
| -Dlua=luajit \ | ||
| -D{amf,d3d11,javascript,lua,shaderc,spirv-cross,subrandr,vulkan,win32-smtc}=enabled | ||
| meson compile -C build | ||
| group_end | ||
|
|
||
| group_start "Packaging artifacts" | ||
| mkdir -p artifact artifact-dev | ||
| # mpv | ||
| cp -pv etc/mpv-*.bat build/mpv.{exe,com} artifact/ | ||
|
|
||
| # libmpv | ||
| cp -pv build/libmpv*.dll{,.a} artifact-dev/ | ||
| mkdir -p artifact-dev/include/mpv | ||
| cp -pv include/mpv/*.h artifact-dev/include/mpv/ | ||
| group_end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is depending on the upstream vulkan loader that bad? 🤔
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upstream Vulkan loader doesn't support static linking. That's why all our (other) packages have
vulkan-1.dllin them. Apparently https://github.com/BtbN/Vulkan-Shim-Loader exists to workaround that. But it doesn't load functions from platform specific xmls. While, it could be fixed there, I don't mind loading it through get_proc_addr.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah this is a static build? dynamic is nicer IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't it just link to vulkan dll? Windows now includes vulkan loader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This build has probably over 100 libraries linked (I didn't even count, it's everything), linking it statically just makes the output cleaner, we don't need anything else to interact with those dlls.
It's on graphic driver, and on some systems in might not be available. Either way, it's up to docker image that I use. I think it's cleaner to dynamically load vulkan dll. We should be doing it in fact and not directly link to loader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What makes dynamic mpv Windows compiles nicer for you? Legit question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dynamic causes less weird build issues, that's all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dynamic linking on MinGW only introduces more problems, like auto import and runtime pseudo relocation.