From a1dcffb7acb651294515ef236cded80d984be1df Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 16:09:04 +0800 Subject: [PATCH 01/29] ci: add clang builder for windows --- .../workflows/_meta_win_clang_portable.yaml | 126 ++++ .github/workflows/build.yaml | 71 +- msys2/PKGBUILD/10-mingw-w64-brotli/PKGBUILD | 84 +++ msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD | 71 ++ .../bzip2-1.0.6-progress.all.patch | 163 +++++ .../bzip2-buildsystem.all.patch | 645 ++++++++++++++++++ .../bzip2-cygming-1.0.6.src.all.patch | 171 +++++ ...0002-fix-cr-for-awk-in-configure.all.patch | 12 + .../0003-add-cp65001-as-utf8-alias.patch | 12 + ...0004-fix-makefile-devel-assuming-gcc.patch | 12 + msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD | 139 ++++ .../fix-pointer-buf.patch | 37 + msys2/PKGBUILD/10-mingw-w64-libiconv/iconv.pc | 11 + msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD | 92 +++ msys2/PKGBUILD/10-mingw-w64-xz/PKGBUILD | 60 ++ .../01-zlib-1.2.11-1-buildsys.mingw.patch | 256 +++++++ .../03-dont-put-sodir-into-L.mingw.patch | 9 + .../04-fix-largefile-support.patch | 22 + ...-to-link-to-enable-build-shared-vers.patch | 25 + ...Add-bzip2-library-to-pkg-config-file.patch | 22 + msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD | 97 +++ .../0001-detect-arm64-counter.patch | 22 + .../20-mingw-w64-fftw/0002-no-dllexport.patch | 28 + .../20-mingw-w64-fftw/0003-shared-lib.patch | 52 ++ msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD | 161 +++++ msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD | 94 +++ .../freetype-2.10.0-enable-spr.patch | 12 + .../freetype-2.10.0-enable-valid.patch | 21 + msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD | 48 ++ msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD | 72 ++ .../do-not-use-dllimport.diff | 13 + .../20-mingw-w64-gmp/gmp-staticlib.diff | 25 + .../0027-decoding-segfault.patch | 31 + .../0029-xml2-config-win-paths.patch | 10 + .../0030-pkgconfig-add-Cflags-private.patch | 7 + .../0031-apply-msvc-relocation.patch | 39 ++ msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD | 127 ++++ .../libxml2-CLANG32.install | 12 + .../libxml2-CLANG64.install | 12 + .../libxml2-CLANGARM64.install | 12 + .../libxml2-MINGW32.install | 12 + .../libxml2-MINGW64.install | 12 + .../libxml2-UCRT64.install | 12 + .../30-mingw-w64-chromaprint/PKGBUILD | 64 ++ .../0002-fix-mkdir.mingw.patch | 12 + .../0004-fix-mkdtemp.mingw.patch | 216 ++++++ .../0005-fix-setenv.mingw.patch | 27 + .../0007-pkgconfig.mingw.patch | 22 + .../PKGBUILD/30-mingw-w64-fontconfig/PKGBUILD | 100 +++ .../fontconfig-CLANG32.install | 30 + .../fontconfig-CLANG64.install | 18 + .../fontconfig-CLANGARM64.install | 30 + .../fontconfig-MINGW32.install | 30 + .../fontconfig-MINGW64.install | 30 + .../fontconfig-UCRT64.install | 30 + .../fontconfig.hook.in | 14 + .../001-fix-build-with-chafa.patch | 13 + msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD | 106 +++ .../0002-07-field-width-fix.all.patch | 25 + .../30-mingw-w64-lame/0005-no-gtk.all.patch | 11 + .../0006-dont-use-outdated-symbol-list.patch | 10 + .../0007-revert-posix-code.patch | 76 +++ .../30-mingw-w64-lame/0008-skip-termcap.patch | 11 + .../0009-lame-add-pkgconfig.patch | 64 ++ msys2/PKGBUILD/30-mingw-w64-lame/PKGBUILD | 81 +++ .../PKGBUILD/30-mingw-w64-libbluray/PKGBUILD | 61 ++ msys2/PKGBUILD/30-mingw-w64-libogg/PKGBUILD | 65 ++ .../libogg-1.3.4-versioned-dll-cmake.patch | 58 ++ .../0001-enable-shared-on.mingw.patch | 168 +++++ ...003-cross-with-native-binutils.mingw.patch | 23 + .../0005-fix-exports.mingw.patch | 11 + msys2/PKGBUILD/30-mingw-w64-libvpx/PKGBUILD | 116 ++++ .../0001-mingw-cmake-output.patch | 11 + msys2/PKGBUILD/30-mingw-w64-libwebp/PKGBUILD | 76 +++ .../001-aarch64-features.patch | 35 + msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD | 85 +++ .../PKGBUILD/35-mingw-w64-libvorbis/PKGBUILD | 45 ++ .../40-mingw-w64-dav1d/0001-dll-version.patch | 11 + msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD | 70 ++ msys2/PKGBUILD/40-mingw-w64-fdk-aac/PKGBUILD | 53 ++ msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD | 63 ++ .../PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD | 61 ++ .../40-mingw-w64-libtheora/001-example.patch | 24 + .../PKGBUILD/40-mingw-w64-libtheora/PKGBUILD | 61 ++ .../40-mingw-w64-opencl-headers/PKGBUILD | 38 ++ msys2/PKGBUILD/40-mingw-w64-svt-av1/PKGBUILD | 58 ++ .../0001-beautify-pc.all.patch | 14 + .../0002-install-avisynth_c.h.mingw.patch | 13 + .../0003-pkgconfig-add-Cflags-private.patch | 10 + .../0004-dont-align-64byte-stack.patch | 19 + msys2/PKGBUILD/40-mingw-w64-x264/PKGBUILD | 84 +++ msys2/PKGBUILD/40-mingw-w64-x265/PKGBUILD | 119 ++++ .../0001-zimg-export-def-symbols.patch | 18 + msys2/PKGBUILD/40-mingw-w64-zimg/PKGBUILD | 53 ++ .../50-mingw-w64-amf-headers/PKGBUILD | 29 + .../50-mingw-w64-ffnvcodec-headers/PKGBUILD | 41 ++ .../0001-fix-pkgconfig-file.patch | 13 + .../0002-cmake-install-vars-sh.patch | 13 + .../0003-cmake-fix-32bit-install.patch | 11 + msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD | 84 +++ ...01-do-not-use-mingw32-def-on-clang32.patch | 11 + .../50-mingw-w64-opencl-icd/OpenCL.pc | 12 + .../PKGBUILD/50-mingw-w64-opencl-icd/PKGBUILD | 74 ++ msys2/build.sh | 113 +++ 104 files changed, 5887 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/_meta_win_clang_portable.yaml create mode 100644 msys2/PKGBUILD/10-mingw-w64-brotli/PKGBUILD create mode 100644 msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD create mode 100644 msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-1.0.6-progress.all.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-buildsystem.all.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-cygming-1.0.6.src.all.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-libiconv/0002-fix-cr-for-awk-in-configure.all.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-libiconv/0003-add-cp65001-as-utf8-alias.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-libiconv/0004-fix-makefile-devel-assuming-gcc.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD create mode 100644 msys2/PKGBUILD/10-mingw-w64-libiconv/fix-pointer-buf.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-libiconv/iconv.pc create mode 100644 msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD create mode 100644 msys2/PKGBUILD/10-mingw-w64-xz/PKGBUILD create mode 100644 msys2/PKGBUILD/10-mingw-w64-zlib/01-zlib-1.2.11-1-buildsys.mingw.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-zlib/03-dont-put-sodir-into-L.mingw.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-zlib/04-fix-largefile-support.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-zlib/07-Add-no-undefined-to-link-to-enable-build-shared-vers.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-zlib/08-Add-bzip2-library-to-pkg-config-file.patch create mode 100644 msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD create mode 100644 msys2/PKGBUILD/20-mingw-w64-fftw/0001-detect-arm64-counter.patch create mode 100644 msys2/PKGBUILD/20-mingw-w64-fftw/0002-no-dllexport.patch create mode 100644 msys2/PKGBUILD/20-mingw-w64-fftw/0003-shared-lib.patch create mode 100644 msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD create mode 100644 msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD create mode 100644 msys2/PKGBUILD/20-mingw-w64-freetype/freetype-2.10.0-enable-spr.patch create mode 100644 msys2/PKGBUILD/20-mingw-w64-freetype/freetype-2.10.0-enable-valid.patch create mode 100644 msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD create mode 100644 msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD create mode 100644 msys2/PKGBUILD/20-mingw-w64-gmp/do-not-use-dllimport.diff create mode 100644 msys2/PKGBUILD/20-mingw-w64-gmp/gmp-staticlib.diff create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/0027-decoding-segfault.patch create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/0029-xml2-config-win-paths.patch create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/0030-pkgconfig-add-Cflags-private.patch create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/0031-apply-msvc-relocation.patch create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANG32.install create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANG64.install create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANGARM64.install create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-MINGW32.install create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-MINGW64.install create mode 100644 msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-UCRT64.install create mode 100644 msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/0002-fix-mkdir.mingw.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/0004-fix-mkdtemp.mingw.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/0005-fix-setenv.mingw.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/0007-pkgconfig.mingw.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/PKGBUILD create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANG32.install create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANG64.install create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANGARM64.install create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-MINGW32.install create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-MINGW64.install create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-UCRT64.install create mode 100644 msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig.hook.in create mode 100644 msys2/PKGBUILD/30-mingw-w64-harfbuzz/001-fix-build-with-chafa.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD create mode 100644 msys2/PKGBUILD/30-mingw-w64-lame/0002-07-field-width-fix.all.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-lame/0005-no-gtk.all.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-lame/0006-dont-use-outdated-symbol-list.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-lame/0007-revert-posix-code.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-lame/0008-skip-termcap.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-lame/0009-lame-add-pkgconfig.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-lame/PKGBUILD create mode 100644 msys2/PKGBUILD/30-mingw-w64-libbluray/PKGBUILD create mode 100644 msys2/PKGBUILD/30-mingw-w64-libogg/PKGBUILD create mode 100644 msys2/PKGBUILD/30-mingw-w64-libogg/libogg-1.3.4-versioned-dll-cmake.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-libvpx/0001-enable-shared-on.mingw.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-libvpx/0003-cross-with-native-binutils.mingw.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-libvpx/0005-fix-exports.mingw.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-libvpx/PKGBUILD create mode 100644 msys2/PKGBUILD/30-mingw-w64-libwebp/0001-mingw-cmake-output.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-libwebp/PKGBUILD create mode 100644 msys2/PKGBUILD/30-mingw-w64-opus/001-aarch64-features.patch create mode 100644 msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD create mode 100644 msys2/PKGBUILD/35-mingw-w64-libvorbis/PKGBUILD create mode 100644 msys2/PKGBUILD/40-mingw-w64-dav1d/0001-dll-version.patch create mode 100644 msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD create mode 100644 msys2/PKGBUILD/40-mingw-w64-fdk-aac/PKGBUILD create mode 100644 msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD create mode 100644 msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD create mode 100644 msys2/PKGBUILD/40-mingw-w64-libtheora/001-example.patch create mode 100644 msys2/PKGBUILD/40-mingw-w64-libtheora/PKGBUILD create mode 100644 msys2/PKGBUILD/40-mingw-w64-opencl-headers/PKGBUILD create mode 100644 msys2/PKGBUILD/40-mingw-w64-svt-av1/PKGBUILD create mode 100644 msys2/PKGBUILD/40-mingw-w64-x264/0001-beautify-pc.all.patch create mode 100644 msys2/PKGBUILD/40-mingw-w64-x264/0002-install-avisynth_c.h.mingw.patch create mode 100644 msys2/PKGBUILD/40-mingw-w64-x264/0003-pkgconfig-add-Cflags-private.patch create mode 100644 msys2/PKGBUILD/40-mingw-w64-x264/0004-dont-align-64byte-stack.patch create mode 100644 msys2/PKGBUILD/40-mingw-w64-x264/PKGBUILD create mode 100644 msys2/PKGBUILD/40-mingw-w64-x265/PKGBUILD create mode 100644 msys2/PKGBUILD/40-mingw-w64-zimg/0001-zimg-export-def-symbols.patch create mode 100644 msys2/PKGBUILD/40-mingw-w64-zimg/PKGBUILD create mode 100644 msys2/PKGBUILD/50-mingw-w64-amf-headers/PKGBUILD create mode 100644 msys2/PKGBUILD/50-mingw-w64-ffnvcodec-headers/PKGBUILD create mode 100644 msys2/PKGBUILD/50-mingw-w64-libvpl/0001-fix-pkgconfig-file.patch create mode 100644 msys2/PKGBUILD/50-mingw-w64-libvpl/0002-cmake-install-vars-sh.patch create mode 100644 msys2/PKGBUILD/50-mingw-w64-libvpl/0003-cmake-fix-32bit-install.patch create mode 100644 msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD create mode 100644 msys2/PKGBUILD/50-mingw-w64-opencl-icd/001-do-not-use-mingw32-def-on-clang32.patch create mode 100644 msys2/PKGBUILD/50-mingw-w64-opencl-icd/OpenCL.pc create mode 100644 msys2/PKGBUILD/50-mingw-w64-opencl-icd/PKGBUILD create mode 100755 msys2/build.sh diff --git a/.github/workflows/_meta_win_clang_portable.yaml b/.github/workflows/_meta_win_clang_portable.yaml new file mode 100644 index 00000000000..011185f60f2 --- /dev/null +++ b/.github/workflows/_meta_win_clang_portable.yaml @@ -0,0 +1,126 @@ +on: + workflow_call: + inputs: + release: + required: false + default: false + type: boolean + secrets: + deploy-host: + required: false + deploy-user: + required: false + deploy-key: + required: false + +jobs: + build: + name: 'Build Portable FFmpeg' + runs-on: windows-latest + strategy: + fail-fast: true + matrix: + os: + - name: CLANG64 + arch: win64 + defaults: + run: + shell: msys2 {0} + steps: + - uses: msys2/setup-msys2@v2 + with: + update: true + msystem: CLANG64 + install: >- + git + curl + wget + mingw-w64-clang-x86_64-toolchain + quilt + diffstat + mingw-w64-clang-x86_64-nasm + + - run: git config --global core.autocrlf input # Disable autoclr for windows + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Prepare prefix dir + run: | + mkdir /clang64/ffbuild + + - name: Build Portable + run: ./msys2/build.sh + + - name: Upload Artifacts + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + with: + name: win-clang-${{ matrix.os.arch }}-portable + path: ./builder/artifacts + + publish: + name: Publish Portable Release + if: ${{ inputs.release }} + runs-on: ubuntu-latest + needs: + - build + strategy: + fail-fast: true + matrix: + arch: [win64] + + steps: + - name: Set Versions + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + id: set_version + with: + script: | + const tag = context.ref.substring(10) + const no_v = tag.replace('v', '') + const dash_index = no_v.lastIndexOf('-') + const major_index = no_v.indexOf('.') + const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v + const major = (major_index > -1) ? no_v.substring(0, major_index) : no_v + core.setOutput('tag', tag) + core.setOutput('no-v', no_v) + core.setOutput('no-dash', no_dash) + core.setOutput('major', major) + + - name: Download Artifacts + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: win-clang-${{ matrix.arch }}-portable + path: artifact + + - name: Upload GH Release Assets + uses: shogo82148/actions-upload-release-asset@8f032eff0255912cc9c8455797fd6d72f25c7ab7 # v1.7.5 + with: + upload_url: ${{ github.event.release.upload_url }} + overwrite: true + asset_path: | + ./artifact/**/*.zip + + - name: Upload release archive to repo.jellyfin.org + uses: appleboy/scp-action@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7 + with: + host: ${{ secrets.deploy-host }} + username: ${{ secrets.deploy-user }} + key: ${{ secrets.deploy-key }} + source: artifact/* + strip_components: 1 + target: /srv/incoming/ffmpeg/${{ steps.set_version.outputs.no-v }}/windows/${{ matrix.arch }} + + - name: Move incoming release into repository + uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3 + with: + host: ${{ secrets.deploy-host }} + username: ${{ secrets.deploy-user }} + key: ${{ secrets.deploy-key }} + envs: JELLYFIN_VERSION + script_stop: true + script: | + # Create the target folder and move arch directory into it + sudo mkdir -p /srv/repository/main/ffmpeg/windows/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }} + sudo mv -t /srv/repository/main/ffmpeg/windows/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }}/ /srv/incoming/ffmpeg/${{ steps.set_version.outputs.no-v }}/windows/${{ matrix.arch }}/* + sudo chown -R root:root /srv/repository/main/ffmpeg/windows/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }} + # Update symlink for latest-X.x + sudo rm -f /srv/repository/main/ffmpeg/windows/latest-${{ steps.set_version.outputs.major }}.x || true + sudo ln -s /srv/repository/main/ffmpeg/windows/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }} /srv/repository/main/ffmpeg/windows/latest-${{ steps.set_version.outputs.major }}.x || true diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c47600da6d2..824207fabd8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,37 +18,52 @@ on: - '**/*.md' jobs: - build_debian: - uses: ./.github/workflows/_meta.yaml - with: - distro: 'debian' - codenames: '["bullseye", "bookworm"]' - architectures: '["amd64", "arm64", "armhf"]' - release: false - - build_ubuntu: - uses: ./.github/workflows/_meta.yaml - with: - distro: 'ubuntu' - codenames: '["focal", "jammy", "noble"]' - architectures: '["amd64", "arm64", "armhf"]' - release: false +# build_debian: +# uses: ./.github/workflows/_meta.yaml +# with: +# distro: 'debian' +# codenames: '["bullseye", "bookworm"]' +# architectures: '["amd64", "arm64", "armhf"]' +# release: false +# +# build_ubuntu: +# uses: ./.github/workflows/_meta.yaml +# with: +# distro: 'ubuntu' +# codenames: '["focal", "jammy", "noble"]' +# architectures: '["amd64", "arm64", "armhf"]' +# release: false +# +# build_portable_windows: +# uses: ./.github/workflows/_meta_portable.yaml +# with: +# os: 'windows' +# architectures: '["win64"]' +# release: false build_portable_windows: - uses: ./.github/workflows/_meta_portable.yaml + strategy: + fail-fast: true + matrix: + cc: + - name: gcc + profile: _meta_portable + - name: clang + profile: _meta_win_clang_portable + uses: ./.github/workflows/${{ matrix.cc.profile }}.yaml with: os: 'windows' architectures: '["win64"]' release: false - - build_portable_linux: - uses: ./.github/workflows/_meta_portable.yaml - with: - os: 'linux' - architectures: '["amd64", "arm64"]' - release: false - - build_portable_mac: - uses: ./.github/workflows/_meta_mac_portable.yaml - with: - release: false +# +# build_portable_linux: +# uses: ./.github/workflows/_meta_portable.yaml +# with: +# os: 'linux' +# architectures: '["amd64", "arm64"]' +# release: false +# +# build_portable_mac: +# uses: ./.github/workflows/_meta_mac_portable.yaml +# with: +# release: false diff --git a/msys2/PKGBUILD/10-mingw-w64-brotli/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-brotli/PKGBUILD new file mode 100644 index 00000000000..7fe0b67a455 --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-brotli/PKGBUILD @@ -0,0 +1,84 @@ +# Maintainer: J. Peter Mugaas + +_realname=brotli +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}") +pkgver=1.1.0 +pkgrel=1 +pkgdesc="Brotli compression library (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url='https://github.com/google/brotli' +msys2_references=( + "pypi: brotli" + "cpe: cpe:/a:google:brotli" +) +makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-python-setuptools" + "${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-installer" + "${MINGW_PACKAGE_PREFIX}-python-wheel" +) +license=('spdx:MIT') +source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/google/brotli/archive/v${pkgver}.tar.gz") +sha256sums=('e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff') + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" +} + +build() { + cd "${srcdir}/${_realname}-${pkgver}" + + ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation + + declare -a extra_config + if check_option "debug" "n"; then + extra_config+=("-DCMAKE_BUILD_TYPE=Release") + else + extra_config+=("-DCMAKE_BUILD_TYPE=Debug") + fi + + mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static" + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + ${MINGW_PREFIX}/bin/cmake \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX}/ffbuild/ \ + "${extra_config[@]}" \ + -DBUILD_SHARED_LIBS=OFF \ + -DENABLE_STATIC=ON \ + -DBUILD_STATIC_LIBS=ON \ + ../${_realname}-${pkgver} + + ${MINGW_PREFIX}/bin/cmake --build . +} + +check() { + cd "${srcdir}"/build-${MSYSTEM}-static + ${MINGW_PREFIX}/bin/ctest . || warning "Tests failed" +} + +package_brotli() { + cd "${srcdir}"/build-${MSYSTEM}-static + DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install . + + install -D -m644 "${srcdir}"/brotli-${pkgver}/LICENSE "${pkgdir}${MINGW_PREFIX}/ffbuild/share/licenses/${_realname}/LICENSE" + + # Let ffmpeg also statically link to brotlicommon + sed -s "s|-lbrotlidec|-lbrotlidec\ -lbrotlicommon|g" -i "${pkgdir}"${MINGW_PREFIX}/ffbuild/lib/pkgconfig/libbrotlidec.pc + sed -s "s|-lbrotlidec|-lbrotlidec\ -lbrotlicommon|g" -i "${pkgdir}"${MINGW_PREFIX}/ffbuild/lib/pkgconfig/libbrotlienc.pc +} + +# template start; name=mingw-w64-splitpkg-wrappers; version=1.0; +# vim: set ft=bash : + +# generate wrappers +for _name in "${pkgname[@]}"; do + _short="package_${_name#${MINGW_PACKAGE_PREFIX}-jellyfin-}" + _func="$(declare -f "${_short}")" + eval "${_func/#${_short}/package_${_name}}" +done +# template end; diff --git a/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD new file mode 100644 index 00000000000..32788e66d9c --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD @@ -0,0 +1,71 @@ +# Maintainer: Alexey Pavlov +# Contributor: Renato Silva + +_realname=bzip2 +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=1.0.8 +pkgrel=3 +pkgdesc="A high-quality data compression program (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://sourceware.org/bzip2/" +msys2_references=( + "cpe: cpe:/a:bzip:bzip2" +) +license=("custom") +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-autotools") +options=('strip' 'staticlibs') +source=("https://sourceware.org/pub/bzip2/bzip2-${pkgver}.tar.gz" + "bzip2-cygming-1.0.6.src.all.patch" + "bzip2-buildsystem.all.patch" + "bzip2-1.0.6-progress.all.patch") +sha256sums=('ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269' + '7e67f77172b19f3e6c1f0875b1d3e9cb79211f8e1c752794ef9afd3704f928cf' + 'e519a50a4adaf05b18650d3e9d644badc66e80ca86063681ffe9a2c2226319d0' + 'f93e6b50082a8e880ee8436c7ec6a65a8f01e9282436af77f95bb259b1c7f7f7') + +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + # remove files that are created by patches. + rm -rf README.CYGMING | true + rm -rf aclocal.m4 | true + rm -rf configure.ac | true + rm -rf libbz2.def.in | true + rm -rf bzip2.pc.in | true + rm -rf Makefile.in | true + + patch -p1 -i "$srcdir/"bzip2-cygming-1.0.6.src.all.patch + patch -p1 -i "$srcdir/"bzip2-buildsystem.all.patch + patch -p1 -i "$srcdir/"bzip2-1.0.6-progress.all.patch + + autoreconf -fi +} + +build() { + mkdir -p "${srcdir}/build-${CARCH}" + cd "${srcdir}/build-${CARCH}" + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --disable-shared + + make all-libs +} + +check() { + cd "${srcdir}/build-${CARCH}" + make -k check +} + +package() { + cd "${srcdir}/build-${CARCH}" + make DESTDIR="${pkgdir}" install + # rm "${pkgdir}${MINGW_PREFIX}/bin/bz"{diff,grep,more} + install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +} diff --git a/msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-1.0.6-progress.all.patch b/msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-1.0.6-progress.all.patch new file mode 100644 index 00000000000..7691d63e27c --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-1.0.6-progress.all.patch @@ -0,0 +1,163 @@ +Ripped from Mandrake + +http://bugs.gentoo.org/82192 + +--- bzip2-1.0.6/bzip2.1 ++++ bzip2-1.0.6/bzip2.1 +@@ -235,6 +235,10 @@ + Suppress non-essential warning messages. Messages pertaining to + I/O errors and other critical events will not be suppressed. + .TP ++.B \-p \-\-show\-progress ++Show percentage of input\-file done and while compressing show the percentage ++of the original file the new file is. ++.TP + .B \-v --verbose + Verbose mode -- show the compression ratio for each file processed. + Further \-v's increase the verbosity level, spewing out lots of +--- bzip2-1.0.6/bzip2.c ++++ bzip2-1.0.6/bzip2.c +@@ -145,6 +145,7 @@ + #include + #include + #include ++#include + #include + #include "bzlib.h" + +@@ -301,6 +302,7 @@ + Char progNameReally[FILE_NAME_LEN]; + FILE *outputHandleJustInCase; + Int32 workFactor; ++Char showProgress; + + static void panic ( Char* ) NORETURN; + static void ioError ( void ) NORETURN; +@@ -425,6 +427,12 @@ + UInt32 nbytes_in_lo32, nbytes_in_hi32; + UInt32 nbytes_out_lo32, nbytes_out_hi32; + Int32 bzerr, bzerr_dummy, ret; ++ double fileSize = 0; /* initialized to make the compiler stop crying */ ++ /* double because big files might otherwhise give ++ * overflows. not long long since not all compilers ++ * support that one ++ */ ++ time_t startTime, currentTime; + + SET_BINARY_MODE(stream); + SET_BINARY_MODE(zStream); +@@ -432,12 +440,21 @@ + if (ferror(stream)) goto errhandler_io; + if (ferror(zStream)) goto errhandler_io; + ++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) { ++ (void)fseek(stream, 0, SEEK_END); ++ fileSize = ftello(stream); ++ rewind(stream); ++ if (verbosity >= 1) ++ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize); ++ } ++ + bzf = BZ2_bzWriteOpen ( &bzerr, zStream, + blockSize100k, verbosity, workFactor ); + if (bzerr != BZ_OK) goto errhandler; + + if (verbosity >= 2) fprintf ( stderr, "\n" ); + ++ time(&startTime); + while (True) { + + if (myfeof(stream)) break; +@@ -446,6 +463,22 @@ + if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf ); + if (bzerr != BZ_OK) goto errhandler; + ++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) { ++ time(¤tTime); ++ ++ if ((currentTime - startTime) > 1) { /* show progress every 2 seconds */ ++ double curInPos = ftello(stream); ++ double curOutPos = ftello(zStream); ++ ++ startTime = currentTime; ++ ++ fprintf(stderr, "%.2f%% done", (curInPos * 100.0) / fileSize); ++ if (srcMode == SM_F2F) ++ fprintf(stderr, ", new size: %.2f%%", (curOutPos * 100.0) / curInPos); ++ ++ fprintf(stderr, " \r"); ++ } ++ } + } + + BZ2_bzWriteClose64 ( &bzerr, bzf, 0, +@@ -526,6 +559,8 @@ + UChar unused[BZ_MAX_UNUSED]; + Int32 nUnused; + UChar* unusedTmp; ++ double fileSize = 0; /* initialized to make the compiler stop crying */ ++ time_t startTime, currentTime; + + nUnused = 0; + streamNo = 0; +@@ -533,9 +568,19 @@ + SET_BINARY_MODE(stream); + SET_BINARY_MODE(zStream); + ++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) { ++ off_t dummy = ftello(zStream); ++ (void)fseeko(zStream, 0, SEEK_END); ++ fileSize = ftello(zStream); ++ (void)fseeko(zStream, dummy, SEEK_SET); ++ if (verbosity >= 1) ++ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize); ++ } ++ + if (ferror(stream)) goto errhandler_io; + if (ferror(zStream)) goto errhandler_io; + ++ time(&startTime); + while (True) { + + bzf = BZ2_bzReadOpen ( +@@ -551,6 +596,16 @@ + if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0) + fwrite ( obuf, sizeof(UChar), nread, stream ); + if (ferror(stream)) goto errhandler_io; ++ ++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) { ++ time(¤tTime); ++ if ((currentTime - startTime) >= 2) { ++ double curInPos = ftello(zStream); ++ startTime = currentTime; ++ ++ fprintf(stderr, "%.2f%% done\r", (curInPos * 100.0) / fileSize); ++ } ++ } + } + if (bzerr != BZ_STREAM_END) goto errhandler; + +@@ -1872,6 +1927,7 @@ + deleteOutputOnInterrupt = False; + exitValue = 0; + i = j = 0; /* avoid bogus warning from egcs-1.1.X */ ++ showProgress = False; + + /*-- Set up signal handlers for mem access errors --*/ + signal (SIGSEGV, mySIGSEGVorSIGBUScatcher); +@@ -1949,6 +2005,7 @@ + case 'k': keepInputFiles = True; break; + case 's': smallMode = True; break; + case 'q': noisy = False; break; ++ case 'p': showProgress = True; break; + case '1': blockSize100k = 1; break; + case '2': blockSize100k = 2; break; + case '3': blockSize100k = 3; break; +@@ -1985,6 +2042,7 @@ + if (ISFLAG("--keep")) keepInputFiles = True; else + if (ISFLAG("--small")) smallMode = True; else + if (ISFLAG("--quiet")) noisy = False; else ++ if (ISFLAG("--show-progress")) showProgress = True; else + if (ISFLAG("--version")) license(); else + if (ISFLAG("--license")) license(); else + if (ISFLAG("--exponential")) workFactor = 1; else diff --git a/msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-buildsystem.all.patch b/msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-buildsystem.all.patch new file mode 100644 index 00000000000..18f18912946 --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-buildsystem.all.patch @@ -0,0 +1,645 @@ +--- bzip2-1.0.6/Makefile.in 1970-01-01 04:00:00 +0400 ++++ bzip2-1.0.6/Makefile.in 2011-05-21 23:10:44 +0400 +@@ -0,0 +1,386 @@ ++# @configure_input@ ++# ------------------------------------------------------------------ ++# This file is part of bzip2/libbzip2, a program and library for ++# lossless, block-sorting data compression. ++# ++# bzip2/libbzip2 version 1.0.6 of 6 September 2010 ++# Copyright (C) 1996-2010 Julian Seward ++# ++# File: Makefile.in for autoconf configuration ++# Contributed by Keith Marshall ++# ++# Please read the WARNING, DISCLAIMER and PATENTS sections in the ++# README file. ++# ++# This program is released under the terms of the license contained ++# in the file LICENSE. ++# ------------------------------------------------------------------ ++ ++PACKAGE = @PACKAGE_TARNAME@ ++VERSION = @PACKAGE_VERSION@ ++ ++# If building libbz2 as a shared library, we use these version tags, ++SO_VER = 1 ++SO_AGE = 0 ++SO_REV = 6 ++# ++# This yields a shared object library name below, following the ++# normal naming rules -- most linux distributions patch Julian's ++# original makefile to do something similar. ++# ++SO_MAJOR := $(shell expr $(SO_VER) - $(SO_AGE)) ++SONAME = libbz2.so.$(SO_MAJOR) ++SOFULL = $(SONAME).$(SO_AGE).$(SO_REV) ++ ++# For MS-Windows hosts, Julian's original build strategy, (and that ++# still adopted for building with MSVC), creates an unversioned DLL, ++# exporting functions using the __stdcall (WINAPI) calling convention. ++# Conversly, MinGW developers have chosen to sanitise the libbz2 ABI, ++# avoiding the use of the __stdcall calling convention, in favour of ++# the more GNU/Linux-alike __cdecl convention. ++# ++# To permit MinGW builds of libbz2.dll to co-exist, in the developer ++# universe, with MSVC builds, the MinGW Project has specified a scheme ++# for distribution of versioned DLLs, unambiguously named libbz2-N.dll, ++# where N is an ABI version number, nominally computed as: ++# ++# SO_VER - SO_AGE (ignoring SO_REV) ++# ++# Unfortunately, at an early stage in the evolution of the MinGW ++# versioned libbz2-N.dll, at a time when this version paradigm would ++# have yielded N = 1, a libbz2-1.dll was released, which employed the ++# __stdcall calling convention. Thus, to avoid potential confusion ++# with this early release, and specific to the case of libbz2-N.dll, ++# the DLLVER for the __cdecl releases, as computed by the configure ++# script will lead the nominal value by one, becoming effectively: ++# ++# 1 + SO_VER - SO_AGE ++# ++# Note that for cygwin, a similar scheme (SO_VER - SO_AGE) is used, ++# but on that platform the extra +1 is not needed. ++DLLVER = @DLLVER@ ++DLLNAME = @DLLNAME@ ++LIBNAME = libbz2 ++ ++ ++# Shell used by make... ++# ++SHELL = @SHELL@ ++ ++# Where to find the sources... ++# ++VPATH = ${srcdir} ++srcdir = @srcdir@ ++ ++# To assist in cross-compiling... ++# ++CC = @CC@ ++AR = @AR@ ++RANLIB = @RANLIB@ ++LN_S = @LN_S@ ++ ++OBJEXT = @OBJEXT@ ++EXEEXT = @EXEEXT@ ++ ++BIGFILES = -D_FILE_OFFSET_BITS=64 ++CFLAGS = @CFLAGS@ $(BIGFILES) ++LDFLAGS = @LDFLAGS@ ++ARFLAGS = @ARFLAGS@ ++ ++# Where you want it installed when you do 'make install' ++# ++PREFIX = @prefix@ ++ ++OBJS= blocksort.$(OBJEXT) \ ++ huffman.$(OBJEXT) \ ++ crctable.$(OBJEXT) \ ++ randtable.$(OBJEXT) \ ++ compress.$(OBJEXT) \ ++ decompress.$(OBJEXT) \ ++ bzlib.$(OBJEXT) ++ ++# Default build goals... ++# ++all: all-libs bzip2$(EXEEXT) bzip2recover$(EXEEXT) ++all-libs: libbz2.a @enable_shared@ ++ ++bzip2$(EXEEXT): libbz2.a bzip2.$(OBJEXT) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ bzip2.$(OBJEXT) -L. -lbz2 ++ ++bzip2recover$(EXEEXT): bzip2recover.$(OBJEXT) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ ++ ++libbz2.a: $(OBJS) ++ rm -f $@ ++ $(AR) $(ARFLAGS) $@ $(OBJS) ++ $(RANLIB) $@ ++ ++blocksort.$(OBJEXT): blocksort.c ++ @cat ${srcdir}/words0 ++ $(CC) $(CFLAGS) -c -o $@ $^ ++ ++%.$(OBJEXT): %.c ++ $(CC) $(CFLAGS) -c -o$@ $< ++ ++# Building using a shared library, for dynamic linking on GNU/Linux... ++# (Invoked when configured with `--enable-shared' for a non-Win32 host). ++# ++# This is incorporated from Julian's original Makefile-libbz2_so. ++# It is reported to work successfully on x86-Linux (Red Hat 7.2), with ++# gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98); YMMV. ++# ++# Please refer to README, for important information regarding building ++# libbz2 as a shared library, in this manner. ++# ++PICFLAGS = -fpic -fPIC -Wall -Winline $(CFLAGS) ++ ++all-bzip2-shared: bzip2-shared$(EXEEXT) ++bzip2-shared$(EXEEXT): bzip2.c $(SOFULL) ++ $(CC) $(PICFLAGS) -o $@ $^ ++ ++$(SOFULL): $(OBJS:.$(OBJEXT)=-pic.$(OBJEXT)) ++ $(CC) -shared -Wl,-soname -Wl,$(SONAME) -o $@ $^ ++ rm -f $(SONAME); $(LN_S) $@ $(SONAME) ++ rm -f $(SONAME).$(SO_AGE); $(LN_S) $@ $(SONAME).$(SO_AGE) ++ ++%-pic.$(OBJEXT): %.c ++ $(CC) $(PICFLAGS) -c -o $@ $< ++ ++# Building using a shared library, for dynamic linking on MS-Windows ++# and cygwin... ++# (Invoked when configured with `--enable-shared' for a Win32/cygwin host) ++ ++all-dll-shared: $(LIBNAME).dll.a ++ ++$(LIBNAME).dll.a: $(DLLNAME)-$(DLLVER).dll ++ ++$(DLLNAME)-$(DLLVER).dll: libbz2.def $(OBJS) ++ $(CC) -shared -o $@ $(LDFLAGS) -Wl,--out-implib=$(LIBNAME).dll.a $(OBJS) ++ ++libbz2.def: libbz2.def.in ++ sed -e s,%DLLNAME%,$(DLLNAME), -e s,%DLLVER%,$(DLLVER), $^ > $@ ++ ++# Build validation... ++# ++check: test ++test: bzip2$(EXEEXT) ++ @cat ${srcdir}/words1 ++ ./bzip2$(EXEEXT) -1 < ${srcdir}/sample1.ref > sample1.rb2 ++ ./bzip2$(EXEEXT) -2 < ${srcdir}/sample2.ref > sample2.rb2 ++ ./bzip2$(EXEEXT) -3 < ${srcdir}/sample3.ref > sample3.rb2 ++ ./bzip2$(EXEEXT) -d < ${srcdir}/sample1.bz2 > sample1.tst ++ ./bzip2$(EXEEXT) -d < ${srcdir}/sample2.bz2 > sample2.tst ++ ./bzip2$(EXEEXT) -ds < ${srcdir}/sample3.bz2 > sample3.tst ++ cmp ${srcdir}/sample1.bz2 sample1.rb2 ++ cmp ${srcdir}/sample2.bz2 sample2.rb2 ++ cmp ${srcdir}/sample3.bz2 sample3.rb2 ++ cmp sample1.tst ${srcdir}/sample1.ref ++ cmp sample2.tst ${srcdir}/sample2.ref ++ cmp sample3.tst ${srcdir}/sample3.ref ++ @cat ${srcdir}/words3 ++ ++# GNU Standard Specifications for Installation Directories... ++# ++prefix = $(PREFIX) ++exec_prefix = @exec_prefix@ ++ ++bindir = @bindir@ ++datarootdir = @datarootdir@ ++includedir = @includedir@ ++libdir = @libdir@ ++ ++# `man' Documentation Hierarchy, in Terms of GNU Standards... ++# ++# FIXME: Julian's original distribution wasn't fully compliant ++# with current GNU Standards; to achieve compliance, we must use ++# this autotool standard definition: ++# ++# mandir = @mandir@ ++# ++# in place of: ++# ++# mandir = $(PREFIX)/man ++# ++# which preserves Julian's original configuration. ++# ++mandir = $(PREFIX)/share/man ++man1dir = ${mandir}/man1 ++ ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA = bzip2.pc ++ ++# Installation... ++# ++FORCE: ++${bindir} ${includedir} ${libdir} ${man1dir} ${pkgconfigdir}: FORCE ++ test -d ${DESTDIR}$@ || mkdir -p ${DESTDIR}$@ ++ ++install: all ${bindir} ${includedir} ${libdir} ${man1dir} ${pkgconfigdir} ++ cp -f ${pkgconfig_DATA} ${DESTDIR}${pkgconfigdir}/${pkgconfig_DATA} ++ cp -f bzip2$(EXEEXT) ${DESTDIR}${bindir}/bzip2$(EXEEXT) ++ cp -f bzip2$(EXEEXT) ${DESTDIR}${bindir}/bunzip2$(EXEEXT) ++ cp -f bzip2$(EXEEXT) ${DESTDIR}${bindir}/bzcat$(EXEEXT) ++ cp -f bzip2recover$(EXEEXT) ${DESTDIR}${bindir}/bzip2recover$(EXEEXT) ++ if test -f $(DLLNAME)-$(DLLVER).dll; \ ++ then \ ++ cp -f $(DLLNAME)-$(DLLVER).dll ${DESTDIR}${bindir}/$(DLLNAME)-$(DLLVER).dll; \ ++ chmod a+rx ${DESTDIR}${bindir}/$(DLLNAME)-$(DLLVER).dll; \ ++ fi ++ chmod a+x ${DESTDIR}${bindir}/bzip2$(EXEEXT) ++ chmod a+x ${DESTDIR}${bindir}/bunzip2$(EXEEXT) ++ chmod a+x ${DESTDIR}${bindir}/bzcat$(EXEEXT) ++ chmod a+x ${DESTDIR}${bindir}/bzip2recover$(EXEEXT) ++ cp -f ${srcdir}/bzlib.h ${DESTDIR}${includedir} ++ chmod a+r ${DESTDIR}${includedir}/bzlib.h ++ cp -f libbz2.a ${DESTDIR}${libdir} ++ if test -f $(LIBNAME).dll.a; \ ++ then \ ++ cp -f $(LIBNAME).dll.a ${DESTDIR}${libdir}/$(LIBNAME).dll.a; \ ++ chmod a+r ${DESTDIR}${libdir}/$(LIBNAME).dll.a; \ ++ fi ++ chmod a+r ${DESTDIR}${libdir}/libbz2.a ++ if test -f $(SOFULL); \ ++ then \ ++ cp -f $(SOFULL) ${DESTDIR}${libdir}; \ ++ cd ${DESTDIR}${libdir}; rm -f $(SO_NAME).$(SO_AGE) $(SONAME); \ ++ $(LN_S) $(SOFULL) $(SONAME).$(SO_AGE); \ ++ $(LN_S) $(SOFULL) $(SONAME); \ ++ chmod a+r $(SOFULL); \ ++ fi ++ cp -f ${srcdir}/bzgrep ${DESTDIR}${bindir}/bzgrep ++ cd ${DESTDIR}${bindir}; $(LN_S) -f bzgrep bzegrep ++ cd ${DESTDIR}${bindir}; $(LN_S) -f bzgrep bzfgrep ++ chmod a+x ${DESTDIR}${bindir}/bzgrep ++ cp -f ${srcdir}/bzmore ${DESTDIR}${bindir}/bzmore ++ cd ${DESTDIR}${bindir}; $(LN_S) -f bzmore bzless ++ chmod a+x ${DESTDIR}${bindir}/bzmore ++ cp -f ${srcdir}/bzdiff ${DESTDIR}${bindir}/bzdiff ++ cd ${DESTDIR}${bindir}; $(LN_S) -f bzdiff bzcmp ++ chmod a+x ${DESTDIR}${bindir}/bzdiff ++ cd ${srcdir}; cp -f bzip2.1 bzgrep.1 bzmore.1 bzdiff.1 ${DESTDIR}${man1dir} ++ chmod a+r ${DESTDIR}${man1dir}/bzip2.1 ++ chmod a+r ${DESTDIR}${man1dir}/bzgrep.1 ++ chmod a+r ${DESTDIR}${man1dir}/bzmore.1 ++ chmod a+r ${DESTDIR}${man1dir}/bzdiff.1 ++ echo ".so man1/bzgrep.1" > ${DESTDIR}${man1dir}/bzegrep.1 ++ echo ".so man1/bzgrep.1" > ${DESTDIR}${man1dir}/bzfgrep.1 ++ echo ".so man1/bzmore.1" > ${DESTDIR}${man1dir}/bzless.1 ++ echo ".so man1/bzdiff.1" > ${DESTDIR}${man1dir}/bzcmp.1 ++ ++ldconfig: ++ ldconfig -n ${DESTDIR}${libdir} ++ ++# Housekeeping... ++# ++clean: ++ cmp > /dev/null 2>&1 ${srcdir}/libbz2.def libbz2.def \ ++ || rm -f libbz2.def ++ rm -f *.$(OBJEXT) libbz2*.a $(DLLNAME)*.dll \ ++ bzip2$(EXEEXT) bzip2recover$(EXEEXT) \ ++ sample1.rb2 sample2.rb2 sample3.rb2 \ ++ sample1.tst sample2.tst sample3.tst ++ ++distclean: clean ++ rm -f config.status config.log Makefile ++ ++# NOTE: Julian's original Makefile had these in `distclean'. ++# Since they are `distributables', that might have surprised ++# users expecting GNU standard behaviour; they rightfully ++# belong in `maintainer-clean'. ++# ++maintainer-clean: clean ++ rm -f manual.ps manual.html manual.pdf ++ ++# Distribution... ++# ++DISTNAME = $(PACKAGE)-$(VERSION) ++# ++# FIXME: this method of creating a source distribution works fine ++# on systems which fully support symbolic links between directories; ++# it cannot be used reliably, on MS-Windows hosts running MSYS. ++# ++dist: manual ++ rm -f $(DISTNAME) $(DISTNAME)$(SNAPSHOT).* ++ $(LN_S) -f ${srcdir} $(DISTNAME) ++ tar cvf $(DISTNAME)$(SNAPSHOT).tar \ ++ $(DISTNAME)/aclocal.m4 \ ++ $(DISTNAME)/configure \ ++ $(DISTNAME)/configure.ac \ ++ $(DISTNAME)/Makefile.in \ ++ $(DISTNAME)/blocksort.c \ ++ $(DISTNAME)/huffman.c \ ++ $(DISTNAME)/crctable.c \ ++ $(DISTNAME)/randtable.c \ ++ $(DISTNAME)/compress.c \ ++ $(DISTNAME)/decompress.c \ ++ $(DISTNAME)/bzlib.c \ ++ $(DISTNAME)/bzip2.c \ ++ $(DISTNAME)/bzip2recover.c \ ++ $(DISTNAME)/bzlib.h \ ++ $(DISTNAME)/bzlib_private.h \ ++ $(DISTNAME)/LICENSE \ ++ $(DISTNAME)/bzip2.1 \ ++ $(DISTNAME)/bzip2.1.preformatted \ ++ $(DISTNAME)/bzip2.pc.in \ ++ $(DISTNAME)/bzip2.txt \ ++ $(DISTNAME)/words0 \ ++ $(DISTNAME)/words1 \ ++ $(DISTNAME)/words2 \ ++ $(DISTNAME)/words3 \ ++ $(DISTNAME)/sample1.ref \ ++ $(DISTNAME)/sample2.ref \ ++ $(DISTNAME)/sample3.ref \ ++ $(DISTNAME)/sample1.bz2 \ ++ $(DISTNAME)/sample2.bz2 \ ++ $(DISTNAME)/sample3.bz2 \ ++ $(DISTNAME)/dlltest.c \ ++ $(DISTNAME)/manual.html \ ++ $(DISTNAME)/manual.pdf \ ++ $(DISTNAME)/manual.ps \ ++ $(DISTNAME)/README \ ++ $(DISTNAME)/README.COMPILATION.PROBLEMS \ ++ $(DISTNAME)/README.XML.STUFF \ ++ $(DISTNAME)/CHANGES \ ++ $(DISTNAME)/libbz2.def \ ++ $(DISTNAME)/libbz2.def.in \ ++ $(DISTNAME)/libbz2.dsp \ ++ $(DISTNAME)/dlltest.dsp \ ++ $(DISTNAME)/makefile.msc \ ++ $(DISTNAME)/unzcrash.c \ ++ $(DISTNAME)/spewG.c \ ++ $(DISTNAME)/mk251.c \ ++ $(DISTNAME)/bzdiff \ ++ $(DISTNAME)/bzdiff.1 \ ++ $(DISTNAME)/bzmore \ ++ $(DISTNAME)/bzmore.1 \ ++ $(DISTNAME)/bzgrep \ ++ $(DISTNAME)/bzgrep.1 \ ++ $(DISTNAME)/Makefile-libbz2_so \ ++ $(DISTNAME)/bz-common.xsl \ ++ $(DISTNAME)/bz-fo.xsl \ ++ $(DISTNAME)/bz-html.xsl \ ++ $(DISTNAME)/bzip.css \ ++ $(DISTNAME)/entities.xml \ ++ $(DISTNAME)/manual.xml \ ++ $(DISTNAME)/format.pl \ ++ $(DISTNAME)/xmlproc.sh ++ gzip -v $(DISTNAME)$(SNAPSHOT).tar ++ rm -f $(DISTNAME) ++ ++# For rebuilding the manual from sources on Julian's SuSE 9.1 box ++# ++MANUAL_SRCS = bz-common.xsl bz-fo.xsl bz-html.xsl bzip.css \ ++ entities.xml manual.xml ++ ++manual: manual.html manual.ps manual.pdf ++ ++manual.ps: $(MANUAL_SRCS) ++ ${srcdir}/xmlproc.sh -ps manual.xml ++ ++manual.pdf: $(MANUAL_SRCS) ++ ${srcdir}/xmlproc.sh -pdf manual.xml ++ ++manual.html: $(MANUAL_SRCS) ++ ${srcdir}/xmlproc.sh -html manual.xml ++ ++# Makefile: end of file +--- bzip2-1.0.6/README.CYGMING 1970-01-01 04:00:00 +0400 ++++ bzip2-1.0.6/README.CYGMING 2011-09-02 05:22:32 +0400 +@@ -0,0 +1,49 @@ ++This distribution was built using an alternate build system. The original ++distribution used a simple Makefile, which had to be heavily customized to ++meet the needs of modern cygwin and MinGW systems. Furthermore, it was ++wholly unsuited for building the distribution in a cross-hosted environment. ++ ++Keith Marshall implemented an autoconf-based ++build system, to facilitate cross-hosted building for use with MinGW. This ++build system consists of the following original files: ++ configure.ac ++ Makefile.in ++ aclocal.m4 ++ libbz2.def.in ++found in the 'cygming-autotools-buildfiles.tar.gz' tarball included within ++the bzip2-$VER-$REL-mingw-src tarball. ++ ++The source preparation phase of the build runs autoconf, which creates the ++following file(s): ++ configure ++In addition, the source preparation phase explicitly removes the original ++Makefile from the $srcdir, as a new Makefile will be generated in the ++$builddir by the configure phase of the build. ++ ++This configure script is NOT distributed in this package; it is assumed that ++the 'autoconf' tool is available. The proper (non-automated) procedure is: ++ ++ unpack bzip2-$VER-$REL-mingw-src.tar.gz ++ ++This will create a number of new files, included several additional ++tarballs and patches. ++ ++ unpack the upstream source tarball bzip2-$VER.tar.gz ++ unpack the extra 'cygming-autotools-buildfiles.tar.gz' tarball ++ cd bzip2-$VER ++ autoconf ++ mkdir ../build ++ cd ../build ++ ../bzip2-$VER/configure [various options] ++ make ++ ++However, the automated procedure, which can be used to exactly reproduce ++the official mingw package, is: ++ ++ mgwport bzip2-${VER}-${REL}.mgwport all ++ ++which performs all of the above steps, as well as applying various additional ++patches (from Debian and elsewhere), installing into a local staging area, ++and generating the mingw-get compatible installation packages. See ++MINGW-PATCHES/bzip2.README for more information. ++ +--- bzip2-1.0.6/aclocal.m4 1970-01-01 04:00:00 +0400 ++++ bzip2-1.0.6/aclocal.m4 2011-05-21 22:21:23 +0400 +@@ -0,0 +1,115 @@ ++# aclocal.m4 -*- Autoconf -*- vim: filetype=config ++# ------------------------------------------------------------------ ++# This file is part of bzip2/libbzip2, a program and library for ++# lossless, block-sorting data compression. ++# ++# bzip2/libbzip2 version 1.0.5 of 10 December 2007 ++# Copyright (C) 1996-2007 Julian Seward ++# ++# File: aclocal.m4 for autoconf configuration ++# Contributed by Keith Marshall ++# ++# Please read the WARNING, DISCLAIMER and PATENTS sections in the ++# README file. ++# ++# This program is released under the terms of the license contained ++# in the file LICENSE. ++# ------------------------------------------------------------------ ++ ++# BZIP2_AC_WINDOWS_HOST ++# --------------------- ++# Check if the runtime platform is a native MS-Windows host. ++# FIXME: is checking _WIN64 an appropriate choice, for 64-bit Windows? ++# Because we only need to know whether the host is (native) win32 ++# or not, we can avoid the expensive AC_CANONICAL_HOST checks. ++# ++AC_DEFUN([BZIP2_AC_WINDOWS_HOST], ++[AC_CACHE_CHECK([whether we are building for an MS-Windows host], ++ [bzip2_cv_windows_host], ++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ ++@%:@if defined _WIN32 || defined _WIN64 ++ choke me ++@%:@endif]])], ++[bzip2_cv_windows_host=no], [bzip2_cv_windows_host=yes]))dnl ++])# BZIP2_AC_WINDOWS_HOST ++ ++# BZIP2_AC_CYGWIN_HOST ++# --------------------- ++# Check if the runtime platform is a cygwin host. ++# Because we only need to know whether the host is cygwin ++# or not, we can avoid the expensive AC_CANONICAL_HOST checks. ++# ++AC_DEFUN([BZIP2_AC_CYGWIN_HOST], ++[AC_CACHE_CHECK([whether we are building for a cygwin host], ++ [bzip2_cv_cygwin_host], ++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ ++@%:@if defined __CYGWIN__ ++ choke me ++@%:@endif]])], ++[bzip2_cv_cygwin_host=no], [bzip2_cv_cygwin_host=yes]))dnl ++])# BZIP2_AC_CYGWIN_HOST ++ ++# BZIP2_AC_ENABLE_SHARED ++# ---------------------- ++# Check if the user is configuring with `--enable-shared'; ++# if yes, activate shared library build support as appropriate, ++# for the host on which this build is to be deployed. ++# ++AC_DEFUN([BZIP2_AC_ENABLE_SHARED], ++[AC_REQUIRE([BZIP2_AC_WINDOWS_HOST])dnl ++ AC_REQUIRE([BZIP2_AC_CYGWIN_HOST])dnl ++ AC_MSG_CHECKING([for make goal to build shared libraries]) ++ AC_ARG_ENABLE([shared], ++ [AS_HELP_STRING([--enable-shared], ++ [enable building as a shared library @<:@default=no@:>@])], ++ [if test "x$enable_shared" = xyes ++ then ++ if test "x${bzip2_cv_windows_host}" = xyes || ++ test "x${bzip2_cv_cygwin_host}" = xyes ++ then ++ enable_shared="all-dll-shared" ++ else ++ enable_shared="all-bzip2-shared" ++ fi ++ else ++ enable_shared="none" ++ fi ++ ], [enable_shared="none"])dnl ++ AC_MSG_RESULT([${enable_shared}]) ++ [test "x$enable_shared" = xnone && enable_shared=""] ++ AC_SUBST([enable_shared])dnl ++])# BZIP2_AC_ENABLE_SHARED ++ ++# BZIP2_AC_SUBST_DLLVER ++# --------------------- ++# Establish the ABI version number for MS-Windows shared libraries; ++# this is derived from the universal SO_VER and SO_AGE properties, as ++# specified in `Makefile.in'; (nominally, it is SO_VER - SO_AGE, but ++# see the note in `Makefile.in', explaining why, in this instance, ++# we use one more than that nominal value for $host = mingw32) ++# ++AC_DEFUN([BZIP2_AC_SUBST_DLLVER], ++[AC_REQUIRE([BZIP2_AC_WINDOWS_HOST])dnl ++ AC_MSG_CHECKING([for API version of DLL shared libraries]) ++ [SO_VER=`FS=' ';sed -n "/^[$FS]*SO_VER[$FS]*=[$FS]*/s///p" ${srcdir}/Makefile.in`] ++ [SO_AGE=`FS=' ';sed -n "/^[$FS]*SO_AGE[$FS]*=[$FS]*/s///p" ${srcdir}/Makefile.in`] ++ [dllver=`expr ${SO_VER} - ${SO_AGE}` ++ test "x$bzip2_cv_windows_host" = xyes && dllver=`expr ${SO_VER} - ${SO_AGE}`] ++ AC_SUBST([DLLVER], [${dllver}]) ++ AC_MSG_RESULT([${dllver}])dnl ++])# BZIP2_AC_SUBST_DLLVER ++ ++# BZIP2_AC_SUBST_DLLNAME ++# ---------------------- ++# Establish the base name MS-Windows or cygwin shared libraries; ++# ++AC_DEFUN([BZIP2_AC_SUBST_DLLNAME], ++[AC_REQUIRE([BZIP2_AC_WINDOWS_HOST])dnl ++ AC_MSG_CHECKING([for base name of DLL shared libraries]) ++ [dllname=cygbz2 ++ test "x$bzip2_cv_windows_host" = xyes && dllname=libbz2] ++ AC_SUBST([DLLNAME], [${dllname}]) ++ AC_MSG_RESULT([${dllname}])dnl ++])# BZIP2_AC_SUBST_DLLNAME ++ ++# aclocal.m4: end of file +--- bzip2-1.0.6/configure.ac 1970-01-01 04:00:00 +0400 ++++ bzip2-1.0.6/configure.ac 2011-05-21 08:35:18 +0400 +@@ -0,0 +1,39 @@ ++AC_INIT([bzip2],[1.0.6]) ++# ------------------------------------------------------------------ ++# This file is part of bzip2/libbzip2, a program and library for ++# lossless, block-sorting data compression. ++# ++# bzip2/libbzip2 version 1.0.6 of 6 September 2010 ++# Copyright (C) 1996-2010 Julian Seward ++# ++# File: configure.ac for autoconf configuration ++# Contributed by Keith Marshall ++# ++# Please read the WARNING, DISCLAIMER and PATENTS sections in the ++# README file. ++# ++# This program is released under the terms of the license contained ++# in the file LICENSE. ++# ------------------------------------------------------------------ ++AC_PROG_CC ++AC_PROG_LN_S ++ ++BZIP2_AC_ENABLE_SHARED ++BZIP2_AC_SUBST_DLLVER ++BZIP2_AC_SUBST_DLLNAME ++ ++AC_ARG_VAR([AR],[Archive librarian command]) ++AC_ARG_VAR([ARFLAGS],[Archive librarian control flags, e.g. cq]) ++AC_ARG_VAR([RANLIB],[Archive library indexing command]) ++ ++AC_CHECK_TOOL([AR],[ar],[ar]) ++AC_CHECK_TOOL([RANLIB],[ranlib],[true]) ++ ++AC_MSG_CHECKING([for flags to pass to ${AR}]) ++AC_SUBST([ARFLAGS],[${ARFLAGS-cq}]) ++AC_MSG_RESULT([${ARFLAGS}]) ++ ++AC_CONFIG_FILES([Makefile bzip2.pc]) ++AC_OUTPUT ++ ++# configure.ac: end of file +--- bzip2-1.0.6/libbz2.def.in 1970-01-01 04:00:00 +0400 ++++ bzip2-1.0.6/libbz2.def.in 2011-05-21 08:35:45 +0400 +@@ -0,0 +1,27 @@ ++LIBRARY %DLLNAME%-%DLLVER% ++DESCRIPTION "libbzip2: library for data compression" ++EXPORTS ++ BZ2_bzCompressInit ++ BZ2_bzCompress ++ BZ2_bzCompressEnd ++ BZ2_bzDecompressInit ++ BZ2_bzDecompress ++ BZ2_bzDecompressEnd ++ BZ2_bzReadOpen ++ BZ2_bzReadClose ++ BZ2_bzReadGetUnused ++ BZ2_bzRead ++ BZ2_bzWriteOpen ++ BZ2_bzWrite ++ BZ2_bzWriteClose ++ BZ2_bzWriteClose64 ++ BZ2_bzBuffToBuffCompress ++ BZ2_bzBuffToBuffDecompress ++ BZ2_bzlibVersion ++ BZ2_bzopen ++ BZ2_bzdopen ++ BZ2_bzread ++ BZ2_bzwrite ++ BZ2_bzflush ++ BZ2_bzclose ++ BZ2_bzerror +--- bzip2-1.0.6/bzip2.pc.in.orig 1970-01-01 01:00:00.000000000 +0100 ++++ bzip2-1.0.6/bzip2.pc.in 2009-11-03 18:48:28.000000000 +0100 +@@ -0,0 +1,11 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++bindir=@bindir@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: bzip2 ++Description: Lossless, block-sorting data compression ++Version: @PACKAGE_VERSION@ ++Libs: -L${libdir} -lbz2 ++Cflags: -I${includedir} diff --git a/msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-cygming-1.0.6.src.all.patch b/msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-cygming-1.0.6.src.all.patch new file mode 100644 index 00000000000..78c2b644537 --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-bzip2/bzip2-cygming-1.0.6.src.all.patch @@ -0,0 +1,171 @@ +diff -urN bzip2-1.0.6/bzip2.c bzip2-1.0.6/bzip2.c +--- bzip2-1.0.6/bzip2.c 2010-09-10 19:04:53.000000000 -0400 ++++ bzip2-1.0.6/bzip2.c 2011-05-20 21:22:16.853325100 -0400 +@@ -1132,8 +1132,8 @@ + static + void compress ( Char *name ) + { +- FILE *inStr; +- FILE *outStr; ++ FILE *inStr = NULL; ++ FILE *outStr = NULL; + Int32 n, i; + struct MY_STAT statBuf; + +@@ -1313,8 +1313,8 @@ + static + void uncompress ( Char *name ) + { +- FILE *inStr; +- FILE *outStr; ++ FILE *inStr = NULL; ++ FILE *outStr = NULL; + Int32 n, i; + Bool magicNumberOK; + Bool cantGuess; +@@ -1511,7 +1511,7 @@ + static + void testf ( Char *name ) + { +- FILE *inStr; ++ FILE *inStr = NULL; + Bool allOK; + struct MY_STAT statBuf; + +diff -urN bzip2-1.0.6/bzip2recover.c bzip2-1.0.6/bzip2recover.c +--- bzip2-1.0.6/bzip2recover.c 2010-09-10 19:18:40.000000000 -0400 ++++ bzip2-1.0.6/bzip2recover.c 2011-05-20 21:21:39.518325100 -0400 +@@ -24,6 +24,8 @@ + #include + #include + #include ++#include ++#include + + + /* This program records bit locations in the file to be recovered. +@@ -269,6 +271,19 @@ + name[n-1] == '2'); + } + ++/*---------------------------------------------*/ ++/* Open an output file safely with O_EXCL and good permissions */ ++FILE* fopen_output( Char* name, const char* mode ) ++{ ++ FILE *fp; ++ int fh; ++ ++ fh = open(name, O_WRONLY|O_CREAT|O_EXCL, 0600); ++ if (fh == -1) return NULL; ++ fp = fdopen(fh, mode); ++ if (fp == NULL) close(fh); ++ return fp; ++} + + /*---------------------------------------------------*/ + /*--- ---*/ +@@ -306,6 +321,7 @@ + Int32 b, wrBlock, currBlock, rbCtr; + MaybeUInt64 bitsRead; + ++ + UInt32 buffHi, buffLo, blockCRC; + Char* p; + +@@ -486,7 +502,7 @@ + fprintf ( stderr, " writing block %d to `%s' ...\n", + wrBlock+1, outFileName ); + +- outFile = fopen ( outFileName, "wb" ); ++ outFile = fopen_output ( outFileName, "wb" ); + if (outFile == NULL) { + fprintf ( stderr, "%s: can't write `%s'\n", + progName, outFileName ); +diff -urN bzip2-1.0.6/bzlib.c bzip2-1.0.6/bzlib.c +--- bzip2-1.0.6/bzlib.c 2010-09-10 18:38:23.000000000 -0400 ++++ bzip2-1.0.6/bzlib.c 2011-05-20 21:21:39.524325100 -0400 +@@ -1372,7 +1372,7 @@ + #ifndef BZ_NO_STDIO + /*---------------------------------------------------*/ + +-#if defined(_WIN32) || defined(OS2) || defined(MSDOS) ++#if defined(_WIN32) || defined(OS2) || defined(MSDOS) || defined(__CYGWIN__) + # include + # include + # define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY) +diff -urN bzip2-1.0.6/bzlib.h bzip2-1.0.6/bzlib.h +--- bzip2-1.0.6/bzlib.h 2010-09-10 19:08:42.000000000 -0400 ++++ bzip2-1.0.6/bzlib.h 2011-05-20 22:38:02.807325100 -0400 +@@ -75,21 +75,39 @@ + #include + #endif + +-#ifdef _WIN32 ++#if defined(_WIN32) && !defined(__CYGWIN__) + # include + # ifdef small + /* windows.h define small to char */ + # undef small + # endif +-# ifdef BZ_EXPORT +-# define BZ_API(func) WINAPI func +-# define BZ_EXTERN extern ++# ifndef __GNUC__ ++ /* Use these rules only for non-gcc native win32 */ ++# ifdef BZ_EXPORT ++# define BZ_API(func) WINAPI func ++# define BZ_EXTERN extern ++# else ++ /* import windows dll dynamically */ ++# define BZ_API(func) (WINAPI * func) ++# define BZ_EXTERN ++# endif + # else +- /* import windows dll dynamically */ +-# define BZ_API(func) (WINAPI * func) +-# define BZ_EXTERN ++ /* For gcc on native win32, use import library trampoline */ ++ /* functions on DLL import. This avoids requiring clients to */ ++ /* use special compilation flags depending on whether eventual */ ++ /* link will be against static libbz2 or against DLL, at the */ ++ /* expense of a small loss of efficiency. */ ++ ++ /* Because libbz2 does not export any DATA items, GNU ld's */ ++ /* "auto-import" is not a factor; the MinGW-built DLL can be */ ++ /* used by other compilers, provided an import library suitable */ ++ /* for that compiler is (manually) constructed using the .def */ ++ /* file and the appropriate tool. */ ++# define BZ_API(func) func ++# define BZ_EXTERN extern + # endif + #else ++ /* non-win32 platforms, and cygwin */ + # define BZ_API(func) func + # define BZ_EXTERN extern + #endif +diff -urN bzip2-1.0.6/bzmore bzip2-1.0.6/bzmore +--- bzip2-1.0.6/bzmore 2007-01-02 21:00:55.000000000 -0500 ++++ bzip2-1.0.6/bzmore 2011-05-20 21:21:39.540325100 -0400 +@@ -24,10 +24,10 @@ + # 'stty min 1' resets eof to ^a on both SunOS and SysV! + cb='min 1 -icanon'; ncb='icanon eof ^d' + fi +-if test $? -eq 0 -a -n "$oldtty"; then +- trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15 ++if test $? -eq 0 && test -n "$oldtty"; then ++ trap 'stty $oldtty 2>/dev/null; exit' 0 INT QUIT TRAP USR1 PIPE TERM + else +- trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15 ++ trap 'stty $ncb echo 2>/dev/null; exit' 0 INT QUIT TRAP USR1 PIPE TERM + fi + + if test $# = 0; then +@@ -46,7 +46,7 @@ + ANS=`dd bs=1 count=1 2>/dev/null` + stty $ncb echo 2>/dev/null + echo " " +- if test "$ANS" = 'e' -o "$ANS" = 'q'; then ++ if test "$ANS" = 'e' || test "$ANS" = 'q'; then + exit + fi + fi diff --git a/msys2/PKGBUILD/10-mingw-w64-libiconv/0002-fix-cr-for-awk-in-configure.all.patch b/msys2/PKGBUILD/10-mingw-w64-libiconv/0002-fix-cr-for-awk-in-configure.all.patch new file mode 100644 index 00000000000..61f502685bc --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-libiconv/0002-fix-cr-for-awk-in-configure.all.patch @@ -0,0 +1,12 @@ +diff -urN libiconv-1.17/configure.orig libiconv-1.17/configure +--- libiconv-1.17/configure.orig 2022-06-09 17:17:33.325129700 +0200 ++++ libiconv-1.17/configure 2022-06-09 17:41:31.158194700 +0200 +@@ -31929,7 +31929,7 @@ + fi + ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` + if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then +- ac_cs_awk_cr='\\r' ++ ac_cs_awk_cr='\r' + else + ac_cs_awk_cr=$ac_cr + fi diff --git a/msys2/PKGBUILD/10-mingw-w64-libiconv/0003-add-cp65001-as-utf8-alias.patch b/msys2/PKGBUILD/10-mingw-w64-libiconv/0003-add-cp65001-as-utf8-alias.patch new file mode 100644 index 00000000000..8090b0f090e --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-libiconv/0003-add-cp65001-as-utf8-alias.patch @@ -0,0 +1,12 @@ +diff -urN a/lib/encodings.def b/lib/encodings.def +--- a/lib/encodings.def 2021-06-06 17:50:48.000000000 +0800 ++++ b/lib/encodings.def 2023-01-12 21:17:32.598803000 +0800 +@@ -59,7 +59,7 @@ + + DEFENCODING(( "UTF-8", /* IANA, RFC 2279 */ + /*"UTF8", JDK 1.1 */ +- /*"CP65001", Windows */ ++ "CP65001", /* Windows */ + ), + utf8, + { utf8_mbtowc, NULL }, { utf8_wctomb, NULL }) diff --git a/msys2/PKGBUILD/10-mingw-w64-libiconv/0004-fix-makefile-devel-assuming-gcc.patch b/msys2/PKGBUILD/10-mingw-w64-libiconv/0004-fix-makefile-devel-assuming-gcc.patch new file mode 100644 index 00000000000..80905eeafb8 --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-libiconv/0004-fix-makefile-devel-assuming-gcc.patch @@ -0,0 +1,12 @@ +diff -urN a/Makefile.devel b/Makefile.devel +--- a/Makefile.devel 2022-01-24 04:49:47 +0000 ++++ b/Makefile.devel 2023-01-14 18:28:46 +0000 +@@ -9,7 +9,7 @@ + AUTOMAKE = automake-1.16 + ACLOCAL = aclocal-1.16 + GPERF = gperf +-CC = gcc -Wall ++CC = cc -Wall + CFLAGS = -O + MAN2HTML = groff -mandoc -Thtml + CP = cp diff --git a/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD new file mode 100644 index 00000000000..ae82e12b23b --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD @@ -0,0 +1,139 @@ +# Maintainer: Alexey Pavlov +# Contributor: Renato Silva + +_realname=libiconv +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=(${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname} ${MINGW_PACKAGE_PREFIX}-jellyfin-iconv) +license=('spdx:GPL-3.0-or-later') +pkgdesc='Character encoding conversion library and utility (mingw-w64)' +pkgver=1.17 +pkgrel=4 +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url='https://www.gnu.org/software/libiconv/' +source=("https://mirrors.kernel.org/gnu/${_realname}/${_realname}-${pkgver}.tar.gz"{,.sig} + 0004-fix-makefile-devel-assuming-gcc.patch + 0003-add-cp65001-as-utf8-alias.patch + 0002-fix-cr-for-awk-in-configure.all.patch + fix-pointer-buf.patch + iconv.pc) +sha256sums=('8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313' + 'SKIP' + '2f08ca8681e4c85cdb2e6835921a502fd623dee4bf8ca10aa3c66747ede58a47' + 'cb2b1cca44c9b9bd11c3bd33997c10d22dff263542275324c88f34b59910ef87' + '89d5c0f666e50a0186cfb142ba7b77e8fe1ac4d65bdfd9ae14ae8d2f0045a87c' + '6b6e2393840f4dc6067587165777b1a07978f4c05247d7c1010a45ad251bbeeb' + 'SKIP') +validpgpkeys=('SKIP') # "Bruno Haible (Open Source Development) " +options=('!libtool' 'staticlibs') +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-gettext-tools" + "${MINGW_PACKAGE_PREFIX}-gperf") + + +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" + +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -Nbp1 -i "${srcdir}/${_patch}" + done +} + +regenerate_files() { + msg2 "Regenerating autogenerated files" + make -f Makefile.devel all +} + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + apply_patch_with_msg \ + 0002-fix-cr-for-awk-in-configure.all.patch \ + fix-pointer-buf.patch \ + 0003-add-cp65001-as-utf8-alias.patch \ + 0004-fix-makefile-devel-assuming-gcc.patch + regenerate_files +} + +build() { + [[ -d "${srcdir}/build-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}" + mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" + + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --docdir=${MINGW_PREFIX}/share/doc/libiconv \ + --enable-static \ + --disable-shared \ + --enable-extra-encodings \ + --enable-relocatable \ + --disable-rpath \ + --enable-silent-rules \ + --enable-nls + + make +} + +check() { + cd "${srcdir}/build-${MSYSTEM}" + make check || msg2 "tests failed" +} + +package_libiconv() { + pkgdesc='Character encoding conversion library (mingw-w64)' + license=('spdx:LGPL-2.1-or-later' documentation:'spdx:GPL-3.0-or-later') # This is LGPL except for documentation, see README + + cd "${srcdir}/build-${MSYSTEM}" + make install DESTDIR="${pkgdir}" + rm -fr "${pkgdir}${MINGW_PREFIX}"/bin/*.exe + rm -f "${pkgdir}${MINGW_PREFIX}"/lib/charset.alias + rm -fr "${pkgdir}${MINGW_PREFIX}"/share/locale + rm -f "${pkgdir}${MINGW_PREFIX}"/share/doc/libiconv/*.1.* + rm -fr "${pkgdir}${MINGW_PREFIX}"/share/man/man1 + + # Pkg-config file + install -Dm644 "${srcdir}/iconv.pc" "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/iconv.pc" + sed -e "s|@PREFIX@|${MINGW_PREFIX}|g" \ + -e "s|@VERSION@|${pkgver}|g" \ + -i "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/iconv.pc" + + # Licenses + install -Dm644 "${srcdir}/${_realname}-${pkgver}/README" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/README" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING.LIB" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING.LIB" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/libcharset/COPYING.LIB" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/libcharset/COPYING.LIB" +} + +package_iconv() { + pkgdesc='Character encoding conversion utility (mingw-w64)' + depends=("${MINGW_PACKAGE_PREFIX}-libiconv=${pkgver}-${pkgrel}" + "${MINGW_PACKAGE_PREFIX}-gettext-runtime") + license=('spdx:GPL-3.0-or-later') + + cd "${srcdir}/build-${MSYSTEM}" + make install DESTDIR="${pkgdir}" + rm -f "${pkgdir}${MINGW_PREFIX}"/bin/*.dll + rm -fr "${pkgdir}${MINGW_PREFIX}"/include + rm -fr "${pkgdir}${MINGW_PREFIX}"/lib + rm -f "${pkgdir}${MINGW_PREFIX}"/share/doc/libiconv/*.3.* + rm -fr "${pkgdir}${MINGW_PREFIX}"/share/man/man3 + + # Licenses + install -Dm644 "${srcdir}/${_realname}-${pkgver}/README" "${pkgdir}${MINGW_PREFIX}/share/licenses/iconv/README" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/iconv/COPYING" +} + +# template start; name=mingw-w64-splitpkg-wrappers; version=1.0; +# vim: set ft=bash : + +# generate wrappers +for _name in "${pkgname[@]}"; do + _short="package_${_name#${MINGW_PACKAGE_PREFIX}-jellyfin-}" + _func="$(declare -f "${_short}")" + eval "${_func/#${_short}/package_${_name}}" +done +# template end; diff --git a/msys2/PKGBUILD/10-mingw-w64-libiconv/fix-pointer-buf.patch b/msys2/PKGBUILD/10-mingw-w64-libiconv/fix-pointer-buf.patch new file mode 100644 index 00000000000..914b87bdf0e --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-libiconv/fix-pointer-buf.patch @@ -0,0 +1,37 @@ +--- a/lib/iconv.c 2018-05-03 23:18:55.997221700 -0400 ++++ b/lib/iconv.c 2018-05-03 23:26:47.611682700 -0400 +@@ -170,12 +170,12 @@ static const struct stringpool2_t string + #include "aliases2.h" + #undef S + }; + #define stringpool2 ((const char *) &stringpool2_contents) + static const struct alias sysdep_aliases[] = { +-#define S(tag,name,encoding_index) { (int)(long)&((struct stringpool2_t *)0)->stringpool_##tag, encoding_index }, ++#define S(tag,name,encoding_index) { (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_##tag, encoding_index }, + #include "aliases2.h" + #undef S + }; + #ifdef __GNUC__ + __inline + #else +--- a/lib/genaliases.c 2023-01-14 00:00:00.000000000 +0000 ++++ b/lib/genaliases.c 2023-01-14 10:18:00.000000000 +0000 +@@ -50,7 +50,7 @@ + putc(c, out2); + } + } +- fprintf(out2,"\")' tmp.h | sed -e 's|^.*\\(stringpool_str[0-9]*\\).*$| (int)(long)\\&((struct stringpool_t *)0)->\\1,|'\n"); ++ fprintf(out2,"\")' tmp.h | sed -e 's|^.*\\(stringpool_str[0-9]*\\).*$| (int)(intptr_t)\\&((struct stringpool_t *)0)->\\1,|'\n"); + for (; n > 0; names++, n--) + emit_alias(out1, *names, c_name); + } +--- a/lib/genaliases2.c 2023-01-14 00:00:00.000000000 +0000 ++++ b/lib/genaliases2.c 2023-01-14 10:18:00.000000000 +0000 +@@ -44,6 +44,6 @@ + static void emit_encoding (FILE* out1, FILE* out2, const char* tag, const char* const* names, size_t n, const char* c_name) + { +- fprintf(out2," (int)(long)&((struct stringpool2_t *)0)->stringpool_%s_%u,\n",tag,counter); ++ fprintf(out2," (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_%s_%u,\n",tag,counter); + for (; n > 0; names++, n--) + emit_alias(out1, tag, *names, c_name); + } diff --git a/msys2/PKGBUILD/10-mingw-w64-libiconv/iconv.pc b/msys2/PKGBUILD/10-mingw-w64-libiconv/iconv.pc new file mode 100644 index 00000000000..d7d0ede1bcf --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-libiconv/iconv.pc @@ -0,0 +1,11 @@ +prefix=@PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: iconv +Description: libiconv +URL: https://www.gnu.org/software/libiconv/ +Version: @VERSION@ +Libs: -L${libdir} -liconv +Cflags: -I${includedir} \ No newline at end of file diff --git a/msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD new file mode 100644 index 00000000000..584f9ea2cab --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD @@ -0,0 +1,92 @@ +# Maintainer: Alexey Pavlov + +_realname=libpng +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=1.6.43 +_apngver=1.6.40 +pkgrel=1 +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +pkgdesc="A collection of routines used to create PNG format graphics (mingw-w64)" +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-jellyfin-zlib") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-autotools") +license=('custom') +url="http://www.libpng.org/pub/png/libpng.html" +msys2_repository_url='https://github.com/pnggroup/libpng' +msys2_references=( + "cpe: cpe:/a:greg_roelofs:libpng" + "cpe: cpe:/a:libpng:libpng" +) +options=('strip' '!libtool' 'staticlibs') +# apng: https://github.com/mozilla/gecko-dev/commits/master/media/libpng/apng.patch +source=("https://downloads.sourceforge.net/sourceforge/libpng/${_realname}-${pkgver}.tar.xz" + "https://raw.githubusercontent.com/mozilla/gecko-dev/ee4f298265cc851314bf431fb0efccba6af15f74/media/libpng/apng.patch") +sha256sums=('6a5ca0652392a2d7c9db2ae5b40210843c0bbc081cbd410825ab00cc59f14a6c' + '2a65fa19b126e85ad14ef1d1d9fc5079193e92af6b8db4454e3a875da5fdb79d') +validpgpkeys=('8048643BA2C840F4F92A195FF54984BFA16C640F') # Glenn Randers-Pehrson (mozilla) + +export MINGW_FFBUILD_PREFIX="${MINGW_PREFIX}/ffbuild/" + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + + # Add animated PNG (apng) support + # Some context as to why this is here: https://bugs.gentoo.org/824018 + # Arch dropped it some time ago: + # https://gitlab.archlinux.org/archlinux/packaging/packages/libpng/-/commit/bc95b152de9709a21c2938d5a + # Maybe we should too? + patch -p1 -i "${srcdir}/apng.patch" + + # autoreconf to get updated libtool files with clang support + autoreconf -fiv +} + +build() { + [[ -d "${srcdir}/build-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}" + mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" + + ../"${_realname}-${pkgver}"/configure \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --prefix=${MINGW_FFBUILD_PREFIX} \ + --disable-shared --enable-static \ + as_ln_s="cp -pR" + + make + + msg2 "Build contributed programs" + mkdir -p ".libs/contrib/pngminus" && cd ".libs/contrib/pngminus" + cp -r "${srcdir}/${_realname}-${pkgver}/contrib/pngminus"/* . +# libpng.a and libpng.dll.a are basically symlinks to libpng16.a +# and libpng16.dll.a that are created at "make install" but we are +# building the contributed programs before the "make install" so +# we have to link to libpng16.dll.a or libpng16.a if building +# statically. When building the static programs, we might also +# want to build with the static version of zlib. + make PNGINC="-I${srcdir}/${_realname}-${pkgver} -I${srcdir}/build-${MSYSTEM}" \ + CC="${MINGW_PREFIX}/bin/cc" \ + PNGLIB_SHARED="-L../.. -lpng16" \ + PNGLIB_STATIC="../../libpng16.a" \ + ZLIB_STATIC="${MINGW_FFBUILD_PREFIX}/lib/libz.a" \ + CFLAGS="$CFLAGS" \ + LDFLAGS="-L../.. $LDFLAGS" \ + png2pnm pnm2png png2pnm-static pnm2png-static +} + +check() { + : +} + +package () { + cd "${srcdir}/build-${MSYSTEM}" + make install DESTDIR="${pkgdir}" + + install -D -m644 "${srcdir}/libpng-${pkgver}/LICENSE" "${pkgdir}${MINGW_FFBUILD_PREFIX}/share/licenses/${_realname}/LICENSE" + + msg2 "Install contributed programs" + cd ".libs/contrib/pngminus" +} + diff --git a/msys2/PKGBUILD/10-mingw-w64-xz/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-xz/PKGBUILD new file mode 100644 index 00000000000..c4e9e02b530 --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-xz/PKGBUILD @@ -0,0 +1,60 @@ +# Maintainer: Alexey Pavlov +# Contributor: Renato Silva + +_realname=xz +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=5.6.2 +pkgrel=2 +pkgdesc="Library and command line tools for XZ and LZMA compressed files (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://tukaani.org/xz" +msys2_repository_url="https://github.com/tukaani-project/xz/" +msys2_references=( + 'archlinux: xz' + "cpe: cpe:/a:tukaani:xz" +) +# TODO: check situation with getopt_long mentioned in COPYING for possible +# removal of LGPL from this field +license=('spdx:0BSD AND LGPL-2.1-or-later AND GPL-2.0-or-later') +depends=("${MINGW_PACKAGE_PREFIX}-gettext-runtime") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-gettext-tools" + "${MINGW_PACKAGE_PREFIX}-doxygen" + "po4a") +source=("https://github.com/tukaani-project/xz/releases/download/v${pkgver}/xz-${pkgver}.tar.xz") +sha256sums=('a9db3bb3d64e248a0fae963f8fb6ba851a26ba1822e504dc0efd18a80c626caf') +validpgpkeys=('3690C240CE51B4670D30AD1C38EE757D69184620') # Lasse Collin + +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" + +prepare() { + cd "${_realname}-${pkgver}" + + ./autogen.sh +} + + +build() { + mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" + + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --disable-rpath \ + --disable-lzma-links \ + --disable-symbol-versions \ + --disable-shared \ + --enable-static \ + --enable-doxygen + + make +} + +package() { + cd "${srcdir}/build-${MSYSTEM}" + make DESTDIR="${pkgdir}" install + + install -Dm644 ${srcdir}/${_realname}-${pkgver}/COPYING* -t ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname} +} diff --git a/msys2/PKGBUILD/10-mingw-w64-zlib/01-zlib-1.2.11-1-buildsys.mingw.patch b/msys2/PKGBUILD/10-mingw-w64-zlib/01-zlib-1.2.11-1-buildsys.mingw.patch new file mode 100644 index 00000000000..52d55133d08 --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-zlib/01-zlib-1.2.11-1-buildsys.mingw.patch @@ -0,0 +1,256 @@ +--- a/configure ++++ b/configure +@@ -38,6 +38,7 @@ + + # destination name for static library + STATICLIB=libz.a ++IMPORTLIB= + + # extract zlib version numbers from zlib.h + VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}zlib.h` +@@ -74,7 +75,7 @@ + prefix=${prefix-/usr/local} + exec_prefix=${exec_prefix-'${prefix}'} + libdir=${libdir-'${exec_prefix}/lib'} +-sharedlibdir=${sharedlibdir-'${libdir}'} ++sharedlibdir=${sharedlibdir-'${exec_prefix}/bin'} + includedir=${includedir-'${prefix}/include'} + mandir=${mandir-'${prefix}/share/man'} + shared_ext='.so' +@@ -90,6 +91,7 @@ + sanitize=0 + old_cc="$CC" + old_cflags="$CFLAGS" ++old_ldflags="$LDFLAGS" + OBJC='$(OBJZ) $(OBJG)' + PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)' + +@@ -224,12 +226,23 @@ + LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} + LDCONFIG="ldconfig -m" ;; + CYGWIN* | Cygwin* | cygwin* | *-cygwin* | OS/2*) ++ CFLAGS="${CFLAGS} -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64" ++ SFLAGS="${CFLAGS}" ++ LDFLAGS="-L. ${old_ldflags}" ++ shared_ext=".dll" ++ SHAREDLIB='cygz.dll' ++ IMPORTLIB='libz.dll.a' ++ LDSHARED=${LDSHARED-"$cc -shared -Wl,--export-all-symbols -Wl,--enable-auto-image-base -Wl,--out-implib=${IMPORTLIB}"} ++ LDSHAREDLIBC='' + EXE='.exe' ;; + MINGW* | mingw* | *-mingw*) +- rm -f $test.[co] $test $test$shared_ext +- echo "If this doesn't work for you, try win32/Makefile.gcc." | tee -a configure.log +- LDSHARED=${LDSHARED-"$cc -shared"} +- LDSHAREDLIBC="" ++ SFLAGS="${CFLAGS}" ++ LDFLAGS="-L. ${old_ldflags}" ++ shared_ext=".dll" ++ SHAREDLIB='zlib1.dll' ++ IMPORTLIB='libz.dll.a' ++ LDSHARED=${LDSHARED-"$cc -shared -Wl,--export-all-symbols -Wl,--enable-auto-image-base -Wl,--out-implib=${IMPORTLIB}"} ++ LDSHAREDLIBC='' + EXE='.exe' ;; + QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 + # (alain.bonnefoy@icbt.com) +@@ -355,11 +367,32 @@ + esac + fi + ++case "$uname" in ++ *CYGWIN* | *Cygwin* | *cygwin* ) ++ # On cygwin, we always build both shared and static libs ++ ALL="static shared" ++ SHAREDLIBPOST='/bin/true' ++ SHAREDTARGET=${SHAREDLIB} ++ TEST="all teststatic testshared" ++ ;; ++ *MINGW* | *Mingw* | *mingw* ) ++ # On Mingw, we always build both shared and static libs ++ ALL="static shared" ++ SHAREDLIBPOST='/bin/true' ++ SHAREDTARGET=${SHAREDLIB} ++ TEST="all teststatic testshared" ++ ;; ++ *) ++ + # destination names for shared library if not defined above + SHAREDLIB=${SHAREDLIB-"libz$shared_ext"} + SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"} + SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"} +- ++SHAREDLIBPOST='(rm -f $(SHAREDLIB) $(SHAREDLIBM); ln -s $@ $(SHAREDLIB) ; ln -s $@ $(SHAREDLIBM) )' ++SHAREDTARGET='$(SHAREDLIBV)' ++ ;; ++esac ++ + echo >> configure.log + + # define functions for testing compiler and library characteristics and logging the results +@@ -854,6 +887,9 @@ + echo SHAREDLIBM = $SHAREDLIBM >> configure.log + echo SHAREDLIBV = $SHAREDLIBV >> configure.log + echo STATICLIB = $STATICLIB >> configure.log ++echo IMPORTLIB = $IMPORTLIB >> configure.log ++echo SHAREDLIBPOST = $SHAREDLIBPOST >> configure.log ++echo SHAREDTARGET = $SHAREDTARGET >> configure.log + echo TEST = $TEST >> configure.log + echo VER = $VER >> configure.log + echo SRCDIR = $SRCDIR >> configure.log +@@ -874,9 +910,12 @@ + /^LDSHARED *=/s#=.*#=$LDSHARED# + /^CPP *=/s#=.*#=$CPP# + /^STATICLIB *=/s#=.*#=$STATICLIB# ++/^IMPORTLIB *=/s#=.*#=$IMPORTLIB# + /^SHAREDLIB *=/s#=.*#=$SHAREDLIB# + /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV# + /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM# ++/^SHAREDLIBPOST *=/s#=.*#=$SHAREDLIBPOST# ++/^SHAREDTARGET *=/s#=.*#=$SHAREDTARGET# + /^AR *=/s#=.*#=$AR# + /^ARFLAGS *=/s#=.*#=$ARFLAGS# + /^RANLIB *=/s#=.*#=$RANLIB# +@@ -905,9 +944,12 @@ + /^CPP *=/s#=.*#=$CPP# + /^LDSHARED *=/s#=.*#=$LDSHARED# + /^STATICLIB *=/s#=.*#=$STATICLIB# ++/^IMPORTLIB *=/s#=.*#=$IMPORTLIB# + /^SHAREDLIB *=/s#=.*#=$SHAREDLIB# + /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV# + /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM# ++/^SHAREDLIBPOST *=/s#=.*#=$SHAREDLIBPOST# ++/^SHAREDTARGET *=/s#=.*#=$SHAREDTARGET# + /^AR *=/s#=.*#=$AR# + /^ARFLAGS *=/s#=.*#=$ARFLAGS# + /^RANLIB *=/s#=.*#=$RANLIB# +--- a/Makefile.in ++++ b/Makefile.in +@@ -34,6 +34,9 @@ + SHAREDLIB=libz.so + SHAREDLIBV=libz.so.1.2.12 + SHAREDLIBM=libz.so.1 ++IMPORTLIB= ++SHAREDLIBPOST='(rm -f $(SHAREDLIB) $(SHAREDLIBM); ln -s $@ $(SHAREDLIB) ; ln -s $@ $(SHAREDLIBM) )' ++SHAREDTARGET=$(SHAREDLIBV) + LIBS=$(STATICLIB) $(SHAREDLIBV) + + AR=ar +@@ -48,7 +51,7 @@ + prefix = /usr/local + exec_prefix = ${prefix} + libdir = ${exec_prefix}/lib +-sharedlibdir = ${libdir} ++sharedlibdir = ${exec_prefix}/bin + includedir = ${prefix}/include + mandir = ${prefix}/share/man + man3dir = ${mandir}/man3 +@@ -127,7 +130,7 @@ + ./infcover + gcov inf*.c + +-libz.a: $(OBJS) ++$(STATICLIB): $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 + +@@ -278,11 +281,9 @@ + -@mv objs/gzwrite.o $@ + + +-placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a ++placebo $(SHAREDTARGET): $(PIC_OBJS) $(STATICLIB) + $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS) +- rm -f $(SHAREDLIB) $(SHAREDLIBM) +- ln -s $@ $(SHAREDLIB) +- ln -s $@ $(SHAREDLIBM) ++ $(SHAREDLIBPOST) + -@rmdir objs + + example$(EXE): example.o $(STATICLIB) +@@ -291,11 +292,11 @@ + minigzip$(EXE): minigzip.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) + +-examplesh$(EXE): example.o $(SHAREDLIBV) +- $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV) ++examplesh$(EXE): example.o $(SHAREDTARGET) ++ $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(IMPORTLIB) + +-minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) +- $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV) ++minigzipsh$(EXE): minigzip.o $(SHAREDTARGET) ++ $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(IMPORTLIB) + + example64$(EXE): example64.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) +@@ -309,20 +310,34 @@ + -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi + -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi + -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi +- rm -f $(DESTDIR)$(libdir)/$(STATICLIB) + cp $(STATICLIB) $(DESTDIR)$(libdir) +- chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB) +- -@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1 +- -@if test -n "$(SHAREDLIBV)"; then \ +- rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \ +- cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \ +- echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \ +- chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \ +- echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \ +- rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ +- ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \ +- ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ +- ($(LDCONFIG) || true) >/dev/null 2>&1; \ ++ -@(chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)) ++ -@($(RANLIB) $(DESTDIR)$(libdir)/$(STATICLIB) || true) >/dev/null 2>&1 ++ -@if test -n "$(IMPORTLIB)" ; then \ ++ cp $(IMPORTLIB) $(DESTDIR)$(libdir); \ ++ echo "cp $(IMPORTLIB) $(DESTDIR)$(libdir)"; \ ++ chmod 644 $(DESTDIR)$(libdir)/$(IMPORTLIB); \ ++ if test -n "$(SHAREDTARGET)" ; then \ ++ if test -f "$(SHAREDTARGET)" ; then \ ++ cp $(SHAREDTARGET) $(DESTDIR)$(sharedlibdir); \ ++ echo "cp $(SHAREDTARGET) $(DESTDIR)$(sharedlibdir)"; \ ++ chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDTARGET); \ ++ echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDTARGET)"; \ ++ fi; \ ++ fi; \ ++ if test -n "$(SHAREDLIBV)"; then \ ++ if test -f "$(SHAREDLIBV)"; then \ ++ rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ ++ ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \ ++ ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ ++ ($(LDCONFIG) || true) >/dev/null 2>&1; \ ++ fi; \ ++ fi; \ ++ else \ ++ cp $(SHAREDTARGET) $(DESTDIR)$(sharedlibdir); \ ++ echo "cp $(SHAREDTARGET) $(DESTDIR)$(sharedlibdir)"; \ ++ chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDTARGET); \ ++ echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDTARGET)"; \ + fi + rm -f $(DESTDIR)$(man3dir)/zlib.3 + cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir) +@@ -341,12 +356,13 @@ + + uninstall: + cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h +- cd $(DESTDIR)$(libdir) && rm -f libz.a; \ ++ cd $(DESTDIR)$(libdir) && rm -f $(STATCILIB) $(IMPORTLIB); \ + if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \ + rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ + fi + cd $(DESTDIR)$(man3dir) && rm -f zlib.3 + cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc ++ cd $(DESTDIR)$(sharedlibdir) && (rm -f $(SHAREDTARGET) || true) > /dev/null 2>&1 + + docs: zlib.3.pdf + +@@ -369,6 +385,7 @@ + example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \ + example64$(EXE) minigzip64$(EXE) \ + infcover \ ++ $(STATICLIB) $(IMPORTLIB) $(SHAREDTARGET) $(SHAREDLIBV) $(SHAREDLIBV) $(SHAREDLIBM) \ + libz.* foo.gz so_locations \ + _match.s maketree contrib/infback9/*.o + rm -rf objs diff --git a/msys2/PKGBUILD/10-mingw-w64-zlib/03-dont-put-sodir-into-L.mingw.patch b/msys2/PKGBUILD/10-mingw-w64-zlib/03-dont-put-sodir-into-L.mingw.patch new file mode 100644 index 00000000000..0fce7d58446 --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-zlib/03-dont-put-sodir-into-L.mingw.patch @@ -0,0 +1,9 @@ +--- a/zlib.pc.in ++++ b/zlib.pc.in +@@ -9,5 +9,5 @@ + Version: @VERSION@ + + Requires: +-Libs: -L${libdir} -L${sharedlibdir} -lz ++Libs: -L${libdir} -lz + Cflags: -I${includedir} diff --git a/msys2/PKGBUILD/10-mingw-w64-zlib/04-fix-largefile-support.patch b/msys2/PKGBUILD/10-mingw-w64-zlib/04-fix-largefile-support.patch new file mode 100644 index 00000000000..636982bd2cc --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-zlib/04-fix-largefile-support.patch @@ -0,0 +1,22 @@ +--- a/zconf.h.in ++++ b/zconf.h.in +@@ -504,7 +504,7 @@ + # define z_off_t long + #endif + +-#if !defined(_WIN32) && defined(Z_LARGE64) ++#if (defined(_WIN32) && defined(__GNUC__) && defined(_LARGEFILE64_SOURCE)) || defined(Z_LARGE64) + # define z_off64_t off64_t + #else + # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +--- a/zconf.h.cmakein ++++ b/zconf.h.cmakein +@@ -506,7 +506,7 @@ + # define z_off_t long + #endif + +-#if !defined(_WIN32) && defined(Z_LARGE64) ++#if (defined(_WIN32) && defined(__GNUC__) && defined(_LARGEFILE64_SOURCE)) || defined(Z_LARGE64) + # define z_off64_t off64_t + #else + # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) diff --git a/msys2/PKGBUILD/10-mingw-w64-zlib/07-Add-no-undefined-to-link-to-enable-build-shared-vers.patch b/msys2/PKGBUILD/10-mingw-w64-zlib/07-Add-no-undefined-to-link-to-enable-build-shared-vers.patch new file mode 100644 index 00000000000..e2621b1d17e --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-zlib/07-Add-no-undefined-to-link-to-enable-build-shared-vers.patch @@ -0,0 +1,25 @@ +From 6fcaf7683d06488f451107fe0466ec8f91572096 Mon Sep 17 00:00:00 2001 +From: Alexpux +Date: Mon, 13 Oct 2014 07:23:44 +0400 +Subject: [PATCH 2/3] Add -no-undefined to link to enable build shared version + with mingw. + +--- + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index e2958e6..9a6ab44 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -22,7 +22,7 @@ libminizip_la_SOURCES = \ + ioapi_mem.c \ + ${iowin32_src} + +-libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz ++libminizip_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 1:0:0 -lz + + minizip_includedir = $(includedir)/minizip + minizip_include_HEADERS = \ +-- +2.1.2 diff --git a/msys2/PKGBUILD/10-mingw-w64-zlib/08-Add-bzip2-library-to-pkg-config-file.patch b/msys2/PKGBUILD/10-mingw-w64-zlib/08-Add-bzip2-library-to-pkg-config-file.patch new file mode 100644 index 00000000000..306254e1442 --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-zlib/08-Add-bzip2-library-to-pkg-config-file.patch @@ -0,0 +1,22 @@ +From d6c5f14af2f9368032efbcfd0928b73d98379c92 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Tue, 28 Oct 2014 14:15:56 +0300 +Subject: [PATCH 3/3] Add bzip2 library to pkg-config file. + +--- + minizip.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/minizip.pc.in b/minizip.pc.in +index 69b5b7f..2cc4787 100644 +--- a/minizip.pc.in ++++ b/minizip.pc.in +@@ -8,5 +8,5 @@ Description: Minizip zip file manipulation library + Requires: + Version: @PACKAGE_VERSION@ + Libs: -L${libdir} -lminizip +-Libs.private: -lz ++Libs.private: -lz -lbz2 + Cflags: -I${includedir} +-- +2.1.2 diff --git a/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD new file mode 100644 index 00000000000..78625190b95 --- /dev/null +++ b/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD @@ -0,0 +1,97 @@ +# Maintainer: Alexey Pavlov +# Contributor: Martell Malone +# Contributor: Renato Silva +# Contributor: Ray Donnelly + +_realname=zlib +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}") +pkgver=1.3.1 +pkgrel=1 +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +license=('spdx:Zlib') +url="https://www.zlib.net/" +msys2_repository_url="https://github.com/madler/zlib" +msys2_references=( + "cpe: cpe:/a:gnu:zlib" + "cpe: cpe:/a:zlib:zlib" +) +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-bzip2") +source=("https://github.com/madler/zlib/releases/download/v${pkgver}/zlib-${pkgver}.tar.xz"{,.asc} + 01-zlib-1.2.11-1-buildsys.mingw.patch + 03-dont-put-sodir-into-L.mingw.patch + 04-fix-largefile-support.patch + 07-Add-no-undefined-to-link-to-enable-build-shared-vers.patch + 08-Add-bzip2-library-to-pkg-config-file.patch) +sha256sums=('38ef96b8dfe510d42707d9c781877914792541133e1870841463bfa73f883e32' + 'SKIP' + '8175e70c980ffc48a2e90c6f0431ddb80ef6ff690f9e8906dd6a756238552fa5' + '7287d12db57dcf0f66964c861100bf06ebe1ddcb243e7ee0773fcab1b2935596' + '4d8ebda55b95d19cd7c467c486d4c42d2bad6db9ff5dca361f6d8c24120e5f30' + 'fb83292f494f649ea7f1835aa4abea61acc593d7f90625741d42cd99cac0e075' + '0be98a7e660e7c068856f08b9e92d6c73a6b0d88c3e29a9716140b147f7c23c5') +validpgpkeys=('5ED46A6721D365587791E2AA783FCD8E58BCAFBA') + +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" + +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -Nbp1 -i "${srcdir}/${_patch}" + done +} + +prepare() { + cd ${srcdir}/${_realname}-${pkgver} + apply_patch_with_msg \ + 01-zlib-1.2.11-1-buildsys.mingw.patch \ + 03-dont-put-sodir-into-L.mingw.patch \ + 04-fix-largefile-support.patch + + cd ${srcdir}/${_realname}-${pkgver}/contrib/minizip + apply_patch_with_msg \ + 07-Add-no-undefined-to-link-to-enable-build-shared-vers.patch \ + 08-Add-bzip2-library-to-pkg-config-file.patch + autoreconf -fi +} + +build() { + mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" + + CHOST=${MINGW_CHOST} \ + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --static + + make +} + +check() { + cd "${srcdir}/build-${MSYSTEM}" + make test +} + +package_zlib() { + pkgdesc="Compression library implementing the deflate compression method found in gzip and PKZIP (mingw-w64)" + + cd "${srcdir}/build-${MSYSTEM}" + + make DESTDIR="${pkgdir}" install + + install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +} + +# template start; name=mingw-w64-splitpkg-wrappers; version=1.0; +# vim: set ft=bash : + +# generate wrappers +for _name in "${pkgname[@]}"; do + _short="package_${_name#${MINGW_PACKAGE_PREFIX}-jellyfin-}" + _func="$(declare -f "${_short}")" + eval "${_func/#${_short}/package_${_name}}" +done +# template end; diff --git a/msys2/PKGBUILD/20-mingw-w64-fftw/0001-detect-arm64-counter.patch b/msys2/PKGBUILD/20-mingw-w64-fftw/0001-detect-arm64-counter.patch new file mode 100644 index 00000000000..8ce2a6bf136 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-fftw/0001-detect-arm64-counter.patch @@ -0,0 +1,22 @@ +--- a/kernel/cycle.h 2020-12-10 05:02:44.000000000 -0700 ++++ b/kernel/cycle.h 2022-07-01 20:16:52.642814700 -0600 +@@ -539,6 +539,10 @@ + #define HAVE_TICK_COUNTER + #endif + ++/*----------------------------------------------------------------*/ ++/* ++ * ARMv8 cycle counter ++ */ + #if defined(__aarch64__) && defined(HAVE_ARMV8_CNTVCT_EL0) && !defined(HAVE_ARMV8_PMCCNTR_EL0) + typedef uint64_t ticks; + static inline ticks getticks(void) +@@ -551,7 +555,7 @@ + #define HAVE_TICK_COUNTER + #endif + +-#if defined(__aarch64__) && defined(HAVE_ARMV8_PMCCNTR_EL0) ++#if (defined(__aarch64__) && defined(HAVE_ARMV8_PMCCNTR_EL0)) || (defined(_M_ARM64) && defined(__clang__)) + typedef uint64_t ticks; + static inline ticks getticks(void) + { diff --git a/msys2/PKGBUILD/20-mingw-w64-fftw/0002-no-dllexport.patch b/msys2/PKGBUILD/20-mingw-w64-fftw/0002-no-dllexport.patch new file mode 100644 index 00000000000..0d17b3ae93f --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-fftw/0002-no-dllexport.patch @@ -0,0 +1,28 @@ +Some functions are missing the dllexport attribute. That means they aren't +exported. To work around that, don't add the dllexport attribute to any +functions because that is not necessary with MinGW64. + +diff -urN fftw-3.3.10/api/api.h.orig fftw-3.3.10/api/api.h +--- fftw-3.3.10/api/api.h.orig 2020-12-10 13:02:44.000000000 +0100 ++++ fftw-3.3.10/api/api.h 2023-02-28 14:18:43.815688000 +0100 +@@ -40,7 +40,7 @@ + linking bench.exe will fail. This has the advantage of forcing + us to mark things correctly, which is necessary for other compilers + (such as MS VC++). */ +-#ifdef DLL_EXPORT ++#if defined (DLL_EXPORT) && defined (_MSC_VER) + # define FFTW_DLL + #endif + +diff -urN fftw-3.3.10/kernel/ifftw.h.orig fftw-3.3.10/kernel/ifftw.h +--- fftw-3.3.10/kernel/ifftw.h.orig 2020-12-10 13:02:44.000000000 +0100 ++++ fftw-3.3.10/kernel/ifftw.h 2023-02-28 14:10:07.971862800 +0100 +@@ -52,7 +52,7 @@ + under Windows when compiling as a DLL (see api/fftw3.h). */ + #if defined(FFTW_EXTERN) + # define IFFTW_EXTERN FFTW_EXTERN +-#elif (defined(FFTW_DLL) || defined(DLL_EXPORT)) \ ++#elif defined(FFTW_DLL) \ + && (defined(_WIN32) || defined(__WIN32__)) + # define IFFTW_EXTERN extern __declspec(dllexport) + #else diff --git a/msys2/PKGBUILD/20-mingw-w64-fftw/0003-shared-lib.patch b/msys2/PKGBUILD/20-mingw-w64-fftw/0003-shared-lib.patch new file mode 100644 index 00000000000..45c83babc2e --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-fftw/0003-shared-lib.patch @@ -0,0 +1,52 @@ +Add "-no-undefined" to linker flags of threading libraries to allow building +shared libraries on Windows. + +diff -urN fftw-3.3.10/threads/Makefile.am.orig fftw-3.3.10/threads/Makefile.am +--- fftw-3.3.10/threads/Makefile.am.orig 2020-12-10 13:02:44.000000000 +0100 ++++ fftw-3.3.10/threads/Makefile.am 2023-03-02 12:09:54.323824700 +0100 +@@ -21,7 +21,9 @@ + threads.h dft-vrank-geq1.c ct.c rdft-vrank-geq1.c hc2hc.c \ + vrank-geq1-rdft2.c f77api.c f77funcs.h + libfftw3@PREC_SUFFIX@_threads_la_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) +-libfftw3@PREC_SUFFIX@_threads_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ ++libfftw3@PREC_SUFFIX@_threads_la_LDFLAGS = \ ++@QUAD_FALSE@@COMBINED_THREADS_FALSE@ -no-undefined \ ++ -version-info @SHARED_VERSION_INFO@ + if !COMBINED_THREADS + libfftw3@PREC_SUFFIX@_threads_la_LIBADD = ../libfftw3@PREC_SUFFIX@.la + endif +@@ -30,7 +32,9 @@ + threads.h dft-vrank-geq1.c ct.c rdft-vrank-geq1.c hc2hc.c \ + vrank-geq1-rdft2.c f77api.c f77funcs.h + libfftw3@PREC_SUFFIX@_omp_la_CFLAGS = $(AM_CFLAGS) $(OPENMP_CFLAGS) +-libfftw3@PREC_SUFFIX@_omp_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ ++libfftw3@PREC_SUFFIX@_omp_la_LDFLAGS = \ ++@QUAD_FALSE@@COMBINED_THREADS_FALSE@ -no-undefined \ ++ -version-info @SHARED_VERSION_INFO@ + if !COMBINED_THREADS + libfftw3@PREC_SUFFIX@_omp_la_LIBADD = ../libfftw3@PREC_SUFFIX@.la + endif +diff -urN fftw-3.3.10/threads/Makefile.in.orig fftw-3.3.10/threads/Makefile.in +--- fftw-3.3.10/threads/Makefile.in.orig 2021-09-14 16:43:46.000000000 +0200 ++++ fftw-3.3.10/threads/Makefile.in 2023-03-02 12:12:36.736513100 +0100 +@@ -414,14 +414,18 @@ + vrank-geq1-rdft2.c f77api.c f77funcs.h + + libfftw3@PREC_SUFFIX@_threads_la_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) +-libfftw3@PREC_SUFFIX@_threads_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ ++libfftw3@PREC_SUFFIX@_threads_la_LDFLAGS = \ ++@QUAD_FALSE@@COMBINED_THREADS_FALSE@ -no-undefined \ ++ -version-info @SHARED_VERSION_INFO@ + @COMBINED_THREADS_FALSE@libfftw3@PREC_SUFFIX@_threads_la_LIBADD = ../libfftw3@PREC_SUFFIX@.la + libfftw3@PREC_SUFFIX@_omp_la_SOURCES = api.c conf.c openmp.c \ + threads.h dft-vrank-geq1.c ct.c rdft-vrank-geq1.c hc2hc.c \ + vrank-geq1-rdft2.c f77api.c f77funcs.h + + libfftw3@PREC_SUFFIX@_omp_la_CFLAGS = $(AM_CFLAGS) $(OPENMP_CFLAGS) +-libfftw3@PREC_SUFFIX@_omp_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ ++libfftw3@PREC_SUFFIX@_omp_la_LDFLAGS = \ ++@QUAD_FALSE@@COMBINED_THREADS_FALSE@ -no-undefined \ ++ -version-info @SHARED_VERSION_INFO@ + @COMBINED_THREADS_FALSE@libfftw3@PREC_SUFFIX@_omp_la_LIBADD = ../libfftw3@PREC_SUFFIX@.la + all: all-am + diff --git a/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD new file mode 100644 index 00000000000..53dc7970d78 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD @@ -0,0 +1,161 @@ +# Maintainer: Alexey Pavlov + +_realname=fftw +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +_pkgver=3.3.10 +pkgver=${_pkgver//-/.} +pkgrel=5 +pkgdesc="A library for computing the discrete Fourier transform (DFT) (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://www.fftw.org/" +license=("spdx:GPL-2.0-or-later") +makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-cmake" + $( [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || \ + echo "${MINGW_PACKAGE_PREFIX}-gcc-fortran")) +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") +options=('staticlibs' 'strip') +source=("https://www.fftw.org/${_realname}-${_pkgver}.tar.gz" + "0001-detect-arm64-counter.patch" + "0002-no-dllexport.patch" + "0003-shared-lib.patch") +sha256sums=('56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467' + 'f8be1bef7df7438328d0aabefd51a7043a6f9f569b646e0e3151db9cdc9ff05e' + 'd44e0b25fee59bee3b2fa81ce86762b66158d5e2be7f350d8cf937691aa72b5b' + 'd82e96c8545515b9c83d54356209ee9c4a45bedc3859cb01cf3966dc38fc7a33') + +precision="double float \ + $( [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || echo "quad" )" + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -Nbp1 -i "${srcdir}/${_patch}" + done +} + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + apply_patch_with_msg \ + 0001-detect-arm64-counter.patch \ + 0002-no-dllexport.patch \ + 0003-shared-lib.patch +} + +build() { + # clang complains when trying to use an sse2 intrinsic if sse2 is not enabled + if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-i686* ]]; then + CFLAGS+=" -msse2" + fi + + for cur in ${precision}; do + [[ -d "${srcdir}"/build-${MSYSTEM}-${cur} ]] && rm -rf "${srcdir}"/build-${MSYSTEM}-${cur} + mkdir -p "${srcdir}"/build-${MSYSTEM}-${cur} && cd "${srcdir}"/build-${MSYSTEM}-${cur} + + msg "Building ${_realname} for ${cur} precision ..." + + # create FFTW3LibraryDepends.cmake by configuring (but not building) with cmake + local -a _config_cmake="" + if [ "${cur}" = "float" ]; then + _config_cmake="-DENABLE_FLOAT=ON" + elif [ "${cur}" = "long_double" ]; then + _config_cmake="-DENABLE_LONG_DOUBLE=ON" + elif [ "${cur}" = "quad" ]; then + _config_cmake="-DENABLE_QUAD_PRECISION=ON" + fi + + if [[ $CARCH != aarch64 ]]; then + _config_cmake+=" -DENABLE_SSE=ON -DENABLE_SSE2=ON -DENABLE_AVX=ON -DENABLE_AVX2=ON" + fi + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe \ + -Wno-dev \ + -GNinja \ + ${_config_cmake} \ + -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ + -DBUILD_SHARED_LIBS=ON \ + -DENABLE_OPENMP=ON \ + -DENABLE_THREADS=ON \ + ../${_realname}-${_pkgver} + + # build library using autotools + local -a _config="" + if [[ $CARCH != aarch64 ]]; then + _config+="--enable-sse2 --enable-avx --enable-avx-128-fma --enable-avx2" + fi + if [ $CARCH = x86_64 ]; then + _config+=" --enable-avx512" + fi + + if [ "${cur}" = "float" ]; then + _config+=" --enable-float" + elif [ "${cur}" = "long_double" ]; then + _config="--enable-long-double" + elif [ "${cur}" = "quad" ]; then + _config="--enable-quad-precision" + fi + + ../${_realname}-${_pkgver}/configure \ + --prefix="${MINGW_PREFIX}" \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + ${_config} \ + --enable-static \ + --enable-single \ + --disable-shared \ + --disable-doc \ + --disable-fortran \ + --enable-threads \ + --with-our-malloc \ + --with-g77-wrappers \ + --with-windows-f77-mangling \ + --with-combined-threads \ + --with-incoming-stack-boundary=2 + + make + done +} + +package() { + for cur in ${precision}; do + msg "Installing ${_realname} for ${cur} precision ..." + cd "${srcdir}"/build-${MSYSTEM}-${cur} + + make DESTDIR="${pkgdir}" install -C "${srcdir}"/build-${MSYSTEM}-${cur} + + # move .cmake files to correct directory + local _prec_prefix + local _file_prefix + case "${cur}" in + double) + _prec_prefix=fftw3 + _file_prefix=FFTW3 + ;; + float) + _prec_prefix=fftw3f + _file_prefix=FFTW3f + ;; + long_double) + _prec_prefix=fftw3l + _file_prefix=FFTW3l + ;; + quad) + _prec_prefix=fftw3q + _file_prefix=FFTW3q + ;; + esac + local _staging_prefix=$(cygpath -am ${srcdir}/build-${MSYSTEM}-${cur}) + sed -e "s|IMPORTED_IMPLIB_RELEASE \"${_staging_prefix}|IMPORTED_IMPLIB_RELEASE \"${MINGW_PREFIX}/lib|g" -i ./FFTW3LibraryDepends.cmake + sed -e "s|IMPORTED_LOCATION_RELEASE \"${_staging_prefix}|IMPORTED_LOCATION_RELEASE \"${MINGW_PREFIX}/bin|g" -i ./FFTW3LibraryDepends.cmake + install -Dm644 ./FFTW3LibraryDepends.cmake "${pkgdir}"${MINGW_PREFIX}/lib/cmake/${_prec_prefix}/FFTW3LibraryDepends.cmake + mv "${pkgdir}"${MINGW_PREFIX}/lib/cmake/fftw3/${_file_prefix}*.cmake "${pkgdir}"${MINGW_PREFIX}/lib/cmake/${_prec_prefix}/ + done +} diff --git a/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD new file mode 100644 index 00000000000..3afcb554989 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD @@ -0,0 +1,94 @@ +# Maintainer: Alexey Pavlov +# Contributor: Renato Silva + +_with_harfbuzz="no" + +_realname=freetype +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=2.13.2 +pkgrel=1 +pkgdesc="TrueType font rendering library (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +msys2_references=( + 'archlinux: freetype2' + "cpe: cpe:/a:freetype:freetype" +) +url="https://www.freetype.org/" +license=('spdx:GPL-2.0-or-later OR FTL') +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-jellyfin-brotli" + "${MINGW_PACKAGE_PREFIX}-jellyfin-bzip2" + "${MINGW_PACKAGE_PREFIX}-jellyfin-libpng" + "${MINGW_PACKAGE_PREFIX}-jellyfin-zlib") +if [ "${_with_harfbuzz}" == "yes" ]; then + depends+=("${MINGW_PACKAGE_PREFIX}-harfbuzz") +fi +makedepends=("${MINGW_PACKAGE_PREFIX}-meson" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-pkgconf" + "${MINGW_PACKAGE_PREFIX}-cc") +source=(https://sourceforge.net/projects/freetype/files/freetype2/${pkgver}/freetype-${pkgver}.tar.xz{,.sig} + freetype-2.10.0-enable-valid.patch + freetype-2.10.0-enable-spr.patch) +sha256sums=('12991c4e55c506dd7f9b765933e62fd2be2e06d421505d7950a132e4f1bb484d' + 'SKIP' + '30e84993f899b66c31451992667f7ac6cc9e0b19dfe2f47ccb546d77bbc77ef5' + '0571f18d97834df020e4cbdb1338b14f9160669f868237080951e01f5b86727c') +validpgpkeys=('E30674707856409FF1948010BE6C3AAC63AD8E3F') # Werner Lemberg + +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" + +# Helper macros to help make tasks easier # +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -Nbp1 -i "${srcdir}/${_patch}" + done +} + +prepare() { + cd "${srcdir}/freetype-${pkgver}" + + apply_patch_with_msg \ + freetype-2.10.0-enable-valid.patch \ + freetype-2.10.0-enable-spr.patch +} + +build() { + mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" + + declare -a extra_config + if check_option "debug" "n"; then + extra_config+=("--buildtype=release") + else + extra_config+=("--buildtype=debug") + fi + + if [ "${_with_harfbuzz}" != "yes" ]; then + extra_config+=("-Dharfbuzz=disabled") + fi + + MSYS2_ARG_CONV_EXCL="--prefix=" \ + meson setup \ + --prefix="${MINGW_PREFIX}" \ + --wrap-mode=nodownload \ + --auto-features=enabled \ + --default-library=static \ + "${extra_config[@]}" \ + ../${_realname}-${pkgver} + + meson compile +} + +package () { + cd "${srcdir}/build-${MSYSTEM}" + + DESTDIR="${pkgdir}" meson install + + # Licenses + install -Dm644 "${srcdir}/${_realname}-${pkgver}/docs/GPLv2.TXT" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/GPLv2.TXT" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/docs/FTL.TXT" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/FTL.TXT" +} diff --git a/msys2/PKGBUILD/20-mingw-w64-freetype/freetype-2.10.0-enable-spr.patch b/msys2/PKGBUILD/20-mingw-w64-freetype/freetype-2.10.0-enable-spr.patch new file mode 100644 index 00000000000..ff7e13f8c76 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-freetype/freetype-2.10.0-enable-spr.patch @@ -0,0 +1,12 @@ +diff -Naur freetype-2.10.0.orig/include/freetype/config/ftoption.h freetype-2.10.0/include/freetype/config/ftoption.h +--- freetype-2.10.0.orig/include/freetype/config/ftoption.h 2019-03-15 18:09:32.842668200 -0400 ++++ freetype-2.10.0/include/freetype/config/ftoption.h 2019-03-15 18:20:57.389665500 -0400 +@@ -126,7 +126,7 @@ + * macro is not defined, FreeType offers alternative LCD rendering + * technology that produces excellent output without LCD filtering. + */ +-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ ++#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING + + + /************************************************************************** diff --git a/msys2/PKGBUILD/20-mingw-w64-freetype/freetype-2.10.0-enable-valid.patch b/msys2/PKGBUILD/20-mingw-w64-freetype/freetype-2.10.0-enable-valid.patch new file mode 100644 index 00000000000..a2204483cf9 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-freetype/freetype-2.10.0-enable-valid.patch @@ -0,0 +1,21 @@ +diff -Naur freetype-2.10.0.orig/modules.cfg freetype-2.10.0/modules.cfg +--- freetype-2.10.0.orig/modules.cfg 2019-03-15 18:09:32.780172700 -0400 ++++ freetype-2.10.0/modules.cfg 2019-03-15 18:10:26.450039100 -0400 +@@ -111,7 +111,7 @@ + + # TrueType GX/AAT table validation. Needs `ftgxval.c' below. + # +-# AUX_MODULES += gxvalid ++AUX_MODULES += gxvalid + + # Support for streams compressed with gzip (files with suffix .gz). + # +@@ -130,7 +130,7 @@ + + # OpenType table validation. Needs `ftotval.c' below. + # +-# AUX_MODULES += otvalid ++AUX_MODULES += otvalid + + # Auxiliary PostScript driver component to share common code. + # diff --git a/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD new file mode 100644 index 00000000000..026d2905d4c --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD @@ -0,0 +1,48 @@ +# Maintainer: Alexey Pavlov + +_realname=fribidi +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=1.0.15 +pkgrel=1 +pkgdesc="A Free Implementation of the Unicode Bidirectional Algorithm (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +license=('spdx:LGPL-2.1-or-later') +url="https://github.com/fribidi/fribidi/" +msys2_references=( + "cpe: cpe:/a:gnu:fribidi" +) +depends=() +makedepends=("${MINGW_PACKAGE_PREFIX}-meson" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-pkgconf" + "${MINGW_PACKAGE_PREFIX}-cc") +source=("https://github.com/fribidi/fribidi/releases/download/v${pkgver}/fribidi-${pkgver}.tar.xz") +sha256sums=('0bbc7ff633bfa208ae32d7e369cf5a7d20d5d2557a0b067c9aa98bcbf9967587') + +export MINGW_FFBUILD_PREFIX="${MINGW_PREFIX}/ffbuild/" + +build() { + MSYS2_ARG_CONV_EXCL="--prefix=" \ + ${MINGW_PREFIX}/bin/meson.exe setup \ + --prefix=${MINGW_FFBUILD_PREFIX} \ + --buildtype plain \ + --prefix=${MINGW_FFBUILD_PREFIX} \ + -Ddocs=false \ + --default-library static \ + build-${MSYSTEM}-static \ + ${_realname}-${pkgver} + + ${MINGW_PREFIX}/bin/meson.exe compile -C build-${MSYSTEM}-static +} + +check() { + meson test -C build-${MSYSTEM}-static +} + +package() { + meson install -C build-${MSYSTEM}-static --destdir="${pkgdir}" + + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_FFBUILD_PREFIX}/share/licenses/${_realname}/COPYING" +} diff --git a/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD new file mode 100644 index 00000000000..78c29251185 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: Alexey Pavlov + +_realname=gmp +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}") +pkgver=6.3.0 +pkgrel=2 +pkgdesc="A free library for arbitrary precision arithmetic (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://gmplib.org/" +msys2_references=( + "cpe: cpe:/a:gmplib:gmp" +) +license=('LGPL3' 'GPL') +makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" "${MINGW_PACKAGE_PREFIX}-cc") +source=(https://mirrors.kernel.org/gnu/gmp/${_realname}-${pkgver}.tar.xz{,.sig} + do-not-use-dllimport.diff + gmp-staticlib.diff) +sha256sums=('a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898' + 'SKIP' + '385ab704f82c47f3aecc9141f43c96e7b8de2bf0e654dc457ce0f1a039db2c68' + '7c3cde2634baa2cb1c31404bbfed2d8d7ba33556971ac842a08f2e87667849ab') +validpgpkeys=('343C2FF0FBEE5EC2EDBEF399F3599FF828C67298') # Niels Möller " + +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + [[ -d ../stash ]] && rm -rf ../stash + mkdir ../stash + cp config.{guess,sub} ../stash + patch -p2 -i ${srcdir}/do-not-use-dllimport.diff + patch -p1 -i ${srcdir}/gmp-staticlib.diff + autoreconf -fiv + cp -f ../stash/config.{guess,sub} . +} + +build() { + local -a extra_config + case "$CARCH" in + i?86|x86_64) + extra_config+=(--enable-fat) + ;; + *) + extra_config+=(--disable-assembly) + ;; + esac + + CFLAGS+=" -Wno-attributes -Wno-ignored-attributes" + + # Build static version + mkdir -p "${srcdir}/static-${MSYSTEM}" && cd "${srcdir}/static-${MSYSTEM}" + ../${_realname}-${pkgver}/configure \ + --build=${MINGW_CHOST} \ + --prefix=${MINGW_PREFIX} \ + --enable-cxx \ + "${extra_config[@]}" \ + --enable-static \ + --disable-shared + make +} + +check() { + cd "${srcdir}/static-${MSYSTEM}" + make check +} + +package() { + cd "${srcdir}/static-${MSYSTEM}" + make DESTDIR="${pkgdir}" install +} diff --git a/msys2/PKGBUILD/20-mingw-w64-gmp/do-not-use-dllimport.diff b/msys2/PKGBUILD/20-mingw-w64-gmp/do-not-use-dllimport.diff new file mode 100644 index 00000000000..765a2aa2124 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-gmp/do-not-use-dllimport.diff @@ -0,0 +1,13 @@ +diff --git a/gmp-6.2.1.orig/gmp-h.in b/gmp-6.2.1/gmp-h.in +index 3d449d427..942fab4b1 100644 +--- a/gmp-6.2.1.orig/gmp-h.in ++++ b/gmp-6.2.1/gmp-h.in +@@ -101,7 +101,7 @@ see https://www.gnu.org/licenses/. */ + + #if defined (__GNUC__) + #define __GMP_DECLSPEC_EXPORT __declspec(__dllexport__) +-#define __GMP_DECLSPEC_IMPORT __declspec(__dllimport__) ++#define __GMP_DECLSPEC_IMPORT + #endif + #if defined (_MSC_VER) || defined (__BORLANDC__) + #define __GMP_DECLSPEC_EXPORT __declspec(dllexport) diff --git a/msys2/PKGBUILD/20-mingw-w64-gmp/gmp-staticlib.diff b/msys2/PKGBUILD/20-mingw-w64-gmp/gmp-staticlib.diff new file mode 100644 index 00000000000..1fa0b880082 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-gmp/gmp-staticlib.diff @@ -0,0 +1,25 @@ +diff -aurp gmp-6.3.0-orig/gmp-h.in gmp-6.3.0/gmp-h.in +--- gmp-6.3.0-orig/gmp-h.in 2023-09-13 19:30:34.000000000 +0200 ++++ gmp-6.3.0/gmp-h.in 2023-09-13 19:32:29.000000000 +0200 +@@ -59,8 +59,12 @@ see https://www.gnu.org/licenses/. */ + /* Instantiated by configure. */ + #if ! defined (__GMP_WITHIN_CONFIGURE) + @DEFN_LONG_LONG_LIMB@ ++#ifdef GMP_STATICLIB ++#define __GMP_LIBGMP_DLL 0 ++#else + #define __GMP_LIBGMP_DLL @LIBGMP_DLL@ + #endif ++#endif + + + /* __GMP_DECLSPEC supports Windows DLL versions of libgmp, and is empty in +diff -aurp gmp-6.3.0-orig/gmp.pc.in gmp-6.3.0/gmp.pc.in +--- gmp-6.3.0-orig/gmp.pc.in 2023-09-13 19:30:34.000000000 +0200 ++++ gmp-6.3.0/gmp.pc.in 2023-09-14 00:10:14.000000000 +0200 +@@ -8,4 +8,5 @@ Description: GNU Multiple Precision Arit + URL: https://gmplib.org + Version: @PACKAGE_VERSION@ + Cflags: -I${includedir} ++Cflags.private: -DGMP_STATICLIB + Libs: -L${libdir} -lgmp diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/0027-decoding-segfault.patch b/msys2/PKGBUILD/20-mingw-w64-libxml2/0027-decoding-segfault.patch new file mode 100644 index 00000000000..6ba6b304ecf --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/0027-decoding-segfault.patch @@ -0,0 +1,31 @@ +From 07b1c4c8a736a31ac4b8ae13ea25d50793dfea83 Mon Sep 17 00:00:00 2001 +From: Mike Gorse +Date: Fri, 25 Jan 2019 12:55:52 -0600 +Subject: [PATCH] python: return None if PY_IMPORT_STRING returns NULL + +PY_IMPORT_STRING might return NULL on python 3 if, ie, a string can't be +encoded. We should check for this and return None, rather than returning +NULL. Fixes a NULL pointer dereference when reporting an error with an +invalid string. +--- + python/types.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/python/types.c b/python/types.c +index 124af565..50951ba3 100644 +--- a/python/types.c ++++ b/python/types.c +@@ -150,6 +150,10 @@ libxml_charPtrConstWrap(const char *str) + return (Py_None); + } + ret = PY_IMPORT_STRING(str); ++ if (ret == NULL) { ++ Py_INCREF(Py_None); ++ return (Py_None); ++ } + return (ret); + } + +-- +GitLab + diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/0029-xml2-config-win-paths.patch b/msys2/PKGBUILD/20-mingw-w64-libxml2/0029-xml2-config-win-paths.patch new file mode 100644 index 00000000000..61bb70e4b20 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/0029-xml2-config-win-paths.patch @@ -0,0 +1,10 @@ +--- a/xml2-config.in ++++ b/xml2-config.in +@@ -1,6 +1,6 @@ + #! /bin/sh + +-prefix=@prefix@ ++prefix="$(cygpath -m "@prefix@")" + exec_prefix=@exec_prefix@ + includedir=@includedir@ + libdir=@libdir@ diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/0030-pkgconfig-add-Cflags-private.patch b/msys2/PKGBUILD/20-mingw-w64-libxml2/0030-pkgconfig-add-Cflags-private.patch new file mode 100644 index 00000000000..29add4a86c0 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/0030-pkgconfig-add-Cflags-private.patch @@ -0,0 +1,7 @@ +--- a/libxml-2.0.pc.in ++++ b/libxml-2.0.pc.in +@@ -11,3 +11,4 @@ + Libs: -L${libdir} -lxml2 + Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ + Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@ ++Cflags.private: -DLIBXML_STATIC diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/0031-apply-msvc-relocation.patch b/msys2/PKGBUILD/20-mingw-w64-libxml2/0031-apply-msvc-relocation.patch new file mode 100644 index 00000000000..8ea654f02d0 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/0031-apply-msvc-relocation.patch @@ -0,0 +1,39 @@ +--- a/catalog.c ++++ b/catalog.c +@@ -74,7 +74,7 @@ + #define XML_SGML_DEFAULT_CATALOG "file://" SYSCONFDIR "/sgml/catalog" + #endif + +-#if defined(_WIN32) && defined(_MSC_VER) ++#if defined(_WIN32) + #undef XML_XML_DEFAULT_CATALOG + static char XML_XML_DEFAULT_CATALOG[256] = "file://" SYSCONFDIR "/xml/catalog"; + #if !defined(_WINDOWS_) +@@ -3117,10 +3117,14 @@ + + catalogs = (const char *) getenv("XML_CATALOG_FILES"); + if (catalogs == NULL) +-#if defined(_WIN32) && defined(_MSC_VER) ++#if defined(_WIN32) + { + void* hmodule; ++#ifdef _MSC_VER + hmodule = GetModuleHandleA("libxml2.dll"); ++#else ++ hmodule = GetModuleHandleA("libxml2-2.dll"); ++#endif + if (hmodule == NULL) + hmodule = GetModuleHandleA(NULL); + if (hmodule != NULL) { +@@ -3136,7 +3136,11 @@ + p--; + if (p != buf) { + xmlChar* uri; ++#ifdef _MSC_VER + strncpy(p, "\\..\\etc\\catalog", 255 - (p - buf)); ++#else ++ strncpy(p, "\\..\\etc\\xml\\catalog", 255 - (p - buf)); ++#endif + uri = xmlCanonicPath((const xmlChar*)buf); + if (uri != NULL) { + strncpy(XML_XML_DEFAULT_CATALOG, uri, 255); diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD new file mode 100644 index 00000000000..c8b4493ab07 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD @@ -0,0 +1,127 @@ +# Maintainer: Alexey Pavlov +# Contributor: Renato Silva + +_realname=libxml2 +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" + "${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}-docs") +pkgver=2.12.8 +pkgrel=1 +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +pkgdesc="XML parsing library, version 2 (mingw-w64)" +depends=("${MINGW_PACKAGE_PREFIX}-jellyfin-libiconv" + "${MINGW_PACKAGE_PREFIX}-jellyfin-xz" + "${MINGW_PACKAGE_PREFIX}-jellyfin-zlib") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-python") +optdepends=("${MINGW_PACKAGE_PREFIX}-python: Python bindings") +license=('spdx:MIT') +url="https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home" +msys2_repository_url="https://gitlab.gnome.org/GNOME/libxml2" +msys2_references=( + "cpe: cpe:/a:xmlsoft:libxml2" +) +install=${_realname}-${MSYSTEM}.install +source=("https://download.gnome.org/sources/libxml2/${pkgver%.*}/${_realname}-${pkgver}.tar.xz" + https://www.w3.org/XML/Test/xmlts20130923.tar.gz + 0027-decoding-segfault.patch + 0029-xml2-config-win-paths.patch + 0030-pkgconfig-add-Cflags-private.patch + 0031-apply-msvc-relocation.patch) +sha256sums=('43ad877b018bc63deb2468d71f95219c2fac196876ef36d1bee51d226173ec93' + '9b61db9f5dbffa545f4b8d78422167083a8568c59bd1129f94138f936cf6fc1f' + '0391a4b267ba7251ca74ff2e98bf4c0332a14b618e8147a9341ec5617e45d9d9' + '278b4531da3d2aabda080c412c5122b471202dd6df67768b38bb0c31c7a0e508' + '06c0afaf1b8dec10d6f23dec983026cddf992528ffbc1cc50418302fabf9dee0' + 'b4e3cf5faf0ba1100e2ae6b632dc429c0b25c8caca327e0888b41341d6ddbf9a') + +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" + +# Helper macros to help make tasks easier # +apply_patch_with_msg() { + for _fname in "$@" + do + msg2 "Applying ${_fname}" + patch -Nbp1 -i "${srcdir}"/${_fname} + done +} +# =========================================== # + +prepare() { + cd ${_realname}-${pkgver} + + apply_patch_with_msg \ + 0030-pkgconfig-add-Cflags-private.patch \ + 0031-apply-msvc-relocation.patch + + # https://gitlab.gnome.org/GNOME/libxml2/-/issues/64 + # https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/15 + # https://github.com/msys2/MINGW-packages/issues/7955 + apply_patch_with_msg \ + 0027-decoding-segfault.patch + + # https://github.com/msys2/MINGW-packages/issues/10577 + apply_patch_with_msg \ + 0029-xml2-config-win-paths.patch + + NOCONFIGURE=1 ./autogen.sh +} + +build() { + # Static build + msg2 "Building static for ${MSYSTEM}" + [[ -d "${srcdir}"/build-static-${MSYSTEM} ]] && rm -rf "${srcdir}"/build-static-${MSYSTEM} + mkdir -p ${srcdir}/build-static-${MSYSTEM} && cd ${srcdir}/build-static-${MSYSTEM} + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --build="${MINGW_CHOST}" \ + --without-python \ + --with-modules \ + --enable-static \ + --disable-shared \ + --with-threads=win32 \ + CFLAGS="${CFLAGS} -DLIBXML_STATIC_FOR_DLL -DNOLIBTOOL" + make +} + +check() { + : +} + +package_libxml2() { + # First install shared + make -C ${srcdir}/build-static-${MSYSTEM} install DESTDIR="${pkgdir}" + + # License + install -Dm644 "${srcdir}/${_realname}-${pkgver}/Copyright" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + + # Remove hard coded library path from xlm2-config and libxml-2.0.pc files + local PREFIX_DEPS=$(cygpath -am ${MINGW_PREFIX}) + sed -s "s|${PREFIX_DEPS}\/lib|\${libdir}|g" -i "${pkgdir}"${MINGW_PREFIX}/bin/xml2-config + sed -s "s|${PREFIX_DEPS}\/lib|\${libdir}|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libxml-2.0.pc + + mkdir -p dest${MINGW_PREFIX}/share + mv "${pkgdir}${MINGW_PREFIX}"/share/{doc,gtk-doc} dest${MINGW_PREFIX}/share +} + +package_libxml2-docs() { + pkgdesc+=" (documentation)" + depends=() + + mv dest/* "${pkgdir}" +} + +# template start; name=mingw-w64-splitpkg-wrappers; version=1.0; +# vim: set ft=bash : + +# generate wrappers +for _name in "${pkgname[@]}"; do + _short="package_${_name#${MINGW_PACKAGE_PREFIX}-jellyfin-}" + _func="$(declare -f "${_short}")" + eval "${_func/#${_short}/package_${_name}}" +done +# template end; diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANG32.install b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANG32.install new file mode 100644 index 00000000000..e1adf542a59 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANG32.install @@ -0,0 +1,12 @@ +MINGW_INSTALL=clang32 + +post_install() { + if test ! -f ${MINGW_INSTALL}/etc/xml/catalog; then + usr/bin/mkdir -p ${MINGW_INSTALL}/etc/xml + ${MINGW_INSTALL}/bin/xmlcatalog.exe --noout --create ${MINGW_INSTALL}/etc/xml/catalog + fi +} + +post_upgrade() { + post_install +} diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANG64.install b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANG64.install new file mode 100644 index 00000000000..41b1fe12ee6 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANG64.install @@ -0,0 +1,12 @@ +MINGW_INSTALL=clang64 + +post_install() { + if test ! -f ${MINGW_INSTALL}/etc/xml/catalog; then + usr/bin/mkdir -p ${MINGW_INSTALL}/etc/xml + ${MINGW_INSTALL}/bin/xmlcatalog.exe --noout --create ${MINGW_INSTALL}/etc/xml/catalog + fi +} + +post_upgrade() { + post_install +} diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANGARM64.install b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANGARM64.install new file mode 100644 index 00000000000..0ebe7c40def --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-CLANGARM64.install @@ -0,0 +1,12 @@ +MINGW_INSTALL=clangarm64 + +post_install() { + if test ! -f ${MINGW_INSTALL}/etc/xml/catalog; then + usr/bin/mkdir -p ${MINGW_INSTALL}/etc/xml + ${MINGW_INSTALL}/bin/xmlcatalog.exe --noout --create ${MINGW_INSTALL}/etc/xml/catalog + fi +} + +post_upgrade() { + post_install +} diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-MINGW32.install b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-MINGW32.install new file mode 100644 index 00000000000..624fe930131 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-MINGW32.install @@ -0,0 +1,12 @@ +MINGW_INSTALL=mingw32 + +post_install() { + if test ! -f ${MINGW_INSTALL}/etc/xml/catalog; then + usr/bin/mkdir -p ${MINGW_INSTALL}/etc/xml + ${MINGW_INSTALL}/bin/xmlcatalog.exe --noout --create ${MINGW_INSTALL}/etc/xml/catalog + fi +} + +post_upgrade() { + post_install +} diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-MINGW64.install b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-MINGW64.install new file mode 100644 index 00000000000..f08220fb72d --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-MINGW64.install @@ -0,0 +1,12 @@ +MINGW_INSTALL=mingw64 + +post_install() { + if test ! -f ${MINGW_INSTALL}/etc/xml/catalog; then + usr/bin/mkdir -p ${MINGW_INSTALL}/etc/xml + ${MINGW_INSTALL}/bin/xmlcatalog.exe --noout --create ${MINGW_INSTALL}/etc/xml/catalog + fi +} + +post_upgrade() { + post_install +} diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-UCRT64.install b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-UCRT64.install new file mode 100644 index 00000000000..8ba912f0e33 --- /dev/null +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/libxml2-UCRT64.install @@ -0,0 +1,12 @@ +MINGW_INSTALL=ucrt64 + +post_install() { + if test ! -f ${MINGW_INSTALL}/etc/xml/catalog; then + usr/bin/mkdir -p ${MINGW_INSTALL}/etc/xml + ${MINGW_INSTALL}/bin/xmlcatalog.exe --noout --create ${MINGW_INSTALL}/etc/xml/catalog + fi +} + +post_upgrade() { + post_install +} diff --git a/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD new file mode 100644 index 00000000000..71673c46f48 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD @@ -0,0 +1,64 @@ +# Maintainer: Alexey Pavlov + +_realname=chromaprint +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=1.5.1 +pkgrel=2 +pkgdesc="Library that implements a custom algorithm for extracting fingerprints from any audio source (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://acoustid.org/chromaprint" +license=("LGPL") +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-jellyfin-fftw") +makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-ninja") +options=('strip' 'staticlibs') +source=("https://github.com/acoustid/${_realname}/releases/download/v${pkgver}/${_realname}-${pkgver}.tar.gz") +sha256sums=('a1aad8fa3b8b18b78d3755b3767faff9abb67242e01b478ec9a64e190f335e1c') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" +export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" + +prepare() { + cd "${srcdir}"/${_realname}-${pkgver} +} + +build() { + _common_opts=( + -G"Ninja" + -DCMAKE_BUILD_TYPE=Release \ + -DFFT_LIB=fftw3f \ + -DBUILD_TESTS=off \ + -DBUILD_TOOLS=off \ + ) + + msg "Build static version" + [[ -d "${srcdir}/static-${MSYSTEM}" ]] && rm -r "${srcdir}/static-${MSYSTEM}" + mkdir -p "${srcdir}/static-${MSYSTEM}" && cd "${srcdir}/static-${MSYSTEM}" + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DBUILD_SHARED_LIBS=off \ + "${_common_opts[@]}" \ + ../${_realname}-${pkgver} + + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe --build ./ +} + +package() { + # static + cd "${srcdir}/static-${MSYSTEM}" + DESTDIR="${pkgdir}" ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe --install ./ + + # Let ffmpeg also statically link to fftw3 and stdc++ + # sed -s "s|-lchromaprint|-lchromaprint\ -lfftw3f -lstdc++|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc + # sed -s "s|Cflags\:|Cflags\:\ -DCHROMAPRINT_NODLL|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc + echo "Libs.private: -lfftw3f -lstdc++" >> "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc + echo "Cflags.private: -DCHROMAPRINT_NODLL" >> "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc +} diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/0002-fix-mkdir.mingw.patch b/msys2/PKGBUILD/30-mingw-w64-fontconfig/0002-fix-mkdir.mingw.patch new file mode 100644 index 00000000000..86b2f8dd474 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/0002-fix-mkdir.mingw.patch @@ -0,0 +1,12 @@ +--- fontconfig-2.13.93/test/test-migration.c.orig 2020-12-05 10:40:30.302459200 +0100 ++++ fontconfig-2.13.93/test/test-migration.c 2020-12-05 10:42:21.727935600 +0100 +@@ -30,6 +30,9 @@ + #include + #include + #include ++#ifdef _WIN32 ++#define mkdir(path,mode) _mkdir(path) ++#endif + #ifdef HAVE_UNISTD_H + #include + #endif diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/0004-fix-mkdtemp.mingw.patch b/msys2/PKGBUILD/30-mingw-w64-fontconfig/0004-fix-mkdtemp.mingw.patch new file mode 100644 index 00000000000..d3980a61118 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/0004-fix-mkdtemp.mingw.patch @@ -0,0 +1,216 @@ +--- fontconfig-2.11.0/test/test-migration.c.orig 2014-02-06 12:24:45.529605800 +0000 ++++ fontconfig-2.11.0/test/test-migration.c 2014-02-06 14:43:19.691870300 +0000 +@@ -9,6 +9,213 @@ + #endif + #include + ++#if defined(_WIN32) ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static PSECURITY_DESCRIPTOR ++create_sd (int permissions) ++{ ++ PSECURITY_DESCRIPTOR pSD = NULL; ++ int i; ++ int j; ++ EXPLICIT_ACCESS ea[3]; ++ PSID sids[3] = { NULL, NULL, NULL }; ++ WELL_KNOWN_SID_TYPE sidtypes[3] = { WinCreatorOwnerSid, WinCreatorGroupSid, WinWorldSid }; ++ int ea_len = 0; ++ DWORD dwRes, dwDisposition; ++ PACL pACL = NULL; ++ ++ /* Initialize a security descriptor. */ ++ pSD = (PSECURITY_DESCRIPTOR) LocalAlloc (LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH); ++ if (NULL == pSD) ++ { ++ errno = ENOMEM; ++ return NULL; ++ } ++ ++ if (!InitializeSecurityDescriptor (pSD, SECURITY_DESCRIPTOR_REVISION)) ++ { ++ LocalFree (pSD); ++ errno = EIO; ++ return NULL; ++ } ++ ++ for (i = 0; i < 3; i++) ++ { ++ BOOL b; ++ DWORD bytes; ++ int imasked = permissions & (07 << (2 - i)); ++ if (!imasked) ++ continue; ++ ++ bytes = SECURITY_MAX_SID_SIZE; ++ sids[ea_len] = (PSID) LocalAlloc (LMEM_FIXED, bytes); ++ if (NULL == sids[ea_len]) ++ { ++ errno = ENOMEM; ++ LocalFree (pSD); ++ for (j = 0; j < ea_len; j++) ++ { ++ if (sids[j] != NULL) ++ { ++ LocalFree (sids[j]); ++ sids[j] = NULL; ++ } ++ } ++ return NULL; ++ } ++ ++ b = CreateWellKnownSid (sidtypes[i], NULL, sids[ea_len], &bytes); ++ if (!b) ++ { ++ errno = EINVAL; ++ LocalFree (pSD); ++ for (j = 0; j < ea_len; j++) ++ { ++ if (sids[j] != NULL) ++ { ++ LocalFree (sids[j]); ++ sids[j] = NULL; ++ } ++ } ++ return NULL; ++ } ++ ++ /* Initialize an EXPLICIT_ACCESS structure for an ACE. */ ++ ZeroMemory (&ea[ea_len], sizeof(EXPLICIT_ACCESS)); ++ bytes = 0; ++ if (01 & imasked) ++ bytes = bytes | GENERIC_READ; ++ if (02 & imasked) ++ bytes = bytes | GENERIC_WRITE; ++ if (04 & imasked) ++ bytes = bytes | GENERIC_EXECUTE; ++ ea[ea_len].grfAccessPermissions = bytes; ++ ea[ea_len].grfAccessMode = SET_ACCESS; ++ ea[ea_len].grfInheritance= NO_INHERITANCE; ++ ea[ea_len].Trustee.TrusteeForm = TRUSTEE_IS_SID; ++ ea[ea_len].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP; ++ ea[ea_len].Trustee.ptstrName = (LPTSTR) sids[ea_len]; ++ ea_len = ea_len + 1; ++ } ++ ++ /* Create a new ACL that contains the new ACEs. */ ++ dwRes = SetEntriesInAcl (ea_len, ea, NULL, &pACL); ++ if (ERROR_SUCCESS != dwRes) ++ { ++ errno = EIO; ++ LocalFree (pSD); ++ for (j = 0; j < ea_len; j++) ++ { ++ if (sids[j] != NULL) ++ { ++ LocalFree (sids[j]); ++ sids[j] = NULL; ++ } ++ } ++ return NULL; ++ } ++ ++ for (j = 0; j < ea_len; j++) ++ { ++ if (sids[j] != NULL) ++ { ++ LocalFree (sids[j]); ++ sids[j] = NULL; ++ } ++ } ++ ++ /* Add the ACL to the security descriptor. */ ++ if (!SetSecurityDescriptorDacl (pSD, ++ TRUE, // bDaclPresent flag ++ pACL, ++ FALSE)) // not a default DACL ++ { ++ errno = EIO; ++ LocalFree (pSD); ++ LocalFree (pACL); ++ return NULL; ++ } ++ ++ return pSD; ++} ++ ++static void ++free_sd (PSECURITY_DESCRIPTOR sd) ++{ ++ BOOL b, present, defaulted; ++ PACL pACL = NULL; ++ present = FALSE; ++ b = GetSecurityDescriptorDacl (sd, &present, &pACL, &defaulted); ++ if (b && present && !defaulted && pACL) ++ LocalFree (pACL); ++ LocalFree (sd); ++} ++ ++static void ++randtemplate (char *template, size_t l) ++{ ++ int i; ++ for (i = l - 6; i < l; i++) ++ { ++ int r = rand (); ++ if ((r / (RAND_MAX + 1)) > ((RAND_MAX + 1) / 2)) ++ template[i] = 'A' + (double) rand () / (RAND_MAX + 1) * ('Z' - 'A'); ++ else ++ template[i] = 'a' + (double) rand () / (RAND_MAX + 1) * ('z' - 'a'); ++ } ++} ++ ++static char * ++mkdtemp (char *template) ++{ ++ int i; ++ size_t l; ++ BOOL b; ++ SECURITY_ATTRIBUTES sa; ++ ++ if (template == NULL) ++ { ++ errno = EINVAL; ++ return NULL; ++ } ++ l = strlen (template); ++ if (l < 6 || strcmp (&template[l - 6], "XXXXXX") != 0) ++ { ++ errno = EINVAL; ++ return NULL; ++ } ++ srand(time (NULL)); ++ sa.nLength = sizeof (sa); ++ sa.lpSecurityDescriptor = create_sd (0700); ++ sa.bInheritHandle = FALSE; ++ do ++ { ++ randtemplate (template, l); ++ SetLastError (0); ++ b = CreateDirectoryA (template, &sa); ++ } while (!b && GetLastError () == ERROR_ALREADY_EXISTS); ++ free_sd (sa.lpSecurityDescriptor); ++ if (!b) ++ { ++ errno = EIO; ++ return NULL; ++ } ++ else ++ { ++ errno = 0; ++ return template; ++ } ++} ++#endif ++ + FcBool + mkdir_p(const char *dir) + { diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/0005-fix-setenv.mingw.patch b/msys2/PKGBUILD/30-mingw-w64-fontconfig/0005-fix-setenv.mingw.patch new file mode 100644 index 00000000000..36d31d3b06a --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/0005-fix-setenv.mingw.patch @@ -0,0 +1,27 @@ +--- fontconfig-2.11.0/test/test-migration.c.orig 2014-02-06 14:43:19.691870300 +0000 ++++ fontconfig-2.11.0/test/test-migration.c 2014-02-06 14:48:25.336182200 +0000 +@@ -214,6 +214,24 @@ + return template; + } + } ++ ++static int ++setenv (const char *var, const char *val, int ovr) ++{ ++ BOOL b; ++ char c[2]; ++ if (!ovr) ++ { ++ DWORD d; ++ d = GetEnvironmentVariableA (var, c, 2); ++ if (0 != d && GetLastError () != ERROR_ENVVAR_NOT_FOUND) ++ return; ++ } ++ b = SetEnvironmentVariableA (var, val); ++ if (b) ++ return 0; ++ return 1; ++} + #endif + + FcBool diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/0007-pkgconfig.mingw.patch b/msys2/PKGBUILD/30-mingw-w64-fontconfig/0007-pkgconfig.mingw.patch new file mode 100644 index 00000000000..0895c2fc43c --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/0007-pkgconfig.mingw.patch @@ -0,0 +1,22 @@ +--- fontconfig-2.11.93/m4/pkg.m4.orig 2015-03-09 02:54:03.000000000 +0000 ++++ fontconfig-2.11.93/m4/pkg.m4 2015-04-06 11:04:21.862416100 +0000 +@@ -111,8 +111,8 @@ + pkg_failed=no + AC_MSG_CHECKING([for $1]) + +-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +-_PKG_CONFIG([$1][_LIBS], [libs], [$2]) ++_PKG_CONFIG([$1][_CFLAGS], [cflags --dont-define-prefix], [$2]) ++_PKG_CONFIG([$1][_LIBS], [libs --dont-define-prefix], [$2]) + + m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS + and $1[]_LIBS to avoid the need to call pkg-config. +@@ -207,7 +207,7 @@ + [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl + AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +-_PKG_CONFIG([$1], [variable="][$3]["], [$2]) ++_PKG_CONFIG([$1], [variable="][$3][" --dont-define-prefix], [$2]) + AS_VAR_COPY([$1], [pkg_cv_][$1]) + + AS_VAR_IF([$1], [""], [$5], [$4])dnl diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-fontconfig/PKGBUILD new file mode 100644 index 00000000000..5b3eb9c8c90 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/PKGBUILD @@ -0,0 +1,100 @@ +# Maintainer: Alexey Pavlov +# Contributor: Renato Silva + +_realname=fontconfig +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=2.15.0 +pkgrel=1 +pkgdesc="A library for configuring and customizing font access (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://wiki.freedesktop.org/www/Software/fontconfig/" +msys2_repository_url="https://gitlab.freedesktop.org/fontconfig/fontconfig" +license=("custom") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-python-lxml" + "${MINGW_PACKAGE_PREFIX}-gperf" + "${MINGW_PACKAGE_PREFIX}-gettext-runtime" + "python") +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-jellyfin-freetype" + "${MINGW_PACKAGE_PREFIX}-jellyfin-libxml2" + "${MINGW_PACKAGE_PREFIX}-jellyfin-libiconv") +options=('staticlibs' 'strip') +install=${_realname}-${MSYSTEM}.install +source=("https://www.freedesktop.org/software/fontconfig/release/fontconfig-${pkgver}.tar.xz" + 0002-fix-mkdir.mingw.patch + 0004-fix-mkdtemp.mingw.patch + 0005-fix-setenv.mingw.patch + 0007-pkgconfig.mingw.patch + https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/a76b95105ca26c600279b2daf4bd43b37a918823.patch) +sha256sums=('63a0658d0e06e0fa886106452b58ef04f21f58202ea02a94c39de0d3335d7c0e' + '9e5700b9c555e60cd8116fdc2e24cf0a01de01e83373dbbe78cef1e32b91da3b' + '57ff8420dbf62873b6fcb38b52fb7b37e0e278425a9125e15dccba54668c8ab9' + '552b54010f9fe4097f332cf2397bbd3e78489542d3bbf07792ed1cfe9381796e' + 'af373531873da46d0356305da5444c1ec74f443cd2635ea2db6b7dadd1561f5b' + 'c225c156c4732a492c9588c8d33705ca29af6f3195f201f4012b09ff012f1831') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd "${srcdir}"/${_realname}-${pkgver} + + patch -p1 -i ${srcdir}/0002-fix-mkdir.mingw.patch + patch -p1 -i ${srcdir}/0004-fix-mkdtemp.mingw.patch + patch -p1 -i ${srcdir}/0005-fix-setenv.mingw.patch + patch -p1 -i ${srcdir}/0007-pkgconfig.mingw.patch + + # backport because it seems relevant for us + patch -p1 -i ${srcdir}/a76b95105ca26c600279b2daf4bd43b37a918823.patch + + autoreconf -fiv +} + +build() { + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + [[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}" + mkdir -p "${srcdir}/build-${MINGW_CHOST}" + cd "${srcdir}/build-${MINGW_CHOST}" + + # Use msys python for link_confs.py, so we don't have to fixup the path conversion + # and patch out symlinking + PYTHON=/usr/bin/python \ + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --disable-shared \ + --enable-static \ + --enable-iconv \ + --with-libiconv=${MINGW_PREFIX} \ + --enable-libxml2 \ + --with-libxml2=${MINGW_PREFIX} \ + --disable-docs \ + --with-arch=${CARCH} \ + as_ln_s="cp -pR" + + sed -i 's,all-am: Makefile $(PROGRAMS),all-am:,' test/Makefile + make +} + +package() { + cd "${srcdir}/build-${MINGW_CHOST}" + make -j1 DESTDIR="${pkgdir}" install + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + + find "${pkgdir}${MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm + + # Also install libintl lib + cp "${MINGW_TOOLCHAIN_PREFIX}"/lib/libintl.a "${pkgdir}${MINGW_PREFIX}/lib/" + + # Convert MSYS2-specific paths to pkg-config variables (see issue #872) + sed -i "s#${MINGW_PREFIX}/lib#\${libdir}#g" "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/fontconfig.pc + sed -i "s#${MINGW_PREFIX}/include#\${includedir}#g" "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/fontconfig.pc + + # Also statically link to libintl + sed -s "s|-liconv|-liconv\ -lintl|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/fontconfig.pc +} diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANG32.install b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANG32.install new file mode 100644 index 00000000000..af2663dafbf --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANG32.install @@ -0,0 +1,30 @@ +MINGW_INSTALL=clang32 + +post_install() { + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + ${MINGW_INSTALL}/bin/fc-cache -f + echo "done." + fi +} + +post_upgrade() { + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + ${MINGW_INSTALL}/bin/fc-cache -f + echo "done." + fi +} + +post_remove() { + cat << _EOF + + Check for dead symlinks and leftover files + in ${MINGW_INSTALL}/etc/fonts/conf.d/ + +_EOF +} diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANG64.install b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANG64.install new file mode 100644 index 00000000000..a42bc1b522d --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANG64.install @@ -0,0 +1,18 @@ +MINGW_INSTALL=clang64 + +post_install() { + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" +} + +post_upgrade() { + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" +} + +post_remove() { + cat << _EOF + + Check for dead symlinks and leftover files + in ${MINGW_INSTALL}/etc/fonts/conf.d/ + +_EOF +} diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANGARM64.install b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANGARM64.install new file mode 100644 index 00000000000..670bde7b0bf --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-CLANGARM64.install @@ -0,0 +1,30 @@ +MINGW_INSTALL=clangarm64 + +post_install() { + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + ${MINGW_INSTALL}/bin/fc-cache -f + echo "done." + fi +} + +post_upgrade() { + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + ${MINGW_INSTALL}/bin/fc-cache -f + echo "done." + fi +} + +post_remove() { + cat << _EOF + + Check for dead symlinks and leftover files + in ${MINGW_INSTALL}/etc/fonts/conf.d/ + +_EOF +} diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-MINGW32.install b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-MINGW32.install new file mode 100644 index 00000000000..2556a14dd25 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-MINGW32.install @@ -0,0 +1,30 @@ +MINGW_INSTALL=mingw32 + +post_install() { + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + ${MINGW_INSTALL}/bin/fc-cache -f + echo "done." + fi +} + +post_upgrade() { + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + ${MINGW_INSTALL}/bin/fc-cache -f + echo "done." + fi +} + +post_remove() { + cat << _EOF + + Check for dead symlinks and leftover files + in ${MINGW_INSTALL}/etc/fonts/conf.d/ + +_EOF +} diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-MINGW64.install b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-MINGW64.install new file mode 100644 index 00000000000..a1a3617e776 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-MINGW64.install @@ -0,0 +1,30 @@ +MINGW_INSTALL=mingw64 + +post_install() { + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + ${MINGW_INSTALL}/bin/fc-cache -f + echo "done." + fi +} + +post_upgrade() { + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + ${MINGW_INSTALL}/bin/fc-cache -f + echo "done." + fi +} + +post_remove() { + cat << _EOF + + Check for dead symlinks and leftover files + in ${MINGW_INSTALL}/etc/fonts/conf.d/ + +_EOF +} diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-UCRT64.install b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-UCRT64.install new file mode 100644 index 00000000000..948f91a6c9e --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig-UCRT64.install @@ -0,0 +1,30 @@ +MINGW_INSTALL=ucrt64 + +post_install() { + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + ${MINGW_INSTALL}/bin/fc-cache -f + echo "done." + fi +} + +post_upgrade() { + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + ${MINGW_INSTALL}/bin/fc-cache -f + echo "done." + fi +} + +post_remove() { + cat << _EOF + + Check for dead symlinks and leftover files + in ${MINGW_INSTALL}/etc/fonts/conf.d/ + +_EOF +} diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig.hook.in b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig.hook.in new file mode 100644 index 00000000000..69abc17c38e --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/fontconfig.hook.in @@ -0,0 +1,14 @@ +[Trigger] +Type = Path +Operation = Install +Operation = Upgrade +Operation = Remove +Target = @MINGW_HOOK_TARGET_PREFIX@/share/fonts/* +Target = @MINGW_HOOK_TARGET_PREFIX@/etc/fonts/conf.d/* +Target = @MINGW_HOOK_TARGET_PREFIX@/share/fontconfig/conf.avail/* +Target = @MINGW_HOOK_TARGET_PREFIX@/share/fontconfig/conf.default/* + +[Action] +Description = Updating fontconfig cache... +When = PostTransaction +Exec = @MINGW_PREFIX@/bin/fc-cache -s \ No newline at end of file diff --git a/msys2/PKGBUILD/30-mingw-w64-harfbuzz/001-fix-build-with-chafa.patch b/msys2/PKGBUILD/30-mingw-w64-harfbuzz/001-fix-build-with-chafa.patch new file mode 100644 index 00000000000..9ed34f658fb --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-harfbuzz/001-fix-build-with-chafa.patch @@ -0,0 +1,13 @@ +--- a/util/hb-info.cc ++++ b/util/hb-info.cc +@@ -35,6 +35,10 @@ + # include + #endif + ++#ifdef environ ++#undef environ ++#endif ++ + const unsigned DEFAULT_FONT_SIZE = FONT_SIZE_UPEM; + const unsigned SUBPIXEL_BITS = 0; + diff --git a/msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD new file mode 100644 index 00000000000..b7129d1b4cb --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD @@ -0,0 +1,106 @@ +# Maintainer: Alexey Pavlov +# Contributor: Renato Silva + +_realname=harfbuzz +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}") +pkgver=9.0.0 +pkgrel=1 +pkgdesc="OpenType text shaping engine" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://github.com/harfbuzz/harfbuzz" +msys2_references=( + "archlinux: harfbuzz" + "cpe: cpe:/a:harfbuzz_project:harfbuzz" +) +license=('spdx:MIT') +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-meson" + "${MINGW_PACKAGE_PREFIX}-pkgconf" + "${MINGW_PACKAGE_PREFIX}-python" + "${MINGW_PACKAGE_PREFIX}-gtk-doc" + "${MINGW_PACKAGE_PREFIX}-ragel") +depends=("${MINGW_PACKAGE_PREFIX}-jellyfin-freetype" + "${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-gettext-runtime") +checkdepends=("${MINGW_PACKAGE_PREFIX}-python-fonttools" + "${MINGW_PACKAGE_PREFIX}-python-setuptools") +source=("https://github.com/harfbuzz/harfbuzz/releases/download/${pkgver}/harfbuzz-${pkgver}.tar.xz" + "001-fix-build-with-chafa.patch") +sha256sums=('a41b272ceeb920c57263ec851604542d9ec85ee3030506d94662067c7b6ab89e' + '26b37a1ca9872973905ecb96bcbe3f054472252320956faa74428206900d360e') +noextract=("harfbuzz-${pkgver}.tar.xz") + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + echo "Extracting harfbuzz-${pkgver}.tar.xz..." + tar -xJf harfbuzz-${pkgver}.tar.xz || true + + cd ${_realname}-${pkgver} + patch -p1 -i "${srcdir}"/001-fix-build-with-chafa.patch +} + +build() { + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + local -a _static_flags=( + -DGIO_STATIC_COMPILATION + -DGLIB_STATIC_COMPILATION + -DGMODULE_STATIC_COMPILATION + -DGOBJECT_STATIC_COMPILATION + -DGRAPHITE2_STATIC + ) + + CFLAGS+=" ${_static_flags[@]}" \ + CXXFLAGS+=" ${_static_flags[@]}" \ + MSYS2_ARG_CONV_EXCL="--prefix=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/meson setup \ + --prefix="${MINGW_PREFIX}" \ + --buildtype plain \ + --prefer-static \ + --wrap-mode=nofallback \ + --default-library=static \ + -Dauto_features=enabled \ + -Dintrospection=disabled \ + -Dgobject=disabled \ + -Dicu=disabled \ + -Dcpp_std=c++17 \ + -Dgdi=disabled \ + -Dgraphite=disabled \ + -Ddirectwrite=disabled \ + -Dtests=disabled \ + -Ddocs=disabled \ + -Dchafa=disabled \ + -Dcairo=disabled \ + -Dglib=disabled \ + "build-${MSYSTEM}-static" \ + "${_realname}-${pkgver}" + + ${MINGW_TOOLCHAIN_PREFIX}/bin/meson compile -C "build-${MSYSTEM}-static" +} + +check(){ + : +} + +package_harfbuzz() { + pkgdesc+=" (mingw-w64)" + + ${MINGW_TOOLCHAIN_PREFIX}/bin/meson install -C "build-${MSYSTEM}-static" --destdir "${pkgdir}" + + install -Dm644 "${srcdir}"/${_realname}-${pkgver}/COPYING \ + "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/COPYING +} + +# template start; name=mingw-w64-splitpkg-wrappers; version=1.0; +# vim: set ft=bash : + +# generate wrappers +for _name in "${pkgname[@]}"; do + _short="package_${_name#${MINGW_PACKAGE_PREFIX}-jellyfin-}" + _func="$(declare -f "${_short}")" + eval "${_func/#${_short}/package_${_name}}" +done +# template end; diff --git a/msys2/PKGBUILD/30-mingw-w64-lame/0002-07-field-width-fix.all.patch b/msys2/PKGBUILD/30-mingw-w64-lame/0002-07-field-width-fix.all.patch new file mode 100644 index 00000000000..88129666fff --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-lame/0002-07-field-width-fix.all.patch @@ -0,0 +1,25 @@ +Description: Fix warning on 64 bit machines. Explicitely set variables as + unsigned ints. +Origin: http://git.debian.org/?p=pkg-multimedia/lame.git;a=blob;f=debian/patches/07-field-width-fix.patch +Forwarded: commit:1.282 +Applied-Upstream: commit:1.282 + +--- a/frontend/parse.c ++++ b/frontend/parse.c +@@ -372,11 +372,11 @@ + const char *b = get_lame_os_bitness(); + const char *v = get_lame_version(); + const char *u = get_lame_url(); +- const size_t lenb = strlen(b); +- const size_t lenv = strlen(v); +- const size_t lenu = strlen(u); +- const size_t lw = 80; /* line width of terminal in characters */ +- const size_t sw = 16; /* static width of text */ ++ const unsigned int lenb = strlen(b); ++ const unsigned int lenv = strlen(v); ++ const unsigned int lenu = strlen(u); ++ const unsigned int lw = 80; /* line width of terminal in characters */ ++ const unsigned int sw = 16; /* static width of text */ + + if (lw >= lenb + lenv + lenu + sw || lw < lenu + 2) + /* text fits in 80 chars per line, or line even too small for url */ diff --git a/msys2/PKGBUILD/30-mingw-w64-lame/0005-no-gtk.all.patch b/msys2/PKGBUILD/30-mingw-w64-lame/0005-no-gtk.all.patch new file mode 100644 index 00000000000..fccb283d1d0 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-lame/0005-no-gtk.all.patch @@ -0,0 +1,11 @@ +--- lame-3.99.5/configure.in.orig 2014-04-30 16:21:08.328453700 +0000 ++++ lame-3.99.5/configure.in 2014-04-30 16:21:39.141366400 +0000 +@@ -392,7 +392,7 @@ + + dnl configure use of features + +-AM_PATH_GTK(1.2.0, HAVE_GTK="yes", HAVE_GTK="no") ++AC_SUBST(GTK_CFLAGS,[]) + + dnl ElectricFence malloc debugging + AC_MSG_CHECKING(use of ElectricFence malloc debugging) diff --git a/msys2/PKGBUILD/30-mingw-w64-lame/0006-dont-use-outdated-symbol-list.patch b/msys2/PKGBUILD/30-mingw-w64-lame/0006-dont-use-outdated-symbol-list.patch new file mode 100644 index 00000000000..2abb14e2fe9 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-lame/0006-dont-use-outdated-symbol-list.patch @@ -0,0 +1,10 @@ +--- lame-3.100/libmp3lame/Makefile.am.orig 2016-01-29 22:06:26.000000000 +0100 ++++ lame-3.100/libmp3lame/Makefile.am 2017-10-15 11:40:06.357621100 +0200 +@@ -22,7 +22,6 @@ + libmp3lame_la_LIBADD = $(cpu_ldadd) $(vector_ldadd) $(decoder_ldadd) \ + $(CONFIG_MATH_LIB) + libmp3lame_la_LDFLAGS = -version-info @LIB_MAJOR_VERSION@:@LIB_MINOR_VERSION@ \ +- -export-symbols $(top_srcdir)/include/libmp3lame.sym \ + -no-undefined + + INCLUDES = @INCLUDES@ -I$(top_srcdir)/mpglib -I$(top_builddir) diff --git a/msys2/PKGBUILD/30-mingw-w64-lame/0007-revert-posix-code.patch b/msys2/PKGBUILD/30-mingw-w64-lame/0007-revert-posix-code.patch new file mode 100644 index 00000000000..fa7c39eab16 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-lame/0007-revert-posix-code.patch @@ -0,0 +1,76 @@ +--- lame-3.100/frontend/parse.c.orig 2017-10-15 11:49:51.389922000 +0200 ++++ lame-3.100/frontend/parse.c 2017-10-15 11:56:02.377439500 +0200 +@@ -70,8 +70,6 @@ + #ifdef HAVE_ICONV + #include + #include +-#include +-#include + #endif + + #if defined _ALLOW_INTERNAL_OPTIONS +@@ -153,7 +151,9 @@ + size_t n = 1; + char dst[32]; + char* src = "A"; +- char* cur_code = nl_langinfo(CODESET); ++ char* env_lang = getenv("LANG"); ++ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.'); ++ char* cur_code = xxx_code == NULL ? "" : xxx_code+1; + iconv_t xiconv = iconv_open(cur_code, "ISO_8859-1"); + if (xiconv != (iconv_t)-1) { + for (n = 0; n < 32; ++n) { +@@ -181,7 +181,9 @@ + size_t const n = l*4; + dst = calloc(n+4, 4); + if (dst != 0) { +- char* cur_code = nl_langinfo(CODESET); ++ char* env_lang = getenv("LANG"); ++ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.'); ++ char* cur_code = xxx_code == NULL ? "" : xxx_code+1; + iconv_t xiconv = iconv_open(cur_code, "ISO_8859-1"); + if (xiconv != (iconv_t)-1) { + char* i_ptr = src; +@@ -205,7 +207,9 @@ + size_t const n = l*4; + dst = calloc(n+4, 4); + if (dst != 0) { +- char* cur_code = nl_langinfo(CODESET); ++ char* env_lang = getenv("LANG"); ++ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.'); ++ char* cur_code = xxx_code == NULL ? "" : xxx_code+1; + iconv_t xiconv = iconv_open(cur_code, "UTF-16LE"); + if (xiconv != (iconv_t)-1) { + char* i_ptr = (char*)src; +@@ -231,7 +235,9 @@ + size_t const n = l*4; + dst = calloc(n+4, 4); + if (dst != 0) { +- char* cur_code = nl_langinfo(CODESET); ++ char* env_lang = getenv("LANG"); ++ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.'); ++ char* cur_code = xxx_code == NULL ? "" : xxx_code+1; + iconv_t xiconv = iconv_open("ISO_8859-1//TRANSLIT", cur_code); + if (xiconv != (iconv_t)-1) { + char* i_ptr = (char*)src; +@@ -257,7 +263,9 @@ + size_t const n = (l+1)*4; + dst = calloc(n+4, 4); + if (dst != 0) { +- char* cur_code = nl_langinfo(CODESET); ++ char* env_lang = getenv("LANG"); ++ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.'); ++ char* cur_code = xxx_code == NULL ? "" : xxx_code+1; + iconv_t xiconv = iconv_open("UTF-16LE//TRANSLIT", cur_code); + dst[0] = 0xff; + dst[1] = 0xfe; +@@ -1513,9 +1521,6 @@ + enum TextEncoding id3_tenc = TENC_LATIN1; + #endif + +-#ifdef HAVE_ICONV +- setlocale(LC_CTYPE, ""); +-#endif + inPath[0] = '\0'; + outPath[0] = '\0'; + /* turn on display options. user settings may turn them off below */ diff --git a/msys2/PKGBUILD/30-mingw-w64-lame/0008-skip-termcap.patch b/msys2/PKGBUILD/30-mingw-w64-lame/0008-skip-termcap.patch new file mode 100644 index 00000000000..4ff0b78d286 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-lame/0008-skip-termcap.patch @@ -0,0 +1,11 @@ +--- lame-3.100/frontend/console.c.orig 2017-10-15 12:56:52 +0200 ++++ lame-3.100/frontend/console.c 2017-10-15 12:57:16 +0200 +@@ -145,7 +145,7 @@ + + strcpy(mfp->str_up, "\033[A"); + +-#ifdef HAVE_TERMCAP ++#if defined(HAVE_TERMCAP) && !defined(_WIN32) + apply_termcap_settings(mfp); + #endif /* TERMCAP_AVAILABLE */ + diff --git a/msys2/PKGBUILD/30-mingw-w64-lame/0009-lame-add-pkgconfig.patch b/msys2/PKGBUILD/30-mingw-w64-lame/0009-lame-add-pkgconfig.patch new file mode 100644 index 00000000000..eb59d29a0ac --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-lame/0009-lame-add-pkgconfig.patch @@ -0,0 +1,64 @@ +From: Nicolas Boulenguez +Date: Tue, 27 Sep 2022 20:15:44 +0200 +Subject: Generate and install a pkg-config file for user convenience + +This has been an upstream feature request for a while, and should be +forwarded to https://sourceforge.net/p/lame/feature-requests/42/. + +Bug-Debian: https://bugs.debian.org/829326 +--- + configure.in | 1 + + libmp3lame/Makefile.am | 6 ++++++ + libmp3lame/lame.pc.in | 10 ++++++++++ + 3 files changed, 17 insertions(+) + create mode 100644 libmp3lame/lame.pc.in + +diff --git a/configure.in b/configure.in +index 3f9fddb..073139a 100644 +--- a/configure.in ++++ b/configure.in +@@ -1241,6 +1241,7 @@ AC_SUBST(CONFIG_DEFS) + AC_CONFIG_FILES([Makefile \ + libmp3lame/Makefile \ + libmp3lame/i386/Makefile \ ++ libmp3lame/lame.pc \ + libmp3lame/vector/Makefile \ + frontend/Makefile \ + mpglib/Makefile \ +diff --git a/libmp3lame/Makefile.am b/libmp3lame/Makefile.am +index 50cef75..126a675 100644 +--- a/libmp3lame/Makefile.am ++++ b/libmp3lame/Makefile.am +@@ -30,6 +30,7 @@ INCLUDES = @INCLUDES@ -I$(top_srcdir)/mpglib -I$(top_builddir) + DEFS = @DEFS@ @CONFIG_DEFS@ + + EXTRA_DIST = \ ++ lame.pc.in \ + lame.rc \ + vbrquantize.h \ + logoe.ico +@@ -100,3 +101,8 @@ lclint: lclint.txt + #$(OBJECTS): libtool + #libtool: $(LIBTOOL_DEPS) + # $(SHELL) $(top_builddir)/config.status --recheck ++ ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA = lame.pc ++ ++DISTCLEANFILES = $(pkgconfig_DATA) +diff --git a/libmp3lame/lame.pc.in b/libmp3lame/lame.pc.in +new file mode 100644 +index 0000000..22ddd7a +--- /dev/null ++++ b/libmp3lame/lame.pc.in +@@ -0,0 +1,10 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: @PACKAGE_NAME@ ++Description: high quality MPEG Audio Layer III (MP3) encoder library ++Version: @PACKAGE_VERSION@ ++Libs: -L${libdir} -lmp3lame ++Cflags: -I${includedir}/lame diff --git a/msys2/PKGBUILD/30-mingw-w64-lame/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-lame/PKGBUILD new file mode 100644 index 00000000000..4d03db6d78f --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-lame/PKGBUILD @@ -0,0 +1,81 @@ +# Maintainer: Alexey Pavlov + +_realname=lame +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=3.100 +pkgrel=3 +pkgdesc="A high quality MPEG Audio Layer III (MP3) encoder (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://lame.sourceforge.io/" +msys2_references=( + "cpe: cpe:/a:lame_project:lame" +) +license=("LGPL") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-mpg123" + "${MINGW_PACKAGE_PREFIX}-ncurses" + "${MINGW_PACKAGE_PREFIX}-autotools" + $( [[ "${CARCH}" != "i686" \ + && "${CARCH}" != "x86_64" ]] \ + || echo "${MINGW_PACKAGE_PREFIX}-nasm" )) +depends=("${MINGW_PACKAGE_PREFIX}-jellyfin-libiconv") +options=('strip' 'staticlibs') +source=("https://downloads.sourceforge.net/${_realname}/${_realname}-${pkgver}.tar.gz" + 0002-07-field-width-fix.all.patch + 0005-no-gtk.all.patch + 0006-dont-use-outdated-symbol-list.patch + 0007-revert-posix-code.patch + 0008-skip-termcap.patch + 0009-lame-add-pkgconfig.patch) +sha256sums=('ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e' + 'd3ba595816761706d1e5dcf432f0b3ad8c9c6b37584032e21bf24c89e4fd0fc8' + 'cd3c8807de5b435b8e97200e369e7e8f93f7fc0eba7d44b393ede925e42d3b00' + '21c7ee85854be00a3e8e6790911292837676f083a5c1085718bed899096d3679' + '1e7f61456b15ceea613de8fd982b3f892340b851393d4ca4aff44395ae237ae9' + '8fddeebd0ccdec62ede2932ce3bbe767af6ed6f06018f7f13113401d4ce06179' + '65edcb5090417f822227b4a43f2f0c0224ceca7486fb3fd01aa9a6cf153ad714') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + + patch -p1 -i ${srcdir}/0002-07-field-width-fix.all.patch + patch -p1 -i ${srcdir}/0005-no-gtk.all.patch + patch -p1 -i ${srcdir}/0006-dont-use-outdated-symbol-list.patch + patch -p1 -i ${srcdir}/0007-revert-posix-code.patch + # tgetent() crashes under mingw64, not sure why + patch -p1 -i ${srcdir}/0008-skip-termcap.patch + + # https://salsa.debian.org/multimedia-team/lame + # https://sourceforge.net/p/lame/mailman/message/37616009/ + patch -p1 -i ${srcdir}/0009-lame-add-pkgconfig.patch + + autoreconf -fi +} + +build() { + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + [[ -d "build-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}" + mkdir -p "${srcdir}/build-${MINGW_CHOST}" + cd "${srcdir}/build-${MINGW_CHOST}" + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --disable-{shared,gtktest,cpml,frontend} \ + --enable-static \ + $( [[ "${CARCH}" != "i686" \ + && "${CARCH}" != "x86_64" ]] \ + || echo "--enable-nasm") + make +} + +package() { + cd "${srcdir}/build-${MINGW_CHOST}" + make DESTDIR="${pkgdir}" install +} diff --git a/msys2/PKGBUILD/30-mingw-w64-libbluray/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-libbluray/PKGBUILD new file mode 100644 index 00000000000..961cced62c7 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-libbluray/PKGBUILD @@ -0,0 +1,61 @@ +# Maintainer: Alexey Pavlov + +_realname=libbluray +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=1.3.4 +pkgrel=1 +pkgdesc="Library to access Blu-Ray disks for video playback (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url='https://www.videolan.org/developers/libbluray.html' +msys2_references=( + "cpe: cpe:/a:videolan:libbluray" +) +license=('spdx:LGPL-2.1-or-later') +depends=("${MINGW_PACKAGE_PREFIX}-jellyfin-libxml2" + "${MINGW_PACKAGE_PREFIX}-jellyfin-freetype") +makedepends=( + "${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-cc") +source=(https://download.videolan.org/pub/videolan/libbluray/${pkgver}/${_realname}-${pkgver}.tar.bz2) +sha256sums=('478ffd68a0f5dde8ef6ca989b7f035b5a0a22c599142e5cd3ff7b03bbebe5f2b') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd ${srcdir}/${_realname}-${pkgver} +} + +build() { + export lt_cv_deplibs_check_method='pass_all' + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + + [[ -d "${srcdir}/build-static-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-static-${MSYSTEM}" + mkdir -p "${srcdir}/build-static-${MSYSTEM}" && cd "${srcdir}/build-static-${MSYSTEM}" + + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --enable-examples \ + --disable-bdjava-jar \ + --enable-shared=no \ + --enable-static=yes \ + LIBXML2_CFLAGS="$("${MINGW_PREFIX}"/bin/xml2-config --cflags) -DLIBXML_STATIC" \ + LIBXML2_LIBS="$("${MINGW_PREFIX}"/bin/xml2-config --libs)" + + make +} + +package() { + cd "${srcdir}/build-static-${MSYSTEM}" + make DESTDIR="${pkgdir}" install + + local _prefix_win="$(cygpath -m "${MINGW_PREFIX}")" + sed -s "s|${_prefix_win}|${MINGW_PREFIX}|g" -i ${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/libbluray.pc + + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" +} diff --git a/msys2/PKGBUILD/30-mingw-w64-libogg/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-libogg/PKGBUILD new file mode 100644 index 00000000000..12e8660a599 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-libogg/PKGBUILD @@ -0,0 +1,65 @@ +# Maintainer: Alexey Pavlov + +_realname=libogg +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=1.3.5 +pkgrel=1 +pkgdesc="Ogg bitstream and framing library (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://xiph.org/" +license=('BSD') +makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-cc") +options=('staticlibs' 'strip') +source=("https://downloads.xiph.org/releases/ogg/${_realname}-${pkgver}.tar.gz" + "libogg-1.3.4-versioned-dll-cmake.patch") +sha256sums=('0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664' + '7f635d4ca41c75dc52206749b6346c174c6a028de09604c6d66929bcdabf6c33') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd ${srcdir}/${_realname}-${pkgver} + patch -Np1 -i "${srcdir}/libogg-1.3.4-versioned-dll-cmake.patch" +} + +build() { + export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" + declare -a extra_config + if check_option "debug" "n"; then + extra_config+=("-DCMAKE_BUILD_TYPE=Release") + else + extra_config+=("-DCMAKE_BUILD_TYPE=Debug") + fi + + # Static + [[ -d "${srcdir}/build-${MINGW_CHOST}-static" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}-static" + mkdir -p "${srcdir}/build-${MINGW_CHOST}-static" && cd "${srcdir}/build-${MINGW_CHOST}-static" + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ + -G'MSYS Makefiles' \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + "${extra_config[@]}" \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_TESTING=OFF \ + ../${_realname}-${pkgver} + + make +} + +package() { + # Static + cd "${srcdir}/build-${MINGW_CHOST}-static" + make DESTDIR="${pkgdir}" install + + # m4 + install -Dm644 ${srcdir}/${_realname}-${pkgver}/ogg.m4 ${pkgdir}${MINGW_PREFIX}/share/aclocal/ogg.m4 + + # License + install -Dm644 ${srcdir}/${_realname}-${pkgver}/COPYING ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING +} diff --git a/msys2/PKGBUILD/30-mingw-w64-libogg/libogg-1.3.4-versioned-dll-cmake.patch b/msys2/PKGBUILD/30-mingw-w64-libogg/libogg-1.3.4-versioned-dll-cmake.patch new file mode 100644 index 00000000000..2b250b124dc --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-libogg/libogg-1.3.4-versioned-dll-cmake.patch @@ -0,0 +1,58 @@ +diff -Naur libogg-1.3.4.orig/CMakeLists.txt libogg-1.3.4/CMakeLists.txt +--- libogg-1.3.4.orig/CMakeLists.txt 2019-09-02 15:05:06.093041600 -0400 ++++ libogg-1.3.4/CMakeLists.txt 2019-09-02 15:08:44.811923200 -0400 +@@ -103,6 +103,14 @@ + VERSION ${LIB_VERSION} + PUBLIC_HEADER "${OGG_HEADERS}" + ) ++if(WIN32) ++ set_target_properties(ogg ++ PROPERTIES ++ OUTPUT_NAME ogg ++ RUNTIME_OUTPUT_NAME ogg-${LIB_SOVERSION} ++ ARCHIVE_OUTPUT_NAME ogg ++ ) ++endif() + + if(BUILD_FRAMEWORK) + set_target_properties(ogg PROPERTIES +diff -Naur libogg-1.3.4.orig/win32/ogg.def libogg-1.3.4/win32/ogg.def +--- libogg-1.3.4.orig/win32/ogg.def 2019-09-02 15:05:06.093041600 -0400 ++++ libogg-1.3.4/win32/ogg.def 2019-09-02 15:08:44.811923200 -0400 +@@ -2,10 +2,11 @@ + ; ogg.def + ; List of exported functions for Windows builds. + ; +-LIBRARY ogg ++LIBRARY "libogg-0" + EXPORTS + ; + oggpack_writeinit ++oggpack_writecheck + oggpack_writetrunc + oggpack_writealign + oggpack_writecopy +@@ -24,6 +25,7 @@ + oggpack_get_buffer + ; + oggpackB_writeinit ++oggpackB_writecheck + oggpackB_writetrunc + oggpackB_writealign + oggpackB_writecopy +@@ -49,6 +51,7 @@ + ogg_sync_clear + ogg_sync_reset + ogg_sync_destroy ++ogg_sync_check + ogg_sync_buffer + ogg_sync_wrote + ogg_sync_pageseek +@@ -62,6 +65,7 @@ + ogg_stream_reset + ogg_stream_reset_serialno + ogg_stream_destroy ++ogg_stream_check + ogg_stream_eos + ogg_stream_pageout_fill + ogg_stream_flush_fill diff --git a/msys2/PKGBUILD/30-mingw-w64-libvpx/0001-enable-shared-on.mingw.patch b/msys2/PKGBUILD/30-mingw-w64-libvpx/0001-enable-shared-on.mingw.patch new file mode 100644 index 00000000000..9089fbe4f07 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-libvpx/0001-enable-shared-on.mingw.patch @@ -0,0 +1,168 @@ +diff -aur libvpx-1.6.0-orig/build/make/configure.sh libvpx-1.6.0/build/make/configure.sh +--- libvpx-1.6.0-orig/build/make/configure.sh 2016-07-21 04:15:41.000000000 +0300 ++++ libvpx-1.6.0/build/make/configure.sh 2016-07-28 18:34:25.287546800 +0300 +@@ -647,7 +647,10 @@ + --libdir=*) + libdir="${optval}" + ;; +- --libc|--as|--prefix|--libdir) ++ --bindir=*) ++ bindir="${optval}" ++ ;; ++ --libc|--as|--prefix|--libdir|--bindir) + die "Option ${opt} requires argument" + ;; + --help|-h) +@@ -618,9 +621,14 @@ + prefix="${prefix%/}" + libdir="${libdir:-${prefix}/lib}" + libdir="${libdir%/}" ++ bindir="${bindir:-${prefix}/bin}" ++ bindir="${bindir%/}" + if [ "${libdir#${prefix}}" = "${libdir}" ]; then + die "Libdir ${libdir} must be a subdirectory of ${prefix}" + fi ++ if [ "${bindir#${prefix}}" = "${bindir}" ]; then ++ die "Bindir ${bindir} must be a subdirectory of ${prefix}" ++ fi + } + + post_process_cmdline() { +diff -aur libvpx-1.6.0-orig/build/make/Makefile libvpx-1.6.0/build/make/Makefile +--- libvpx-1.6.0-orig/build/make/Makefile 2016-07-21 04:15:41.000000000 +0300 ++++ libvpx-1.6.0/build/make/Makefile 2016-07-28 18:34:25.287546800 +0300 +@@ -300,6 +300,20 @@ + $$(filter %.o,$$^) $$(extralibs) + endef + ++define dll_gnu_template ++# Not using a pattern rule here because we don't want to generate empty ++# archives when they are listed as a dependency in files not responsible ++# for creating them. ++# ++# This needs further abstraction for dealing with non-GNU linkers. ++$(1): ++ $(if $(quiet),@echo " [LD] $$@") ++ $(qexec)$$(LD) -shared $$(LDFLAGS) \ ++ -Wl,--no-undefined \ ++ -o $$@ \ ++ -Wl,--out-implib=$$(subst $(2),.dll.a,$(1)) $$(filter %.o,$$^) $$(extralibs) ++endef ++ + define dl_template + # Not using a pattern rule here because we don't want to generate empty + # archives when they are listed as a dependency in files not responsible +@@ -383,6 +397,7 @@ + $(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib)))) + $(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib)))) + $(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib)))) ++$(foreach lib,$(filter %-$(VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_gnu_template,$(lib),-$(VERSION_MAJOR).dll))) + + INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS) + ifeq ($(MAKECMDGOALS),dist) +Only in libvpx-1.6.0/build/make: Makefile.orig +diff -aur libvpx-1.6.0-orig/configure libvpx-1.6.0/configure +--- libvpx-1.6.0-orig/configure 2016-07-21 04:15:41.000000000 +0300 ++++ libvpx-1.6.0/configure 2016-07-28 18:37:36.879364800 +0300 +@@ -473,6 +473,7 @@ + DIST_DIR?=\$(DESTDIR)${prefix} + endif + LIBSUBDIR=${libdir##${prefix}/} ++BINSUBDIR=${bindir##${prefix}/} + + VERSION_STRING=${VERSION_STRING} + +@@ -510,9 +511,13 @@ + ;; + *) + if enabled gnu; then +- echo "--enable-shared is only supported on ELF; assuming this is OK" ++ echo "--enable-shared is only supported on ELF and PE; assuming this is OK" ++ elif enabled win32; then ++ echo "--enable-shared is only supported on ELF and PE; assuming this is OK" ++ elif enabled win64; then ++ echo "--enable-shared is only supported on ELF and PE; assuming this is OK" + else +- die "--enable-shared only supported on ELF, OS/2, and Darwin for now" ++ die "--enable-shared only supported on ELF, OS/2, Darwin and PE for now" + fi + ;; + esac +diff -aur libvpx-1.6.0-orig/examples.mk libvpx-1.6.0/examples.mk +--- libvpx-1.6.0-orig/examples.mk 2016-07-21 04:15:41.000000000 +0300 ++++ libvpx-1.6.0/examples.mk 2016-07-28 18:34:25.303172800 +0300 +@@ -302,9 +302,13 @@ + ifneq ($(filter os2%,$(TGT_OS)),) + SHARED_LIB_SUF=_dll.a + else ++ifneq ($(filter win%,$(TGT_OS)),) ++SHARED_LIB_SUF=.dll.a ++else + SHARED_LIB_SUF=.so + endif + endif ++endif + CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a) + $(foreach bin,$(BINS-yes),\ + $(eval $(bin):$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF))\ +diff -aur libvpx-1.6.0-orig/libs.mk libvpx-1.6.0/libs.mk +--- libvpx-1.6.0-orig/libs.mk 2016-07-21 04:15:41.000000000 +0300 ++++ libvpx-1.6.0/libs.mk 2016-07-28 18:34:25.303172800 +0300 +@@ -130,6 +130,7 @@ + INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx/% + INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/% + INSTALL_MAPS += $(LIBSUBDIR)/% % ++INSTALL_MAPS += $(BINSUBDIR)/% % + INSTALL_MAPS += src/% $(SRC_PATH_BARE)/% + ifeq ($(CONFIG_MSVS),yes) + INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Release/%) +@@ -252,6 +253,13 @@ + LIBVPX_SO_SYMLINKS := + LIBVPX_SO_IMPLIB := libvpx_dll.a + else ++ifeq ($(filter win%,$(TGT_OS)),$(TGT_OS)) ++LIBVPX_SO := libvpx-$(VERSION_MAJOR).dll ++SHARED_LIB_SUF := .dll.a ++EXPORT_FILE := ++LIBVPX_SO_SYMLINKS := ++LIBVPX_SO_IMPLIB := libvpx.dll.a ++else + LIBVPX_SO := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH) + SHARED_LIB_SUF := .so + EXPORT_FILE := libvpx.ver +@@ -261,13 +269,14 @@ + endif + endif + endif ++endif + + LIBS-$(CONFIG_SHARED) += $(BUILD_PFX)$(LIBVPX_SO)\ + $(notdir $(LIBVPX_SO_SYMLINKS)) \ + $(if $(LIBVPX_SO_IMPLIB), $(BUILD_PFX)$(LIBVPX_SO_IMPLIB)) + $(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE) + $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm +-$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR) ++$(BUILD_PFX)$(LIBVPX_SO): SONAME = $(LIBVPX_SO) + $(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE) + + libvpx.ver: $(call enabled,CODEC_EXPORTS) +@@ -295,6 +304,10 @@ + $(qexec)emximp -o $@ $< + CLEAN-OBJS += libvpx_dll.a + ++libvpx.dll.a: $(LIBVPX_SO) ++ @echo " [IMPLIB] $@" ++CLEAN-OBJS += libvpx.dll.a ++ + define libvpx_symlink_template + $(1): $(2) + @echo " [LN] $(2) $$@" +@@ -311,7 +324,7 @@ + + + INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS) +-INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO) ++INSTALL-LIBS-$(CONFIG_SHARED) += $(BINSUBDIR)/$(LIBVPX_SO) + INSTALL-LIBS-$(CONFIG_SHARED) += $(if $(LIBVPX_SO_IMPLIB),$(LIBSUBDIR)/$(LIBVPX_SO_IMPLIB)) + + diff --git a/msys2/PKGBUILD/30-mingw-w64-libvpx/0003-cross-with-native-binutils.mingw.patch b/msys2/PKGBUILD/30-mingw-w64-libvpx/0003-cross-with-native-binutils.mingw.patch new file mode 100644 index 00000000000..b8dab7d7e29 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-libvpx/0003-cross-with-native-binutils.mingw.patch @@ -0,0 +1,23 @@ +--- libvpx-1.6.1/build/make/configure.sh.orig 2017-04-18 07:55:35.521235500 -0400 ++++ libvpx-1.6.1/build/make/configure.sh 2017-04-18 08:03:57.773345200 -0400 +@@ -636,13 +636,13 @@ post_process_cmdline() { + } + + setup_gnu_toolchain() { +- CC=${CC:-${CROSS}gcc} +- CXX=${CXX:-${CROSS}g++} +- AR=${AR:-${CROSS}ar} +- LD=${LD:-${CROSS}${link_with_cc:-ld}} +- AS=${AS:-${CROSS}as} +- STRIP=${STRIP:-${CROSS}strip} +- NM=${NM:-${CROSS}nm} ++ CC=${CC:-gcc} ++ CXX=${CXX:-g++} ++ AR=${AR:-ar} ++ LD=${LD:-${link_with_cc:-ld}} ++ AS=${AS:-as} ++ STRIP=${STRIP:-strip} ++ NM=${NM:-nm} + AS_SFX=.S + EXE_SFX= + } diff --git a/msys2/PKGBUILD/30-mingw-w64-libvpx/0005-fix-exports.mingw.patch b/msys2/PKGBUILD/30-mingw-w64-libvpx/0005-fix-exports.mingw.patch new file mode 100644 index 00000000000..17bff593771 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-libvpx/0005-fix-exports.mingw.patch @@ -0,0 +1,11 @@ +diff -Naur libvpx-1.4.0-orig/vpx/exports_enc libvpx-1.4.0/vpx/exports_enc +--- libvpx-1.4.0-orig/vpx/exports_enc 2015-04-03 21:49:19.000000000 +0300 ++++ libvpx-1.4.0/vpx/exports_enc 2015-04-07 09:41:36.904200000 +0300 +@@ -2,6 +2,7 @@ + text vpx_codec_enc_config_set + text vpx_codec_enc_init_multi_ver + text vpx_codec_enc_init_ver ++text vpx_codec_enc_init_multi_ver + text vpx_codec_encode + text vpx_codec_get_cx_data + text vpx_codec_get_global_headers diff --git a/msys2/PKGBUILD/30-mingw-w64-libvpx/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-libvpx/PKGBUILD new file mode 100644 index 00000000000..4a9a86c4d5f --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-libvpx/PKGBUILD @@ -0,0 +1,116 @@ +# Maintainer: Alexey Pavlov + +_realname=libvpx +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=1.14.0 +pkgrel=1 +pkgdesc="The VP8/VP9 Codec SDK (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +license=('spdx:BSD-3-Clause') +depends=("${MINGW_PACKAGE_PREFIX}-libwinpthread-git") +makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-winpthreads-git" + $( [[ "${CARCH}" != "i686" \ + && "${CARCH}" != "x86_64" ]] \ + || echo "${MINGW_PACKAGE_PREFIX}-yasm" )) +url="https://www.webmproject.org/" +msys2_repository_url="https://github.com/webmproject/libvpx" +msys2_references=( + "cpe: cpe:/a:webmproject:libvpx" +) +source=(${_realname}-${pkgver}.tar.gz::https://github.com/webmproject/libvpx/archive/v${pkgver}.tar.gz + 0001-enable-shared-on.mingw.patch + 0003-cross-with-native-binutils.mingw.patch + 0005-fix-exports.mingw.patch) +options=('strip' 'staticlibs') +sha256sums=('5f21d2db27071c8a46f1725928a10227ae45c5cd1cad3727e4aafbe476e321fa' + 'f37a24525725cad215d73c538c0b06343b043f2b07553e7dc25835bd68af0695' + 'fabe7d4a756b33016947f741b1b5d8cbbf9aefd8862240645d0ed7bf7b4a3739' + '7c511b5df935278da2cba32b03b90582f360ab6786a5e32028bc82025193fabd') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +# Helper macros to help make tasks easier # +apply_patch_with_msg() { + msg2 "Applying $1" + patch -Np1 -i "${srcdir}"/$1 +} + +del_file_exists() { + for _fname in "$@" + do + if [ -f $_fname ]; then + rm -rf $_fname + fi + done +} +# =========================================== # + + +prepare() { + cd ${srcdir}/${_realname}-${pkgver} + + apply_patch_with_msg 0001-enable-shared-on.mingw.patch + apply_patch_with_msg 0003-cross-with-native-binutils.mingw.patch + apply_patch_with_msg 0005-fix-exports.mingw.patch +} + +build() { + [[ -d "${srcdir}"/build-${MSYSTEM} ]] && rm -rf "${srcdir}"/build-${MSYSTEM} + mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM} + + case "${MINGW_CHOST}" in + "i686-w64-mingw32") + _targetarch="x86-win32-gcc" + EXTRA_CFLAGS="-mstackrealign" + ;; + "x86_64-w64-mingw32") + _targetarch="x86_64-win64-gcc" + ;; + "aarch64-w64-mingw32") + _targetarch="arm64-win64-gcc" + ;; + esac + + LD=cc CFLAGS="$EXTRA_CFLAGS $CFLAGS -fno-asynchronous-unwind-tables" \ + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --target=${_targetarch} \ + --enable-vp8 \ + --enable-vp9 \ + --enable-vp9-highbitdepth \ + --enable-vp9-temporal-denoising \ + --enable-runtime-cpu-detect \ + --enable-postproc \ + --enable-pic \ + --disable-shared \ + --enable-static \ + --enable-experimental \ + --disable-examples \ + --disable-docs \ + --disable-install-docs \ + --disable-install-srcs \ + --disable-unit-tests + + for _ff in *.mk; do + sed -i "s/HAVE_GNU_STRIP=yes/HAVE_GNU_STRIP=no/g" $_ff + done + make #-j1 +} + +#These tests seem to take a lot of time +#check() { +# cd "${srcdir}/build-$MSYSTEM" +# make test +#} + +package() { + cd "${srcdir}/build-${MSYSTEM}" + make DIST_DIR="${pkgdir}${MINGW_PREFIX}" install + # Also install pthread + cp "${MINGW_TOOLCHAIN_PREFIX}"/lib/libpthread.a "${pkgdir}${MINGW_PREFIX}/lib/" +} diff --git a/msys2/PKGBUILD/30-mingw-w64-libwebp/0001-mingw-cmake-output.patch b/msys2/PKGBUILD/30-mingw-w64-libwebp/0001-mingw-cmake-output.patch new file mode 100644 index 00000000000..8fb926eb088 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-libwebp/0001-mingw-cmake-output.patch @@ -0,0 +1,11 @@ +--- libwebp-1.3.0/CMakeLists.txt.orig 2023-01-13 12:49:52.571844700 +0100 ++++ libwebp-1.3.0/CMakeLists.txt 2023-01-13 12:52:53.077790900 +0100 +@@ -713,7 +713,7 @@ + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +-set(ConfigPackageLocation ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake/) ++set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/) + install(EXPORT ${PROJECT_NAME}Targets NAMESPACE ${PROJECT_NAME}:: + DESTINATION ${ConfigPackageLocation}) + diff --git a/msys2/PKGBUILD/30-mingw-w64-libwebp/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-libwebp/PKGBUILD new file mode 100644 index 00000000000..7bc19fa66eb --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-libwebp/PKGBUILD @@ -0,0 +1,76 @@ +# Maintainer: Alexey Pavlov +# Contributor: Andrew Sun + +_realname=libwebp +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}") +pkgver=1.4.0 +pkgrel=1 +pkgdesc="A library to encode and decode images in WebP format (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url='https://developers.google.com/speed/webp/' +msys2_references=( + "cpe: cpe:/a:webmproject:libwebp" +) +license=('spdx:BSD-3-Clause') +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja") +provides=("${MINGW_PACKAGE_PREFIX}-libsharpyuv") +source=(${_realname}-${pkgver}.tar.gz::https://github.com/webmproject/libwebp/archive/v${pkgver}.tar.gz + 0001-mingw-cmake-output.patch) +sha256sums=('12af50c45530f0a292d39a88d952637e43fb2d4ab1883c44ae729840f7273381' + '30ed42b782af427f57049abada30ce6d4d62318ee13014585cb352b570c68e3d') +validpgpkeys=('6B0E6B70976DE303EDF2F601F9C3D6BDB8232B5D') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + + patch -Np1 -i "${srcdir}"/0001-mingw-cmake-output.patch +} + +build() { + export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + declare -a extra_config + if check_option "debug" "n"; then + extra_config+=("-DCMAKE_BUILD_TYPE=Release") + else + extra_config+=("-DCMAKE_BUILD_TYPE=Debug") + fi + + cd "${srcdir}/${_realname}-${pkgver}" + mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static" + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ + "${extra_config[@]}" \ + -DBUILD_SHARED_LIBS=OFF \ + -DWEBP_ENABLE_SWAP_16BIT_CSP=ON \ + -DWEBP_BUILD_ANIM_UTILS=OFF \ + -DWEBP_BUILD_CWEBP=OFF \ + -DWEBP_BUILD_DWEBP=OFF \ + -DWEBP_BUILD_GIF2WEBP=OFF \ + -DWEBP_BUILD_IMG2WEBP=OFF \ + -DWEBP_BUILD_VWEBP=OFF \ + -DWEBP_BUILD_WEBPINFO=OFF \ + -DWEBP_BUILD_WEBPMUX=OFF \ + -DWEBP_BUILD_EXTRAS=OFF \ + ../${_realname}-${pkgver} + + "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe --build . +} + +package() { + cd "${srcdir}/build-${MSYSTEM}-static" + + DESTDIR="${pkgdir}" "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe --install . + + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" +} diff --git a/msys2/PKGBUILD/30-mingw-w64-opus/001-aarch64-features.patch b/msys2/PKGBUILD/30-mingw-w64-opus/001-aarch64-features.patch new file mode 100644 index 00000000000..cee78a3b52d --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-opus/001-aarch64-features.patch @@ -0,0 +1,35 @@ +diff -bur opus-1.5.1-orig/celt/arm/armcpu.c opus-1.5.1/celt/arm/armcpu.c +--- opus-1.5.1-orig/celt/arm/armcpu.c 2024-03-09 21:13:23.646469400 -0700 ++++ opus-1.5.1/celt/arm/armcpu.c 2024-03-09 22:51:55.794039700 -0700 +@@ -191,6 +191,31 @@ + return flags; + } + ++#elif !defined(_MSC_VER) && defined(_WIN32) ++# define WIN32_LEAN_AND_MEAN ++# define WIN32_EXTRA_LEAN ++# include ++ ++static OPUS_INLINE opus_uint32 opus_cpu_capabilities(void){ ++ opus_uint32 flags; ++ flags=0; ++ ++# if defined(OPUS_ARM_MAY_HAVE_EDSP) || defined(OPUS_ARM_MAY_HAVE_MEDIA) \ ++ || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) ++ ++ flags |= OPUS_CPU_ARM_EDSP_FLAG | OPUS_CPU_ARM_MEDIA_FLAG | OPUS_CPU_ARM_NEON_FLAG; ++ ++# if defined(OPUS_ARM_MAY_HAVE_DOTPROD) ++ ++ if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)) ++ { ++ flags |= OPUS_CPU_ARM_DOTPROD_FLAG; ++ } ++# endif ++# endif ++ return flags; ++} ++ + #else + /* The feature registers which can tell us what the processor supports are + * accessible in priveleged modes only, so we can't have a general user-space diff --git a/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD new file mode 100644 index 00000000000..6db5cf75587 --- /dev/null +++ b/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD @@ -0,0 +1,85 @@ +# Maintainer: Alexey Pavlov + +_realname=opus +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}") +pkgver=1.5.2 +pkgrel=1 +pkgdesc="Codec designed for interactive speech and audio transmission over the Internet (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://www.opus-codec.org/" +msys2_repository_url="https://github.com/xiph/opus" +msys2_references=( + "cpe: cpe:2.3:a:opus-codec:opus" +) +license=('spdx:BSD-3-Clause') +makedepends=( + "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-doxygen" + "${MINGW_PACKAGE_PREFIX}-meson" + "${MINGW_PACKAGE_PREFIX}-ninja" +) +source=("https://downloads.xiph.org/releases/opus/opus-${pkgver}.tar.gz" + 001-aarch64-features.patch) +sha256sums=('65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1' + '5fb0f28264492d6512acb6eec7b5e147c922751f6df30d1317114048eca01516') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -Nbp1 -i "${srcdir}/${_patch}" + done +} + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + + apply_patch_with_msg \ + 001-aarch64-features.patch +} + +build() { + mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM} + + # -Dasm is for ARM fixed point, not neon or x86 avx/sse + MSYS2_ARG_CONV_EXCL="--prefix=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/meson.exe setup \ + --prefix="${MINGW_PREFIX}" \ + --wrap-mode=nodownload \ + --auto-features=enabled \ + --buildtype=plain \ + --default-library=static \ + -Dasm=disabled \ + -Dcustom-modes=true \ + ../${_realname}-${pkgver} + + ${MINGW_TOOLCHAIN_PREFIX}/bin/meson.exe compile +} + +check() { + cd "${srcdir}/build-${MSYSTEM}" + + ${MINGW_TOOLCHAIN_PREFIX}/bin/meson.exe test +} + +package_opus() { + ${MINGW_TOOLCHAIN_PREFIX}/bin/meson.exe install -C "${srcdir}/build-${MSYSTEM}" --destdir "${pkgdir}" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/opus.m4" "${pkgdir}${MINGW_PREFIX}/share/aclocal/opus.m4" + + install -Dm644 "${srcdir}/${_realname}-${pkgver}"/COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" +} +# template start; name=mingw-w64-splitpkg-wrappers; version=1.0; +# vim: set ft=bash : + +# generate wrappers +for _name in "${pkgname[@]}"; do + _short="package_${_name#${MINGW_PACKAGE_PREFIX}-jellyfin-}" + _func="$(declare -f "${_short}")" + eval "${_func/#${_short}/package_${_name}}" +done +# template end; diff --git a/msys2/PKGBUILD/35-mingw-w64-libvorbis/PKGBUILD b/msys2/PKGBUILD/35-mingw-w64-libvorbis/PKGBUILD new file mode 100644 index 00000000000..b497563796f --- /dev/null +++ b/msys2/PKGBUILD/35-mingw-w64-libvorbis/PKGBUILD @@ -0,0 +1,45 @@ +# Maintainer: Alexey Pavlov + +_realname=libvorbis +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=1.3.7 +pkgrel=2 +pkgdesc="Vorbis codec library (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://xiph.org/" +msys2_references=( + "cpe: cpe:/a:xiph.org:libvorbis" +) +license=('custom') +depends=("${MINGW_PACKAGE_PREFIX}-jellyfin-libogg" + "${MINGW_PACKAGE_PREFIX}-gcc-libs") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools") +options=('strip' 'staticlibs') +source=(https://downloads.xiph.org/releases/vorbis/${_realname}-${pkgver}.tar.gz) +sha256sums=('0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +build() { + [[ -d "build-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}" + mkdir -p "${srcdir}/build-${MINGW_CHOST}" + cd "${srcdir}/build-${MINGW_CHOST}" + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --disable-shared \ + --enable-static + + make +} + +package() { + cd ${srcdir}/build-${MINGW_CHOST} + make DESTDIR="${pkgdir}" install +} diff --git a/msys2/PKGBUILD/40-mingw-w64-dav1d/0001-dll-version.patch b/msys2/PKGBUILD/40-mingw-w64-dav1d/0001-dll-version.patch new file mode 100644 index 00000000000..2de9dd30683 --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-dav1d/0001-dll-version.patch @@ -0,0 +1,11 @@ +--- dav1d-1.3.0/src/meson.build.orig 2023-10-03 17:36:52.000000000 +0200 ++++ dav1d-1.3.0/src/meson.build 2023-10-06 08:30:26.038159600 +0200 +@@ -304,7 +304,7 @@ + endforeach + + # The final dav1d library +-if host_machine.system() == 'windows' ++if host_machine.system() == 'windows' and cc.get_id() == 'msvc' + dav1d_soversion = '' + else + dav1d_soversion = dav1d_api_version_major diff --git a/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD new file mode 100644 index 00000000000..99706300ddc --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD @@ -0,0 +1,70 @@ +# Maintainer: Christopher Degawa + +_realname=dav1d +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}") +pkgver=1.4.3 +pkgrel=1 +pkgdesc="AV1 cross-platform decoder focused on speed and correctness (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url='https://code.videolan.org/videolan/dav1d' +msys2_references=( + "cpe: cpe:/a:videolan:dav1d" +) +license=('spdx:BSD-2-Clause') +makedepends=("${MINGW_PACKAGE_PREFIX}-pkgconf" + $( [[ "${CARCH}" != "i686" \ + && "${CARCH}" != "x86_64" ]] \ + || echo "${MINGW_PACKAGE_PREFIX}-nasm" ) + "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-meson" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-xxhash") +source=("https://downloads.videolan.org/pub/videolan/dav1d/${pkgver}/dav1d-${pkgver}.tar.xz"{,.asc} + "0001-dll-version.patch") +sha256sums=('42fe524bcc82ea3a830057178faace22923a79bad3d819a4962d8cfc54c36f19' + 'SKIP' + '7fc584e69c156d7d9805b38912f07f417ccd1cce5fe4ee457761e8bea9128d04') +validpgpkeys=('65F7C6B4206BD057A7EB73787180713BE58D1ADC') # VideoLAN Release Signing Key + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd "${_realname}-${pkgver}" + + patch -Np1 -i "${srcdir}/0001-dll-version.patch" +} + +build() { + mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" + + MSYS2_ARG_CONV_EXCL="--prefix=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/meson setup \ + --prefix=${MINGW_PREFIX} \ + --default-library static \ + --buildtype plain \ + -Denable_tests=false \ + -Denable_asm=true \ + ../${_realname}-${pkgver} + + ${MINGW_TOOLCHAIN_PREFIX}/bin/meson compile +} + +check() { + cd "${srcdir}/build-${MSYSTEM}" + + ${MINGW_PREFIX}/bin/meson test +} + +package() { + cd "${srcdir}/build-${MSYSTEM}" + + DESTDIR="${pkgdir}" ${MINGW_TOOLCHAIN_PREFIX}/bin/meson install + + # License + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/doc/PATENTS" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/PATENTS" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/README.md" "${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}/README.md" +} diff --git a/msys2/PKGBUILD/40-mingw-w64-fdk-aac/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-fdk-aac/PKGBUILD new file mode 100644 index 00000000000..2c2c66921e0 --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-fdk-aac/PKGBUILD @@ -0,0 +1,53 @@ +# Contributor: Alexander Georgievskiy +# Contributor: Andrew Sun + +_realname=fdk-aac-stripped +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=git +pkgrel=1 +pkgdesc="Fraunhofer FDK AAC stripped from parts with patent concerns (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +msys2_references=( + 'archlinux: libfdk-aac' +) +license=('custom') +makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" "${MINGW_PACKAGE_PREFIX}-cc") +_commit="529b87452cd33d45e1d0a5066d20b64f10b38845" +source=("${_realname}"::"git+https://gitlab.freedesktop.org/wtaymans/${_realname}.git#commit=${_commit}") +sha256sums=('SKIP') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd ${srcdir}/${_realname} + ./autogen.sh +} + +build() { + cd "${srcdir}"/${_realname} + [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH} + mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH} + ../${_realname}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --enable-static \ + --disable-shared \ + --disable-example + + make +} + +package() { + cd ${srcdir}/build-${CARCH} + + make DESTDIR=${pkgdir} install + + # Install license + install -dm 755 "${pkgdir}${MINGW_PREFIX}"/share/licenses/libfdk-aac + install -m 644 "${srcdir}"/${_realname}/NOTICE "${pkgdir}${MINGW_PREFIX}"/share/licenses/libfdk-aac/ +} diff --git a/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD new file mode 100644 index 00000000000..581fe0f227a --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD @@ -0,0 +1,63 @@ +# Maintainer: Alexey Pavlov + +_realname=libass +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgver=0.17.3 +pkgrel=1 +pkgdesc="A portable library for SSA/ASS subtitles rendering (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url='https://github.com/libass/libass' +msys2_references=( + "cpe: cpe:/a:libass_project:libass" +) +license=('spdx:ISC') +makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-cc" + $( [[ "${CARCH}" != "i686" \ + && "${CARCH}" != "x86_64" ]] \ + || echo "${MINGW_PACKAGE_PREFIX}-nasm" )) +depends=("${MINGW_PACKAGE_PREFIX}-jellyfin-fribidi" + "${MINGW_PACKAGE_PREFIX}-jellyfin-fontconfig" + "${MINGW_PACKAGE_PREFIX}-jellyfin-freetype" + "${MINGW_PACKAGE_PREFIX}-jellyfin-harfbuzz") +source=(https://github.com/libass/${_realname}/releases/download/${pkgver}/${_realname}-${pkgver}.tar.xz) +sha256sums=('SKIP') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + # autoreconf to get updated libtool for clang + autoreconf -fiv +} + +build() { + [[ -d "${srcdir}/build-${MSYSTEM}-static" ]] && rm -rf "${srcdir}/build-${MSYSTEM}-static" + mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static" + + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + CPPFLAGS+=" -DFRIBIDI_LIB_STATIC" \ + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --disable-shared \ + --enable-static \ + --disable-directwrite \ + --disable-libunibreak \ + --with-pic \ + $( [[ "${CARCH}" != "i686" \ + && "${CARCH}" != "x86_64" ]] \ + || echo "--enable-asm") + + make +} + +package() { + cd "${srcdir}/build-${MSYSTEM}-static" + make DESTDIR="${pkgdir}" install +} diff --git a/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD new file mode 100644 index 00000000000..d523fa5ffa8 --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD @@ -0,0 +1,61 @@ +# Maintainer: Leandro Nini + +_realname=libopenmpt +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}") +pkgver=0.7.8 +pkgrel=1 +pkgdesc="A cross-platform C++ and C library to decode tracked music files (modules) into a raw PCM audio stream (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32') +url='https://lib.openmpt.org/libopenmpt/' +msys2_repository_url='https://github.com/OpenMPT/openmpt' +msys2_references=( + "cpe: cpe:/a:openmpt:libopenmpt" +) +license=('spdx:BSD-3-Clause') +depends=("${MINGW_PACKAGE_PREFIX}-jellyfin-zlib" + "${MINGW_PACKAGE_PREFIX}-jellyfin-libogg" + "${MINGW_PACKAGE_PREFIX}-jellyfin-libvorbis") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools") +source=("https://lib.openmpt.org/files/${_realname}/src/${_realname}-${pkgver}+release.autotools.tar.gz") +sha256sums=('87778c8046a226c6cbfb114f4c8e3e27c121b7b3dccce5cb7de45899250274cc') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}+release.autotools" + # autoreconf to get updated libtool files with clang support + autoreconf -fiv +} + +build() { + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" + + CPPFLAGS+=" -DMPT_CHECK_CXX_IGNORE_WARNING_O2" \ + ../${_realname}-${pkgver}+release.autotools/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --enable-static \ + --disable-{shared,examples,tests,openmpt123} \ + --without-{mpg123,portaudio,portaudiocpp,sndfile,flac} + + make +} + +check() { + cd "${srcdir}/build-${MSYSTEM}" + make check || true +} + +package() { + cd "${srcdir}/build-${MSYSTEM}" + make DESTDIR="${pkgdir}" install + + install -Dm644 "${srcdir}/${_realname}-${pkgver}+release.autotools/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +} diff --git a/msys2/PKGBUILD/40-mingw-w64-libtheora/001-example.patch b/msys2/PKGBUILD/40-mingw-w64-libtheora/001-example.patch new file mode 100644 index 00000000000..49bec25a046 --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-libtheora/001-example.patch @@ -0,0 +1,24 @@ +--- libtheora-1.1.1/examples/encoder_example.c.orig 2015-01-19 20:00:34.333600000 +0300 ++++ libtheora-1.1.1/examples/encoder_example.c 2015-01-19 20:02:00.570400000 +0300 +@@ -47,11 +47,12 @@ + #include "vorbis/codec.h" + #include "vorbis/vorbisenc.h" + +-#ifdef _WIN32 ++#if defined(_WIN32) + /*supply missing headers and functions to Win32. going to hell, I know*/ + #include + #include + ++#if !defined(__MINGW64_VERSION_MAJOR) + static double rint(double x) + { + if (x < 0.0) +@@ -60,6 +61,7 @@ + return (double)(int)(x + 0.5); + } + #endif ++#endif + + const char *optstring = "b:e:o:a:A:v:V:s:S:f:F:ck:d:z:\1\2\3\4"; + struct option options [] = { diff --git a/msys2/PKGBUILD/40-mingw-w64-libtheora/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-libtheora/PKGBUILD new file mode 100644 index 00000000000..1c0ba4f5488 --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-libtheora/PKGBUILD @@ -0,0 +1,61 @@ +# Maintainer: Alexey Pavlov + +_realname=libtheora +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=1.1.1 +pkgrel=7 +pkgdesc="An open video codec developed by the Xiph.org (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://xiph.org/" +license=('BSD') +depends=("${MINGW_PACKAGE_PREFIX}-jellyfin-libpng" + "${MINGW_PACKAGE_PREFIX}-jellyfin-libogg" + "${MINGW_PACKAGE_PREFIX}-jellyfin-libvorbis") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-doxygen" + "${MINGW_PACKAGE_PREFIX}-SDL" + "${MINGW_PACKAGE_PREFIX}-autotools") +source=("https://downloads.xiph.org/releases/theora/${_realname}-${pkgver}.tar.bz2" + libtheora-1.1.1-libpng16.patch + 001-example.patch) +sha256sums=('b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc' + 'e4c9a8dc798c596ed32a2a720020ae27a0e72f5add1a47cb8fadebe0e7180d7e' + '5627d26c3316fef71bca037e1834bcba063dbf949ea9293820f0e68b13641105') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd ${srcdir}/${_realname}-${pkgver} + sed -i "s,EXPORTS,," "win32/xmingw32/libtheoradec-all.def" + sed -i "s,EXPORTS,," "win32/xmingw32/libtheoraenc-all.def" + patch -p0 -i ${srcdir}/libtheora-1.1.1-libpng16.patch + patch -p1 -i ${srcdir}/001-example.patch + + autoreconf -fiv -I m4 +} + +build() { + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + [[ -d "build-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}" + mkdir -p ${srcdir}/build-$MINGW_CHOST + cd "${srcdir}/build-$MINGW_CHOST" + + ../${_realname}-${pkgver}/configure \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --prefix=${MINGW_PREFIX} \ + --disable-{shared,examples,extra-programs,oggtest,vorbistest,spec,doc} \ + --enable-static + + # parallel is broken (libtheoraenc is missing sometimes) + make -j1 +} + +package() { + cd "${srcdir}/build-$MINGW_CHOST" + make install DESTDIR="${pkgdir}" +} diff --git a/msys2/PKGBUILD/40-mingw-w64-opencl-headers/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-opencl-headers/PKGBUILD new file mode 100644 index 00000000000..8ca7b7a59fc --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-opencl-headers/PKGBUILD @@ -0,0 +1,38 @@ +# Maintainer: Alexey Pavlov + +_realname=opencl-headers +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname} +pkgver=2023.04.17 +pkgrel=1 +epoch=2 +pkgdesc='OpenCL (Open Computing Language) header files (mingw-w64)' +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url='https://registry.khronos.org/OpenCL/' +license=('spdx:Apache-2.0') +makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-cc") +source=(https://github.com/KhronosGroup/OpenCL-Headers/archive/v${pkgver}/OpenCL-Headers-${pkgver}.tar.gz) +sha256sums=('SKIP') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +package() { + export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + cd "${srcdir}"/OpenCL-Headers-${pkgver} + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ + -G'Ninja' \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DBUILD_TESTING=OFF \ + ../${_realname}-${pkgver} + + DESTDIR=${pkgdir} cmake --install . + + install -D -m644 "${srcdir}"/OpenCL-Headers-${pkgver}/LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +} diff --git a/msys2/PKGBUILD/40-mingw-w64-svt-av1/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-svt-av1/PKGBUILD new file mode 100644 index 00000000000..6796d33b0ff --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-svt-av1/PKGBUILD @@ -0,0 +1,58 @@ +# Maintainer: Miloš Komarčević + +_realname=SVT-AV1 +pkgbase=mingw-w64-jellyfin-svt-av1 +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-svt-av1") +pkgver=2.1.2 +pkgrel=1 +pkgdesc="Scalable Video Technology AV1 encoder and decoder (mingw-w64)" +arch=('any') +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') +url='https://gitlab.com/AOMediaCodec/SVT-AV1' +license=('spdx:BSD-3-Clause-Clear') +makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-nasm" + "${MINGW_PACKAGE_PREFIX}-cc") +source=("${url}/-/archive/v${pkgver}/${_realname}-v${pkgver}.tar.gz") +sha256sums=('SKIP') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd "${srcdir}"/${_realname}-v${pkgver} +} + +build() { + export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + declare -a extra_config + if check_option "debug" "n"; then + extra_config+=("-DCMAKE_BUILD_TYPE=Release") + else + extra_config+=("-DCMAKE_BUILD_TYPE=Debug") + fi + + [[ -d "${srcdir}"/build-${MSYSTEM}-static ]] && rm -rf "${srcdir}"/build-${MSYSTEM}-static + mkdir -p "${srcdir}"/build-${MSYSTEM}-static && cd "${srcdir}"/build-${MSYSTEM}-static + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + "${extra_config[@]}" \ + -DBUILD_SHARED_LIBS=OFF \ + -DREPRODUCIBLE_BUILDS=ON \ + ../${_realname}-v${pkgver} + + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake --build . +} + +package() { + cd "${srcdir}"/build-${MSYSTEM}-static + DESTDIR="${pkgdir}" ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake --install . + + install -Dm644 ${srcdir}/${_realname}-v${pkgver}/LICENSE.md ${pkgdir}${MINGW_PREFIX}/share/licenses/svt-av1/LICENSE + install -Dm644 ${srcdir}/${_realname}-v${pkgver}/PATENTS.md ${pkgdir}${MINGW_PREFIX}/share/licenses/svt-av1/PATENTS.md +} diff --git a/msys2/PKGBUILD/40-mingw-w64-x264/0001-beautify-pc.all.patch b/msys2/PKGBUILD/40-mingw-w64-x264/0001-beautify-pc.all.patch new file mode 100644 index 00000000000..3678368ae71 --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-x264/0001-beautify-pc.all.patch @@ -0,0 +1,14 @@ +--- x264/configure.orig 2020-01-16 21:08:21.000000000 +0100 ++++ x264/configure 2020-01-16 21:09:16.000000000 +0100 +@@ -1571,9 +1571,9 @@ includedir=$includedir + Name: x264 + Description: H.264 (MPEG4 AVC) encoder library + Version: $(grep POINTVER < x264_config.h | sed -e 's/.* "//; s/".*//; s/ .*//') +-Libs: -L$libdir -lx264 $([ "$shared" = "yes" ] || echo $libpthread $libm $libdl) ++Libs: -L\${libdir} -lx264 $([ "$shared" = "yes" ] || echo $libpthread $libm $libdl) + Libs.private: $([ "$shared" = "yes" ] && echo $libpthread $libm $libdl) +-Cflags: -I$includedir $([ "$shared" = "yes" ] && echo "-DX264_API_IMPORTS") ++Cflags: -I\${includedir} $([ "$shared" = "yes" ] && echo "-DX264_API_IMPORTS") + EOF + + filters="crop select_every" diff --git a/msys2/PKGBUILD/40-mingw-w64-x264/0002-install-avisynth_c.h.mingw.patch b/msys2/PKGBUILD/40-mingw-w64-x264/0002-install-avisynth_c.h.mingw.patch new file mode 100644 index 00000000000..f714efb4049 --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-x264/0002-install-avisynth_c.h.mingw.patch @@ -0,0 +1,13 @@ +--- x264/Makefile.orig 2013-12-21 21:45:07.000000000 +0000 ++++ x264/Makefile 2013-12-22 21:25:49.711777600 +0000 +@@ -392,8 +392,9 @@ + + install-lib-dev: + $(INSTALL) -d $(DESTDIR)$(includedir) +- $(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig ++ $(INSTALL) -d $(DESTDIR)$(includedir) $(DESTDIR)$(includedir)/avisynth $(DESTDIR)$(libdir)/pkgconfig + $(INSTALL) -m 644 $(SRCPATH)/x264.h x264_config.h $(DESTDIR)$(includedir) ++ $(INSTALL) -m 644 $(SRCPATH)/extras/avisynth_c.h $(DESTDIR)$(includedir)/avisynth + $(INSTALL) -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig + + install-lib-static: lib-static install-lib-dev diff --git a/msys2/PKGBUILD/40-mingw-w64-x264/0003-pkgconfig-add-Cflags-private.patch b/msys2/PKGBUILD/40-mingw-w64-x264/0003-pkgconfig-add-Cflags-private.patch new file mode 100644 index 00000000000..f7f2d471e66 --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-x264/0003-pkgconfig-add-Cflags-private.patch @@ -0,0 +1,10 @@ +--- a/configure ++++ b/configure +@@ -1611,6 +1611,7 @@ Version: $(grep POINTVER < x264_config.h | sed -e 's/.* "//; s/".*//; s/ .*//') + Libs: -L\${libdir} -lx264 $([ "$shared" = "yes" ] || echo $libpthread $libm $libdl) + Libs.private: $([ "$shared" = "yes" ] && echo $libpthread $libm $libdl) + Cflags: -I\${includedir} $([ "$shared" = "yes" ] && echo "-DX264_API_IMPORTS") ++Cflags.private: -UX264_API_IMPORTS + EOF + + filters="crop select_every" diff --git a/msys2/PKGBUILD/40-mingw-w64-x264/0004-dont-align-64byte-stack.patch b/msys2/PKGBUILD/40-mingw-w64-x264/0004-dont-align-64byte-stack.patch new file mode 100644 index 00000000000..8a7bc63eb32 --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-x264/0004-dont-align-64byte-stack.patch @@ -0,0 +1,19 @@ +diff --git a/configure b/configure +index c1fb599f..7e77c7dd 100755 +--- a/configure ++++ b/configure +@@ -934,13 +934,7 @@ fi + + if cc_check '' '' '' '__attribute__((force_align_arg_pointer))' ; then + if [ $compiler = GNU -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then +- if cc_check '' -mpreferred-stack-boundary=6 ; then +- CFLAGS="$CFLAGS -mpreferred-stack-boundary=6" +- stack_alignment=64 +- elif cc_check '' -mstack-alignment=64 ; then +- CFLAGS="$CFLAGS -mstack-alignment=64" +- stack_alignment=64 +- elif [ $stack_alignment -lt 16 ] ; then ++ if [ $stack_alignment -lt 16 ] ; then + if cc_check '' -mpreferred-stack-boundary=4 ; then + CFLAGS="$CFLAGS -mpreferred-stack-boundary=4" + stack_alignment=16 diff --git a/msys2/PKGBUILD/40-mingw-w64-x264/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-x264/PKGBUILD new file mode 100644 index 00000000000..d1c351d1f1e --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-x264/PKGBUILD @@ -0,0 +1,84 @@ +# Maintainer: Alexey Pavlov + +_realname=x264 +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-libx264") +pkgver=0.164.r3191.4613ac3 +pkgrel=1 +pkgdesc="Library for encoding H264/AVC video streams (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://www.videolan.org/developers/x264.html" +license=("custom") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools" + $( [[ "${CARCH}" != "i686" \ + && "${CARCH}" != "x86_64" ]] \ + || echo "${MINGW_PACKAGE_PREFIX}-nasm" ) + "git") +options=('strip' 'staticlibs') +_commit="4613ac3c15fd75cebc4b9f65b7fb95e70a3acce1" +source=("${_realname}"::"git+https://code.videolan.org/videolan/${_realname}.git#commit=${_commit}" + 0001-beautify-pc.all.patch + 0002-install-avisynth_c.h.mingw.patch + 0003-pkgconfig-add-Cflags-private.patch + 0004-dont-align-64byte-stack.patch) +sha256sums=('SKIP' + '8e92f4d6c1924664e7c9f5b797070a35f8eabbfce431f996167fe426fc833dda' + '611d427742347e0dfbcea8d45c8c9b0fd15e29ab0b22207000f8bf5f3ba1a3a9' + '0cbf016c01291f1b8b97ffabdf7e52a8a8593ddf8d88c782245b60462a18bd60' + 'SKIP') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +pkgver() { + cd ${srcdir}/${_realname} + + ./version.sh | grep X264_POINTVER | sed -r 's/^#define X264_POINTVER "([0-9]+\.[0-9]+)\.([0-9]+)M? (.*)"$/\1.r\2.\3/' +} + +prepare() { + cd ${_realname} + patch -p1 -i ${srcdir}/0001-beautify-pc.all.patch + patch -p1 -i ${srcdir}/0002-install-avisynth_c.h.mingw.patch + patch -p1 -i ${srcdir}/0003-pkgconfig-add-Cflags-private.patch + # 64byte stack alignment conflicts with ffmpeg's 16byte alignment, + # which errors in clang with LTO, see https://github.com/llvm/llvm-project/issues/60310 + patch -p1 -i ${srcdir}/0004-dont-align-64byte-stack.patch +} + +build() { + [[ -d "build-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}" + mkdir -p "${srcdir}/build-${MINGW_CHOST}" + cd "${srcdir}/build-${MINGW_CHOST}" + ../${_realname}/configure \ + --prefix=${MINGW_PREFIX} \ + --host=${MINGW_CHOST} \ + --enable-static \ + --enable-strip \ + --disable-cli \ + --disable-lavf \ + --disable-swscale + + make + + make DESTDIR="${srcdir}/dest/libx264" install +} + +package_libx264() { + depends=() + + cp -r "${srcdir}/dest/libx264/"* "${pkgdir}" +} + +# template start; name=mingw-w64-splitpkg-wrappers; version=1.0; +# vim: set ft=bash : + +# generate wrappers +for _name in "${pkgname[@]}"; do + _short="package_${_name#${MINGW_PACKAGE_PREFIX}-jellyfin-}" + _func="$(declare -f "${_short}")" + eval "${_func/#${_short}/package_${_name}}" +done +# template end; diff --git a/msys2/PKGBUILD/40-mingw-w64-x265/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-x265/PKGBUILD new file mode 100644 index 00000000000..99334090f5b --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-x265/PKGBUILD @@ -0,0 +1,119 @@ +# Maintainer: Alexey Pavlov +# Contributor: Yuta Nakai + +_realname=x265 +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=git +pkgrel=1 +pkgdesc='Open Source H265/HEVC video encoder (mingw-w64)' +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +license=('GPL') +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") +makedepends=( + "${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-cc" + $([[ "${CARCH}" != "x86_64" ]] || echo "${MINGW_PACKAGE_PREFIX}-nasm") +) +options=('strip') +url='https://bitbucket.org/multicoreware/x265_git' +msys2_references=( + "cpe: cpe:/a:multicorewareinc:x265" + "cpe: cpe:/a:multicorewareinc:x265_high_efficiency_video_coding" +) +_commit="ad1a30a8a69d5bbc0096da7aafc9da21c599cb01" +source=("${_realname}"::"git+https://bitbucket.org/multicoreware/x265_git.git#commit=${_commit}") +sha256sums=('SKIP') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + mv "${srcdir}"/"x265"* "${srcdir}"/x265_${pkgver} + cd "${srcdir}"/x265_${pkgver} + + for d in 8 10 12; do + if [[ -d ${srcdir}/build-${CARCH}-${d} ]]; then + rm -rf ${srcdir}/build-${CARCH}-${d} + fi + mkdir -p ${srcdir}/build-${CARCH}-${d} + done +} + + +build() { + export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + if [ "${CARCH}" = 'x86_64' ]; then + _ENABLE_ASM=ON + else + _ENABLE_ASM=OFF + fi + + # 12-bit + cd "${srcdir}/build-${CARCH}-12" + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ + -G Ninja \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DHIGH_BIT_DEPTH=ON \ + -DMAIN12=ON \ + -DEXPORT_C_API=OFF \ + -DENABLE_CLI=OFF \ + -DENABLE_SHARED=OFF \ + -DENABLE_ASSEMBLY=${_ENABLE_ASM} \ + ../x265_${pkgver}/source + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe --build . + + # 10-bit + cd "${srcdir}/build-${CARCH}-10" + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ + -G Ninja \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DHIGH_BIT_DEPTH=ON \ + -DEXPORT_C_API=OFF \ + -DENABLE_CLI=OFF \ + -DENABLE_SHARED=OFF \ + -DENABLE_ASSEMBLY=${_ENABLE_ASM} \ + ../x265_${pkgver}/source + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe --build . + + # 8-bit + cd "${srcdir}/build-${CARCH}-8" + ln -s ../build-${CARCH}-10/libx265.a libx265_main10.a + ln -s ../build-${CARCH}-12/libx265.a libx265_main12.a + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ + -G Ninja \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DENABLE_SHARED=OFF \ + -DCMAKE_DLL_NAME_WITH_SOVERSION=ON \ + -DENABLE_ASSEMBLY=${_ENABLE_ASM} \ + -DENABLE_HDR10_PLUS=ON \ + -DEXTRA_LIB='x265_main10.a;x265_main12.a' \ + -DEXTRA_LINK_FLAGS='-L .' \ + -DLINKED_10BIT=ON \ + -DLINKED_12BIT=ON \ + ../x265_${pkgver}/source + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe --build . + + # merge + mv libx265.a libx265_main.a + ar -M < + +_realname=zimg +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=3.0.5 +pkgrel=2 +pkgdesc="Scaling, colorspace conversion, and dithering library (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://github.com/sekrit-twc/zimg" +license=('spdx:WTFPL') +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools" + "bsdtar") +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-winpthreads-git") +source=("${_realname}-${pkgver}.tar.gz::https://github.com/sekrit-twc/${_realname}/archive/release-${pkgver}.tar.gz" + 0001-zimg-export-def-symbols.patch) +noextract=("${_realname}-${pkgver}.tar.gz") +sha256sums=('a9a0226bf85e0d83c41a8ebe4e3e690e1348682f6a2a7838f1b8cbff1b799bcf' + '6e52d715d19080434392f04b33005fee428368e12176da20555f4059209c8134') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare(){ + bsdtar -xzf "${srcdir}/${_realname}-${pkgver}.tar.gz" || bsdtar -xzf "${srcdir}/${_realname}-${pkgver}.tar.gz" + cd "${srcdir}/${_realname}-release-${pkgver}" + patch -p1 -i "${srcdir}/0001-zimg-export-def-symbols.patch" + ./autogen.sh +} + +build() { + [[ -d "build-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}" + mkdir -p "${srcdir}/build-${MINGW_CHOST}" + cd "${srcdir}/build-${MINGW_CHOST}" + + ../${_realname}-release-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --enable-static \ + --disable-shared + + make +} + +package() { + cd "${srcdir}/build-${MINGW_CHOST}" + make DESTDIR=${pkgdir} install +} diff --git a/msys2/PKGBUILD/50-mingw-w64-amf-headers/PKGBUILD b/msys2/PKGBUILD/50-mingw-w64-amf-headers/PKGBUILD new file mode 100644 index 00000000000..6c1c9e48385 --- /dev/null +++ b/msys2/PKGBUILD/50-mingw-w64-amf-headers/PKGBUILD @@ -0,0 +1,29 @@ +# Maintainer: ImperatorS79 + +_realname=amf-headers +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=1.4.34 +pkgrel=1 +pkgdesc='Header files for AMD Advanced Media Framework' +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32') +url='https://github.com/GPUOpen-LibrariesAndSDKs/AMF/' +license=('spdx:MIT') +source=("${_realname}-${pkgver}.tar.gz::https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/v${pkgver}.tar.gz") +sha256sums=('SKIP') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd "AMF-${pkgver}" +} + +package() { + mkdir -p "${pkgdir}${MINGW_PREFIX}"/include/AMF/ + cp -r "${srcdir}/AMF-${pkgver}"/amf/public/include/core/ "${pkgdir}${MINGW_PREFIX}"/include/AMF/ + cp -r "${srcdir}/AMF-${pkgver}"/amf/public/include/components/ "${pkgdir}${MINGW_PREFIX}"/include/AMF/ + + install -D -m644 "${srcdir}/AMF-${pkgver}"/LICENSE.txt "${pkgdir}${MINGW_PREFIX}"/share/licenses/${_realname}/LICENSE +} diff --git a/msys2/PKGBUILD/50-mingw-w64-ffnvcodec-headers/PKGBUILD b/msys2/PKGBUILD/50-mingw-w64-ffnvcodec-headers/PKGBUILD new file mode 100644 index 00000000000..5b1f2fadabf --- /dev/null +++ b/msys2/PKGBUILD/50-mingw-w64-ffnvcodec-headers/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: ImperatorS79 + +_realname=ffnvcodec-headers +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +pkgver=12.0.16.1 +pkgrel=1 +pkgdesc='FFmpeg version of headers required to interface with Nvidias codec APIs (mingw-w64)' +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url=https://github.com/FFmpeg/nv-codec-headers.git +license=('spdx:MIT') +makedepends=("git") +_tag=451da99614412a7f9526ef301a5ee0c7a6f9ad76 +source=(git+https://github.com/FFmpeg/nv-codec-headers.git#tag=${_tag}) +sha256sums=('SKIP') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +pkgver() { + cd nv-codec-headers + + git describe --tags | sed 's/^n//' +} + +build() { + make PREFIX=${MINGW_PREFIX} -C nv-codec-headers + sed -n '4,25p' nv-codec-headers/include/ffnvcodec/nvEncodeAPI.h > LICENSE # Extract license + sed -i '1,22s/^.\{,3\}//' LICENSE # Delete C comments +} + +package() { + make PREFIX=${MINGW_PREFIX} DESTDIR="${pkgdir}" -C nv-codec-headers install + install -Dm 644 LICENSE -t "${pkgdir}${MINGW_PREFIX}"/share/licenses/ffnvcodec-headers/ + + local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) + for pcfile in "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/*.pc; do + sed -s "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i "${pcfile}" + done +} diff --git a/msys2/PKGBUILD/50-mingw-w64-libvpl/0001-fix-pkgconfig-file.patch b/msys2/PKGBUILD/50-mingw-w64-libvpl/0001-fix-pkgconfig-file.patch new file mode 100644 index 00000000000..40ad847b56a --- /dev/null +++ b/msys2/PKGBUILD/50-mingw-w64-libvpl/0001-fix-pkgconfig-file.patch @@ -0,0 +1,13 @@ +--- a/libvpl/pkgconfig/vpl.pc.in ++++ b/libvpl/pkgconfig/vpl.pc.in +@@ -1,6 +1,7 @@ +-prefix=@pc_rel_prefix@ +-libdir=@pc_rel_libdir@ +-includedir=@pc_rel_incdir@ ++prefix=@CMAKE_INSTALL_PREFIX@ ++exec_prefix=${prefix} ++libdir=${exec_prefix}/lib ++includedir=${prefix}/include + + # oneAPI Video Processing Library (oneVPL) + Name: oneVPL diff --git a/msys2/PKGBUILD/50-mingw-w64-libvpl/0002-cmake-install-vars-sh.patch b/msys2/PKGBUILD/50-mingw-w64-libvpl/0002-cmake-install-vars-sh.patch new file mode 100644 index 00000000000..607a99da104 --- /dev/null +++ b/msys2/PKGBUILD/50-mingw-w64-libvpl/0002-cmake-install-vars-sh.patch @@ -0,0 +1,13 @@ +--- libvpl-2.10.1/env/CMakeLists.txt.orig 2024-01-23 08:40:12.541802700 +0100 ++++ libvpl-2.10.1/env/CMakeLists.txt 2024-01-23 08:42:01.336124000 +0100 +@@ -34,7 +34,9 @@ + PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${ENV_SCRIPT_NAME}" + DESTINATION "${VPL_INSTALL_ENVDIR}" + COMPONENT ${VPL_COMPONENT_DEV}) +-else() ++endif() ++ ++if(NOT WIN32 OR MINGW) + file(TO_CMAKE_PATH "${env_rel_prefix}" env_rel_prefix) + file(TO_CMAKE_PATH "${CMAKE_INSTALL_INCLUDEDIR}" _install_includedir) + file(TO_CMAKE_PATH "${CMAKE_INSTALL_LIBDIR}" _install_libdir) diff --git a/msys2/PKGBUILD/50-mingw-w64-libvpl/0003-cmake-fix-32bit-install.patch b/msys2/PKGBUILD/50-mingw-w64-libvpl/0003-cmake-fix-32bit-install.patch new file mode 100644 index 00000000000..ca40a88c6db --- /dev/null +++ b/msys2/PKGBUILD/50-mingw-w64-libvpl/0003-cmake-fix-32bit-install.patch @@ -0,0 +1,11 @@ +--- a/cmake/InstallDirs.cmake ++++ b/cmake/InstallDirs.cmake +@@ -8,7 +8,7 @@ + # Set installation directories + # + +-if(WIN32 ++if(MSVC + AND NOT CMAKE_CROSSCOMPILING + AND CMAKE_SIZEOF_VOID_P EQUAL 4) + if(NOT CMAKE_INSTALL_BINDIR) diff --git a/msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD b/msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD new file mode 100644 index 00000000000..5f2008e3c99 --- /dev/null +++ b/msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD @@ -0,0 +1,84 @@ +# Maintainer: Biswapriyo Nath + +_realname=libvpl +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}") +pkgver=2.11.0 +pkgrel=1 +pkgdesc="Intel Video Processing Library (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32') +url='https://intel.github.io/libvpl' +msys2_repository_url="https://github.com/intel/libvpl" +license=('spdx:MIT') +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") +provides=("${MINGW_PACKAGE_PREFIX}-jellyfin-onevpl") +conflicts=("${MINGW_PACKAGE_PREFIX}-jellyfin-onevpl") +replaces=("${MINGW_PACKAGE_PREFIX}-jellyfin-onevpl") +makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-cc") +source=("https://github.com/intel/libvpl/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz" + 0001-fix-pkgconfig-file.patch + 0002-cmake-install-vars-sh.patch + 0003-cmake-fix-32bit-install.patch) +sha256sums=('SKIP' + 'f23ca1ccbaa9c8e3fd4fd7320996e5be2753cfcdc6e2a25f6def08222a5691cd' + 'b9b1cdcb531ee0b6b1d7eef8bbfb1df8ca1ffe72d76961050dd912203edecc67' + '21b2cc2f466f636940c8ef81f50dff177aff96d60dc4bc57f58c5c9f016502fe') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -Nbp1 -i "${srcdir}/${_patch}" + done +} + +prepare() { + cd "${srcdir}"/libvpl-${pkgver} + + apply_patch_with_msg \ + 0001-fix-pkgconfig-file.patch \ + 0002-cmake-install-vars-sh.patch \ + 0003-cmake-fix-32bit-install.patch +} + +build() { + export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + declare -a extra_config + if check_option "debug" "n"; then + extra_config+=("-DCMAKE_BUILD_TYPE=Release") + else + extra_config+=("-DCMAKE_BUILD_TYPE=Debug") + fi + + mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static" + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ + "${extra_config[@]}" \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_{DISPATCHER,DEV}=ON \ + -DBUILD_{PREVIEW,TESTS}=OFF \ + -DBUILD_TOOLS{,_ONEVPL_EXPERIMENTAL}=OFF \ + -DINSTALL_EXAMPLE_CODE=OFF \ + ../libvpl-${pkgver} + + "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe --build . +} + +package() { + cd "${srcdir}/build-${MSYSTEM}-static" + DESTDIR="${pkgdir}" "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe --install . + + rm -r "${pkgdir}${MINGW_PREFIX}/share/vpl/examples" + + install -Dm644 "${srcdir}/libvpl-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +} diff --git a/msys2/PKGBUILD/50-mingw-w64-opencl-icd/001-do-not-use-mingw32-def-on-clang32.patch b/msys2/PKGBUILD/50-mingw-w64-opencl-icd/001-do-not-use-mingw32-def-on-clang32.patch new file mode 100644 index 00000000000..ae59226f7bd --- /dev/null +++ b/msys2/PKGBUILD/50-mingw-w64-opencl-icd/001-do-not-use-mingw32-def-on-clang32.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -97,7 +97,7 @@ + + # For mingw-i686 builds only we need a special .def file with stdcall + # exports. In all other cases we can use a standard .def file. +- if ((CMAKE_SIZEOF_VOID_P EQUAL 4) AND (MINGW OR MSYS OR CYGWIN)) ++ if ((CMAKE_SIZEOF_VOID_P EQUAL 4) AND (MINGW OR MSYS OR CYGWIN) AND CMAKE_C_COMPILER_ID STREQUAL "GNU") + list (APPEND OPENCL_ICD_LOADER_SOURCES loader/windows/OpenCL-mingw-i686.def) + else () + list (APPEND OPENCL_ICD_LOADER_SOURCES loader/windows/OpenCL.def) \ No newline at end of file diff --git a/msys2/PKGBUILD/50-mingw-w64-opencl-icd/OpenCL.pc b/msys2/PKGBUILD/50-mingw-w64-opencl-icd/OpenCL.pc new file mode 100644 index 00000000000..5259889513e --- /dev/null +++ b/msys2/PKGBUILD/50-mingw-w64-opencl-icd/OpenCL.pc @@ -0,0 +1,12 @@ +prefix=@PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${exec_prefix}/include + +Name: OpenCL +Description: Khronos OpenCL ICD Loader +Requires: OpenCL-Headers +Version: 3.0 +Libs: -L${libdir} -l:OpenCL.a +Cflags: -I\${includedir} +Libs.private: -lole32 -lshlwapi -lcfgmgr32 \ No newline at end of file diff --git a/msys2/PKGBUILD/50-mingw-w64-opencl-icd/PKGBUILD b/msys2/PKGBUILD/50-mingw-w64-opencl-icd/PKGBUILD new file mode 100644 index 00000000000..4a3709547ce --- /dev/null +++ b/msys2/PKGBUILD/50-mingw-w64-opencl-icd/PKGBUILD @@ -0,0 +1,74 @@ +# Maintainer: Peter Budai + +_realname=opencl-icd +pkgbase=mingw-w64-jellyfin-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}" +replaces=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}-git") +pkgver=2023.04.17 +pkgrel=1 +pkgdesc="OpenCL ICD Loader (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +msys2_references=( + 'aur: mingw-w64-opencl-icd' +) +url='https://github.com/KhronosGroup/OpenCL-ICD-Loader' +license=('spdx:Apache-2.0') +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-opencl-headers" + "${MINGW_PACKAGE_PREFIX}-tools") +source=("https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz" + "001-do-not-use-mingw32-def-on-clang32.patch" + "OpenCL.pc") +sha256sums=('SKIP' + 'eb947c742dd31f2d1cc18ec8eb9af686385cc8634a9c56a3c4fb36d530d8280f' + 'SKIP') + +export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" + +prepare() { + cd "${srcdir}"/OpenCL-ICD-Loader-${pkgver} + patch -p1 -i "${srcdir}"/001-do-not-use-mingw32-def-on-clang32.patch +} + +build() { + export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" + export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM} + + declare -a extra_config + if check_option "debug" "n"; then + extra_config+=("-DCMAKE_BUILD_TYPE=Release") + else + extra_config+=("-DCMAKE_BUILD_TYPE=Debug") + fi + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ + -G'Ninja' \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + "${extra_config[@]}" \ + -DBUILD_SHARED_LIBS=OFF \ + -DOPENCL_ICD_LOADER_DISABLE_OPENCLON12=ON \ + -DOPENCL_ICD_LOADER_HEADERS_DIR=${MINGW_PREFIX}/include \ + -DBUILD_TESTING=OFF \ + ../OpenCL-ICD-Loader-${pkgver} + + ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake --build . +} + +package() { + cd "${srcdir}"/build-${MSYSTEM} + DESTDIR=${pkgdir} ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake --install . + + # Replace the Pkg-config file + rm -f "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/OpenCL.pc" + install -Dm644 "${srcdir}/OpenCL.pc" "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/OpenCL.pc" + sed -e "s|@PREFIX@|${MINGW_PREFIX}|g" \ + -i "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/OpenCL.pc" + + install -Dm644 ${srcdir}/OpenCL-ICD-Loader-${pkgver}/LICENSE ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE +} diff --git a/msys2/build.sh b/msys2/build.sh new file mode 100755 index 00000000000..b348e1b3463 --- /dev/null +++ b/msys2/build.sh @@ -0,0 +1,113 @@ +#!/bin/bash +set -xe +cd "$(dirname "$0")" +export BUILDER_ROOT="$(pwd)" +export FFBUILD_PREFIX="/clang64/ffbuild" + +arch="x86_64" +TARGET="win64-clang" +VARIANT="gpl" + +pacman -S --noconfirm mingw-w64-clang-x86_64-toolchain git quilt diffstat mingw-w64-clang-x86_64-nasm + +# Copy libc++ to our prefix folder +cp /clang64/lib/libc++.a /clang64/ffbuild/lib/libc++.a + +cd "$BUILDER_ROOT"/PKGBUILD +for pkg in */; do + if [ -d "$dir" ]; then + echo "Installing $dir" + cd "$dir" + + (MINGW_ARCH=clang64 makepkg-mingw -sLfi --noconfirm --skippgpcheck) || exit $? + + cd .. + fi +done + +cd "$BUILDER_ROOT" +cd .. +if [[ -f "debian/patches/series" ]]; then + ln -s debian/patches patches + quilt push -a +fi + +PKG_CONFIG_PATH=/clang64/ffbuild/lib/pkgconfig ./configure --cc=clang \ + --pkg-config-flags=--static \ + --extra-cflags=-I/clang64/ffbuild/include \ + --extra-ldflags=-L/clang64/ffbuild/lib \ + --prefix=/clang64/ffbuild/jellyfin-ffmpeg \ + --extra-version=Jellyfin \ + --disable-ffplay \ + --disable-debug \ + --disable-doc \ + --disable-sdl2 \ + --disable-ptx-compression \ + --enable-shared \ + --enable-lto \ + --enable-gpl \ + --enable-version3 \ + --enable-schannel \ + --enable-iconv \ + --enable-libxml2 \ + --enable-zlib \ + --enable-lzma \ + --enable-gmp \ + --enable-chromaprint \ + --enable-libfreetype \ + --enable-libfribidi \ + --enable-libfontconfig \ + --enable-libass \ + --enable-libbluray \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libtheora \ + --enable-libvorbis \ + --enable-libopenmpt \ + --enable-libwebp \ + --enable-libvpx \ + --enable-libzimg \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libsvtav1 \ + --enable-libdav1d \ + --enable-libfdk-aac \ + --enable-opencl \ + --enable-dxva2 \ + --enable-d3d11va \ + --enable-amf \ + --enable-libvpl \ + --enable-ffnvcodec \ + --enable-cuda \ + --enable-cuda-llvm \ + --enable-cuvid \ + --enable-nvdec \ + --enable-nvenc + +make -j$(nproc) V=1 + +# We have to manually match lines to get version as there will be no dpkg-parsechangelog on msys2 +PKG_VER=0.0.0 +while IFS= read -r line; do + if [[ $line == jellyfin-ffmpeg* ]]; then + if [[ $line =~ \(([^\)]+)\) ]]; then + PKG_VER="${BASH_REMATCH[1]}" + break + fi + fi +done < "$BUILDER_ROOT"/../debian/changelog + +PKG_NAME="jellyfin-ffmpeg_${PKG_VER}_portable_${TARGET}-${VARIANT}${ADDINS_STR:+-}${ADDINS_STR}" +ARTIFACTS_PATH="$BUILDER_ROOT"/artifacts +OUTPUT_FNAME="${PKG_NAME}.zip" +cd "$BUILDER_ROOT" +mkdir -p artifacts +mv ../ffmpeg.exe ./ +mv ../ffprobe.exe ./ +zip -9 -r "${ARTIFACTS_PATH}/${OUTPUT_FNAME}" ffmpeg.exe ffprobe.exe +cd "$BUILDER_ROOT"/.. + +if [[ -n "$GITHUB_ACTIONS" ]]; then + echo "build_name=${BUILD_NAME}" >> "$GITHUB_OUTPUT" + echo "${OUTPUT_FNAME}" > "${ARTIFACTS_PATH}/${TARGET}-${VARIANT}${ADDINS_STR:+-}${ADDINS_STR}.txt" +fi From 1d0cf5daae34768f51e00aa4c9ddf8067a009c2b Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 16:12:51 +0800 Subject: [PATCH 02/29] configure: Disable inline assembly with nonlocal labels with LTO on Clang on Windows backport of https://patchwork.ffmpeg.org/project/ffmpeg/patch/20231220124248.2816809-1-martin@martin.st/ --- ...nable-gcc-vectorization-and-lto-auto.patch | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/debian/patches/0035-enable-gcc-vectorization-and-lto-auto.patch b/debian/patches/0035-enable-gcc-vectorization-and-lto-auto.patch index 77625d61ca8..03406e637a8 100644 --- a/debian/patches/0035-enable-gcc-vectorization-and-lto-auto.patch +++ b/debian/patches/0035-enable-gcc-vectorization-and-lto-auto.patch @@ -1,17 +1,28 @@ -Index: jellyfin-ffmpeg/configure +Index: FFmpeg/configure =================================================================== ---- jellyfin-ffmpeg.orig/configure -+++ jellyfin-ffmpeg/configure -@@ -7196,6 +7196,8 @@ if enabled lto; then +--- FFmpeg.orig/configure ++++ FFmpeg/configure +@@ -7197,7 +7197,19 @@ if enabled lto; then test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker" check_cflags -flto check_ldflags -flto $cpuflags + check_cflags -flto=auto + check_ldflags -flto=auto $cpuflags disable inline_asm_direct_symbol_refs ++ if test "$cc_type" = "clang"; then ++ # Clang's LTO fails on Windows, when there are references outside ++ # of inline assembly to nonlocal labels defined within inline assembly, ++ # see https://github.com/llvm/llvm-project/issues/76046. ++ case $target_os in ++ mingw*|win*) ++ disable inline_asm_nonlocal_labels ++ ;; ++ esac ++ fi fi -@@ -7234,7 +7236,9 @@ if enabled icc; then + enabled ftrapv && check_cflags -ftrapv +@@ -7235,7 +7247,9 @@ if enabled icc; then disable aligned_stack fi elif enabled gcc; then @@ -22,10 +33,10 @@ Index: jellyfin-ffmpeg/configure check_cflags -Werror=format-security check_cflags -Werror=implicit-function-declaration check_cflags -Werror=missing-prototypes -Index: jellyfin-ffmpeg/libavcodec/x86/cabac.h +Index: FFmpeg/libavcodec/x86/cabac.h =================================================================== ---- jellyfin-ffmpeg.orig/libavcodec/x86/cabac.h -+++ jellyfin-ffmpeg/libavcodec/x86/cabac.h +--- FFmpeg.orig/libavcodec/x86/cabac.h ++++ FFmpeg/libavcodec/x86/cabac.h @@ -183,6 +183,9 @@ av_noinline #else av_always_inline From 5f707484cf4d1680f7a52aa97c47a255126b2af1 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 16:16:34 +0800 Subject: [PATCH 03/29] configure: use thin lto for clang --- ...nable-gcc-vectorization-and-lto-auto.patch | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/debian/patches/0035-enable-gcc-vectorization-and-lto-auto.patch b/debian/patches/0035-enable-gcc-vectorization-and-lto-auto.patch index 03406e637a8..eee3a4b37b3 100644 --- a/debian/patches/0035-enable-gcc-vectorization-and-lto-auto.patch +++ b/debian/patches/0035-enable-gcc-vectorization-and-lto-auto.patch @@ -2,14 +2,15 @@ Index: FFmpeg/configure =================================================================== --- FFmpeg.orig/configure +++ FFmpeg/configure -@@ -7197,7 +7197,19 @@ if enabled lto; then +@@ -7195,8 +7195,23 @@ check_optflags -fno-signed-zeros + + if enabled lto; then test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker" - check_cflags -flto - check_ldflags -flto $cpuflags -+ check_cflags -flto=auto -+ check_ldflags -flto=auto $cpuflags - disable inline_asm_direct_symbol_refs +- check_cflags -flto +- check_ldflags -flto $cpuflags + if test "$cc_type" = "clang"; then ++ check_cflags -flto=thin ++ check_ldflags -flto=thin $cpuflags + # Clang's LTO fails on Windows, when there are references outside + # of inline assembly to nonlocal labels defined within inline assembly, + # see https://github.com/llvm/llvm-project/issues/76046. @@ -18,11 +19,16 @@ Index: FFmpeg/configure + disable inline_asm_nonlocal_labels + ;; + esac ++ else ++ check_cflags -flto ++ check_ldflags -flto $cpuflags ++ check_cflags -flto=auto ++ check_ldflags -flto=auto $cpuflags + fi + disable inline_asm_direct_symbol_refs fi - enabled ftrapv && check_cflags -ftrapv -@@ -7235,7 +7247,9 @@ if enabled icc; then +@@ -7235,7 +7250,9 @@ if enabled icc; then disable aligned_stack fi elif enabled gcc; then From 1f1ce5ebf45cf5aa3689c81fedb02163236a5b6b Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 16:29:09 +0800 Subject: [PATCH 04/29] ci: don't use matrix for windows to select compiler --- .github/workflows/build.yaml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 824207fabd8..b4b18ae798c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -41,20 +41,8 @@ jobs: # architectures: '["win64"]' # release: false - build_portable_windows: - strategy: - fail-fast: true - matrix: - cc: - - name: gcc - profile: _meta_portable - - name: clang - profile: _meta_win_clang_portable - uses: ./.github/workflows/${{ matrix.cc.profile }}.yaml - with: - os: 'windows' - architectures: '["win64"]' - release: false + build_portable_windows_clang: + uses: ./.github/workflows/_meta_win_clang_portable.yaml # # build_portable_linux: # uses: ./.github/workflows/_meta_portable.yaml From e7d00296eff11ed0d449be3204d882bfdd5de506 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 16:32:23 +0800 Subject: [PATCH 05/29] ci: don't install dependencies twice --- msys2/build.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/msys2/build.sh b/msys2/build.sh index b348e1b3463..d9c953a0854 100755 --- a/msys2/build.sh +++ b/msys2/build.sh @@ -8,8 +8,6 @@ arch="x86_64" TARGET="win64-clang" VARIANT="gpl" -pacman -S --noconfirm mingw-w64-clang-x86_64-toolchain git quilt diffstat mingw-w64-clang-x86_64-nasm - # Copy libc++ to our prefix folder cp /clang64/lib/libc++.a /clang64/ffbuild/lib/libc++.a From f39247b39e13de65da302eb9d651e1d1546ef6e3 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 16:34:16 +0800 Subject: [PATCH 06/29] ci: create the folder if not exist --- msys2/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/msys2/build.sh b/msys2/build.sh index d9c953a0854..c47cc7ec31b 100755 --- a/msys2/build.sh +++ b/msys2/build.sh @@ -9,6 +9,7 @@ TARGET="win64-clang" VARIANT="gpl" # Copy libc++ to our prefix folder +mkdir -p /clang64/ffbuild/lib cp /clang64/lib/libc++.a /clang64/ffbuild/lib/libc++.a cd "$BUILDER_ROOT"/PKGBUILD From 00fb01a75a4f9e25a09c628bce379fb94d6422ec Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 16:39:17 +0800 Subject: [PATCH 07/29] ci: fix pkg path --- msys2/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/msys2/build.sh b/msys2/build.sh index c47cc7ec31b..adec2873997 100755 --- a/msys2/build.sh +++ b/msys2/build.sh @@ -13,10 +13,10 @@ mkdir -p /clang64/ffbuild/lib cp /clang64/lib/libc++.a /clang64/ffbuild/lib/libc++.a cd "$BUILDER_ROOT"/PKGBUILD -for pkg in */; do - if [ -d "$dir" ]; then - echo "Installing $dir" - cd "$dir" +for pkg in *; do + if [ -d "$pkg" ]; then + echo "Installing $pkg" + cd "$pkg" (MINGW_ARCH=clang64 makepkg-mingw -sLfi --noconfirm --skippgpcheck) || exit $? From 2ad75e031413718d513f0e70d53c1b3be45b7448 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 16:50:06 +0800 Subject: [PATCH 08/29] ci: disable autocrlf --- .github/workflows/_meta_win_clang_portable.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_meta_win_clang_portable.yaml b/.github/workflows/_meta_win_clang_portable.yaml index 011185f60f2..226f065a0e0 100644 --- a/.github/workflows/_meta_win_clang_portable.yaml +++ b/.github/workflows/_meta_win_clang_portable.yaml @@ -40,7 +40,7 @@ jobs: diffstat mingw-w64-clang-x86_64-nasm - - run: git config --global core.autocrlf input # Disable autoclr for windows + - run: git config --global core.autocrlf false # Disable autoclr for windows - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Prepare prefix dir From 452a4a6f31d835d2177ae0fc15687b38315b0581 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 16:59:11 +0800 Subject: [PATCH 09/29] ci: also disable for runner internal git --- .github/workflows/_meta_win_clang_portable.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_meta_win_clang_portable.yaml b/.github/workflows/_meta_win_clang_portable.yaml index 226f065a0e0..a958ee47420 100644 --- a/.github/workflows/_meta_win_clang_portable.yaml +++ b/.github/workflows/_meta_win_clang_portable.yaml @@ -40,7 +40,8 @@ jobs: diffstat mingw-w64-clang-x86_64-nasm - - run: git config --global core.autocrlf false # Disable autoclr for windows + - run: 'C:\Program Files\Git\bin\git.exe config --global core.autocrlf false' # Disable autocrlf for windows + - run: git config --global core.autocrlf false - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Prepare prefix dir From d409d9224fdf1e44c25509ed2e1b8d407b00e3b4 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 17:01:52 +0800 Subject: [PATCH 10/29] ci: fix windows path --- .github/workflows/_meta_win_clang_portable.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_meta_win_clang_portable.yaml b/.github/workflows/_meta_win_clang_portable.yaml index a958ee47420..77dae4d4de6 100644 --- a/.github/workflows/_meta_win_clang_portable.yaml +++ b/.github/workflows/_meta_win_clang_portable.yaml @@ -40,7 +40,7 @@ jobs: diffstat mingw-w64-clang-x86_64-nasm - - run: 'C:\Program Files\Git\bin\git.exe config --global core.autocrlf false' # Disable autocrlf for windows + - run: '"C:\Program Files\Git\bin\git.exe" config --global core.autocrlf false' # Disable autocrlf for windows - run: git config --global core.autocrlf false - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 From 46bb615836fc8be716e889e73b0a02f2be84e92e Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 17:06:49 +0800 Subject: [PATCH 11/29] ci: apply more config to force line ending --- .github/workflows/_meta_win_clang_portable.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_meta_win_clang_portable.yaml b/.github/workflows/_meta_win_clang_portable.yaml index 77dae4d4de6..799c084ddcb 100644 --- a/.github/workflows/_meta_win_clang_portable.yaml +++ b/.github/workflows/_meta_win_clang_portable.yaml @@ -40,8 +40,11 @@ jobs: diffstat mingw-w64-clang-x86_64-nasm - - run: '"C:\Program Files\Git\bin\git.exe" config --global core.autocrlf false' # Disable autocrlf for windows - - run: git config --global core.autocrlf false + - run: | # Disable autocrlf for windows + '"C:\Program Files\Git\bin\git.exe" config --global core.autocrlf false' + '"C:\Program Files\Git\bin\git.exe" config --global core.eol lf' + git config --global core.autocrlf false + git config --global core.eol lf - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Prepare prefix dir From 29ded39547d9a8255aa48fe624fb894cf22c5ec4 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 17:10:43 +0800 Subject: [PATCH 12/29] ci: fix command --- .github/workflows/_meta_win_clang_portable.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_meta_win_clang_portable.yaml b/.github/workflows/_meta_win_clang_portable.yaml index 799c084ddcb..0b8421bed34 100644 --- a/.github/workflows/_meta_win_clang_portable.yaml +++ b/.github/workflows/_meta_win_clang_portable.yaml @@ -40,9 +40,9 @@ jobs: diffstat mingw-w64-clang-x86_64-nasm + - run: '"C:\Program Files\Git\bin\git.exe" config --global core.autocrlf false' + - run: '"C:\Program Files\Git\bin\git.exe" config --global core.eol lf' - run: | # Disable autocrlf for windows - '"C:\Program Files\Git\bin\git.exe" config --global core.autocrlf false' - '"C:\Program Files\Git\bin\git.exe" config --global core.eol lf' git config --global core.autocrlf false git config --global core.eol lf - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 From 989d80e7f04dd39f61f0a7612767b3addf0bd2c7 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 17:16:51 +0800 Subject: [PATCH 13/29] ci: never convert line endings --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 5a19b963b66..8766fc0be98 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.pnm -diff -text tests/ref/fate/sub-scc eol=crlf +msys2** -text From e1f142aaec10d8b3067a8737956d729406e7dd9f Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 17:23:22 +0800 Subject: [PATCH 14/29] ci: force lf --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 8766fc0be98..bb32dc23869 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ +* text eol=lf *.pnm -diff -text tests/ref/fate/sub-scc eol=crlf -msys2** -text From 7aebcd8ec0429a7275bcfc8b1e39577e575d527a Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 17:35:33 +0800 Subject: [PATCH 15/29] pkgbuild: fix path --- msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD index 32788e66d9c..d21dce709dc 100644 --- a/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD @@ -26,7 +26,7 @@ sha256sums=('ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269' 'e519a50a4adaf05b18650d3e9d644badc66e80ca86063681ffe9a2c2226319d0' 'f93e6b50082a8e880ee8436c7ec6a65a8f01e9282436af77f95bb259b1c7f7f7') -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" +export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" prepare() { cd "${srcdir}/${_realname}-${pkgver}" From 8a6384398e8b3703c15c205a26e9a0b788e5a91b Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 17:35:59 +0800 Subject: [PATCH 16/29] ci: use .gitattributes instead --- .github/workflows/_meta_win_clang_portable.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/_meta_win_clang_portable.yaml b/.github/workflows/_meta_win_clang_portable.yaml index 0b8421bed34..c2eb94936eb 100644 --- a/.github/workflows/_meta_win_clang_portable.yaml +++ b/.github/workflows/_meta_win_clang_portable.yaml @@ -40,11 +40,6 @@ jobs: diffstat mingw-w64-clang-x86_64-nasm - - run: '"C:\Program Files\Git\bin\git.exe" config --global core.autocrlf false' - - run: '"C:\Program Files\Git\bin\git.exe" config --global core.eol lf' - - run: | # Disable autocrlf for windows - git config --global core.autocrlf false - git config --global core.eol lf - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Prepare prefix dir From a76999455d51e9d42ff6b01c20b5e69bb2822b10 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 17:46:26 +0800 Subject: [PATCH 17/29] pkgbuild: prefix with ff --- msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD index d21dce709dc..9d14cd95072 100644 --- a/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD @@ -26,7 +26,7 @@ sha256sums=('ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269' 'e519a50a4adaf05b18650d3e9d644badc66e80ca86063681ffe9a2c2226319d0' 'f93e6b50082a8e880ee8436c7ec6a65a8f01e9282436af77f95bb259b1c7f7f7') -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" prepare() { cd "${srcdir}/${_realname}-${pkgver}" @@ -49,7 +49,7 @@ build() { mkdir -p "${srcdir}/build-${CARCH}" cd "${srcdir}/build-${CARCH}" ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ @@ -67,5 +67,5 @@ package() { cd "${srcdir}/build-${CARCH}" make DESTDIR="${pkgdir}" install # rm "${pkgdir}${MINGW_PREFIX}/bin/bz"{diff,grep,more} - install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" } From 16e04fe875f06df45ee26512db8462aa24c2e3c2 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 18:11:08 +0800 Subject: [PATCH 18/29] pkgbuild: prefix all path with ff --- msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD | 46 +++++++++---------- msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD | 12 ++--- msys2/PKGBUILD/10-mingw-w64-xz/PKGBUILD | 6 +-- msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD | 6 +-- msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD | 14 +++--- msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD | 8 ++-- msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD | 8 ++-- msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD | 4 +- msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD | 16 +++---- .../30-mingw-w64-chromaprint/PKGBUILD | 18 ++++---- .../PKGBUILD/30-mingw-w64-fontconfig/PKGBUILD | 22 ++++----- msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD | 8 ++-- msys2/PKGBUILD/30-mingw-w64-lame/PKGBUILD | 6 +-- .../PKGBUILD/30-mingw-w64-libbluray/PKGBUILD | 16 +++---- msys2/PKGBUILD/30-mingw-w64-libogg/PKGBUILD | 12 ++--- msys2/PKGBUILD/30-mingw-w64-libvpx/PKGBUILD | 8 ++-- msys2/PKGBUILD/30-mingw-w64-libwebp/PKGBUILD | 10 ++-- msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD | 8 ++-- .../PKGBUILD/35-mingw-w64-libvorbis/PKGBUILD | 4 +- msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD | 12 ++--- msys2/PKGBUILD/40-mingw-w64-fdk-aac/PKGBUILD | 10 ++-- msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD | 6 +-- .../PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD | 8 ++-- .../PKGBUILD/40-mingw-w64-libtheora/PKGBUILD | 6 +-- .../40-mingw-w64-opencl-headers/PKGBUILD | 10 ++-- msys2/PKGBUILD/40-mingw-w64-svt-av1/PKGBUILD | 12 ++--- msys2/PKGBUILD/40-mingw-w64-x264/PKGBUILD | 4 +- msys2/PKGBUILD/40-mingw-w64-x265/PKGBUILD | 12 ++--- msys2/PKGBUILD/40-mingw-w64-zimg/PKGBUILD | 4 +- .../50-mingw-w64-amf-headers/PKGBUILD | 10 ++-- .../50-mingw-w64-ffnvcodec-headers/PKGBUILD | 14 +++--- msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD | 12 ++--- .../PKGBUILD/50-mingw-w64-opencl-icd/PKGBUILD | 20 ++++---- 33 files changed, 187 insertions(+), 185 deletions(-) diff --git a/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD index ae82e12b23b..63372d26126 100644 --- a/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD @@ -31,8 +31,8 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-gettext-tools" "${MINGW_PACKAGE_PREFIX}-gperf") - -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" + +export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" apply_patch_with_msg() { for _patch in "$@" @@ -62,11 +62,11 @@ build() { mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ - --docdir=${MINGW_PREFIX}/share/doc/libiconv \ + --docdir=${FF_MINGW_PREFIX}/share/doc/libiconv \ --enable-static \ --disable-shared \ --enable-extra-encodings \ @@ -89,23 +89,23 @@ package_libiconv() { cd "${srcdir}/build-${MSYSTEM}" make install DESTDIR="${pkgdir}" - rm -fr "${pkgdir}${MINGW_PREFIX}"/bin/*.exe - rm -f "${pkgdir}${MINGW_PREFIX}"/lib/charset.alias - rm -fr "${pkgdir}${MINGW_PREFIX}"/share/locale - rm -f "${pkgdir}${MINGW_PREFIX}"/share/doc/libiconv/*.1.* - rm -fr "${pkgdir}${MINGW_PREFIX}"/share/man/man1 + rm -fr "${pkgdir}${FF_MINGW_PREFIX}"/bin/*.exe + rm -f "${pkgdir}${FF_MINGW_PREFIX}"/lib/charset.alias + rm -fr "${pkgdir}${FF_MINGW_PREFIX}"/share/locale + rm -f "${pkgdir}${FF_MINGW_PREFIX}"/share/doc/libiconv/*.1.* + rm -fr "${pkgdir}${FF_MINGW_PREFIX}"/share/man/man1 # Pkg-config file - install -Dm644 "${srcdir}/iconv.pc" "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/iconv.pc" - sed -e "s|@PREFIX@|${MINGW_PREFIX}|g" \ + install -Dm644 "${srcdir}/iconv.pc" "${pkgdir}${FF_MINGW_PREFIX}/lib/pkgconfig/iconv.pc" + sed -e "s|@PREFIX@|${FF_MINGW_PREFIX}|g" \ -e "s|@VERSION@|${pkgver}|g" \ - -i "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/iconv.pc" + -i "${pkgdir}${FF_MINGW_PREFIX}/lib/pkgconfig/iconv.pc" # Licenses - install -Dm644 "${srcdir}/${_realname}-${pkgver}/README" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/README" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING.LIB" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING.LIB" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/libcharset/COPYING.LIB" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/libcharset/COPYING.LIB" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/README" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/README" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING.LIB" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING.LIB" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/libcharset/COPYING.LIB" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/libcharset/COPYING.LIB" } package_iconv() { @@ -116,15 +116,15 @@ package_iconv() { cd "${srcdir}/build-${MSYSTEM}" make install DESTDIR="${pkgdir}" - rm -f "${pkgdir}${MINGW_PREFIX}"/bin/*.dll - rm -fr "${pkgdir}${MINGW_PREFIX}"/include - rm -fr "${pkgdir}${MINGW_PREFIX}"/lib - rm -f "${pkgdir}${MINGW_PREFIX}"/share/doc/libiconv/*.3.* - rm -fr "${pkgdir}${MINGW_PREFIX}"/share/man/man3 + rm -f "${pkgdir}${FF_MINGW_PREFIX}"/bin/*.dll + rm -fr "${pkgdir}${FF_MINGW_PREFIX}"/include + rm -fr "${pkgdir}${FF_MINGW_PREFIX}"/lib + rm -f "${pkgdir}${FF_MINGW_PREFIX}"/share/doc/libiconv/*.3.* + rm -fr "${pkgdir}${FF_MINGW_PREFIX}"/share/man/man3 # Licenses - install -Dm644 "${srcdir}/${_realname}-${pkgver}/README" "${pkgdir}${MINGW_PREFIX}/share/licenses/iconv/README" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/iconv/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/README" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/iconv/README" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/iconv/COPYING" } # template start; name=mingw-w64-splitpkg-wrappers; version=1.0; diff --git a/msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD index 584f9ea2cab..9253bf3899a 100644 --- a/msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD @@ -27,7 +27,7 @@ sha256sums=('6a5ca0652392a2d7c9db2ae5b40210843c0bbc081cbd410825ab00cc59f14a6c' '2a65fa19b126e85ad14ef1d1d9fc5079193e92af6b8db4454e3a875da5fdb79d') validpgpkeys=('8048643BA2C840F4F92A195FF54984BFA16C640F') # Glenn Randers-Pehrson (mozilla) -export MINGW_FFBUILD_PREFIX="${MINGW_PREFIX}/ffbuild/" +export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" prepare() { cd "${srcdir}/${_realname}-${pkgver}" @@ -51,7 +51,7 @@ build() { --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ - --prefix=${MINGW_FFBUILD_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --disable-shared --enable-static \ as_ln_s="cp -pR" @@ -60,17 +60,17 @@ build() { msg2 "Build contributed programs" mkdir -p ".libs/contrib/pngminus" && cd ".libs/contrib/pngminus" cp -r "${srcdir}/${_realname}-${pkgver}/contrib/pngminus"/* . -# libpng.a and libpng.dll.a are basically symlinks to libpng16.a +# libpng.a and libpng.dll.a are basically symlinks to libpng16.a # and libpng16.dll.a that are created at "make install" but we are # building the contributed programs before the "make install" so -# we have to link to libpng16.dll.a or libpng16.a if building +# we have to link to libpng16.dll.a or libpng16.a if building # statically. When building the static programs, we might also # want to build with the static version of zlib. make PNGINC="-I${srcdir}/${_realname}-${pkgver} -I${srcdir}/build-${MSYSTEM}" \ CC="${MINGW_PREFIX}/bin/cc" \ PNGLIB_SHARED="-L../.. -lpng16" \ PNGLIB_STATIC="../../libpng16.a" \ - ZLIB_STATIC="${MINGW_FFBUILD_PREFIX}/lib/libz.a" \ + ZLIB_STATIC="${FF_MINGW_PREFIX}/lib/libz.a" \ CFLAGS="$CFLAGS" \ LDFLAGS="-L../.. $LDFLAGS" \ png2pnm pnm2png png2pnm-static pnm2png-static @@ -84,7 +84,7 @@ package () { cd "${srcdir}/build-${MSYSTEM}" make install DESTDIR="${pkgdir}" - install -D -m644 "${srcdir}/libpng-${pkgver}/LICENSE" "${pkgdir}${MINGW_FFBUILD_PREFIX}/share/licenses/${_realname}/LICENSE" + install -D -m644 "${srcdir}/libpng-${pkgver}/LICENSE" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" msg2 "Install contributed programs" cd ".libs/contrib/pngminus" diff --git a/msys2/PKGBUILD/10-mingw-w64-xz/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-xz/PKGBUILD index c4e9e02b530..f9eccec809c 100644 --- a/msys2/PKGBUILD/10-mingw-w64-xz/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-xz/PKGBUILD @@ -28,7 +28,7 @@ source=("https://github.com/tukaani-project/xz/releases/download/v${pkgver}/xz-$ sha256sums=('a9db3bb3d64e248a0fae963f8fb6ba851a26ba1822e504dc0efd18a80c626caf') validpgpkeys=('3690C240CE51B4670D30AD1C38EE757D69184620') # Lasse Collin -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" +export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" prepare() { cd "${_realname}-${pkgver}" @@ -41,7 +41,7 @@ build() { mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --disable-rpath \ --disable-lzma-links \ --disable-symbol-versions \ @@ -56,5 +56,5 @@ package() { cd "${srcdir}/build-${MSYSTEM}" make DESTDIR="${pkgdir}" install - install -Dm644 ${srcdir}/${_realname}-${pkgver}/COPYING* -t ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname} + install -Dm644 ${srcdir}/${_realname}-${pkgver}/COPYING* -t ${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname} } diff --git a/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD index 78625190b95..a72395b3f11 100644 --- a/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD @@ -35,7 +35,7 @@ sha256sums=('38ef96b8dfe510d42707d9c781877914792541133e1870841463bfa73f883e32' '0be98a7e660e7c068856f08b9e92d6c73a6b0d88c3e29a9716140b147f7c23c5') validpgpkeys=('5ED46A6721D365587791E2AA783FCD8E58BCAFBA') -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" +export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" apply_patch_with_msg() { for _patch in "$@" @@ -64,7 +64,7 @@ build() { CHOST=${MINGW_CHOST} \ ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --static make @@ -82,7 +82,7 @@ package_zlib() { make DESTDIR="${pkgdir}" install - install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" } # template start; name=mingw-w64-splitpkg-wrappers; version=1.0; diff --git a/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD index 53dc7970d78..441082b6878 100644 --- a/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD @@ -31,7 +31,7 @@ precision="double float \ $( [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || echo "quad" )" export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" apply_patch_with_msg() { for _patch in "$@" @@ -80,7 +80,7 @@ build() { -Wno-dev \ -GNinja \ ${_config_cmake} \ - -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ + -DCMAKE_INSTALL_PREFIX="${FF_MINGW_PREFIX}" \ -DBUILD_SHARED_LIBS=ON \ -DENABLE_OPENMP=ON \ -DENABLE_THREADS=ON \ @@ -104,7 +104,7 @@ build() { fi ../${_realname}-${_pkgver}/configure \ - --prefix="${MINGW_PREFIX}" \ + --prefix="${FF_MINGW_PREFIX}" \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ ${_config} \ @@ -153,9 +153,9 @@ package() { ;; esac local _staging_prefix=$(cygpath -am ${srcdir}/build-${MSYSTEM}-${cur}) - sed -e "s|IMPORTED_IMPLIB_RELEASE \"${_staging_prefix}|IMPORTED_IMPLIB_RELEASE \"${MINGW_PREFIX}/lib|g" -i ./FFTW3LibraryDepends.cmake - sed -e "s|IMPORTED_LOCATION_RELEASE \"${_staging_prefix}|IMPORTED_LOCATION_RELEASE \"${MINGW_PREFIX}/bin|g" -i ./FFTW3LibraryDepends.cmake - install -Dm644 ./FFTW3LibraryDepends.cmake "${pkgdir}"${MINGW_PREFIX}/lib/cmake/${_prec_prefix}/FFTW3LibraryDepends.cmake - mv "${pkgdir}"${MINGW_PREFIX}/lib/cmake/fftw3/${_file_prefix}*.cmake "${pkgdir}"${MINGW_PREFIX}/lib/cmake/${_prec_prefix}/ + sed -e "s|IMPORTED_IMPLIB_RELEASE \"${_staging_prefix}|IMPORTED_IMPLIB_RELEASE \"${FF_MINGW_PREFIX}/lib|g" -i ./FFTW3LibraryDepends.cmake + sed -e "s|IMPORTED_LOCATION_RELEASE \"${_staging_prefix}|IMPORTED_LOCATION_RELEASE \"${FF_MINGW_PREFIX}/bin|g" -i ./FFTW3LibraryDepends.cmake + install -Dm644 ./FFTW3LibraryDepends.cmake "${pkgdir}"${FF_MINGW_PREFIX}/lib/cmake/${_prec_prefix}/FFTW3LibraryDepends.cmake + mv "${pkgdir}"${FF_MINGW_PREFIX}/lib/cmake/fftw3/${_file_prefix}*.cmake "${pkgdir}"${FF_MINGW_PREFIX}/lib/cmake/${_prec_prefix}/ done } diff --git a/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD index 3afcb554989..b75abf80cca 100644 --- a/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD @@ -38,7 +38,7 @@ sha256sums=('12991c4e55c506dd7f9b765933e62fd2be2e06d421505d7950a132e4f1bb484d' '0571f18d97834df020e4cbdb1338b14f9160669f868237080951e01f5b86727c') validpgpkeys=('E30674707856409FF1948010BE6C3AAC63AD8E3F') # Werner Lemberg -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" +export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -73,7 +73,7 @@ build() { MSYS2_ARG_CONV_EXCL="--prefix=" \ meson setup \ - --prefix="${MINGW_PREFIX}" \ + --prefix="${FF_MINGW_PREFIX}" \ --wrap-mode=nodownload \ --auto-features=enabled \ --default-library=static \ @@ -89,6 +89,6 @@ package () { DESTDIR="${pkgdir}" meson install # Licenses - install -Dm644 "${srcdir}/${_realname}-${pkgver}/docs/GPLv2.TXT" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/GPLv2.TXT" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/docs/FTL.TXT" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/FTL.TXT" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/docs/GPLv2.TXT" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/GPLv2.TXT" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/docs/FTL.TXT" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/FTL.TXT" } diff --git a/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD index 026d2905d4c..21e83993a6c 100644 --- a/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD @@ -21,14 +21,14 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-meson" source=("https://github.com/fribidi/fribidi/releases/download/v${pkgver}/fribidi-${pkgver}.tar.xz") sha256sums=('0bbc7ff633bfa208ae32d7e369cf5a7d20d5d2557a0b067c9aa98bcbf9967587') -export MINGW_FFBUILD_PREFIX="${MINGW_PREFIX}/ffbuild/" +export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" build() { MSYS2_ARG_CONV_EXCL="--prefix=" \ ${MINGW_PREFIX}/bin/meson.exe setup \ - --prefix=${MINGW_FFBUILD_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --buildtype plain \ - --prefix=${MINGW_FFBUILD_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ -Ddocs=false \ --default-library static \ build-${MSYSTEM}-static \ @@ -44,5 +44,5 @@ check() { package() { meson install -C build-${MSYSTEM}-static --destdir="${pkgdir}" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_FFBUILD_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING" } diff --git a/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD index 78c29251185..9755645542e 100644 --- a/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD @@ -23,7 +23,7 @@ sha256sums=('a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898' '7c3cde2634baa2cb1c31404bbfed2d8d7ba33556971ac842a08f2e87667849ab') validpgpkeys=('343C2FF0FBEE5EC2EDBEF399F3599FF828C67298') # Niels Möller " -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" +export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" prepare() { cd "${srcdir}/${_realname}-${pkgver}" @@ -53,7 +53,7 @@ build() { mkdir -p "${srcdir}/static-${MSYSTEM}" && cd "${srcdir}/static-${MSYSTEM}" ../${_realname}-${pkgver}/configure \ --build=${MINGW_CHOST} \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --enable-cxx \ "${extra_config[@]}" \ --enable-static \ diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD index c8b4493ab07..1f07844524d 100644 --- a/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD @@ -37,7 +37,7 @@ sha256sums=('43ad877b018bc63deb2468d71f95219c2fac196876ef36d1bee51d226173ec93' '06c0afaf1b8dec10d6f23dec983026cddf992528ffbc1cc50418302fabf9dee0' 'b4e3cf5faf0ba1100e2ae6b632dc429c0b25c8caca327e0888b41341d6ddbf9a') -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild/" +export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -75,7 +75,7 @@ build() { [[ -d "${srcdir}"/build-static-${MSYSTEM} ]] && rm -rf "${srcdir}"/build-static-${MSYSTEM} mkdir -p ${srcdir}/build-static-${MSYSTEM} && cd ${srcdir}/build-static-${MSYSTEM} ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ --build="${MINGW_CHOST}" \ @@ -97,15 +97,15 @@ package_libxml2() { make -C ${srcdir}/build-static-${MSYSTEM} install DESTDIR="${pkgdir}" # License - install -Dm644 "${srcdir}/${_realname}-${pkgver}/Copyright" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/Copyright" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING" # Remove hard coded library path from xlm2-config and libxml-2.0.pc files - local PREFIX_DEPS=$(cygpath -am ${MINGW_PREFIX}) - sed -s "s|${PREFIX_DEPS}\/lib|\${libdir}|g" -i "${pkgdir}"${MINGW_PREFIX}/bin/xml2-config - sed -s "s|${PREFIX_DEPS}\/lib|\${libdir}|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libxml-2.0.pc + local PREFIX_DEPS=$(cygpath -am ${FF_MINGW_PREFIX}) + sed -s "s|${PREFIX_DEPS}\/lib|\${libdir}|g" -i "${pkgdir}"${FF_MINGW_PREFIX}/bin/xml2-config + sed -s "s|${PREFIX_DEPS}\/lib|\${libdir}|g" -i "${pkgdir}"${FF_MINGW_PREFIX}/lib/pkgconfig/libxml-2.0.pc - mkdir -p dest${MINGW_PREFIX}/share - mv "${pkgdir}${MINGW_PREFIX}"/share/{doc,gtk-doc} dest${MINGW_PREFIX}/share + mkdir -p dest${FF_MINGW_PREFIX}/share + mv "${pkgdir}${FF_MINGW_PREFIX}"/share/{doc,gtk-doc} dest${FF_MINGW_PREFIX}/share } package_libxml2-docs() { diff --git a/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD index 71673c46f48..87aa3476110 100644 --- a/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD @@ -20,15 +20,15 @@ source=("https://github.com/acoustid/${_realname}/releases/download/v${pkgver}/$ sha256sums=('a1aad8fa3b8b18b78d3755b3767faff9abb67242e01b478ec9a64e190f335e1c') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" -export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" -export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd "${srcdir}"/${_realname}-${pkgver} } build() { + export CMAKE_PREFIX_PATH="${MINGW_TOOLCHAIN_PREFIX}" + export PKG_CONFIG_PATH="${MINGW_TOOLCHAIN_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" _common_opts=( -G"Ninja" -DCMAKE_BUILD_TYPE=Release \ @@ -43,7 +43,7 @@ build() { MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe \ - -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DCMAKE_INSTALL_PREFIX=${FF_MINGW_PREFIX} \ -DBUILD_SHARED_LIBS=off \ "${_common_opts[@]}" \ ../${_realname}-${pkgver} @@ -52,13 +52,15 @@ build() { } package() { + export CMAKE_PREFIX_PATH="${MINGW_TOOLCHAIN_PREFIX}" + export PKG_CONFIG_PATH="${MINGW_TOOLCHAIN_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" # static cd "${srcdir}/static-${MSYSTEM}" DESTDIR="${pkgdir}" ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe --install ./ # Let ffmpeg also statically link to fftw3 and stdc++ - # sed -s "s|-lchromaprint|-lchromaprint\ -lfftw3f -lstdc++|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc - # sed -s "s|Cflags\:|Cflags\:\ -DCHROMAPRINT_NODLL|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc - echo "Libs.private: -lfftw3f -lstdc++" >> "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc - echo "Cflags.private: -DCHROMAPRINT_NODLL" >> "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc + # sed -s "s|-lchromaprint|-lchromaprint\ -lfftw3f -lstdc++|g" -i "${pkgdir}"${FF_MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc + # sed -s "s|Cflags\:|Cflags\:\ -DCHROMAPRINT_NODLL|g" -i "${pkgdir}"${FF_MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc + echo "Libs.private: -lfftw3f -lstdc++" >> "${pkgdir}"${FF_MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc + echo "Cflags.private: -DCHROMAPRINT_NODLL" >> "${pkgdir}"${FF_MINGW_PREFIX}/lib/pkgconfig/libchromaprint.pc } diff --git a/msys2/PKGBUILD/30-mingw-w64-fontconfig/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-fontconfig/PKGBUILD index 5b3eb9c8c90..cac98dd7673 100644 --- a/msys2/PKGBUILD/30-mingw-w64-fontconfig/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-fontconfig/PKGBUILD @@ -38,7 +38,7 @@ sha256sums=('63a0658d0e06e0fa886106452b58ef04f21f58202ea02a94c39de0d3335d7c0e' 'c225c156c4732a492c9588c8d33705ca29af6f3195f201f4012b09ff012f1831') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd "${srcdir}"/${_realname}-${pkgver} @@ -55,7 +55,7 @@ prepare() { } build() { - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" [[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}" mkdir -p "${srcdir}/build-${MINGW_CHOST}" cd "${srcdir}/build-${MINGW_CHOST}" @@ -64,15 +64,15 @@ build() { # and patch out symlinking PYTHON=/usr/bin/python \ ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --disable-shared \ --enable-static \ --enable-iconv \ - --with-libiconv=${MINGW_PREFIX} \ + --with-libiconv=${FF_MINGW_PREFIX} \ --enable-libxml2 \ - --with-libxml2=${MINGW_PREFIX} \ + --with-libxml2=${FF_MINGW_PREFIX} \ --disable-docs \ --with-arch=${CARCH} \ as_ln_s="cp -pR" @@ -84,17 +84,17 @@ build() { package() { cd "${srcdir}/build-${MINGW_CHOST}" make -j1 DESTDIR="${pkgdir}" install - install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING" - find "${pkgdir}${MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm + find "${pkgdir}${FF_MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm # Also install libintl lib - cp "${MINGW_TOOLCHAIN_PREFIX}"/lib/libintl.a "${pkgdir}${MINGW_PREFIX}/lib/" + cp "${MINGW_TOOLCHAIN_PREFIX}"/lib/libintl.a "${pkgdir}${FF_MINGW_PREFIX}/lib/" # Convert MSYS2-specific paths to pkg-config variables (see issue #872) - sed -i "s#${MINGW_PREFIX}/lib#\${libdir}#g" "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/fontconfig.pc - sed -i "s#${MINGW_PREFIX}/include#\${includedir}#g" "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/fontconfig.pc + sed -i "s#${FF_MINGW_PREFIX}/lib#\${libdir}#g" "${pkgdir}${FF_MINGW_PREFIX}"/lib/pkgconfig/fontconfig.pc + sed -i "s#${FF_MINGW_PREFIX}/include#\${includedir}#g" "${pkgdir}${FF_MINGW_PREFIX}"/lib/pkgconfig/fontconfig.pc # Also statically link to libintl - sed -s "s|-liconv|-liconv\ -lintl|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/fontconfig.pc + sed -s "s|-liconv|-liconv\ -lintl|g" -i "${pkgdir}"${FF_MINGW_PREFIX}/lib/pkgconfig/fontconfig.pc } diff --git a/msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD index b7129d1b4cb..cf2fab5fc24 100644 --- a/msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD @@ -33,7 +33,7 @@ sha256sums=('a41b272ceeb920c57263ec851604542d9ec85ee3030506d94662067c7b6ab89e' noextract=("harfbuzz-${pkgver}.tar.xz") export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { echo "Extracting harfbuzz-${pkgver}.tar.xz..." @@ -44,7 +44,7 @@ prepare() { } build() { - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" local -a _static_flags=( -DGIO_STATIC_COMPILATION -DGLIB_STATIC_COMPILATION @@ -57,7 +57,7 @@ build() { CXXFLAGS+=" ${_static_flags[@]}" \ MSYS2_ARG_CONV_EXCL="--prefix=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/meson setup \ - --prefix="${MINGW_PREFIX}" \ + --prefix="${FF_MINGW_PREFIX}" \ --buildtype plain \ --prefer-static \ --wrap-mode=nofallback \ @@ -91,7 +91,7 @@ package_harfbuzz() { ${MINGW_TOOLCHAIN_PREFIX}/bin/meson install -C "build-${MSYSTEM}-static" --destdir "${pkgdir}" install -Dm644 "${srcdir}"/${_realname}-${pkgver}/COPYING \ - "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/COPYING + "${pkgdir}"${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING } # template start; name=mingw-w64-splitpkg-wrappers; version=1.0; diff --git a/msys2/PKGBUILD/30-mingw-w64-lame/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-lame/PKGBUILD index 4d03db6d78f..9e0871d4318 100644 --- a/msys2/PKGBUILD/30-mingw-w64-lame/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-lame/PKGBUILD @@ -38,7 +38,7 @@ sha256sums=('ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e' '65edcb5090417f822227b4a43f2f0c0224ceca7486fb3fd01aa9a6cf153ad714') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd "${srcdir}/${_realname}-${pkgver}" @@ -58,12 +58,12 @@ prepare() { } build() { - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" [[ -d "build-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}" mkdir -p "${srcdir}/build-${MINGW_CHOST}" cd "${srcdir}/build-${MINGW_CHOST}" ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ diff --git a/msys2/PKGBUILD/30-mingw-w64-libbluray/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-libbluray/PKGBUILD index 961cced62c7..277bc19229d 100644 --- a/msys2/PKGBUILD/30-mingw-w64-libbluray/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-libbluray/PKGBUILD @@ -22,7 +22,7 @@ source=(https://download.videolan.org/pub/videolan/libbluray/${pkgver}/${_realna sha256sums=('478ffd68a0f5dde8ef6ca989b7f035b5a0a22c599142e5cd3ff7b03bbebe5f2b') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd ${srcdir}/${_realname}-${pkgver} @@ -30,13 +30,13 @@ prepare() { build() { export lt_cv_deplibs_check_method='pass_all' - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" [[ -d "${srcdir}/build-static-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-static-${MSYSTEM}" mkdir -p "${srcdir}/build-static-${MSYSTEM}" && cd "${srcdir}/build-static-${MSYSTEM}" ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ @@ -44,8 +44,8 @@ build() { --disable-bdjava-jar \ --enable-shared=no \ --enable-static=yes \ - LIBXML2_CFLAGS="$("${MINGW_PREFIX}"/bin/xml2-config --cflags) -DLIBXML_STATIC" \ - LIBXML2_LIBS="$("${MINGW_PREFIX}"/bin/xml2-config --libs)" + LIBXML2_CFLAGS="$("${FF_MINGW_PREFIX}"/bin/xml2-config --cflags) -DLIBXML_STATIC" \ + LIBXML2_LIBS="$("${FF_MINGW_PREFIX}"/bin/xml2-config --libs)" make } @@ -54,8 +54,8 @@ package() { cd "${srcdir}/build-static-${MSYSTEM}" make DESTDIR="${pkgdir}" install - local _prefix_win="$(cygpath -m "${MINGW_PREFIX}")" - sed -s "s|${_prefix_win}|${MINGW_PREFIX}|g" -i ${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/libbluray.pc + local _prefix_win="$(cygpath -m "${FF_MINGW_PREFIX}")" + sed -s "s|${_prefix_win}|${FF_MINGW_PREFIX}|g" -i ${pkgdir}${FF_MINGW_PREFIX}/lib/pkgconfig/libbluray.pc - install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING" } diff --git a/msys2/PKGBUILD/30-mingw-w64-libogg/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-libogg/PKGBUILD index 12e8660a599..4195ba1b56d 100644 --- a/msys2/PKGBUILD/30-mingw-w64-libogg/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-libogg/PKGBUILD @@ -19,7 +19,7 @@ sha256sums=('0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664' '7f635d4ca41c75dc52206749b6346c174c6a028de09604c6d66929bcdabf6c33') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd ${srcdir}/${_realname}-${pkgver} @@ -27,8 +27,8 @@ prepare() { } build() { - export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" + export CMAKE_PREFIX_PATH="${FF_MINGW_PREFIX}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" declare -a extra_config if check_option "debug" "n"; then extra_config+=("-DCMAKE_BUILD_TYPE=Release") @@ -43,7 +43,7 @@ build() { MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ -G'MSYS Makefiles' \ - -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DCMAKE_INSTALL_PREFIX=${FF_MINGW_PREFIX} \ "${extra_config[@]}" \ -DBUILD_SHARED_LIBS=OFF \ -DBUILD_TESTING=OFF \ @@ -58,8 +58,8 @@ package() { make DESTDIR="${pkgdir}" install # m4 - install -Dm644 ${srcdir}/${_realname}-${pkgver}/ogg.m4 ${pkgdir}${MINGW_PREFIX}/share/aclocal/ogg.m4 + install -Dm644 ${srcdir}/${_realname}-${pkgver}/ogg.m4 ${pkgdir}${FF_MINGW_PREFIX}/share/aclocal/ogg.m4 # License - install -Dm644 ${srcdir}/${_realname}-${pkgver}/COPYING ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING + install -Dm644 ${srcdir}/${_realname}-${pkgver}/COPYING ${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING } diff --git a/msys2/PKGBUILD/30-mingw-w64-libvpx/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-libvpx/PKGBUILD index 4a9a86c4d5f..4db741eae6f 100644 --- a/msys2/PKGBUILD/30-mingw-w64-libvpx/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-libvpx/PKGBUILD @@ -32,7 +32,7 @@ sha256sums=('5f21d2db27071c8a46f1725928a10227ae45c5cd1cad3727e4aafbe476e321fa' '7c511b5df935278da2cba32b03b90582f360ab6786a5e32028bc82025193fabd') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -78,7 +78,7 @@ build() { LD=cc CFLAGS="$EXTRA_CFLAGS $CFLAGS -fno-asynchronous-unwind-tables" \ ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --target=${_targetarch} \ --enable-vp8 \ --enable-vp9 \ @@ -110,7 +110,7 @@ build() { package() { cd "${srcdir}/build-${MSYSTEM}" - make DIST_DIR="${pkgdir}${MINGW_PREFIX}" install + make DIST_DIR="${pkgdir}${FF_MINGW_PREFIX}" install # Also install pthread - cp "${MINGW_TOOLCHAIN_PREFIX}"/lib/libpthread.a "${pkgdir}${MINGW_PREFIX}/lib/" + cp "${MINGW_TOOLCHAIN_PREFIX}"/lib/libpthread.a "${pkgdir}${FF_MINGW_PREFIX}/lib/" } diff --git a/msys2/PKGBUILD/30-mingw-w64-libwebp/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-libwebp/PKGBUILD index 7bc19fa66eb..535a971b4c6 100644 --- a/msys2/PKGBUILD/30-mingw-w64-libwebp/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-libwebp/PKGBUILD @@ -25,7 +25,7 @@ sha256sums=('12af50c45530f0a292d39a88d952637e43fb2d4ab1883c44ae729840f7273381' validpgpkeys=('6B0E6B70976DE303EDF2F601F9C3D6BDB8232B5D') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd "${srcdir}/${_realname}-${pkgver}" @@ -34,8 +34,8 @@ prepare() { } build() { - export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export CMAKE_PREFIX_PATH="${FF_MINGW_PREFIX}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" declare -a extra_config if check_option "debug" "n"; then extra_config+=("-DCMAKE_BUILD_TYPE=Release") @@ -49,7 +49,7 @@ build() { MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe \ -GNinja \ - -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ + -DCMAKE_INSTALL_PREFIX="${FF_MINGW_PREFIX}" \ "${extra_config[@]}" \ -DBUILD_SHARED_LIBS=OFF \ -DWEBP_ENABLE_SWAP_16BIT_CSP=ON \ @@ -72,5 +72,5 @@ package() { DESTDIR="${pkgdir}" "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe --install . - install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING" } diff --git a/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD index 6db5cf75587..67023ca904d 100644 --- a/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD @@ -26,7 +26,7 @@ sha256sums=('65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1' '5fb0f28264492d6512acb6eec7b5e147c922751f6df30d1317114048eca01516') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" apply_patch_with_msg() { for _patch in "$@" @@ -49,7 +49,7 @@ build() { # -Dasm is for ARM fixed point, not neon or x86 avx/sse MSYS2_ARG_CONV_EXCL="--prefix=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/meson.exe setup \ - --prefix="${MINGW_PREFIX}" \ + --prefix="${FF_MINGW_PREFIX}" \ --wrap-mode=nodownload \ --auto-features=enabled \ --buildtype=plain \ @@ -69,9 +69,9 @@ check() { package_opus() { ${MINGW_TOOLCHAIN_PREFIX}/bin/meson.exe install -C "${srcdir}/build-${MSYSTEM}" --destdir "${pkgdir}" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/opus.m4" "${pkgdir}${MINGW_PREFIX}/share/aclocal/opus.m4" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/opus.m4" "${pkgdir}${FF_MINGW_PREFIX}/share/aclocal/opus.m4" - install -Dm644 "${srcdir}/${_realname}-${pkgver}"/COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}"/COPYING "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING" } # template start; name=mingw-w64-splitpkg-wrappers; version=1.0; # vim: set ft=bash : diff --git a/msys2/PKGBUILD/35-mingw-w64-libvorbis/PKGBUILD b/msys2/PKGBUILD/35-mingw-w64-libvorbis/PKGBUILD index b497563796f..a8425612e71 100644 --- a/msys2/PKGBUILD/35-mingw-w64-libvorbis/PKGBUILD +++ b/msys2/PKGBUILD/35-mingw-w64-libvorbis/PKGBUILD @@ -22,14 +22,14 @@ source=(https://downloads.xiph.org/releases/vorbis/${_realname}-${pkgver}.tar.gz sha256sums=('0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" build() { [[ -d "build-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}" mkdir -p "${srcdir}/build-${MINGW_CHOST}" cd "${srcdir}/build-${MINGW_CHOST}" ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ diff --git a/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD index 99706300ddc..1e76ce7d170 100644 --- a/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD @@ -29,7 +29,7 @@ sha256sums=('42fe524bcc82ea3a830057178faace22923a79bad3d819a4962d8cfc54c36f19' validpgpkeys=('65F7C6B4206BD057A7EB73787180713BE58D1ADC') # VideoLAN Release Signing Key export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd "${_realname}-${pkgver}" @@ -42,7 +42,7 @@ build() { MSYS2_ARG_CONV_EXCL="--prefix=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/meson setup \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --default-library static \ --buildtype plain \ -Denable_tests=false \ @@ -55,7 +55,7 @@ build() { check() { cd "${srcdir}/build-${MSYSTEM}" - ${MINGW_PREFIX}/bin/meson test + ${FF_MINGW_PREFIX}/bin/meson test } package() { @@ -64,7 +64,7 @@ package() { DESTDIR="${pkgdir}" ${MINGW_TOOLCHAIN_PREFIX}/bin/meson install # License - install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/doc/PATENTS" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/PATENTS" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/README.md" "${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}/README.md" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/doc/PATENTS" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/PATENTS" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/README.md" "${pkgdir}${FF_MINGW_PREFIX}/share/doc/${_realname}/README.md" } diff --git a/msys2/PKGBUILD/40-mingw-w64-fdk-aac/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-fdk-aac/PKGBUILD index 2c2c66921e0..59d5f66c855 100644 --- a/msys2/PKGBUILD/40-mingw-w64-fdk-aac/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-fdk-aac/PKGBUILD @@ -19,7 +19,7 @@ source=("${_realname}"::"git+https://gitlab.freedesktop.org/wtaymans/${_realname sha256sums=('SKIP') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd ${srcdir}/${_realname} @@ -31,7 +31,7 @@ build() { [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH} mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH} ../${_realname}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ @@ -46,8 +46,8 @@ package() { cd ${srcdir}/build-${CARCH} make DESTDIR=${pkgdir} install - + # Install license - install -dm 755 "${pkgdir}${MINGW_PREFIX}"/share/licenses/libfdk-aac - install -m 644 "${srcdir}"/${_realname}/NOTICE "${pkgdir}${MINGW_PREFIX}"/share/licenses/libfdk-aac/ + install -dm 755 "${pkgdir}${FF_MINGW_PREFIX}"/share/licenses/libfdk-aac + install -m 644 "${srcdir}"/${_realname}/NOTICE "${pkgdir}${FF_MINGW_PREFIX}"/share/licenses/libfdk-aac/ } diff --git a/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD index 581fe0f227a..24c404a5dab 100644 --- a/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD @@ -26,7 +26,7 @@ source=(https://github.com/libass/${_realname}/releases/download/${pkgver}/${_re sha256sums=('SKIP') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd "${srcdir}/${_realname}-${pkgver}" @@ -38,10 +38,10 @@ build() { [[ -d "${srcdir}/build-${MSYSTEM}-static" ]] && rm -rf "${srcdir}/build-${MSYSTEM}-static" mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static" - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" CPPFLAGS+=" -DFRIBIDI_LIB_STATIC" \ ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ diff --git a/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD index d523fa5ffa8..8aef2a614e1 100644 --- a/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD @@ -23,7 +23,7 @@ source=("https://lib.openmpt.org/files/${_realname}/src/${_realname}-${pkgver}+r sha256sums=('87778c8046a226c6cbfb114f4c8e3e27c121b7b3dccce5cb7de45899250274cc') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd "${srcdir}/${_realname}-${pkgver}+release.autotools" @@ -32,12 +32,12 @@ prepare() { } build() { - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" CPPFLAGS+=" -DMPT_CHECK_CXX_IGNORE_WARNING_O2" \ ../${_realname}-${pkgver}+release.autotools/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ @@ -57,5 +57,5 @@ package() { cd "${srcdir}/build-${MSYSTEM}" make DESTDIR="${pkgdir}" install - install -Dm644 "${srcdir}/${_realname}-${pkgver}+release.autotools/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" + install -Dm644 "${srcdir}/${_realname}-${pkgver}+release.autotools/LICENSE" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" } diff --git a/msys2/PKGBUILD/40-mingw-w64-libtheora/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-libtheora/PKGBUILD index 1c0ba4f5488..2dec86bd946 100644 --- a/msys2/PKGBUILD/40-mingw-w64-libtheora/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-libtheora/PKGBUILD @@ -25,7 +25,7 @@ sha256sums=('b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc' '5627d26c3316fef71bca037e1834bcba063dbf949ea9293820f0e68b13641105') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd ${srcdir}/${_realname}-${pkgver} @@ -38,7 +38,7 @@ prepare() { } build() { - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" [[ -d "build-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}" mkdir -p ${srcdir}/build-$MINGW_CHOST cd "${srcdir}/build-$MINGW_CHOST" @@ -47,7 +47,7 @@ build() { --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --disable-{shared,examples,extra-programs,oggtest,vorbistest,spec,doc} \ --enable-static diff --git a/msys2/PKGBUILD/40-mingw-w64-opencl-headers/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-opencl-headers/PKGBUILD index 8ca7b7a59fc..c0d23686163 100644 --- a/msys2/PKGBUILD/40-mingw-w64-opencl-headers/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-opencl-headers/PKGBUILD @@ -18,21 +18,21 @@ source=(https://github.com/KhronosGroup/OpenCL-Headers/archive/v${pkgver}/OpenCL sha256sums=('SKIP') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" package() { - export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export CMAKE_PREFIX_PATH="${FF_MINGW_PREFIX}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" cd "${srcdir}"/OpenCL-Headers-${pkgver} MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ -G'Ninja' \ - -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DCMAKE_INSTALL_PREFIX=${FF_MINGW_PREFIX} \ -DBUILD_TESTING=OFF \ ../${_realname}-${pkgver} DESTDIR=${pkgdir} cmake --install . - install -D -m644 "${srcdir}"/OpenCL-Headers-${pkgver}/LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" + install -D -m644 "${srcdir}"/OpenCL-Headers-${pkgver}/LICENSE "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" } diff --git a/msys2/PKGBUILD/40-mingw-w64-svt-av1/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-svt-av1/PKGBUILD index 6796d33b0ff..56bdb314b96 100644 --- a/msys2/PKGBUILD/40-mingw-w64-svt-av1/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-svt-av1/PKGBUILD @@ -18,15 +18,15 @@ source=("${url}/-/archive/v${pkgver}/${_realname}-v${pkgver}.tar.gz") sha256sums=('SKIP') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd "${srcdir}"/${_realname}-v${pkgver} } build() { - export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export CMAKE_PREFIX_PATH="${FF_MINGW_PREFIX}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" declare -a extra_config if check_option "debug" "n"; then extra_config+=("-DCMAKE_BUILD_TYPE=Release") @@ -40,7 +40,7 @@ build() { MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ -GNinja \ - -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DCMAKE_INSTALL_PREFIX=${FF_MINGW_PREFIX} \ "${extra_config[@]}" \ -DBUILD_SHARED_LIBS=OFF \ -DREPRODUCIBLE_BUILDS=ON \ @@ -53,6 +53,6 @@ package() { cd "${srcdir}"/build-${MSYSTEM}-static DESTDIR="${pkgdir}" ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake --install . - install -Dm644 ${srcdir}/${_realname}-v${pkgver}/LICENSE.md ${pkgdir}${MINGW_PREFIX}/share/licenses/svt-av1/LICENSE - install -Dm644 ${srcdir}/${_realname}-v${pkgver}/PATENTS.md ${pkgdir}${MINGW_PREFIX}/share/licenses/svt-av1/PATENTS.md + install -Dm644 ${srcdir}/${_realname}-v${pkgver}/LICENSE.md ${pkgdir}${FF_MINGW_PREFIX}/share/licenses/svt-av1/LICENSE + install -Dm644 ${srcdir}/${_realname}-v${pkgver}/PATENTS.md ${pkgdir}${FF_MINGW_PREFIX}/share/licenses/svt-av1/PATENTS.md } diff --git a/msys2/PKGBUILD/40-mingw-w64-x264/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-x264/PKGBUILD index d1c351d1f1e..95d91684cbb 100644 --- a/msys2/PKGBUILD/40-mingw-w64-x264/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-x264/PKGBUILD @@ -30,7 +30,7 @@ sha256sums=('SKIP' 'SKIP') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" pkgver() { cd ${srcdir}/${_realname} @@ -53,7 +53,7 @@ build() { mkdir -p "${srcdir}/build-${MINGW_CHOST}" cd "${srcdir}/build-${MINGW_CHOST}" ../${_realname}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --host=${MINGW_CHOST} \ --enable-static \ --enable-strip \ diff --git a/msys2/PKGBUILD/40-mingw-w64-x265/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-x265/PKGBUILD index 99334090f5b..50cb6b9909e 100644 --- a/msys2/PKGBUILD/40-mingw-w64-x265/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-x265/PKGBUILD @@ -28,7 +28,7 @@ source=("${_realname}"::"git+https://bitbucket.org/multicoreware/x265_git.git#co sha256sums=('SKIP') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { mv "${srcdir}"/"x265"* "${srcdir}"/x265_${pkgver} @@ -44,8 +44,8 @@ prepare() { build() { - export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export CMAKE_PREFIX_PATH="${FF_MINGW_PREFIX}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" if [ "${CARCH}" = 'x86_64' ]; then _ENABLE_ASM=ON else @@ -57,7 +57,7 @@ build() { MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ -G Ninja \ - -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DCMAKE_INSTALL_PREFIX=${FF_MINGW_PREFIX} \ -DHIGH_BIT_DEPTH=ON \ -DMAIN12=ON \ -DEXPORT_C_API=OFF \ @@ -72,7 +72,7 @@ build() { MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ -G Ninja \ - -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DCMAKE_INSTALL_PREFIX=${FF_MINGW_PREFIX} \ -DHIGH_BIT_DEPTH=ON \ -DEXPORT_C_API=OFF \ -DENABLE_CLI=OFF \ @@ -88,7 +88,7 @@ build() { MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ -G Ninja \ - -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DCMAKE_INSTALL_PREFIX=${FF_MINGW_PREFIX} \ -DENABLE_SHARED=OFF \ -DCMAKE_DLL_NAME_WITH_SOVERSION=ON \ -DENABLE_ASSEMBLY=${_ENABLE_ASM} \ diff --git a/msys2/PKGBUILD/40-mingw-w64-zimg/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-zimg/PKGBUILD index c5a52467ef2..0162c5ae62d 100644 --- a/msys2/PKGBUILD/40-mingw-w64-zimg/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-zimg/PKGBUILD @@ -22,7 +22,7 @@ sha256sums=('a9a0226bf85e0d83c41a8ebe4e3e690e1348682f6a2a7838f1b8cbff1b799bcf' '6e52d715d19080434392f04b33005fee428368e12176da20555f4059209c8134') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare(){ bsdtar -xzf "${srcdir}/${_realname}-${pkgver}.tar.gz" || bsdtar -xzf "${srcdir}/${_realname}-${pkgver}.tar.gz" @@ -37,7 +37,7 @@ build() { cd "${srcdir}/build-${MINGW_CHOST}" ../${_realname}-release-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ + --prefix=${FF_MINGW_PREFIX} \ --build=${MINGW_CHOST} \ --host=${MINGW_CHOST} \ --target=${MINGW_CHOST} \ diff --git a/msys2/PKGBUILD/50-mingw-w64-amf-headers/PKGBUILD b/msys2/PKGBUILD/50-mingw-w64-amf-headers/PKGBUILD index 6c1c9e48385..43b5c85b2c0 100644 --- a/msys2/PKGBUILD/50-mingw-w64-amf-headers/PKGBUILD +++ b/msys2/PKGBUILD/50-mingw-w64-amf-headers/PKGBUILD @@ -14,16 +14,16 @@ source=("${_realname}-${pkgver}.tar.gz::https://github.com/GPUOpen-LibrariesAndS sha256sums=('SKIP') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd "AMF-${pkgver}" } package() { - mkdir -p "${pkgdir}${MINGW_PREFIX}"/include/AMF/ - cp -r "${srcdir}/AMF-${pkgver}"/amf/public/include/core/ "${pkgdir}${MINGW_PREFIX}"/include/AMF/ - cp -r "${srcdir}/AMF-${pkgver}"/amf/public/include/components/ "${pkgdir}${MINGW_PREFIX}"/include/AMF/ + mkdir -p "${pkgdir}${FF_MINGW_PREFIX}"/include/AMF/ + cp -r "${srcdir}/AMF-${pkgver}"/amf/public/include/core/ "${pkgdir}${FF_MINGW_PREFIX}"/include/AMF/ + cp -r "${srcdir}/AMF-${pkgver}"/amf/public/include/components/ "${pkgdir}${FF_MINGW_PREFIX}"/include/AMF/ - install -D -m644 "${srcdir}/AMF-${pkgver}"/LICENSE.txt "${pkgdir}${MINGW_PREFIX}"/share/licenses/${_realname}/LICENSE + install -D -m644 "${srcdir}/AMF-${pkgver}"/LICENSE.txt "${pkgdir}${FF_MINGW_PREFIX}"/share/licenses/${_realname}/LICENSE } diff --git a/msys2/PKGBUILD/50-mingw-w64-ffnvcodec-headers/PKGBUILD b/msys2/PKGBUILD/50-mingw-w64-ffnvcodec-headers/PKGBUILD index 5b1f2fadabf..a1841a1b182 100644 --- a/msys2/PKGBUILD/50-mingw-w64-ffnvcodec-headers/PKGBUILD +++ b/msys2/PKGBUILD/50-mingw-w64-ffnvcodec-headers/PKGBUILD @@ -16,7 +16,7 @@ source=(git+https://github.com/FFmpeg/nv-codec-headers.git#tag=${_tag}) sha256sums=('SKIP') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" pkgver() { cd nv-codec-headers @@ -25,17 +25,17 @@ pkgver() { } build() { - make PREFIX=${MINGW_PREFIX} -C nv-codec-headers + make PREFIX=${FF_MINGW_PREFIX} -C nv-codec-headers sed -n '4,25p' nv-codec-headers/include/ffnvcodec/nvEncodeAPI.h > LICENSE # Extract license sed -i '1,22s/^.\{,3\}//' LICENSE # Delete C comments } package() { - make PREFIX=${MINGW_PREFIX} DESTDIR="${pkgdir}" -C nv-codec-headers install - install -Dm 644 LICENSE -t "${pkgdir}${MINGW_PREFIX}"/share/licenses/ffnvcodec-headers/ + make PREFIX=${FF_MINGW_PREFIX} DESTDIR="${pkgdir}" -C nv-codec-headers install + install -Dm 644 LICENSE -t "${pkgdir}${FF_MINGW_PREFIX}"/share/licenses/ffnvcodec-headers/ - local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) - for pcfile in "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/*.pc; do - sed -s "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i "${pcfile}" + local PREFIX_WIN=$(cygpath -wm ${FF_MINGW_PREFIX}) + for pcfile in "${pkgdir}${FF_MINGW_PREFIX}"/lib/pkgconfig/*.pc; do + sed -s "s|${PREFIX_WIN}|${FF_MINGW_PREFIX}|g" -i "${pcfile}" done } diff --git a/msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD b/msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD index 5f2008e3c99..d3e44cb75ac 100644 --- a/msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD +++ b/msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD @@ -28,7 +28,7 @@ sha256sums=('SKIP' '21b2cc2f466f636940c8ef81f50dff177aff96d60dc4bc57f58c5c9f016502fe') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" apply_patch_with_msg() { for _patch in "$@" @@ -48,8 +48,8 @@ prepare() { } build() { - export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export CMAKE_PREFIX_PATH="${FF_MINGW_PREFIX}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" declare -a extra_config if check_option "debug" "n"; then extra_config+=("-DCMAKE_BUILD_TYPE=Release") @@ -62,7 +62,7 @@ build() { MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe \ -GNinja \ - -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ + -DCMAKE_INSTALL_PREFIX="${FF_MINGW_PREFIX}" \ "${extra_config[@]}" \ -DBUILD_SHARED_LIBS=OFF \ -DBUILD_{DISPATCHER,DEV}=ON \ @@ -78,7 +78,7 @@ package() { cd "${srcdir}/build-${MSYSTEM}-static" DESTDIR="${pkgdir}" "${MINGW_TOOLCHAIN_PREFIX}"/bin/cmake.exe --install . - rm -r "${pkgdir}${MINGW_PREFIX}/share/vpl/examples" + rm -r "${pkgdir}${FF_MINGW_PREFIX}/share/vpl/examples" - install -Dm644 "${srcdir}/libvpl-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" + install -Dm644 "${srcdir}/libvpl-${pkgver}/LICENSE" "${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" } diff --git a/msys2/PKGBUILD/50-mingw-w64-opencl-icd/PKGBUILD b/msys2/PKGBUILD/50-mingw-w64-opencl-icd/PKGBUILD index 4a3709547ce..a3ada064600 100644 --- a/msys2/PKGBUILD/50-mingw-w64-opencl-icd/PKGBUILD +++ b/msys2/PKGBUILD/50-mingw-w64-opencl-icd/PKGBUILD @@ -27,7 +27,7 @@ sha256sums=('SKIP' 'SKIP') export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" -export MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" +export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild" prepare() { cd "${srcdir}"/OpenCL-ICD-Loader-${pkgver} @@ -35,8 +35,8 @@ prepare() { } build() { - export CMAKE_PREFIX_PATH="${MINGW_PREFIX}" - export PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export CMAKE_PREFIX_PATH="${FF_MINGW_PREFIX}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM} declare -a extra_config @@ -49,11 +49,11 @@ build() { MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake \ -G'Ninja' \ - -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DCMAKE_INSTALL_PREFIX=${FF_MINGW_PREFIX} \ "${extra_config[@]}" \ -DBUILD_SHARED_LIBS=OFF \ -DOPENCL_ICD_LOADER_DISABLE_OPENCLON12=ON \ - -DOPENCL_ICD_LOADER_HEADERS_DIR=${MINGW_PREFIX}/include \ + -DOPENCL_ICD_LOADER_HEADERS_DIR=${FF_MINGW_PREFIX}/include \ -DBUILD_TESTING=OFF \ ../OpenCL-ICD-Loader-${pkgver} @@ -65,10 +65,10 @@ package() { DESTDIR=${pkgdir} ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake --install . # Replace the Pkg-config file - rm -f "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/OpenCL.pc" - install -Dm644 "${srcdir}/OpenCL.pc" "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/OpenCL.pc" - sed -e "s|@PREFIX@|${MINGW_PREFIX}|g" \ - -i "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/OpenCL.pc" + rm -f "${pkgdir}${FF_MINGW_PREFIX}/lib/pkgconfig/OpenCL.pc" + install -Dm644 "${srcdir}/OpenCL.pc" "${pkgdir}${FF_MINGW_PREFIX}/lib/pkgconfig/OpenCL.pc" + sed -e "s|@PREFIX@|${FF_MINGW_PREFIX}|g" \ + -i "${pkgdir}${FF_MINGW_PREFIX}/lib/pkgconfig/OpenCL.pc" - install -Dm644 ${srcdir}/OpenCL-ICD-Loader-${pkgver}/LICENSE ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE + install -Dm644 ${srcdir}/OpenCL-ICD-Loader-${pkgver}/LICENSE ${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/LICENSE } From 93ecddc66d7d092113158c8159310878da2ed17c Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 18:19:40 +0800 Subject: [PATCH 19/29] pkgbuild: delay libpng build --- .../{10-mingw-w64-libpng => 15-mingw-w64-libpng}/PKGBUILD | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename msys2/PKGBUILD/{10-mingw-w64-libpng => 15-mingw-w64-libpng}/PKGBUILD (100%) diff --git a/msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD b/msys2/PKGBUILD/15-mingw-w64-libpng/PKGBUILD similarity index 100% rename from msys2/PKGBUILD/10-mingw-w64-libpng/PKGBUILD rename to msys2/PKGBUILD/15-mingw-w64-libpng/PKGBUILD From 5654bb72e6bbbad220777dec30063912f12ee179 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 18:54:19 +0800 Subject: [PATCH 20/29] pkgconfig: export pkgbuild path --- msys2/PKGBUILD/15-mingw-w64-libpng/PKGBUILD | 1 + msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD | 1 + msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD | 1 + msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD | 1 + 4 files changed, 4 insertions(+) diff --git a/msys2/PKGBUILD/15-mingw-w64-libpng/PKGBUILD b/msys2/PKGBUILD/15-mingw-w64-libpng/PKGBUILD index 9253bf3899a..0d6dba4973f 100644 --- a/msys2/PKGBUILD/15-mingw-w64-libpng/PKGBUILD +++ b/msys2/PKGBUILD/15-mingw-w64-libpng/PKGBUILD @@ -44,6 +44,7 @@ prepare() { } build() { + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" [[ -d "${srcdir}/build-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}" mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" diff --git a/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD index b75abf80cca..8bca0da7289 100644 --- a/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-freetype/PKGBUILD @@ -58,6 +58,7 @@ prepare() { } build() { + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" declare -a extra_config diff --git a/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD index 21e83993a6c..bc471ba9d72 100644 --- a/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD @@ -24,6 +24,7 @@ sha256sums=('0bbc7ff633bfa208ae32d7e369cf5a7d20d5d2557a0b067c9aa98bcbf9967587') export FF_MINGW_PREFIX="${MINGW_PREFIX}/ffbuild" build() { + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" MSYS2_ARG_CONV_EXCL="--prefix=" \ ${MINGW_PREFIX}/bin/meson.exe setup \ --prefix=${FF_MINGW_PREFIX} \ diff --git a/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD index 1f07844524d..62e2044109d 100644 --- a/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-libxml2/PKGBUILD @@ -70,6 +70,7 @@ prepare() { } build() { + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" # Static build msg2 "Building static for ${MSYSTEM}" [[ -d "${srcdir}"/build-static-${MSYSTEM} ]] && rm -rf "${srcdir}"/build-static-${MSYSTEM} From 582ce2fe7d1276eb508f657b57f92aea14951143 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 20:08:18 +0800 Subject: [PATCH 21/29] pkgbuild: fix chromaprint search path --- msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD | 2 +- msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD index 441082b6878..e1f6cd7ba25 100644 --- a/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-fftw/PKGBUILD @@ -27,7 +27,7 @@ sha256sums=('56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467' 'd44e0b25fee59bee3b2fa81ce86762b66158d5e2be7f350d8cf937691aa72b5b' 'd82e96c8545515b9c83d54356209ee9c4a45bedc3859cb01cf3966dc38fc7a33') -precision="double float \ +precision="float \ $( [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || echo "quad" )" export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}" diff --git a/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD index 87aa3476110..f1bf2d499c3 100644 --- a/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-chromaprint/PKGBUILD @@ -27,8 +27,8 @@ prepare() { } build() { - export CMAKE_PREFIX_PATH="${MINGW_TOOLCHAIN_PREFIX}" - export PKG_CONFIG_PATH="${MINGW_TOOLCHAIN_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" + export CMAKE_PREFIX_PATH="${FF_MINGW_PREFIX}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" _common_opts=( -G"Ninja" -DCMAKE_BUILD_TYPE=Release \ @@ -52,8 +52,8 @@ build() { } package() { - export CMAKE_PREFIX_PATH="${MINGW_TOOLCHAIN_PREFIX}" - export PKG_CONFIG_PATH="${MINGW_TOOLCHAIN_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" + export CMAKE_PREFIX_PATH="${FF_MINGW_PREFIX}" + export PKG_CONFIG_PATH="${FF_MINGW_PREFIX}/lib/pkgconfig/:${PKG_CONFIG_PATH}" # static cd "${srcdir}/static-${MSYSTEM}" DESTDIR="${pkgdir}" ${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe --install ./ From 48c86a8541dab8feb654e5b81ecce7b6f734bb2c Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 22:55:41 +0800 Subject: [PATCH 22/29] pkgbuild: dont run check these takes a lot of time and will timeout on ci --- msys2/PKGBUILD/10-mingw-w64-brotli/PKGBUILD | 3 +-- msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD | 3 +-- msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD | 3 +-- msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD | 3 +-- msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD | 2 +- msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD | 3 +-- msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD | 4 +--- msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD | 4 +--- msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD | 3 +-- 9 files changed, 9 insertions(+), 19 deletions(-) diff --git a/msys2/PKGBUILD/10-mingw-w64-brotli/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-brotli/PKGBUILD index 7fe0b67a455..edff52a02a7 100644 --- a/msys2/PKGBUILD/10-mingw-w64-brotli/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-brotli/PKGBUILD @@ -57,8 +57,7 @@ build() { } check() { - cd "${srcdir}"/build-${MSYSTEM}-static - ${MINGW_PREFIX}/bin/ctest . || warning "Tests failed" + : } package_brotli() { diff --git a/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD index 9d14cd95072..f5280c64723 100644 --- a/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD @@ -59,8 +59,7 @@ build() { } check() { - cd "${srcdir}/build-${CARCH}" - make -k check + : } package() { diff --git a/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD index 63372d26126..bdcca6480ff 100644 --- a/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-libiconv/PKGBUILD @@ -79,8 +79,7 @@ build() { } check() { - cd "${srcdir}/build-${MSYSTEM}" - make check || msg2 "tests failed" + : } package_libiconv() { diff --git a/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD index a72395b3f11..1f13b138cc4 100644 --- a/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-zlib/PKGBUILD @@ -71,8 +71,7 @@ build() { } check() { - cd "${srcdir}/build-${MSYSTEM}" - make test + : } package_zlib() { diff --git a/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD index bc471ba9d72..20bb10430b2 100644 --- a/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-fribidi/PKGBUILD @@ -39,7 +39,7 @@ build() { } check() { - meson test -C build-${MSYSTEM}-static + : } package() { diff --git a/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD b/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD index 9755645542e..6ed8910b759 100644 --- a/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD +++ b/msys2/PKGBUILD/20-mingw-w64-gmp/PKGBUILD @@ -62,8 +62,7 @@ build() { } check() { - cd "${srcdir}/static-${MSYSTEM}" - make check + : } package() { diff --git a/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD b/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD index 67023ca904d..787b38e8966 100644 --- a/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD +++ b/msys2/PKGBUILD/30-mingw-w64-opus/PKGBUILD @@ -62,9 +62,7 @@ build() { } check() { - cd "${srcdir}/build-${MSYSTEM}" - - ${MINGW_TOOLCHAIN_PREFIX}/bin/meson.exe test + : } package_opus() { diff --git a/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD index 1e76ce7d170..866248cd3eb 100644 --- a/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-dav1d/PKGBUILD @@ -53,9 +53,7 @@ build() { } check() { - cd "${srcdir}/build-${MSYSTEM}" - - ${FF_MINGW_PREFIX}/bin/meson test + : } package() { diff --git a/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD index 8aef2a614e1..e8d11b7994f 100644 --- a/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-libopenmpt/PKGBUILD @@ -49,8 +49,7 @@ build() { } check() { - cd "${srcdir}/build-${MSYSTEM}" - make check || true + : } package() { From b33857246554e3e4920d5cbfc07abe42c1a7175e Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 8 Jul 2024 23:42:37 +0800 Subject: [PATCH 23/29] pkgbuild: add libtheora patch --- .../libtheora-1.1.1-libpng16.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 msys2/PKGBUILD/40-mingw-w64-libtheora/libtheora-1.1.1-libpng16.patch diff --git a/msys2/PKGBUILD/40-mingw-w64-libtheora/libtheora-1.1.1-libpng16.patch b/msys2/PKGBUILD/40-mingw-w64-libtheora/libtheora-1.1.1-libpng16.patch new file mode 100644 index 00000000000..93da700c4d7 --- /dev/null +++ b/msys2/PKGBUILD/40-mingw-w64-libtheora/libtheora-1.1.1-libpng16.patch @@ -0,0 +1,17 @@ +http://bugs.gentoo.org/465450 +http://trac.xiph.org/ticket/1947 + +--- examples/png2theora.c ++++ examples/png2theora.c +@@ -462,9 +462,9 @@ + png_set_strip_alpha(png_ptr); + + row_data = (png_bytep)png_malloc(png_ptr, +- 3*height*width*png_sizeof(*row_data)); ++ 3*height*width*sizeof(*row_data)); + row_pointers = (png_bytep *)png_malloc(png_ptr, +- height*png_sizeof(*row_pointers)); ++ height*sizeof(*row_pointers)); + for(y = 0; y < height; y++) { + row_pointers[y] = row_data + y*(3*width); + } From dfcf8b54e50db1dee89e6d910b2e32a37dbd8801 Mon Sep 17 00:00:00 2001 From: gnattu Date: Tue, 9 Jul 2024 00:56:21 +0800 Subject: [PATCH 24/29] msys2: don't enable shared dll for clang --- msys2/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/msys2/build.sh b/msys2/build.sh index adec2873997..e71b5a76c3f 100755 --- a/msys2/build.sh +++ b/msys2/build.sh @@ -42,7 +42,6 @@ PKG_CONFIG_PATH=/clang64/ffbuild/lib/pkgconfig ./configure --cc=clang \ --disable-doc \ --disable-sdl2 \ --disable-ptx-compression \ - --enable-shared \ --enable-lto \ --enable-gpl \ --enable-version3 \ From e6a06430262e3c2b12836dcd0c530a1739fa246d Mon Sep 17 00:00:00 2001 From: gnattu Date: Tue, 9 Jul 2024 00:56:49 +0800 Subject: [PATCH 25/29] ci: install zip for clang builder --- .github/workflows/_meta_win_clang_portable.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/_meta_win_clang_portable.yaml b/.github/workflows/_meta_win_clang_portable.yaml index c2eb94936eb..771167b4f10 100644 --- a/.github/workflows/_meta_win_clang_portable.yaml +++ b/.github/workflows/_meta_win_clang_portable.yaml @@ -35,6 +35,7 @@ jobs: git curl wget + zip mingw-w64-clang-x86_64-toolchain quilt diffstat From ba428b643af4f0cec9cf4a2b61a5709fdea6f2bb Mon Sep 17 00:00:00 2001 From: gnattu Date: Tue, 9 Jul 2024 02:08:57 +0800 Subject: [PATCH 26/29] ci: fix artifact path --- .github/workflows/_meta_win_clang_portable.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_meta_win_clang_portable.yaml b/.github/workflows/_meta_win_clang_portable.yaml index 771167b4f10..d8637485ffc 100644 --- a/.github/workflows/_meta_win_clang_portable.yaml +++ b/.github/workflows/_meta_win_clang_portable.yaml @@ -54,7 +54,7 @@ jobs: uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 with: name: win-clang-${{ matrix.os.arch }}-portable - path: ./builder/artifacts + path: ./msys2/artifacts publish: name: Publish Portable Release From dc5ce19d9dc6fad934d94d3f410c8eb421c94c03 Mon Sep 17 00:00:00 2001 From: gnattu Date: Tue, 9 Jul 2024 02:22:05 +0800 Subject: [PATCH 27/29] ci: re-enable other ci --- .github/workflows/build.yaml | 70 ++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b4b18ae798c..7bc9b14d86c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,40 +18,42 @@ on: - '**/*.md' jobs: -# build_debian: -# uses: ./.github/workflows/_meta.yaml -# with: -# distro: 'debian' -# codenames: '["bullseye", "bookworm"]' -# architectures: '["amd64", "arm64", "armhf"]' -# release: false -# -# build_ubuntu: -# uses: ./.github/workflows/_meta.yaml -# with: -# distro: 'ubuntu' -# codenames: '["focal", "jammy", "noble"]' -# architectures: '["amd64", "arm64", "armhf"]' -# release: false -# -# build_portable_windows: -# uses: ./.github/workflows/_meta_portable.yaml -# with: -# os: 'windows' -# architectures: '["win64"]' -# release: false + build_debian: + uses: ./.github/workflows/_meta.yaml + with: + distro: 'debian' + codenames: '["bullseye", "bookworm"]' + architectures: '["amd64", "arm64", "armhf"]' + release: false + + build_ubuntu: + uses: ./.github/workflows/_meta.yaml + with: + distro: 'ubuntu' + codenames: '["focal", "jammy", "noble"]' + architectures: '["amd64", "arm64", "armhf"]' + release: false + + build_portable_windows: + uses: ./.github/workflows/_meta_portable.yaml + with: + os: 'windows' + architectures: '["win64"]' + release: false build_portable_windows_clang: uses: ./.github/workflows/_meta_win_clang_portable.yaml -# -# build_portable_linux: -# uses: ./.github/workflows/_meta_portable.yaml -# with: -# os: 'linux' -# architectures: '["amd64", "arm64"]' -# release: false -# -# build_portable_mac: -# uses: ./.github/workflows/_meta_mac_portable.yaml -# with: -# release: false + with: + release: false + + build_portable_linux: + uses: ./.github/workflows/_meta_portable.yaml + with: + os: 'linux' + architectures: '["amd64", "arm64"]' + release: false + + build_portable_mac: + uses: ./.github/workflows/_meta_mac_portable.yaml + with: + release: false From cf76ead75bc19bbd4a41cdd4d417c01fbaa5a60f Mon Sep 17 00:00:00 2001 From: gnattu Date: Tue, 9 Jul 2024 02:31:08 +0800 Subject: [PATCH 28/29] pkgbuild: use mirrors.kernel.org instead of sourceware.org --- msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD b/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD index f5280c64723..f616f1b9570 100644 --- a/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD +++ b/msys2/PKGBUILD/10-mingw-w64-bzip2/PKGBUILD @@ -17,7 +17,7 @@ license=("custom") depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-autotools") options=('strip' 'staticlibs') -source=("https://sourceware.org/pub/bzip2/bzip2-${pkgver}.tar.gz" +source=("https://mirrors.kernel.org/sourceware/bzip2/bzip2-${pkgver}.tar.gz" "bzip2-cygming-1.0.6.src.all.patch" "bzip2-buildsystem.all.patch" "bzip2-1.0.6-progress.all.patch") From 0b41bc97f4d31bd8e16946135ff6a5d6bfdb3f19 Mon Sep 17 00:00:00 2001 From: gnattu Date: Tue, 16 Jul 2024 02:25:33 +0800 Subject: [PATCH 29/29] ci: enable directwrite for libass --- msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD b/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD index 24c404a5dab..84de4ca75b5 100644 --- a/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD +++ b/msys2/PKGBUILD/40-mingw-w64-libass/PKGBUILD @@ -47,7 +47,7 @@ build() { --target=${MINGW_CHOST} \ --disable-shared \ --enable-static \ - --disable-directwrite \ + --enable-directwrite \ --disable-libunibreak \ --with-pic \ $( [[ "${CARCH}" != "i686" \