diff --git a/.github/workflows/mpv_clang.yml b/.github/workflows/mpv_clang.yml index f70735a5e..2f4bb3187 100644 --- a/.github/workflows/mpv_clang.yml +++ b/.github/workflows/mpv_clang.yml @@ -10,11 +10,6 @@ on: description: 'Run custom command before building' required: false type: string - sourceforge: - description: 'Upload to Sourceforge' - required: false - default: false - type: boolean github_release: description: 'Upload to Github release' required: false @@ -121,11 +116,6 @@ jobs: ninja -C build_$BIT mpv-packaging; mv build_$BIT/mpv*.7z release_$BIT if [[ $BIT == x86_64_v3 ]]; then for dir in release_$BIT/mpv-*; do name=$(basename $dir); mv $dir $(dirname $dir)/${name/x86_64/x86_64-v3}; done; fi - - name: Copying ffmpeg - run: | - hash=$(git -C src_packages/ffmpeg rev-parse --short HEAD) - 7z a -m0=lzma2 -mx=9 -ms=on release_$BIT/ffmpeg-${{ env.arch }}${{ env.x86_64_level }}-git-$hash.7z ./build_$BIT/$BIT-w64-mingw32/bin/ffmpeg.exe - - name: Collecting logs if: always() run: | @@ -250,30 +240,6 @@ jobs: mv release_i686/* release_x86_64/* release_x86_64_v3/* release_aarch64/* release du -ah release/* - - name: Uploading packages to Sourceforge - id: upload_packages_sf - if: ${{ github.event.inputs.sourceforge == 'true' }} - continue-on-error: true - env: - MPV_VER: ${{ needs.build_mpv.outputs.mpv_ver }} - run: | - mkdir -p /root/.ssh/ - echo "${{ secrets.SF_PRIVATE_KEY }}" > sf_key - pubkey=$(cat < /root/.ssh/known_hosts - chmod 400 sf_key - chmod -R 700 /root - sftp -i sf_key shinchiro@frs.sourceforge.net:/home/frs/project/mpv-player-windows <> $GITHUB_ENV - elif [[ $BIT == "x86_64" ]]; then - echo "arch=x86_64" >> $GITHUB_ENV - elif [[ $BIT == "x86_64_v3" ]]; then - echo "arch=x86_64" >> $GITHUB_ENV - echo "gcc_arch=-DGCC_ARCH=x86-64-v3" >> $GITHUB_ENV - echo "x86_64_level=-v3" >> $GITHUB_ENV - fi - - - name: Setup git config - run: | - git config --global user.name "github-actions" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global pull.rebase true - git config --global rebase.autoStash true - git config --global fetch.prune true - git config --global --add safe.directory $PWD - - - uses: actions/checkout@main - with: - ref: master - - - name: Loading ${{ matrix.bit }} toolchain cache - uses: actions/cache/restore@main - with: - path: build_${{ matrix.bit }} - key: ${{ secrets.CACHE_VERSION }}-gcc-${{ matrix.bit }}_toolchain-${{ github.run_id }} - restore-keys: | - ${{ secrets.CACHE_VERSION }}-gcc-${{ matrix.bit }}_toolchain - - - name: Loading repository cache - uses: actions/cache/restore@main - with: - path: src_packages - key: ${{ secrets.CACHE_VERSION }}-repository-${{ github.run_id }} - restore-keys: | - ${{ secrets.CACHE_VERSION }}-repository - - - name: Loading rustup cache - uses: actions/cache/restore@main - with: - path: | - clang_root - key: ${{ secrets.CACHE_VERSION }}-clang_root-${{ github.run_id }} - restore-keys: | - ${{ secrets.CACHE_VERSION }}-clang_root - - - name: Running custom command - if: ${{ github.event.inputs.command != '' }} - continue-on-error: true - run: ${{ github.event.inputs.command }} - - - name: Downloading source - run: | - cmake -DTARGET_ARCH=${{ env.arch }}-w64-mingw32 ${{ env.gcc_arch }} -DSINGLE_SOURCE_LOCATION=$PWD/src_packages -DRUSTUP_LOCATION=$PWD/clang_root/install_rustup -DENABLE_CCACHE=ON --fresh -G Ninja -B build_$BIT -S $PWD - ninja -C build_$BIT download || true - - - name: Building toolchain - run: | - if [[ ! -f "build_$BIT/install/bin/cross-gcc" ]]; then ninja -C build_$BIT gcc && rm -rf build_$BIT/toolchain; fi - - - name: Building mpv - id: build_mpv_step - env: - MPV_TARBALL: ${{ github.event.inputs.mpv_tarball }} - run: | - ninja -C build_$BIT update - $MPV_TARBALL && ninja -C build_$BIT mpv-release || ninja -C build_$BIT mpv - $MPV_TARBALL && echo "mpv_ver=$(cat build_$BIT/packages/mpv-release-prefix/VERSION)" >> $GITHUB_OUTPUT || echo "mpv_ver=UNKNOWN" >> $GITHUB_OUTPUT - - - name: Packaging mpv - run: | - mkdir -p release_$BIT - rm -rf build_$BIT/mpv-debug*; ninja -C build_$BIT mpv-packaging; mv build_$BIT/mpv*.7z release_$BIT - - - name: Copying ffmpeg - run: | - hash=$(git -C src_packages/ffmpeg rev-parse --short HEAD) - 7z a -m0=lzma2 -mx=9 -ms=on release_$BIT/ffmpeg-${{ env.arch }}${{ env.x86_64_level }}-git-$hash.7z ./build_$BIT/install/mingw/bin/ffmpeg.exe - - - name: Collecting logs - if: always() - run: | - mkdir -p build_${BIT}_logs - cp -fr $(find build_$BIT -type f -iname "*-*.log" -or -wholename "*/ffbuild/config.log") build_${BIT}_logs || true - 7z a -m0=lzma2 -mx=9 -ms=on logs.7z build*logs - - - name: Uploading logs - uses: actions/upload-artifact@master - if: always() - with: - name: mpv-${{ matrix.bit }}-logs - path: logs.7z - retention-days: 1 - - - name: Uploading ${{ matrix.bit }} build - uses: actions/upload-artifact@master - with: - name: mpv-${{ matrix.bit }} - path: release_${{ matrix.bit }}/mpv-${{ env.arch }}* - - - name: Cleaning build directory - if: always() - run: | - rm -rf build_$BIT/mpv* - - - name: Cleaning rust toolchain directory - if: always() - run: | - ninja -C build_$BIT cargo-clean - - - name: Saving ${{ matrix.bit }} toolchain cache - uses: actions/cache/save@main - if: always() - with: - path: build_${{ matrix.bit }} - key: ${{ secrets.CACHE_VERSION }}-gcc-${{ matrix.bit }}_toolchain-${{ github.run_id }} - - - name: Saving repository cache - uses: actions/cache/save@main - if: false - with: - path: src_packages - key: ${{ secrets.CACHE_VERSION }}-repository-${{ github.run_id }} - - - name: Saving release_${{ matrix.bit }} cache - uses: actions/cache/save@main - if: ${{ github.event.inputs.github_release == 'true' }} - with: - path: release_${{ matrix.bit }} - key: ${{ secrets.CACHE_VERSION }}-gcc-release_${{ matrix.bit }}-${{ github.run_id }} - - release: - name: Upload releases - runs-on: ubuntu-latest - needs: build_mpv - if: ${{ github.event.inputs.github_release == 'true' }} - env: - GH_TOKEN: ${{ github.token }} - CURL_RETRIES: "--connect-timeout 60 --retry 999 --retry-delay 5 --retry-all-errors" - release_x86_64_key: ${{ secrets.CACHE_VERSION }}-gcc-release_x86_64-${{ github.run_id }} - container: - image: docker://alpine:latest - - steps: - - name: Installing dependencies - shell: sh - run: | - apk add --update --no-cache bash git file openssh curl tar zstd jq - apk add perl-file-rename --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing - git config --global pull.rebase true - git config --global fetch.prune true - git config --global --add safe.directory $PWD - - - uses: actions/checkout@main - with: - ref: master - - - name: Loading release_x86_64 cache - uses: actions/cache/restore@main - with: - path: release_x86_64 - key: ${{ env.release_x86_64_key }} - - - name: Moving archives - run: | - mkdir -p release - mv release_x86_64/* release - rm release/ffmpeg*.7z - file-rename 's/mpv-(.*)x86_64-(.+)/mpv-${1}x86_64-gcc-${2}/s' $PWD/release/mpv*.7z - du -ah release/* - - - name: Uploading packages to Sourceforge - id: upload_packages_sf - if: false - continue-on-error: true - env: - MPV_VER: ${{ needs.build_mpv.outputs.mpv_ver }} - run: | - mkdir -p /root/.ssh/ - echo "${{ secrets.SF_PRIVATE_KEY }}" > sf_key - pubkey=$(cat < /root/.ssh/known_hosts - chmod 400 sf_key - chmod -R 700 /root - sftp -i sf_key shinchiro@frs.sourceforge.net:/home/frs/project/mpv-player-windows < --upgrade`. - -### Cygwin - -Download Cygwin installer and run: - - setup-x86_64.exe -R "C:\cygwin64" -q --packages="bash,binutils,bzip2,cygwin,gcc-core,gcc-g++,cygwin32-gcc-core,cygwin32-gcc-g++,gzip,m4,pkgconf,make,unzip,zip,diffutils,wget,git,patch,cmake,gperf,yasm,enca,asciidoc,bison,flex,gettext-devel,mercurial,python-devel,python-docutils,docbook2X,texinfo,libmpfr-devel,libgmp-devel,libmpc-devel,libtool,autoconf2.5,automake,automake1.9,libxml2-devel,libxslt-devel,meson,libunistring5" - -Additionally, some packages, `re2c`, `ninja`, `ragel`, `gyp`, `rst2pdf`, `nasm` need to be [installed manually](https://gist.github.com/shinchiro/705b0afcc7b6c0accffba1bedb067abf). - -### MSYS2 - -Install MSYS2 and run it via `MSYS2 MSYS` shortcut. -Don't use `MSYS2 MinGW 32-bit` or `MSYS2 MinGW 64-bit` shortcuts, that's important! - -These packages need to be installed first before compiling mpv: - - pacman -S base-devel cmake gcc yasm nasm git mercurial subversion gyp tar gmp-devel mpc-devel mpfr-devel python zlib-devel unzip zip p7zip meson libunistring5 - -Don't install anything from the `mingw32` and `mingw64` repositories, -it's better to completely disable them in `/etc/pacman.conf` just to be safe. - -Additionally, some packages, `re2c`, `ninja`, `ragel`, `libjpeg`, `rst2pdf`, `jinja2` need to be [installed manually](https://gist.github.com/shinchiro/705b0afcc7b6c0accffba1bedb067abf). - - -## Compiling with GCC - -Example: - - cmake -DTARGET_ARCH=x86_64-w64-mingw32 \ - -DGCC_ARCH=x86-64-v3 \ - -DSINGLE_SOURCE_LOCATION="/home/user/packages" \ - -DRUSTUP_LOCATION="/home/user/install_rustup" \ - -G Ninja -B build64 -S mpv-winbuild-cmake - -This cmake command will create `build64` folder for `x86_64-w64-mingw32`. Set `-DTARGET_ARCH=i686-w64-mingw32` for compiling 32-bit. - -`-DGCC_ARCH=x86-64-v3` will set `-march` option when compiling gcc with `x86-64-v3` instructions. Other value like `native`, `znver3` should work too. - -Enter `build64` folder and build toolchain once. By default, it will be installed in `install` folder. - - ninja download # download all packages at once (optional) - ninja gcc # build gcc only once (take around ~20 minutes) - ninja mpv # build mpv and all its dependencies - -On **WSL2**, you might see it stuck with 100% disk usage and never finished. See [below](#wsl-workaround). - -The final `build64` folder's size will be around ~3GB. - -## Building Software (Second Time) - -To build mpv for a second time: - - ninja update # perform git pull on all packages that used git - -After that, build mpv as usual: - - ninja mpv - -## Compiling with Clang - -Supported target architecture (`TARGET_ARCH`) with clang is: `x86_64-w64-mingw32` , `i686-w64-mingw32` , `aarch64-w64-mingw32`. The `aarch64` are untested. - -Example: - - cmake -DTARGET_ARCH=x86_64-w64-mingw32 \ - -DCMAKE_INSTALL_PREFIX="/home/user/clang_root" \ - -DCOMPILER_TOOLCHAIN=clang \ - -DGCC_ARCH=x86-64-v3 \ - -DSINGLE_SOURCE_LOCATION="/home/user/packages" \ - -DRUSTUP_LOCATION="/home/user/install_rustup" \ - -DMINGW_INSTALL_PREFIX="/home/user/build_x86_64_v3/x86_64_v3-w64-mingw32" \ - -G Ninja -B build_x86_64_v3 -S mpv-winbuild-cmake - -The cmake command will create `clang_root` as clang sysroot where llvm tools installed. `build_x86_64` is build directory to compiling packages. - - cd build_x86_64 - ninja llvm # build LLVM (take around ~2 hours) - ninja rustup # build rust toolchain - ninja llvm-clang # build clang on specified target - ninja mpv # build mpv and all its dependencies - -If you want add another target (ex. `i686-w64-mingw32`), change `TARGET_ARCH` and build folder. - - cmake -DTARGET_ARCH=i686-w64-mingw32 \ - -DCMAKE_INSTALL_PREFIX="/home/user/clang_root" \ - -DCOMPILER_TOOLCHAIN=clang \ - -DSINGLE_SOURCE_LOCATION="/home/user/packages" \ - -DRUSTUP_LOCATION="/home/user/install_rustup" \ - -DMINGW_INSTALL_PREFIX="/home/user/build_i686/i686-w64-mingw32" \ - -G Ninja -B build_i686 -S mpv-winbuild-cmake - cd build_i686 - ninja llvm-clang # same as above - -If you've changed `GCC_ARCH` option, you need to run: - - ninja rebuild_cache - -to update flags which will pass on gcc, g++ and etc. - -## Available Commands - -| Commands | Description | -| -------------------------- | ----------- | -| ninja package | compile a package | -| ninja clean | remove all stamp files in all packages. | -| ninja download | Download all packages' sources at once without compiling. | -| ninja update | Update all git repos. When a package pulls new changes, all of its stamp files will be deleted and will be forced rebuild. If there is no change, it will not remove the stamp files and no rebuild occur. Use this instead of `ninja clean` if you don't want to rebuild everything in the next run. | -| ninja package-fullclean | Remove all stamp files of a package. | -| ninja package-liteclean | Remove build, clean stamp files only. This will skip re-configure in the next running `ninja package` (after the first compile). Updating repo or patching need to do manually. Ideally, all `DEPENDS` targets in `package.cmake` should be temporarily commented or deleted. Might be useful in some cases. | -| ninja package-removebuild | Remove 'build' directory of a package. | -| ninja package-removeprefix | Remove 'prefix' directory. | -| ninja package-force-update | Update a package. Only git repo will be updated. | - -`package` is package's name found in `packages` folder. - -## Information about packages - -- Git/Hg - - ANGLE - - FFmpeg - - xz - - x264 - - x265 (multilib) - - uchardet - - rubberband (with libsamplerate) - - opus - - openal-soft - - mpv - - luajit - - libvpx - - libwebp - - libpng - - libsoxr - - libzimg (with graphengine) - - libdvdread - - libdvdnav - - libdvdcss - - libudfread - - libbluray - - libunibreak - - libass - - libmysofa - - lcms2 - - lame - - harfbuzz - - game-music-emu - - freetype2 - - flac - - opus-tools - - mujs - - libarchive - - libjpeg - - shaderc (with spirv-headers, spirv-tools, glslang) - - vulkan-header - - vulkan - - spirv-cross - - fribidi - - ~~nettle~~ - - curl - - libxml2 - - amf-headers - - avisynth-headers - - nvcodec-headers - - libvpl - - megasdk (with termcap, readline, cryptopp, sqlite, libuv, libsodium) - - aom - - dav1d - - libplacebo (with glad, fast_float, xxhash) - - fontconfig - - libbs2b - - libssh - - libsrt - - libjxl (with brotli, highway) - - libmodplug - - uavs3d - - davs2 - - libsixel - - libdovi - - libva - - libzvbi - - svtav1 - - libaribcaption - - zlib (zlib-ng) - - zstd - - expat - - openssl - - libsdl2 - - speex - - vorbis - - ogg - - bzip2 - -- Zip - - xvidcore (1.3.7) - - lzo (2.10) - - libopenmpt (0.7.8) - - libiconv (1.17) - - ~~gmp (6.3.0)~~ - - vapoursynth (R65/R63) - - ~~mbedtls (3.5.0)~~ - - ~~libressl (3.1.5)~~ - - -### WSL workaround - -Place the file on specified location to limit ram & cpu usage to avoid getting stuck while building mpv. - - # /etc/wsl.conf - [interop] - #enabled=false - appendWindowsPath=false - - [automount] - enabled = true - options = "metadata" - mountFsTab = false - - [user] - default= - --------------------------------------- - # C:\Users\\.wslconfig - [wsl2] - memory=4GB - swap=0 - pageReporting=false - -## Acknowledgements - -This project was originally created and maintained [lachs0r](https://github.com/lachs0r/mingw-w64-cmake). Since then, it heavily modified to suit my own need. diff --git a/cmake/custom_steps.cmake b/cmake/custom_steps.cmake index faa158810..77c16a507 100644 --- a/cmake/custom_steps.cmake +++ b/cmake/custom_steps.cmake @@ -96,6 +96,7 @@ file(WRITE ${stamp_dir}/reset_head.sh "#!/bin/bash set -e if [[ ! -f \"${stamp_dir}/${_name}-patch\" || \"${stamp_dir}/${_name}-download\" -nt \"${stamp_dir}/${_name}-patch\" || ! -f \"${stamp_dir}/HEAD\" || \"$(cat ${stamp_dir}/HEAD)\" != \"$(git -C ${source_dir} rev-parse @{u})\" ]]; then + echo ${source_dir} git -C ${source_dir} reset --hard ${reset} -q if [[ -z \"${git_reset}\" ]]; then find \"${stamp_dir}\" -type f ! -iname '*.cmake' -size 0c -delete @@ -114,7 +115,7 @@ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_ INDEPENDENT TRUE WORKING_DIRECTORY COMMAND bash -c "git am --abort 2> /dev/null || true" - COMMAND bash -c "git fetch --filter=tree:0 --no-recurse-submodules" + COMMAND bash -c "git fetch --no-recurse-submodules" COMMAND ${stamp_dir}/reset_head.sh ) ExternalProject_Add_StepTargets(${_name} force-update) diff --git a/cmake/packages_check.cmake b/cmake/packages_check.cmake index e303e10dc..4b9c5509c 100644 --- a/cmake/packages_check.cmake +++ b/cmake/packages_check.cmake @@ -41,11 +41,7 @@ if(TARGET_CPU STREQUAL "x86_64") set(xxhash_dispatch "-DDISPATCH=ON") set(xxhash_cflags "-DXXH_X86DISPATCH_ALLOW_AVX=1") set(nvcodec_headers "nvcodec-headers") - set(ffmpeg_cuda "--enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc") - set(ffmpeg_uavs3d "uavs3d") - set(ffmpeg_uavs3d_cmd "--enable-libuavs3d") - set(ffmpeg_davs2 "davs2") - set(ffmpeg_davs2_cmd "--enable-libdavs2") + set(ffmpeg_cuda "--enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc --enable-ffnvcodec") elseif(TARGET_CPU STREQUAL "i686") set(dlltool_image "i386") set(vulkan_asm "-DUSE_MASM=OFF") @@ -55,11 +51,7 @@ elseif(TARGET_CPU STREQUAL "i686") set(xxhash_dispatch "-DDISPATCH=ON") set(xxhash_cflags "-DXXH_X86DISPATCH_ALLOW_AVX=1") set(nvcodec_headers "nvcodec-headers") - set(ffmpeg_cuda "--enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc") - set(ffmpeg_uavs3d "uavs3d") - set(ffmpeg_uavs3d_cmd "--enable-libuavs3d") - set(ffmpeg_davs2 "davs2") - set(ffmpeg_davs2_cmd "--enable-libdavs2") + set(ffmpeg_cuda "--enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc --enable-ffnvcodec") elseif(TARGET_CPU STREQUAL "aarch64") set(dlltool_image "arm64") set(vulkan_asm "-DUSE_GAS=ON") diff --git a/packages/CMakeLists.txt b/packages/CMakeLists.txt index d9100604c..296b41bc0 100644 --- a/packages/CMakeLists.txt +++ b/packages/CMakeLists.txt @@ -29,7 +29,6 @@ list(APPEND ep libdvdread libdvdnav libiconv - luajit fribidi expat nettle @@ -80,11 +79,9 @@ list(APPEND ep glad fast_float libdovi - svtav1 libplacebo libva libzvbi - libaribcaption libsixel ffmpeg mpv diff --git a/packages/ffmpeg-dash-base-url-escape.patch b/packages/ffmpeg-dash-base-url-escape.patch new file mode 100644 index 000000000..36ed6d5b2 --- /dev/null +++ b/packages/ffmpeg-dash-base-url-escape.patch @@ -0,0 +1,26 @@ +diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c +index 29d4680..c50afaf 100644 +--- a/libavformat/dashdec.c ++++ b/libavformat/dashdec.c +@@ -768,7 +768,9 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur + baseurl = xmlNodeGetContent(node); + root_url = (av_strcasecmp(baseurl, "")) ? baseurl : path; + if (node) { +- xmlNodeSetContent(node, root_url); ++ char* root_url_content = xmlEncodeSpecialChars(NULL, root_url); ++ xmlNodeSetContent(node, root_url_content); ++ xmlFree(root_url_content); + updated = 1; + } + +@@ -802,7 +804,9 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur + memset(p + 1, 0, strlen(p)); + } + av_strlcat(tmp_str, text + start, tmp_max_url_size); +- xmlNodeSetContent(baseurl_nodes[i], tmp_str); ++ char* tmp_str_content = xmlEncodeSpecialChars(NULL, tmp_str); ++ xmlNodeSetContent(baseurl_nodes[i], tmp_str_content); ++ xmlFree(tmp_str_content); + updated = 1; + xmlFree(text); + } diff --git a/packages/ffmpeg.cmake b/packages/ffmpeg.cmake index 49a0f6e95..ffbcbfc34 100644 --- a/packages/ffmpeg.cmake +++ b/packages/ffmpeg.cmake @@ -1,5 +1,5 @@ ExternalProject_Add(ffmpeg - DEPENDS + DEPENDS amf-headers avisynth-headers ${nvcodec_headers} @@ -17,7 +17,6 @@ ExternalProject_Add(ffmpeg libpng libsoxr libbs2b - libvpx libwebp libzimg libmysofa @@ -26,30 +25,18 @@ ExternalProject_Add(ffmpeg opus speex vorbis - x264 - ${ffmpeg_x265} - xvidcore - libxml2 libvpl - libopenmpt libjxl + libxml2 shaderc libplacebo - libzvbi - libaribcaption - aom - svtav1 dav1d - vapoursynth - ${ffmpeg_uavs3d} - ${ffmpeg_davs2} - rubberband - libva openal-soft GIT_REPOSITORY https://github.com/FFmpeg/FFmpeg.git SOURCE_DIR ${SOURCE_LOCATION} GIT_CLONE_FLAGS "--sparse --filter=tree:0" GIT_CLONE_POST_COMMAND "sparse-checkout set --no-cone /* !tests/ref/fate" + PATCH_COMMAND ${EXEC} git apply ${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg-*.patch UPDATE_COMMAND "" CONFIGURE_COMMAND ${EXEC} CONF=1 /configure --cross-prefix=${TARGET_ARCH}- @@ -58,69 +45,272 @@ ExternalProject_Add(ffmpeg --target-os=mingw32 --pkg-config-flags=--static --enable-cross-compile - --enable-runtime-cpudetect - --enable-gpl + + --disable-gpl + --disable-nonfree --enable-version3 - --enable-postproc - --enable-avisynth - --enable-vapoursynth - --enable-libass - --enable-libbluray - --enable-libdvdnav - --enable-libdvdread - --enable-libfreetype - --enable-libfribidi - --enable-libfontconfig - --enable-libharfbuzz - --enable-libmodplug - --enable-libopenmpt - --enable-libmp3lame - --enable-lcms2 - --enable-libopus - --enable-libsoxr - --enable-libspeex - --enable-libvorbis + --enable-static + --disable-shared + --disable-vulkan + --disable-iconv + --enable-stripping + + --disable-muxers + --disable-decoders + --disable-encoders + --disable-demuxers + --disable-parsers + --disable-protocols + --disable-filters + --disable-doc + --disable-postproc + --disable-programs + --disable-gray + --disable-swscale-alpha + + --enable-bsfs + + --enable-amf + --enable-dxva2 + --enable-libmfx + --enable-d3d11va + + --disable-vaapi + --disable-vdpau + --disable-bzlib + --disable-libmfx + --disable-libuavs3d + --disable-linux-perf + --disable-videotoolbox + --disable-audiotoolbox + + --disable-bsf=mjpeg2jpeg + --disable-bsf=mjpega_dump_header + --disable-bsf=mov2textsub + --disable-bsf=text2movsub + --disable-bsf=eac3_core + + --enable-small + --enable-hwaccels + --enable-optimizations + --enable-runtime-cpudetect + + --enable-openssl + --enable-libssh + + --enable-libdav1d + + --enable-libjxl + + --enable-libvpl --enable-libbs2b - --enable-librubberband - --enable-libvpx --enable-libwebp - --enable-libx264 - --enable-libx265 - --enable-libaom - --enable-libsvtav1 - --enable-libdav1d - ${ffmpeg_davs2_cmd} - ${ffmpeg_uavs3d_cmd} - --enable-libxvid --enable-libzimg - --enable-openssl --enable-libxml2 + --enable-libsoxr + --enable-libspeex --enable-libmysofa - --enable-libssh - --enable-libsrt - --enable-libvpl - --enable-libjxl - --enable-libplacebo --enable-libshaderc - --enable-libzvbi - --enable-libaribcaption + --enable-libfribidi + --enable-libfreetype + + --enable-avutil + --enable-avcodec + --enable-avfilter + --enable-avformat + --enable-avdevice + --enable-swscale + --enable-swresample + + --enable-decoder=flv + --enable-decoder=h263 + --enable-decoder=h263i + --enable-decoder=h263p + --enable-decoder=h264* + --enable-decoder=mpeg1video + --enable-decoder=mpeg2* + --enable-decoder=mpeg4* + --enable-decoder=vp6 + --enable-decoder=vp6a + --enable-decoder=vp6f + --enable-decoder=vp8* + --enable-decoder=vp9* + --enable-decoder=hevc* + --enable-decoder=av1* + --enable-decoder=libdav1d + --enable-decoder=theora + --enable-decoder=msmpeg* + --enable-decoder=mjpeg* + --enable-decoder=wmv* + + --enable-decoder=aac* + --enable-decoder=ac3 + --enable-decoder=alac + --enable-decoder=als + --enable-decoder=ape + --enable-decoder=atrac* + --enable-decoder=eac3 + --enable-decoder=flac + --enable-decoder=gsm* + --enable-decoder=mp1* + --enable-decoder=mp2* + --enable-decoder=mp3* + --enable-decoder=mpc* + --enable-decoder=opus + --enable-decoder=ra* + --enable-decoder=ralf + --enable-decoder=shorten + --enable-decoder=tak + --enable-decoder=tta + --enable-decoder=vorbis + --enable-decoder=wavpack + --enable-decoder=wma* + --enable-decoder=pcm* + --enable-decoder=dsd* + --enable-decoder=dca + + --enable-decoder=ssa + --enable-decoder=ass + --enable-decoder=dvbsub + --enable-decoder=dvdsub + --enable-decoder=srt + --enable-decoder=stl + --enable-decoder=subrip + --enable-decoder=subviewer + --enable-decoder=subviewer1 + --enable-decoder=text + --enable-decoder=vplayer + --enable-decoder=webvtt + --enable-decoder=movtext + + --enable-decoder=mjpeg + --enable-decoder=ljpeg + --enable-decoder=jpegls + --enable-decoder=jpeg2000 + --enable-decoder=png + --enable-decoder=gif + --enable-decoder=bmp + --enable-decoder=tiff + --enable-decoder=webp + --enable-decoder=jpegls + + --enable-demuxer=concat + --enable-demuxer=data + --enable-demuxer=flv + --enable-demuxer=hls + --enable-demuxer=latm + --enable-demuxer=live_flv + --enable-demuxer=loas + --enable-demuxer=m4v + --enable-demuxer=mov + --enable-demuxer=mpegps + --enable-demuxer=mpegts + --enable-demuxer=mpegvideo + --enable-demuxer=hevc + --enable-demuxer=rtsp + --enable-demuxer=mpeg4 + --enable-demuxer=mjpeg* + --enable-demuxer=avi + --enable-demuxer=av1 + --enable-demuxer=matroska + --enable-demuxer=dash + --enable-demuxer=webm_dash_manifest + + --enable-demuxer=aac + --enable-demuxer=ac3 + --enable-demuxer=aiff + --enable-demuxer=ape + --enable-demuxer=asf + --enable-demuxer=au + --enable-demuxer=avi + --enable-demuxer=flac + --enable-demuxer=flv + --enable-demuxer=matroska + --enable-demuxer=mov + --enable-demuxer=m4v + --enable-demuxer=mp3 + --enable-demuxer=mpc* + --enable-demuxer=ogg + --enable-demuxer=pcm* + --enable-demuxer=rm + --enable-demuxer=shorten + --enable-demuxer=tak + --enable-demuxer=tta + --enable-demuxer=wav + --enable-demuxer=wv + --enable-demuxer=xwma + --enable-demuxer=dsf + --enable-demuxer=truehd + --enable-demuxer=dts + --enable-demuxer=dtshd + + --enable-demuxer=ass + --enable-demuxer=srt + --enable-demuxer=stl + --enable-demuxer=webvtt + --enable-demuxer=subviewer + --enable-demuxer=subviewer1 + --enable-demuxer=vplayer + + --enable-parser=h263 + --enable-parser=h264 + --enable-parser=hevc + --enable-parser=mpeg4 + --enable-parser=mpeg4video + --enable-parser=mpegvideo + + --enable-parser=aac* + --enable-parser=ac3 + --enable-parser=cook + --enable-parser=flac + --enable-parser=gsm + --enable-parser=mpegaudio + --enable-parser=tak + --enable-parser=vorbis + --enable-parser=dca + + --enable-filter=overlay + --enable-filter=equalizer + + --enable-protocol=async + --enable-protocol=cache + --enable-protocol=crypto + --enable-protocol=data + --enable-protocol=ffrtmphttp + --enable-protocol=file + --enable-protocol=ftp + --enable-protocol=hls + --enable-protocol=http + --enable-protocol=httpproxy + --enable-protocol=https + --enable-protocol=pipe + --enable-protocol=rtmp + --enable-protocol=rtmps + --enable-protocol=rtmpt + --enable-protocol=rtmpts + --enable-protocol=rtp + --enable-protocol=subfile + --enable-protocol=tcp + --enable-protocol=tls + --enable-protocol=srt + --enable-protocol=udp + + --enable-encoder=mjpeg + --enable-encoder=ljpeg + --enable-encoder=jpegls + --enable-encoder=jpeg2000 + --enable-encoder=png + --enable-encoder=jpegls + + --enable-network + ${ffmpeg_cuda} - --enable-amf - --enable-openal - --enable-opengl - --disable-doc - --disable-ffplay - --disable-ffprobe - --enable-vaapi - --disable-vdpau - --disable-videotoolbox - --disable-decoder=libaom_av1 ${ffmpeg_lto} --extra-cflags='-Wno-error=int-conversion' "--extra-libs='${ffmpeg_extra_libs}'" # -lstdc++ / -lc++ needs by libjxl and shaderc - BUILD_COMMAND ${MAKE} - INSTALL_COMMAND ${MAKE} install - LOG_DOWNLOAD 1 LOG_UPDATE 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 + BUILD_COMMAND ${MAKE} + INSTALL_COMMAND ${MAKE} install + LOG_DOWNLOAD 1 LOG_UPDATE 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 ) force_rebuild_git(ffmpeg) diff --git a/packages/luajit-0001-add-win32-utf-8-filesystem-functions.patch b/packages/luajit-0001-add-win32-utf-8-filesystem-functions.patch deleted file mode 100644 index 7e36a4ca2..000000000 --- a/packages/luajit-0001-add-win32-utf-8-filesystem-functions.patch +++ /dev/null @@ -1,855 +0,0 @@ -From c92ec4586cb91e430aa2c9d7894cf0128a729633 Mon Sep 17 00:00:00 2001 -From: shinchiro -Date: Tue, 25 Jul 2023 22:53:21 +0800 -Subject: [PATCH] Add win32 UTF-8 filesystem functions - -Taken from https://github.com/wm4/libinsanity ---- - src/Makefile | 2 +- - src/Makefile.dep | 3 +- - src/lib_io.c | 1 + - src/lib_os.c | 1 + - src/lib_package.c | 1 + - src/lj_clib.c | 1 + - src/lj_fs_io.c | 582 +++++++++++++++++++++++++++++++++++++++++ - src/lj_fs_io.h | 60 +++++ - src/lj_fs_io_replace.h | 50 ++++ - src/lj_load.c | 1 + - src/lj_trace.c | 1 + - src/ljamalg.c | 1 + - 12 files changed, 702 insertions(+), 2 deletions(-) - create mode 100644 src/lj_fs_io.c - create mode 100644 src/lj_fs_io.h - create mode 100644 src/lj_fs_io_replace.h - -diff --git a/src/Makefile b/src/Makefile -index 68a9a7c..26137e4 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -513,7 +513,7 @@ LJCORE_O= lj_assert.o lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o lj_buf.o \ - lj_asm.o lj_trace.o lj_gdbjit.o \ - lj_ctype.o lj_cdata.o lj_cconv.o lj_ccall.o lj_ccallback.o \ - lj_carith.o lj_clib.o lj_cparse.o \ -- lj_lib.o lj_alloc.o lib_aux.o \ -+ lj_lib.o lj_alloc.o lj_fs_io.o lib_aux.o \ - $(LJLIB_O) lib_init.o lj_str_hash.o - - ifeq (x64,$(TARGET_LJARCH)) -diff --git a/src/Makefile.dep b/src/Makefile.dep -index 400ef8b..5f26250 100644 ---- a/src/Makefile.dep -+++ b/src/Makefile.dep -@@ -47,6 +47,7 @@ lib_table.o: lib_table.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \ - lj_tab.h lj_ff.h lj_ffdef.h lj_lib.h lj_libdef.h - lj_alloc.o: lj_alloc.c lj_def.h lua.h luaconf.h lj_arch.h lj_alloc.h \ - lj_prng.h -+lj_fs_io.o: lj_fs_io.c lj_fs_io.h - lj_api.o: lj_api.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h lj_func.h lj_udata.h \ - lj_meta.h lj_state.h lj_bc.h lj_frame.h lj_trace.h lj_jit.h lj_ir.h \ -@@ -237,7 +238,7 @@ ljamalg.o: ljamalg.c lua.h luaconf.h lauxlib.h lj_assert.c lj_obj.h \ - lj_opt_narrow.c lj_opt_dce.c lj_opt_loop.c lj_snap.h lj_opt_split.c \ - lj_opt_sink.c lj_mcode.c lj_snap.c lj_record.c lj_record.h lj_ffrecord.h \ - lj_crecord.c lj_crecord.h lj_ffrecord.c lj_recdef.h lj_asm.c lj_asm.h \ -- lj_emit_*.h lj_asm_*.h lj_trace.c lj_gdbjit.h lj_gdbjit.c lj_alloc.c \ -+ lj_emit_*.h lj_asm_*.h lj_trace.c lj_gdbjit.h lj_gdbjit.c lj_alloc.c lj_fs_io.c \ - lib_aux.c lib_base.c lj_libdef.h lib_math.c lib_string.c lib_table.c \ - lib_io.c lib_os.c lib_package.c lib_debug.c lib_bit.c lib_jit.c \ - lib_ffi.c lib_buffer.c lib_init.c -diff --git a/src/lib_io.c b/src/lib_io.c -index c22faa2..3014b06 100644 ---- a/src/lib_io.c -+++ b/src/lib_io.c -@@ -25,6 +25,7 @@ - #include "lj_strfmt.h" - #include "lj_ff.h" - #include "lj_lib.h" -+#include "lj_fs_io_replace.h" - - /* Userdata payload for I/O file. */ - typedef struct IOFileUD { -diff --git a/src/lib_os.c b/src/lib_os.c -index 4b4e150..0515579 100644 ---- a/src/lib_os.c -+++ b/src/lib_os.c -@@ -22,6 +22,7 @@ - #include "lj_buf.h" - #include "lj_str.h" - #include "lj_lib.h" -+#include "lj_fs_io_replace.h" - - #if LJ_TARGET_POSIX - #include -diff --git a/src/lib_package.c b/src/lib_package.c -index 63a9121..70fdc53 100644 ---- a/src/lib_package.c -+++ b/src/lib_package.c -@@ -16,6 +16,7 @@ - #include "lj_obj.h" - #include "lj_err.h" - #include "lj_lib.h" -+#include "lj_fs_io_replace.h" - - /* ------------------------------------------------------------------------ */ - -diff --git a/src/lj_clib.c b/src/lj_clib.c -index f0ef6ed..8b22824 100644 ---- a/src/lj_clib.c -+++ b/src/lj_clib.c -@@ -17,6 +17,7 @@ - #include "lj_cdata.h" - #include "lj_clib.h" - #include "lj_strfmt.h" -+#include "lj_fs_io_replace.h" - - /* -- OS-specific functions ----------------------------------------------- */ - -diff --git a/src/lj_fs_io.c b/src/lj_fs_io.c -new file mode 100644 -index 0000000..80668b7 ---- /dev/null -+++ b/src/lj_fs_io.c -@@ -0,0 +1,582 @@ -+// This file is copyrighted. -+ -+#define lj_fs_io_c -+#define LUA_CORE -+ -+#ifdef __MINGW32__ -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "lj_fs_io.h" -+ -+// Like free(), but do not clobber errno and the win32 error state. It is -+// unknown whether MSVCRT's free() clobbers these, but do not take any chances. -+static void free_keep_err(void *ptr) -+{ -+ int err = errno; -+ DWORD bill = GetLastError(); -+ -+ free(ptr); -+ -+ errno = err; -+ SetLastError(bill); -+} -+ -+static void set_errno_from_lasterror(void) -+{ -+ // This just handles the error codes expected from CreateFile at the moment -+ switch (GetLastError()) { -+ case ERROR_FILE_NOT_FOUND: -+ errno = ENOENT; -+ break; -+ case ERROR_SHARING_VIOLATION: -+ case ERROR_ACCESS_DENIED: -+ errno = EACCES; -+ break; -+ case ERROR_FILE_EXISTS: -+ case ERROR_ALREADY_EXISTS: -+ errno = EEXIST; -+ break; -+ case ERROR_PIPE_BUSY: -+ errno = EAGAIN; -+ break; -+ default: -+ errno = EINVAL; -+ break; -+ } -+} -+ -+// Returns NULL + errno on failure. -+static wchar_t *lin_utf8_to_winchar(const char *in) -+{ -+ int res = MultiByteToWideChar(CP_UTF8, 0, in, -1, NULL, 0); -+ if (res <= 0) { -+ set_errno_from_lasterror(); -+ return NULL; -+ } -+ wchar_t *str = malloc(res * sizeof(wchar_t)); -+ if (!str) { -+ errno = ENOMEM; -+ return NULL; -+ } -+ if (MultiByteToWideChar(CP_UTF8, 0, in, -1, str, res) <= 0) { -+ set_errno_from_lasterror(); -+ return NULL; -+ } -+ return str; -+} -+ -+// Returns NULL + errno on failure. -+static char *lin_winchar_to_utf8(const wchar_t *in) -+{ -+ int res = WideCharToMultiByte(CP_UTF8, 0, in, -1, NULL, 0, NULL, NULL); -+ if (res <= 0) { -+ set_errno_from_lasterror(); -+ return NULL; -+ } -+ char *str = malloc(res); -+ if (!str) { -+ errno = ENOMEM; -+ return NULL; -+ } -+ if (WideCharToMultiByte(CP_UTF8, 0, in, -1, str, res, NULL, NULL) <= 0) { -+ set_errno_from_lasterror(); -+ return NULL; -+ } -+ return str; -+} -+ -+static time_t filetime_to_unix_time(int64_t wintime) -+{ -+ static const int64_t hns_per_second = 10000000ll; -+ static const int64_t win_to_unix_epoch = 11644473600ll; -+ return wintime / hns_per_second - win_to_unix_epoch; -+} -+ -+static bool get_file_ids_win8(HANDLE h, lin_dev_t *dev, lin_ino_t *ino) -+{ -+ FILE_ID_INFO ii; -+ if (!GetFileInformationByHandleEx(h, FileIdInfo, &ii, sizeof(ii))) -+ return false; -+ *dev = ii.VolumeSerialNumber; -+ // The definition of FILE_ID_128 differs between mingw-w64 and the Windows -+ // SDK, but we can ignore that by just memcpying it. This will also -+ // truncate the file ID on 32-bit Windows, which doesn't support __int128. -+ // 128-bit file IDs are only used for ReFS, so that should be okay. -+ assert(sizeof(*ino) <= sizeof(ii.FileId)); -+ memcpy(ino, &ii.FileId, sizeof(*ino)); -+ return true; -+} -+ -+static bool get_file_ids(HANDLE h, lin_dev_t *dev, lin_ino_t *ino) -+{ -+ // GetFileInformationByHandle works on FAT partitions and Windows 7, but -+ // doesn't work in UWP and can produce non-unique IDs on ReFS -+ BY_HANDLE_FILE_INFORMATION bhfi; -+ if (!GetFileInformationByHandle(h, &bhfi)) -+ return false; -+ *dev = bhfi.dwVolumeSerialNumber; -+ *ino = ((lin_ino_t)bhfi.nFileIndexHigh << 32) | bhfi.nFileIndexLow; -+ return true; -+} -+ -+// Like fstat(), but with a Windows HANDLE -+static int hstat(HANDLE h, struct lin_stat *buf) -+{ -+ // Handle special (or unknown) file types first -+ switch (GetFileType(h) & ~FILE_TYPE_REMOTE) { -+ case FILE_TYPE_PIPE: -+ *buf = (struct lin_stat){ .st_nlink = 1, .st_mode = _S_IFIFO | 0644 }; -+ return 0; -+ case FILE_TYPE_CHAR: // character device -+ *buf = (struct lin_stat){ .st_nlink = 1, .st_mode = _S_IFCHR | 0644 }; -+ return 0; -+ case FILE_TYPE_UNKNOWN: -+ errno = EBADF; -+ return -1; -+ } -+ -+ struct lin_stat st = { 0 }; -+ -+ FILE_BASIC_INFO bi; -+ if (!GetFileInformationByHandleEx(h, FileBasicInfo, &bi, sizeof(bi))) { -+ errno = EBADF; -+ return -1; -+ } -+ st.st_atime = filetime_to_unix_time(bi.LastAccessTime.QuadPart); -+ st.st_mtime = filetime_to_unix_time(bi.LastWriteTime.QuadPart); -+ st.st_ctime = filetime_to_unix_time(bi.ChangeTime.QuadPart); -+ -+ FILE_STANDARD_INFO si; -+ if (!GetFileInformationByHandleEx(h, FileStandardInfo, &si, sizeof(si))) { -+ errno = EBADF; -+ return -1; -+ } -+ st.st_nlink = si.NumberOfLinks; -+ -+ // Here we pretend Windows has POSIX permissions by pretending all -+ // directories are 755 and regular files are 644 -+ if (si.Directory) { -+ st.st_mode |= _S_IFDIR | 0755; -+ } else { -+ st.st_mode |= _S_IFREG | 0644; -+ st.st_size = si.EndOfFile.QuadPart; -+ } -+ -+ if (!get_file_ids_win8(h, &st.st_dev, &st.st_ino)) { -+ // Fall back to the Windows 7 method (also used for FAT in Win8) -+ if (!get_file_ids(h, &st.st_dev, &st.st_ino)) { -+ errno = EBADF; -+ return -1; -+ } -+ } -+ -+ *buf = st; -+ return 0; -+} -+ -+int lin_stat(const char *path, struct lin_stat *buf) -+{ -+ wchar_t *wpath = lin_utf8_to_winchar(path); -+ if (!wpath) -+ return -1; -+ HANDLE h = CreateFileW(wpath, FILE_READ_ATTRIBUTES, -+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, -+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | SECURITY_SQOS_PRESENT | -+ SECURITY_IDENTIFICATION, NULL); -+ free(wpath); -+ if (h == INVALID_HANDLE_VALUE) { -+ set_errno_from_lasterror(); -+ return -1; -+ } -+ -+ int ret = hstat(h, buf); -+ CloseHandle(h); -+ return ret; -+} -+ -+int lin_fstat(int fd, struct lin_stat *buf) -+{ -+ HANDLE h = (HANDLE)_get_osfhandle(fd); -+ if (h == INVALID_HANDLE_VALUE) { -+ errno = EBADF; -+ return -1; -+ } -+ // Use our hstat() function rather than MSVCRT's fstat() because ours -+ // supports directories and device/inode numbers. -+ return hstat(h, buf); -+} -+ -+int lin_open(const char *filename, int oflag, ...) -+{ -+ // Always use all share modes, which is useful for opening files that are -+ // open in other processes, and also more POSIX-like -+ static const DWORD share = -+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; -+ // Setting FILE_APPEND_DATA and avoiding GENERIC_WRITE/FILE_WRITE_DATA -+ // will make the file handle use atomic append behavior -+ static const DWORD append = -+ FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA; -+ -+ DWORD access = 0; -+ DWORD disposition = 0; -+ DWORD flags = 0; -+ -+ switch (oflag & (_O_RDONLY | _O_RDWR | _O_WRONLY | _O_APPEND)) { -+ case _O_RDONLY: -+ access = GENERIC_READ; -+ flags |= FILE_FLAG_BACKUP_SEMANTICS; // For opening directories -+ break; -+ case _O_RDWR: -+ access = GENERIC_READ | GENERIC_WRITE; -+ break; -+ case _O_RDWR | _O_APPEND: -+ case _O_RDONLY | _O_APPEND: -+ access = GENERIC_READ | append; -+ break; -+ case _O_WRONLY: -+ access = GENERIC_WRITE; -+ break; -+ case _O_WRONLY | _O_APPEND: -+ access = append; -+ break; -+ default: -+ errno = EINVAL; -+ return -1; -+ } -+ -+ switch (oflag & (_O_CREAT | _O_EXCL | _O_TRUNC)) { -+ case 0: -+ case _O_EXCL: // Like MSVCRT, ignore invalid use of _O_EXCL -+ disposition = OPEN_EXISTING; -+ break; -+ case _O_TRUNC: -+ case _O_TRUNC | _O_EXCL: -+ disposition = TRUNCATE_EXISTING; -+ break; -+ case _O_CREAT: -+ disposition = OPEN_ALWAYS; -+ flags |= FILE_ATTRIBUTE_NORMAL; -+ break; -+ case _O_CREAT | _O_TRUNC: -+ disposition = CREATE_ALWAYS; -+ break; -+ case _O_CREAT | _O_EXCL: -+ case _O_CREAT | _O_EXCL | _O_TRUNC: -+ disposition = CREATE_NEW; -+ flags |= FILE_ATTRIBUTE_NORMAL; -+ break; -+ } -+ -+ // Opening a named pipe as a file can allow the pipe server to impersonate -+ // the calling process, which could be a security issue. Set SQOS flags, so -+ // pipe servers can only identify our process, not impersonate it. -+ if (disposition != CREATE_NEW) -+ flags |= SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION; -+ -+ // Keep the same semantics for some MSVCRT-specific flags -+ if (oflag & _O_TEMPORARY) { -+ flags |= FILE_FLAG_DELETE_ON_CLOSE; -+ access |= DELETE; -+ } -+ if (oflag & _O_SHORT_LIVED) -+ flags |= FILE_ATTRIBUTE_TEMPORARY; -+ if (oflag & _O_SEQUENTIAL) { -+ flags |= FILE_FLAG_SEQUENTIAL_SCAN; -+ } else if (oflag & _O_RANDOM) { -+ flags |= FILE_FLAG_RANDOM_ACCESS; -+ } -+ -+ // Open the Windows file handle -+ wchar_t *wpath = lin_utf8_to_winchar(filename); -+ if (!wpath) -+ return -1; -+ HANDLE h = CreateFileW(wpath, access, share, NULL, disposition, flags, NULL); -+ free(wpath); -+ if (h == INVALID_HANDLE_VALUE) { -+ set_errno_from_lasterror(); -+ return -1; -+ } -+ -+ // Map the Windows file handle to a CRT file descriptor. Note: MSVCRT only -+ // cares about the following oflags. -+ oflag &= _O_APPEND | _O_RDONLY | _O_RDWR | _O_WRONLY; -+ oflag |= _O_NOINHERIT; // We never create inheritable handles -+ int fd = _open_osfhandle((intptr_t)h, oflag); -+ if (fd < 0) { -+ CloseHandle(h); -+ return -1; -+ } -+ -+ return fd; -+} -+ -+int lin_creat(const char *filename, int mode) -+{ -+ return lin_open(filename, _O_CREAT | _O_WRONLY | _O_TRUNC, mode); -+} -+ -+FILE *lin_fopen(const char *filename, const char *mode) -+{ -+ if (!mode[0]) { -+ errno = EINVAL; -+ return NULL; -+ } -+ -+ int rwmode; -+ int oflags = 0; -+ switch (mode[0]) { -+ case 'r': -+ rwmode = _O_RDONLY; -+ break; -+ case 'w': -+ rwmode = _O_WRONLY; -+ oflags |= _O_CREAT | _O_TRUNC; -+ break; -+ case 'a': -+ rwmode = _O_WRONLY; -+ oflags |= _O_CREAT | _O_APPEND; -+ break; -+ default: -+ errno = EINVAL; -+ return NULL; -+ } -+ -+ // Parse extra mode flags -+ for (const char *pos = mode + 1; *pos; pos++) { -+ switch (*pos) { -+ case '+': rwmode = _O_RDWR; break; -+ case 'x': oflags |= _O_EXCL; break; -+ // Ignore unknown flags (glibc does too) -+ default: break; -+ } -+ } -+ -+ // Open a CRT file descriptor -+ int fd = lin_open(filename, rwmode | oflags); -+ if (fd < 0) -+ return NULL; -+ -+ // Add 'b' to the mode so the CRT knows the file is opened in binary mode -+ char bmode[] = { mode[0], 'b', rwmode == _O_RDWR ? '+' : '\0', '\0' }; -+ FILE *fp = fdopen(fd, bmode); -+ if (!fp) { -+ close(fd); -+ return NULL; -+ } -+ -+ return fp; -+} -+ -+// Windows' MAX_PATH/PATH_MAX/FILENAME_MAX is fixed to 260, but this limit -+// applies to unicode paths encoded with wchar_t (2 bytes on Windows). The UTF-8 -+// version could end up bigger in memory. In the worst case each wchar_t is -+// encoded to 3 bytes in UTF-8, so in the worst case we have: -+// wcslen(wpath) * 3 <= strlen(utf8path) -+// Thus we need LIN_PATH_MAX as the UTF-8/char version of PATH_MAX. -+// Also make sure there's free space for the terminating \0. -+// (For codepoints encoded as UTF-16 surrogate pairs, UTF-8 has the same length.) -+#define LIN_PATH_MAX (FILENAME_MAX * 3 + 1) -+ -+struct lin_dir { -+ DIR crap; // must be first member, unused, will be set to garbage -+ _WDIR *wdir; -+ union { -+ struct dirent dirent; -+ // dirent has space only for FILENAME_MAX bytes. _wdirent has space for -+ // FILENAME_MAX wchar_t, which might end up bigger as UTF-8 in some -+ // cases. Guarantee we can always hold _wdirent.d_name converted to -+ // UTF-8 (see LIN_PATH_MAX). -+ // This works because dirent.d_name is the last member of dirent. -+ char space[LIN_PATH_MAX]; -+ }; -+}; -+ -+DIR* lin_opendir(const char *path) -+{ -+ wchar_t *wpath = lin_utf8_to_winchar(path); -+ if (!wpath) -+ return NULL; -+ _WDIR *wdir = _wopendir(wpath); -+ free_keep_err(wpath); -+ if (!wdir) -+ return NULL; -+ struct lin_dir *ldir = calloc(1, sizeof(*ldir)); -+ if (!ldir) { -+ _wclosedir(wdir); -+ errno = ENOMEM; -+ return NULL; -+ } -+ // DIR is supposed to be opaque, but unfortunately the MinGW headers still -+ // define it. Make sure nobody tries to use it. -+ memset(&ldir->crap, 0xCD, sizeof(ldir->crap)); -+ ldir->wdir = wdir; -+ return (DIR*)ldir; -+} -+ -+struct dirent* lin_readdir(DIR *dir) -+{ -+ struct lin_dir *ldir = (struct lin_dir*)dir; -+ struct _wdirent *wdirent = _wreaddir(ldir->wdir); -+ if (!wdirent) -+ return NULL; -+ size_t buffersize = sizeof(ldir->space) - offsetof(struct dirent, d_name); -+ if (WideCharToMultiByte(CP_UTF8, 0, wdirent->d_name, -1, ldir->dirent.d_name, -+ buffersize, NULL, NULL) <= 0) -+ { -+ set_errno_from_lasterror(); -+ return NULL; -+ } -+ ldir->dirent.d_ino = 0; -+ ldir->dirent.d_reclen = 0; -+ ldir->dirent.d_namlen = strlen(ldir->dirent.d_name); -+ return &ldir->dirent; -+} -+ -+int lin_closedir(DIR *dir) -+{ -+ struct lin_dir *ldir = (struct lin_dir*)dir; -+ int res = _wclosedir(ldir->wdir); -+ free_keep_err(ldir); -+ return res; -+} -+ -+int lin_mkdir(const char *path, int mode) -+{ -+ wchar_t *wpath = lin_utf8_to_winchar(path); -+ if (!wpath) -+ return -1; -+ int res = _wmkdir(wpath); -+ free(wpath); -+ return res; -+} -+ -+char *lin_getcwd(char *buf, size_t size) -+{ -+ if (size >= SIZE_MAX / 3 - 1) { -+ errno = ENOMEM; -+ return NULL; -+ } -+ size_t wbuffer = size * 3 + 1; -+ wchar_t *wres = malloc(sizeof(wchar_t) * wbuffer); -+ if (!wres) { -+ errno = ENOMEM; -+ return NULL; -+ } -+ DWORD wlen = GetFullPathNameW(L".", wbuffer, wres, NULL); -+ if (wlen >= wbuffer || wlen == 0) { -+ free(wres); -+ errno = wlen ? ERANGE : ENOENT; -+ return NULL; -+ } -+ char *t = lin_winchar_to_utf8(wres); -+ free_keep_err(wres); -+ if (!t) -+ return NULL; -+ size_t st = strlen(t); -+ if (st >= size) { -+ free(t); -+ errno = ERANGE; -+ return NULL; -+ } -+ memcpy(buf, t, st + 1); -+ free(t); -+ return buf; -+} -+ -+off_t lin_lseek(int fd, off_t offset, int whence) -+{ -+ HANDLE h = (HANDLE)_get_osfhandle(fd); -+ if (h != INVALID_HANDLE_VALUE && GetFileType(h) != FILE_TYPE_DISK) { -+ errno = ESPIPE; -+ return (off_t)-1; -+ } -+ return _lseeki64(fd, offset, whence); -+} -+ -+static INIT_ONCE init_getenv_once = INIT_ONCE_STATIC_INIT; -+static char **utf8_environ; -+ -+static void free_env(void) -+{ -+ for (size_t n = 0; utf8_environ && utf8_environ[n]; n++) -+ free(utf8_environ[n]); -+ free(utf8_environ); -+ utf8_environ = NULL; -+} -+ -+// Note: UNIX getenv() returns static strings, and we try to do the same. Since -+// using putenv() is not multithreading safe, we don't expect env vars to change -+// at runtime, and converting/allocating them in advance is ok. -+static void init_getenv(void) -+{ -+ wchar_t *wenv = GetEnvironmentStringsW(); -+ if (!wenv) -+ goto done; -+ -+ wchar_t *wenv_cur = wenv; -+ size_t num_env = 0; -+ while (1) { -+ size_t len = wcslen(wenv_cur); -+ if (!len) -+ break; -+ num_env++; -+ wenv_cur += len + 1; -+ } -+ -+ utf8_environ = calloc(sizeof(utf8_environ[0]), num_env + 1); -+ if (!utf8_environ) -+ goto done; -+ -+ wenv_cur = wenv; -+ size_t cur_env = 0; -+ while (1) { -+ size_t len = wcslen(wenv_cur); -+ if (!len) -+ break; -+ assert(cur_env < num_env); -+ // On OOM, best-effort -+ utf8_environ[cur_env] = lin_winchar_to_utf8(wenv_cur); -+ if (utf8_environ[cur_env]) -+ cur_env++; -+ wenv_cur += len + 1; -+ } -+ -+done: -+ FreeEnvironmentStringsW(wenv); -+ -+ // Avoid showing up in leak detectors etc. -+ atexit(free_env); -+} -+ -+char *lin_getenv(const char *name) -+{ -+ BOOL pending; -+ if (!InitOnceBeginInitialize(&init_getenv_once, 0, &pending, NULL)) -+ return NULL; -+ if (pending) { -+ init_getenv(); -+ InitOnceComplete(&init_getenv_once, 0, NULL); -+ } -+ -+ size_t name_len = strlen(name); -+ for (size_t n = 0; utf8_environ && utf8_environ[n]; n++) { -+ char *env = utf8_environ[n]; -+ if (strncasecmp(env, name, name_len) == 0 && env[name_len] == '=') -+ return env + name_len + 1; -+ } -+ -+ return NULL; -+} -+ -+#endif -diff --git a/src/lj_fs_io.h b/src/lj_fs_io.h -new file mode 100644 -index 0000000..0bdcd20 ---- /dev/null -+++ b/src/lj_fs_io.h -@@ -0,0 +1,60 @@ -+// This file is copyrighted. -+ -+#ifndef _LJ_FS_IO_H -+#define _LJ_FS_IO_H -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#ifdef __MINGW32__ -+ -+int lin_open(const char *filename, int oflag, ...); -+int lin_creat(const char *filename, int mode); -+FILE *lin_fopen(const char *filename, const char *mode); -+DIR *lin_opendir(const char *path); -+struct dirent *lin_readdir(DIR *dir); -+int lin_closedir(DIR *dir); -+int lin_mkdir(const char *path, int mode); -+char *lin_getcwd(char *buf, size_t size); -+off_t lin_lseek(int fd, off_t offset, int whence); -+ -+// lin_stat types. MSVCRT's dev_t and ino_t are way too short to be unique. -+typedef uint64_t lin_dev_t; -+#ifdef _WIN64 -+typedef unsigned __int128 lin_ino_t; -+#else -+// 32-bit Windows doesn't have a __int128-type, which means ReFS file IDs will -+// be truncated and might collide. This is probably not a problem because ReFS -+// is not available in consumer versions of Windows. -+typedef uint64_t lin_ino_t; -+#endif -+ -+// lin_stat uses a different structure to MSVCRT, with 64-bit inodes -+struct lin_stat { -+ lin_dev_t st_dev; -+ lin_ino_t st_ino; -+ unsigned short st_mode; -+ unsigned int st_nlink; -+ short st_uid; -+ short st_gid; -+ lin_dev_t st_rdev; -+ int64_t st_size; -+ time_t st_atime; -+ time_t st_mtime; -+ time_t st_ctime; -+}; -+ -+int lin_stat(const char *path, struct lin_stat *buf); -+int lin_fstat(int fd, struct lin_stat *buf); -+ -+char *lin_getenv(const char *name); -+ -+#endif /* __MINGW32__ */ -+ -+#endif -diff --git a/src/lj_fs_io_replace.h b/src/lj_fs_io_replace.h -new file mode 100644 -index 0000000..604e279 ---- /dev/null -+++ b/src/lj_fs_io_replace.h -@@ -0,0 +1,50 @@ -+// This file is copyrighted. -+ -+#ifndef _LJ_FS_IO_REPLACE -+#define _LJ_FS_IO_REPLACE -+ -+#include "lj_fs_io.h" -+ -+#ifdef __MINGW32__ -+ -+#define dev_t lin_dev_t -+#define ino_t lin_ino_t -+ -+#define open(...) lin_open(__VA_ARGS__) -+#define creat(...) lin_creat(__VA_ARGS__) -+#define fopen(...) lin_fopen(__VA_ARGS__) -+#define opendir(...) lin_opendir(__VA_ARGS__) -+#define readdir(...) lin_readdir(__VA_ARGS__) -+#define closedir(...) lin_closedir(__VA_ARGS__) -+#define mkdir(...) lin_mkdir(__VA_ARGS__) -+#define getcwd(...) lin_getcwd(__VA_ARGS__) -+#define getenv(...) lin_getenv(__VA_ARGS__) -+ -+#undef lseek -+#define lseek(...) lin_lseek(__VA_ARGS__) -+ -+// Affects both "stat()" and "struct stat". -+#undef stat -+#define stat lin_stat -+ -+#undef fstat -+#define fstat(...) lin_fstat(__VA_ARGS__) -+ -+#define utime(...) _utime(__VA_ARGS__) -+#define utimbuf _utimbuf -+ -+#ifndef O_BINARY -+#define O_BINARY 0 -+#endif -+ -+#ifndef O_CLOEXEC -+#define O_CLOEXEC 0 -+#endif -+ -+#ifndef FD_CLOEXEC -+#define FD_CLOEXEC 0 -+#endif -+ -+#endif /* __MINGW32__ */ -+ -+#endif -diff --git a/src/lj_load.c b/src/lj_load.c -index 0aab488..150be4e 100644 ---- a/src/lj_load.c -+++ b/src/lj_load.c -@@ -22,6 +22,7 @@ - #include "lj_lex.h" - #include "lj_bcdump.h" - #include "lj_parse.h" -+#include "lj_fs_io_replace.h" - - /* -- Load Lua source code and bytecode ----------------------------------- */ - -diff --git a/src/lj_trace.c b/src/lj_trace.c -index f816337..f15c4c7 100644 ---- a/src/lj_trace.c -+++ b/src/lj_trace.c -@@ -31,6 +31,7 @@ - #include "lj_vmevent.h" - #include "lj_target.h" - #include "lj_prng.h" -+#include "lj_fs_io_replace.h" - - /* -- Error handling ------------------------------------------------------ */ - -diff --git a/src/ljamalg.c b/src/ljamalg.c -index 4d85950..68fb34b 100644 ---- a/src/ljamalg.c -+++ b/src/ljamalg.c -@@ -18,6 +18,7 @@ - #include "lua.h" - #include "lauxlib.h" - -+#include "lj_fs_io.c" - #include "lj_assert.c" - #include "lj_gc.c" - #include "lj_err.c" --- -2.41.0 - diff --git a/packages/luajit.cmake b/packages/luajit.cmake deleted file mode 100644 index 4499eb6a9..000000000 --- a/packages/luajit.cmake +++ /dev/null @@ -1,58 +0,0 @@ -if(CYGWIN OR MSYS) - # It's much easier to just use the target CC on Cygwin than to worry about - # pointer size mismatches - set(LUAJIT_HOST_GCC ${TARGET_ARCH}-gcc) -else() - set(LUAJIT_HOST_GCC gcc) -endif() - -if(${TARGET_CPU} MATCHES "i686") - set(LUAJIT_GCC_ARGS "-m32") - set(DISABLE_JIT "-DLUAJIT_DISABLE_JIT") -else() - set(LUAJIT_GCC_ARGS "-m64") -endif() - -set(EXPORT - "CROSS=${TARGET_ARCH}- - TARGET_SYS=Windows - BUILDMODE=static - FILE_T=luajit.exe - CFLAGS='-DUNICODE' - XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT ${DISABLE_JIT}' - PREFIX=${MINGW_INSTALL_PREFIX} Q=" -) - -# luajit ships with a broken pkg-config file -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/luajit.pc.in ${CMAKE_CURRENT_BINARY_DIR}/luajit.pc @ONLY) - -ExternalProject_Add(luajit - DEPENDS - libiconv - GIT_REPOSITORY https://github.com/openresty/luajit2.git - SOURCE_DIR ${SOURCE_LOCATION} - GIT_CLONE_FLAGS "--filter=tree:0" - GIT_REMOTE_NAME origin - GIT_TAG v2.1-agentzh - PATCH_COMMAND ${EXEC} git am --3way ${CMAKE_CURRENT_SOURCE_DIR}/luajit-*.patch - UPDATE_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND ${MAKE} -C /src - "HOST_CC='${LUAJIT_HOST_GCC} ${LUAJIT_GCC_ARGS}'" - ${EXPORT} - amalg - INSTALL_COMMAND ${MAKE} - "HOST_CC='${LUAJIT_HOST_GCC} ${LUAJIT_GCC_ARGS}'" - ${EXPORT} - install - BUILD_IN_SOURCE 1 - LOG_DOWNLOAD 1 LOG_UPDATE 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 -) - -ExternalProject_Add_Step(luajit install-pc - DEPENDEES install - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/luajit.pc ${MINGW_INSTALL_PREFIX}/lib/pkgconfig/luajit.pc -) - -force_rebuild_git(luajit) -cleanup(luajit install-pc) diff --git a/packages/luajit.pc.in b/packages/luajit.pc.in deleted file mode 100644 index 506e1501d..000000000 --- a/packages/luajit.pc.in +++ /dev/null @@ -1,25 +0,0 @@ -# Package information for LuaJIT to be used by pkg-config. -majver=2 -minver=1 -relver=0 -version=${majver}.${minver}.${relver}-beta3 -abiver=5.1 - -prefix=@MINGW_INSTALL_PREFIX@ -multilib=lib -exec_prefix=${prefix} -libdir=${exec_prefix}/${multilib} -libname=luajit-${abiver} -includedir=${prefix}/include/luajit-${majver}.${minver} - -INSTALL_LMOD=${prefix}/share/lua/${abiver} -INSTALL_CMOD=${prefix}/${multilib}/lua/${abiver} - -Name: LuaJIT -Description: Just-in-time compiler for Lua -URL: http://luajit.org -Version: ${version} -Requires: -Libs: -L${libdir} -l${libname} -Libs.private: -lm -liconv -Cflags: -I${includedir} diff --git a/packages/mpv-release.cmake b/packages/mpv-release.cmake index 60c1160be..fc2be09eb 100644 --- a/packages/mpv-release.cmake +++ b/packages/mpv-release.cmake @@ -21,22 +21,15 @@ ExternalProject_Add(mpv-release lcms2 libarchive libass - libdvdnav - libdvdread - libiconv libjpeg libpng - luajit - rubberband uchardet - openal-soft - mujs + shaderc + spirv-cross vulkan shaderc libplacebo spirv-cross - vapoursynth - libsdl2 URL ${LINK} SOURCE_DIR ${SOURCE_LOCATION} CONFIGURE_COMMAND ${EXEC} CONF=1 meson setup @@ -45,26 +38,22 @@ ExternalProject_Add(mpv-release --cross-file=${MESON_CROSS} --default-library=shared --prefer-static - -Ddebug=true - -Db_ndebug=true + -Dgpl=false + -Ddebug=false + -Db_ndebug=false -Doptimization=3 -Db_lto=true ${mpv_lto_mode} -Dlibmpv=true -Dpdf-build=enabled - -Dlua=enabled - -Djavascript=enabled - -Dsdl2=enabled - -Dlibarchive=enabled - -Dlibbluray=enabled - -Ddvdnav=enabled + -Dlua=disabled + -Djavascript=disabled -Duchardet=enabled - -Drubberband=enabled -Dlcms2=enabled - -Dopenal=enabled + -Dopenal=disabled -Dspirv-cross=enabled -Dvulkan=enabled - -Dvapoursynth=enabled + -Dvapoursynth=disabled ${mpv_gl} -Dc_args='-Wno-error=int-conversion' BUILD_COMMAND ${EXEC} LTO_JOB=1 ninja -C @@ -91,7 +80,6 @@ ExternalProject_Add_Step(mpv-release copy-binary COMMAND ${CMAKE_COMMAND} -E copy /mpv.exe ${CMAKE_CURRENT_BINARY_DIR}/mpv-package/mpv.exe COMMAND ${CMAKE_COMMAND} -E copy /mpv.com ${CMAKE_CURRENT_BINARY_DIR}/mpv-package/mpv.com COMMAND ${CMAKE_COMMAND} -E copy /mpv.pdf ${CMAKE_CURRENT_BINARY_DIR}/mpv-package/doc/manual.pdf - COMMAND ${CMAKE_COMMAND} -E copy ${MINGW_INSTALL_PREFIX}/etc/fonts/fonts.conf ${CMAKE_CURRENT_BINARY_DIR}/mpv-package/mpv/fonts.conf COMMENT "Copying mpv binaries and manual" ) diff --git a/packages/mpv.cmake b/packages/mpv.cmake index b30e6e33f..1d9ea2edc 100644 --- a/packages/mpv.cmake +++ b/packages/mpv.cmake @@ -6,25 +6,17 @@ ExternalProject_Add(mpv lcms2 libarchive libass - libdvdnav - libdvdread - libiconv libjpeg libpng - luajit - rubberband uchardet - openal-soft - mujs + shaderc + spirv-cross vulkan shaderc libplacebo spirv-cross - vapoursynth - libsdl2 GIT_REPOSITORY https://github.com/mpv-player/mpv.git SOURCE_DIR ${SOURCE_LOCATION} - GIT_CLONE_FLAGS "--filter=tree:0" UPDATE_COMMAND "" CONFIGURE_COMMAND ${EXEC} CONF=1 meson setup --prefix=${MINGW_INSTALL_PREFIX} @@ -32,26 +24,22 @@ ExternalProject_Add(mpv --cross-file=${MESON_CROSS} --default-library=shared --prefer-static - -Ddebug=true - -Db_ndebug=true + -Dgpl=false + -Ddebug=false + -Db_ndebug=false -Doptimization=3 -Db_lto=true ${mpv_lto_mode} -Dlibmpv=true -Dpdf-build=enabled - -Dlua=enabled - -Djavascript=enabled - -Dsdl2=enabled - -Dlibarchive=enabled - -Dlibbluray=enabled - -Ddvdnav=enabled + -Dlua=disabled + -Djavascript=disabled -Duchardet=enabled - -Drubberband=enabled -Dlcms2=enabled - -Dopenal=enabled + -Dopenal=disabled -Dspirv-cross=enabled -Dvulkan=enabled - -Dvapoursynth=enabled + -Dvapoursynth=disabled ${mpv_gl} -Dc_args='-Wno-error=int-conversion' BUILD_COMMAND ${EXEC} LTO_JOB=1 PDB=1 ninja -C diff --git a/packages/spirv-cross.cmake b/packages/spirv-cross.cmake index d49b9d3e8..e5679a453 100644 --- a/packages/spirv-cross.cmake +++ b/packages/spirv-cross.cmake @@ -16,6 +16,10 @@ ExternalProject_Add(spirv-cross -DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_CLI=OFF -DSPIRV_CROSS_ENABLE_TESTS=OFF + -DSPIRV_CROSS_ENABLE_MSL=OFF + -DSPIRV_CROSS_ENABLE_CPP=OFF + -DSPIRV_CROSS_ENABLE_REFLECT=OFF + -DSPIRV_CROSS_ENABLE_UTIL=OFF -DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS} -D__USE_MINGW_ANSI_STDIO' BUILD_COMMAND ${EXEC} ninja -C INSTALL_COMMAND ${EXEC} ninja -C install diff --git a/packages/xz.cmake b/packages/xz.cmake index 670e691d1..bf1cce3b1 100644 --- a/packages/xz.cmake +++ b/packages/xz.cmake @@ -1,9 +1,9 @@ ExternalProject_Add(xz GIT_REPOSITORY https://gitlab.com/shinchiro/xz.git SOURCE_DIR ${SOURCE_LOCATION} - GIT_CLONE_FLAGS "--filter=tree:0" + GIT_CLONE_FLAGS "" UPDATE_COMMAND "" - GIT_RESET 18b845e69752c975dfeda418ec00eda22605c2ee # v5.4.1 + GIT_TAG v5.4.1 CONFIGURE_COMMAND ${EXEC} CONF=1 autoreconf -fi && /configure --host=${TARGET_ARCH} --prefix=${MINGW_INSTALL_PREFIX}