From 238a647d6e4ecc92e827a5dfa8b41c0e37c80d56 Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Sat, 3 Feb 2024 16:29:17 +0200 Subject: [PATCH 01/13] LibRaw --- .../MINGW-packages/mingw-w64-libraw/PKGBUILD | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 tools/MINGW-packages/mingw-w64-libraw/PKGBUILD diff --git a/tools/MINGW-packages/mingw-w64-libraw/PKGBUILD b/tools/MINGW-packages/mingw-w64-libraw/PKGBUILD new file mode 100644 index 000000000..b22c34192 --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-libraw/PKGBUILD @@ -0,0 +1,75 @@ +# Maintainer: Alexey Pavlov + +_realname=LibRaw +pkgbase=mingw-w64-libraw +pkgname="${MINGW_PACKAGE_PREFIX}-libraw" +provides=("${MINGW_PACKAGE_PREFIX}-${_realname}") +replaces=("${MINGW_PACKAGE_PREFIX}-${_realname}") +conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}") +pkgver=0.21.2 +pkgrel=99.1 +pkgdesc="Library for reading RAW files obtained from digital photo cameras (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +msys2_repository_url='https://github.com/LibRaw/LibRaw' +url="https://www.libraw.org/" +license=("spdx:LGPL-2.1 OR CDDL-1.0") +makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" "${MINGW_PACKAGE_PREFIX}-cc") +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-jasper" + "${MINGW_PACKAGE_PREFIX}-lcms2" + "${MINGW_PACKAGE_PREFIX}-libjpeg" + "${MINGW_PACKAGE_PREFIX}-zlib" + "${MINGW_PACKAGE_PREFIX}-libwinpthread-git" + "${MINGW_PACKAGE_PREFIX}-omp") +options=('staticlibs' 'strip') +source=("https://www.libraw.org/data/${_realname}-${pkgver}.tar.gz" + "0001-libraw-pkgconfig-remove-stdcxx.patch" + "LibRaw_obsolete-macros.patch" + https://github.com/LibRaw/LibRaw/commit/e231b01a49ce37d2add75e2a8f7ece5602f00457.patch) +sha256sums=('fe7288013206854baf6e4417d0fb63ba4ed7227bf36fff021992671c2dd34b03' + '3b4c6aece23e020bf50a8bf349a25186273a601286fa2bb1f0a7269083277c13' + '4a31c0ee066f43915beff6f7959b6b2cd246d390720df379bfc047d4cedb6a8f' + 'df9a7d570be17acc9c4e4c2f836bc0815f7d43aec644fc16098969f6fa6353d8') + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + patch -p1 -i "${srcdir}/0001-libraw-pkgconfig-remove-stdcxx.patch" + patch -p1 -i "${srcdir}/LibRaw_obsolete-macros.patch" + + # https://github.com/LibRaw/LibRaw/issues/624 + patch --binary -p1 -i "${srcdir}/e231b01a49ce37d2add75e2a8f7ece5602f00457.patch" + + autoreconf -ifv +} + +build() { + [[ -d "${srcdir}/build-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}" + mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" + + if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then + LDFLAGS+=" -lomp" + fi + + # This would enable more formats (X3F (Foveon), Rapsberry Pi RAW+JPEG), + # but upstream recommends against it for security reasons, see + # https://github.com/LibRaw/LibRaw/blob/27144e42000/Changelog.txt#L417 + # CPPFLAGS+=" -DUSE_6BY9RPI -DUSE_X3FTOOLS" + + CPPFLAGS+=" -DLIBRAW_FORCE_OPENMP" + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} + + make +} + +package() { + cd "${srcdir}/build-${MSYSTEM}" + + make install DESTDIR="${pkgdir}" + + install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE.CDDL" "${pkgdir}${MINGW_PREFIX}/share/licenses/libraw/LICENSE.CDDL" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE.LGPL" "${pkgdir}${MINGW_PREFIX}/share/licenses/libraw/LICENSE.LGPL" +} From 55af584502a6f9c96c712b24e960cb8085f8cfa9 Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Sat, 3 Feb 2024 16:34:53 +0200 Subject: [PATCH 02/13] LibRaw --- .../0001-libraw-pkgconfig-remove-stdcxx.patch | 20 +++++++++++++++++++ .../LibRaw_obsolete-macros.patch | 12 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tools/MINGW-packages/mingw-w64-libraw/0001-libraw-pkgconfig-remove-stdcxx.patch create mode 100644 tools/MINGW-packages/mingw-w64-libraw/LibRaw_obsolete-macros.patch diff --git a/tools/MINGW-packages/mingw-w64-libraw/0001-libraw-pkgconfig-remove-stdcxx.patch b/tools/MINGW-packages/mingw-w64-libraw/0001-libraw-pkgconfig-remove-stdcxx.patch new file mode 100644 index 000000000..c4ec15931 --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-libraw/0001-libraw-pkgconfig-remove-stdcxx.patch @@ -0,0 +1,20 @@ +--- a/libraw.pc.in ++++ b/libraw.pc.in +@@ -7,6 +7,6 @@ + Description: Raw image decoder library (non-thread-safe) + Requires: @PACKAGE_REQUIRES@ + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lraw -lstdc++@PC_OPENMP@ ++Libs: -L${libdir} -lraw @PC_OPENMP@ + Libs.private: @PACKAGE_LIBS_PRIVATE@ + Cflags: -I${includedir}/libraw -I${includedir} +--- a/libraw_r.pc.in ++++ b/libraw_r.pc.in +@@ -7,6 +7,6 @@ + Description: Raw image decoder library (thread-safe) + Requires: @PACKAGE_REQUIRES@ + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lraw_r -lstdc++@PC_OPENMP@ ++Libs: -L${libdir} -lraw_r @PC_OPENMP@ + Libs.private: @PACKAGE_LIBS_PRIVATE@ + Cflags: -I${includedir}/libraw -I${includedir} diff --git a/tools/MINGW-packages/mingw-w64-libraw/LibRaw_obsolete-macros.patch b/tools/MINGW-packages/mingw-w64-libraw/LibRaw_obsolete-macros.patch new file mode 100644 index 000000000..bdaac604d --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-libraw/LibRaw_obsolete-macros.patch @@ -0,0 +1,12 @@ +diff -rupN LibRaw-0.15.4/configure.ac LibRaw-0.15.4-new/configure.ac +--- LibRaw-0.15.4/configure.ac 2013-08-23 04:55:48.000000000 +0200 ++++ LibRaw-0.15.4-new/configure.ac 2014-01-13 17:32:09.891037432 +0100 +@@ -7,7 +7,7 @@ AC_CONFIG_MACRO_DIR([m4]) + # Tools to use + AC_PROG_CXX + AC_PROG_CC +-AC_PROG_LIBTOOL ++LT_INIT + AC_ENABLE_SHARED + AC_ENABLE_STATIC + AC_LIBTOOL_WIN32_DLL From d0db15ee5936467d81282cc39f2475db25010a75 Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Sat, 3 Feb 2024 16:46:48 +0200 Subject: [PATCH 03/13] opencolorio --- .../mingw-w64-opencolorio/PKGBUILD | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 tools/MINGW-packages/mingw-w64-opencolorio/PKGBUILD diff --git a/tools/MINGW-packages/mingw-w64-opencolorio/PKGBUILD b/tools/MINGW-packages/mingw-w64-opencolorio/PKGBUILD new file mode 100644 index 000000000..b76a99f8c --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-opencolorio/PKGBUILD @@ -0,0 +1,86 @@ +# Maintainer: Alexey Pavlov + +_realname=opencolorio +pkgbase=mingw-w64-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}-git") +replaces=("${MINGW_PACKAGE_PREFIX}-${_realname}-git") +pkgver=2.3.1 +pkgrel=99.1 +pkgdesc="A color management framework for visual effects and animation (mingw-w64)" +arch=('any') +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') +url="https://opencolorio.org/" +license=('spdx:BSD-3-Clause') +depends=("${MINGW_PACKAGE_PREFIX}-expat" + "${MINGW_PACKAGE_PREFIX}-freeglut" + "${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-glew" + "${MINGW_PACKAGE_PREFIX}-natron_imath" + "${MINGW_PACKAGE_PREFIX}-lcms2" + "${MINGW_PACKAGE_PREFIX}-minizip-ng" + "${MINGW_PACKAGE_PREFIX}-natron_openexr" + "${MINGW_PACKAGE_PREFIX}-yaml-cpp") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-pkgconf" + "${MINGW_PACKAGE_PREFIX}-pybind11" + "${MINGW_PACKAGE_PREFIX}-pystring" + "${MINGW_PACKAGE_PREFIX}-python" + "${MINGW_PACKAGE_PREFIX}-openshadinglanguage" + "${MINGW_PACKAGE_PREFIX}-zlib") +optdepends=("${MINGW_PACKAGE_PREFIX}-python: Python bindings") +source=(https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz + 0003-fix-python-sitearch.patch) +sha256sums=('7196e979a0449ce28afd46a78383476f3b8fc1cc1d3a417192be439ede83437b' + '4bb650747906aab5b71579d05674ee59a811d6370a6dcda93b5880abb094be70') + +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying $_patch" + patch -Np1 -i "${srcdir}/$_patch" + done +} + +prepare() { + cd ${_realname}-${pkgver} + apply_patch_with_msg \ + 0003-fix-python-sitearch.patch +} + +build() { + 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_PREFIX}"/bin/cmake \ + -GNinja \ + ${extra_config} \ + -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ + -DOCIO_BUILD_TESTS=OFF \ + -DOCIO_BUILD_GPU_TESTS=OFF \ + -DPython_EXECUTABLE=${MINGW_PREFIX}/bin/python.exe \ + ../${_realname}-${pkgver} + + "${MINGW_PREFIX}"/bin/cmake.exe --build . +} + +package() { + cd build-${MSYSTEM} + DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install . + install -Dm644 "${srcdir}"/${_realname}-${pkgver}/LICENSE "${pkgdir}${MINGW_PREFIX}"/share/licenses/${_realname}/LICENSE + + local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) + for _f in "${pkgdir}${MINGW_PREFIX}"/lib/cmake/OpenColorIO/*.cmake; do + sed -e "s|${PREFIX_WIN}|\$\{_IMPORT_PREFIX\}|g" -i "${_f}" + sed -e "s|${MINGW_PREFIX}|\$\{_IMPORT_PREFIX\}|g" -i "${_f}" + done +} From ba092808084167b40705287c21fbb73ef0f64686 Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Sat, 3 Feb 2024 16:48:51 +0200 Subject: [PATCH 04/13] opencolorio --- .../0003-fix-python-sitearch.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tools/MINGW-packages/mingw-w64-opencolorio/0003-fix-python-sitearch.patch diff --git a/tools/MINGW-packages/mingw-w64-opencolorio/0003-fix-python-sitearch.patch b/tools/MINGW-packages/mingw-w64-opencolorio/0003-fix-python-sitearch.patch new file mode 100644 index 000000000..01a19bcdd --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-opencolorio/0003-fix-python-sitearch.patch @@ -0,0 +1,11 @@ +--- a/src/bindings/python/CMakeLists.txt ++++ b/src/bindings/python/CMakeLists.txt +@@ -238,7 +238,7 @@ + ############################################################################### + # Install layout + # Set to site-package location. +-if(WIN32) ++if(MSVC) + set(_Python_VARIANT_PATH "${CMAKE_INSTALL_LIBDIR}/site-packages") + else() + set(_Python_VARIANT_PATH "${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages") From 03fb276366efb91ad94bc8c456b097d2f49ddf2d Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Sat, 3 Feb 2024 16:52:36 +0200 Subject: [PATCH 05/13] Removed openexr 2.5 is no longer --- .../0001-mingw-w64-fix.patch | 14 - .../0002-openexr-2.1.0-headers.patch | 43 --- .../0005-fix-dirs-in-pkgconfig.patch | 32 --- .../0006-cmake-soversion.patch | 68 ----- .../0009-win-dwalookups.patch | 12 - .../mingw-w64-openexr25/0012-exports.patch | 244 ------------------ .../mingw-w64-openexr25/0013-no-py2.patch | 11 - .../mingw-w64-openexr25/PKGBUILD | 124 --------- 8 files changed, 548 deletions(-) delete mode 100644 tools/MINGW-packages/mingw-w64-openexr25/0001-mingw-w64-fix.patch delete mode 100644 tools/MINGW-packages/mingw-w64-openexr25/0002-openexr-2.1.0-headers.patch delete mode 100644 tools/MINGW-packages/mingw-w64-openexr25/0005-fix-dirs-in-pkgconfig.patch delete mode 100644 tools/MINGW-packages/mingw-w64-openexr25/0006-cmake-soversion.patch delete mode 100644 tools/MINGW-packages/mingw-w64-openexr25/0009-win-dwalookups.patch delete mode 100644 tools/MINGW-packages/mingw-w64-openexr25/0012-exports.patch delete mode 100644 tools/MINGW-packages/mingw-w64-openexr25/0013-no-py2.patch delete mode 100644 tools/MINGW-packages/mingw-w64-openexr25/PKGBUILD diff --git a/tools/MINGW-packages/mingw-w64-openexr25/0001-mingw-w64-fix.patch b/tools/MINGW-packages/mingw-w64-openexr25/0001-mingw-w64-fix.patch deleted file mode 100644 index 130c26fdb..000000000 --- a/tools/MINGW-packages/mingw-w64-openexr25/0001-mingw-w64-fix.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/OpenEXR/IlmImf/ImfSimd.h.orig 2013-11-25 23:49:53.000000000 +0400 -+++ b/OpenEXR/IlmImf/ImfSimd.h 2013-12-28 11:32:14.071000000 +0400 -@@ -44,8 +44,10 @@ - - - // GCC and Visual Studio SSE2 compiler flags --#if defined __SSE2__ || (_MSC_VER >= 1300 && !_M_CEE_PURE) -+#ifndef __MINGW64_VERSION_MAJOR -+ #if defined __SSE2__ || (_MSC_VER >= 1300 && !_M_CEE_PURE) - #define IMF_HAVE_SSE2 1 -+ #endif - #endif - - diff --git a/tools/MINGW-packages/mingw-w64-openexr25/0002-openexr-2.1.0-headers.patch b/tools/MINGW-packages/mingw-w64-openexr25/0002-openexr-2.1.0-headers.patch deleted file mode 100644 index b8048fb23..000000000 --- a/tools/MINGW-packages/mingw-w64-openexr25/0002-openexr-2.1.0-headers.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 90de52ef5856c276848dc2c85dd4985f9e2639f4 Mon Sep 17 00:00:00 2001 -From: Stephen -Date: Wed, 24 Feb 2016 14:32:49 -0600 -Subject: [PATCH] Add missing OpenEXR headers to CMake install rule - ---- - IlmImf/CMakeLists.txt | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/OpenEXR/IlmImf/CMakeLists.txt b/OpenEXR/IlmImf/CMakeLists.txt -index 18d90ed..11f7a1a 100644 ---- a/OpenEXR/IlmImf/CMakeLists.txt -+++ b/OpenEXR/IlmImf/CMakeLists.txt -@@ -350,6 +350,29 @@ INSTALL ( FILES - ImfDeepImageState.h - ImfDeepImageStateAttribute.h - ImfFloatVectorAttribute.h -+ ImfAutoArray.h -+ ImfCheckedArithmetic.h -+ ImfCompressor.h -+ ImfDwaCompressor.h -+ ImfDwaCompressorSimd.h -+ ImfFastHuf.h -+ ImfInputPartData.h -+ ImfInputStreamMutex.h -+ ImfOptimizedPixelReading.h -+ ImfOutputPartData.h -+ ImfOutputStreamMutex.h -+ ImfPizCompressor.h -+ ImfPxr24Compressor.h -+ ImfRle.h -+ ImfRleCompressor.h -+ ImfScanLineInputFile.h -+ ImfSimd.h -+ ImfStdIO.h -+ ImfSystemSpecific.h -+ ImfTiledMisc.h -+ ImfTileOffsets.h -+ ImfZip.h -+ ImfZipCompressor.h - DEPENDENCIES - OpenEXR::Config - IlmBase::Iex diff --git a/tools/MINGW-packages/mingw-w64-openexr25/0005-fix-dirs-in-pkgconfig.patch b/tools/MINGW-packages/mingw-w64-openexr25/0005-fix-dirs-in-pkgconfig.patch deleted file mode 100644 index 5d1db7e2c..000000000 --- a/tools/MINGW-packages/mingw-w64-openexr25/0005-fix-dirs-in-pkgconfig.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- openexr-2.4.0/IlmBase/IlmBase.pc.in.orig 2019-10-30 09:49:33.334966000 +0300 -+++ openexr-2.4.0/IlmBase/IlmBase.pc.in 2019-10-30 09:53:46.375320200 +0300 -@@ -4,9 +4,9 @@ - ## - - prefix=@prefix@ --exec_prefix=@exec_prefix@ --libdir=@libdir@ --includedir=@includedir@ -+exec_prefix=${prefix}/@exec_prefix@ -+libdir=${prefix}/@libdir@ -+includedir=${prefix}/@includedir@ - libsuffix=@LIB_SUFFIX_DASH@ - Name: IlmBase - Description: Base math and exception libraries ---- openexr-2.4.0/OpenEXR/OpenEXR.pc.in.orig 2019-10-30 09:54:34.675387800 +0300 -+++ openexr-2.4.0/OpenEXR/OpenEXR.pc.in 2019-10-30 09:54:58.695421500 +0300 -@@ -4,10 +4,10 @@ - ## - - prefix=@prefix@ --exec_prefix=@exec_prefix@ --libdir=@libdir@ --includedir=@includedir@ --OpenEXR_includedir=@includedir@/OpenEXR -+exec_prefix=${prefix}/@exec_prefix@ -+libdir=${prefix}/@libdir@ -+includedir=${prefix}/@includedir@ -+OpenEXR_includedir=${prefix}/@includedir@/OpenEXR - libsuffix=@LIB_SUFFIX_DASH@ - - Name: OpenEXR diff --git a/tools/MINGW-packages/mingw-w64-openexr25/0006-cmake-soversion.patch b/tools/MINGW-packages/mingw-w64-openexr25/0006-cmake-soversion.patch deleted file mode 100644 index b393b9411..000000000 --- a/tools/MINGW-packages/mingw-w64-openexr25/0006-cmake-soversion.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- openexr-2.4.0/IlmBase/config/IlmBaseSetup.cmake.orig 2019-10-29 15:34:57.792136700 +0300 -+++ openexr-2.4.0/IlmBase/config/IlmBaseSetup.cmake 2019-10-29 15:35:30.172182000 +0300 -@@ -31,7 +31,7 @@ - set(ILMBASE_PACKAGE_NAME "IlmBase ${ILMBASE_VERSION}" CACHE STRING "Public string / label for displaying package") - - # Whether to generate and install a pkg-config file IlmBase.pc on --if(WIN32) -+if(MSVC) - option(ILMBASE_INSTALL_PKG_CONFIG "Install IlmBase.pc file" OFF) - else() - option(ILMBASE_INSTALL_PKG_CONFIG "Install IlmBase.pc file" ON) ---- openexr-2.4.0/IlmBase/config/LibraryDefine.cmake.orig 2019-10-29 15:37:25.812343900 +0300 -+++ openexr-2.4.0/IlmBase/config/LibraryDefine.cmake 2019-10-29 15:38:12.164408900 +0300 -@@ -84,7 +84,9 @@ - ) - endif() - set_target_properties(${libname} PROPERTIES -- OUTPUT_NAME "${libname}${ILMBASE_LIB_SUFFIX}" -+ OUTPUT_NAME "${libname}" -+ RUNTIME_OUTPUT_NAME "${libname}${ILMBASE_LIB_SUFFIX}" -+ ARCHIVE_OUTPUT_NAME "${libname}" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - ) - add_library(${PROJECT_NAME}::${libname} ALIAS ${libname}) ---- openexr-2.4.0/OpenEXR/config/OpenEXRSetup.cmake.orig 2019-10-29 15:39:38.034529100 +0300 -+++ openexr-2.4.0/OpenEXR/config/OpenEXRSetup.cmake 2019-10-29 15:39:43.874537300 +0300 -@@ -21,7 +21,7 @@ - set(OPENEXR_PACKAGE_NAME "IlmBase ${ILMBASE_VERSION}" CACHE STRING "Public string / label for displaying package") - - # Whether to generate and install a pkg-config file OpenEXR.pc --if (WIN32) -+if (MSVC) - option(OPENEXR_INSTALL_PKG_CONFIG "Install OpenEXR.pc file" OFF) - else() - option(OPENEXR_INSTALL_PKG_CONFIG "Install OpenEXR.pc file" ON) ---- openexr-2.4.0/oPENexr/config/LibraryDefine.cmake.orig 2019-10-29 15:38:56.304470700 +0300 -+++ openexr-2.4.0/oPENexr/config/LibraryDefine.cmake 2019-10-29 15:39:22.864507900 +0300 -@@ -78,7 +78,9 @@ - ) - endif() - set_target_properties(${libname} PROPERTIES -- OUTPUT_NAME "${libname}${OPENEXR_LIB_SUFFIX}" -+ OUTPUT_NAME "${libname}" -+ RUNTIME_OUTPUT_NAME "${libname}${OPENEXR_LIB_SUFFIX}" -+ ARCHIVE_OUTPUT_NAME "${libname}" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - ) - add_library(${PROJECT_NAME}::${libname} ALIAS ${libname}) ---- openexr-2.4.0/IlmBase/IlmBase.pc.in.orig 2019-10-29 16:09:29.326136000 +0300 -+++ openexr-2.4.0/IlmBase/IlmBase.pc.in 2019-10-29 16:09:50.616346500 +0300 -@@ -13,5 +13,5 @@ - Version: @ILMBASE_VERSION@ - Requires: - Conflicts: --Libs: -L${libdir} -lImath${libsuffix} -lHalf${libsuffix} -lIex${libsuffix} -lIexMath${libsuffix} -lIlmThread${libsuffix} @PTHREAD_LIBS@ -+Libs: -L${libdir} -lImath -lHalf -lIex -lIexMath -lIlmThread @PTHREAD_LIBS@ - Cflags: @PTHREAD_CFLAGS@ -I${includedir} -I${includedir}/OpenEXR ---- openexr-2.4.0/OpenEXR/OpenEXR.pc.in.orig 2019-10-29 16:10:13.784661600 +0300 -+++ openexr-2.4.0/OpenEXR/OpenEXR.pc.in 2019-10-29 16:10:17.744888100 +0300 -@@ -14,7 +14,7 @@ - Description: OpenEXR image library - Version: @OPENEXR_VERSION@ - --Libs: -L${libdir} -lIlmImf${libsuffix} -+Libs: -L${libdir} -lIlmImf - Cflags: -I${OpenEXR_includedir} - Requires: IlmBase - Libs.private: -lz diff --git a/tools/MINGW-packages/mingw-w64-openexr25/0009-win-dwalookups.patch b/tools/MINGW-packages/mingw-w64-openexr25/0009-win-dwalookups.patch deleted file mode 100644 index 57dfced27..000000000 --- a/tools/MINGW-packages/mingw-w64-openexr25/0009-win-dwalookups.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/OpenEXR/IlmImf/dwaLookups.cpp -+++ b/OpenEXR/IlmImf/dwaLookups.cpp -@@ -42,6 +42,9 @@ - #include - #include - -+#ifdef _WIN32 -+#include -+#endif - #include - - #ifdef OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN diff --git a/tools/MINGW-packages/mingw-w64-openexr25/0012-exports.patch b/tools/MINGW-packages/mingw-w64-openexr25/0012-exports.patch deleted file mode 100644 index d832f87e5..000000000 --- a/tools/MINGW-packages/mingw-w64-openexr25/0012-exports.patch +++ /dev/null @@ -1,244 +0,0 @@ -diff -Naur a/OpenEXR/IlmImf/ImfGenericInputFile.h b/OpenEXR/IlmImf/ImfGenericInputFile.h ---- a/OpenEXR/IlmImf/ImfGenericInputFile.h 2018-11-04 22:55:11.645972400 +0300 -+++ b/OpenEXR/IlmImf/ImfGenericInputFile.h 2018-11-04 22:55:48.038053900 +0300 -@@ -42,16 +42,13 @@ - - OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER - --class GenericInputFile -+class IMF_EXPORT GenericInputFile - { - public: -- IMF_EXPORT - virtual ~GenericInputFile(); - - protected: -- IMF_EXPORT - GenericInputFile(); -- IMF_EXPORT - void readMagicNumberAndVersionField(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, int& version); - }; - -diff -Naur a/OpenEXR/IlmImf/ImfGenericOutputFile.h b/OpenEXR/IlmImf/ImfGenericOutputFile.h ---- a/OpenEXR/IlmImf/ImfGenericOutputFile.h 2018-11-04 22:55:07.805752800 +0300 -+++ b/OpenEXR/IlmImf/ImfGenericOutputFile.h 2018-11-04 22:56:00.851786800 +0300 -@@ -45,18 +45,14 @@ - OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER - - --class GenericOutputFile -+class IMF_EXPORT GenericOutputFile - { - public: -- IMF_EXPORT - virtual ~GenericOutputFile(); - - protected: -- IMF_EXPORT - GenericOutputFile(); -- IMF_EXPORT - void writeMagicNumberAndVersionField (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream& os, const Header& header); -- IMF_EXPORT - void writeMagicNumberAndVersionField (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream& os, const Header * headers, int parts); - - }; -diff -Naur a/OpenEXR/IlmImf/ImfName.h b/OpenEXR/IlmImf/ImfName.h ---- a/OpenEXR/IlmImf/ImfName.h 2018-08-10 04:34:58.000000000 +0300 -+++ b/OpenEXR/IlmImf/ImfName.h 2018-11-04 22:52:03.670220800 +0300 -@@ -51,7 +51,7 @@ - OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER - - --class Name -+class IMF_EXPORT Name - { - public: - -@@ -59,9 +59,7 @@ - // Constructors - //------------- - -- IMF_EXPORT - Name (); -- IMF_EXPORT - Name (const char text[]); - - -@@ -69,7 +67,6 @@ - // Assignment operator - //-------------------- - -- IMF_EXPORT - Name & operator = (const char text[]); - - -diff -Naur a/OpenEXR/IlmImf/ImfPreviewImage.h b/OpenEXR/IlmImf/ImfPreviewImage.h ---- a/OpenEXR/IlmImf/ImfPreviewImage.h 2018-08-10 04:34:58.000000000 +0300 -+++ b/OpenEXR/IlmImf/ImfPreviewImage.h 2018-11-04 22:39:19.052487200 +0300 -@@ -52,7 +52,7 @@ - OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER - - --struct PreviewRgba -+struct IMF_EXPORT PreviewRgba - { - unsigned char r; // Red, green and blue components of - unsigned char g; // the pixel's color; intensity is -@@ -70,7 +70,7 @@ - }; - - --class PreviewImage -+class IMF_EXPORT PreviewImage - { - public: - -@@ -87,7 +87,6 @@ - // - //-------------------------------------------------------------------- - -- IMF_EXPORT - PreviewImage (unsigned int width = 0, - unsigned int height = 0, - const PreviewRgba pixels[] = 0); -@@ -96,12 +95,9 @@ - // Copy constructor, destructor and assignment operator - //----------------------------------------------------- - -- IMF_EXPORT - PreviewImage (const PreviewImage &other); -- IMF_EXPORT - ~PreviewImage (); - -- IMF_EXPORT - PreviewImage & operator = (const PreviewImage &other); - - -diff -Naur a/OpenEXR/IlmImf/ImfStdIO.h b/OpenEXR/IlmImf/ImfStdIO.h ---- a/OpenEXR/IlmImf/ImfStdIO.h 2018-11-04 22:26:43.723504100 +0300 -+++ b/OpenEXR/IlmImf/ImfStdIO.h 2018-11-04 22:43:25.795600100 +0300 -@@ -58,7 +58,7 @@ - // class OPENEXR_IMF_INTERNAL_NAMESPACE::IStream based on class std::ifstream - //------------------------------------------- - --class StdIFStream: public OPENEXR_IMF_INTERNAL_NAMESPACE::IStream -+class IMF_EXPORT StdIFStream: public OPENEXR_IMF_INTERNAL_NAMESPACE::IStream - { - public: - -@@ -67,7 +67,6 @@ - // The destructor will close the file. - //------------------------------------------------------- - -- IMF_EXPORT - StdIFStream (const char fileName[]); - - -@@ -77,20 +76,14 @@ - // will not close the std::ifstream. - //--------------------------------------------------------- - -- IMF_EXPORT - StdIFStream (std::ifstream &is, const char fileName[]); - - -- IMF_EXPORT - virtual ~StdIFStream (); - -- IMF_EXPORT - virtual bool read (char c[/*n*/], int n); -- IMF_EXPORT - virtual Int64 tellg (); -- IMF_EXPORT - virtual void seekg (Int64 pos); -- IMF_EXPORT - virtual void clear (); - - private: -@@ -105,26 +98,19 @@ - // OPENEXR_IMF_INTERNAL_NAMESPACE::IStream, based on class std::istringstream - //------------------------------------------------ - --class StdISStream: public OPENEXR_IMF_INTERNAL_NAMESPACE::IStream -+class IMF_EXPORT StdISStream: public OPENEXR_IMF_INTERNAL_NAMESPACE::IStream - { - public: - -- IMF_EXPORT - StdISStream (); - -- IMF_EXPORT - virtual bool read (char c[/*n*/], int n); -- IMF_EXPORT - virtual Int64 tellg (); -- IMF_EXPORT - virtual void seekg (Int64 pos); -- IMF_EXPORT - virtual void clear (); - -- IMF_EXPORT - std::string str () const; - -- IMF_EXPORT - void str (const std::string &s); - - private: -@@ -139,7 +125,7 @@ - // class OPENEXR_IMF_INTERNAL_NAMESPACE::OStream based on class std::ofstream - //------------------------------------------- - --class StdOFStream: public OPENEXR_IMF_INTERNAL_NAMESPACE::OStream -+class IMF_EXPORT StdOFStream: public OPENEXR_IMF_INTERNAL_NAMESPACE::OStream - { - public: - -@@ -148,7 +134,6 @@ - // The destructor will close the file. - //------------------------------------------------------- - -- IMF_EXPORT - StdOFStream (const char fileName[]); - - -@@ -158,18 +143,13 @@ - // will not close the std::ofstream. - //--------------------------------------------------------- - -- IMF_EXPORT - StdOFStream (std::ofstream &os, const char fileName[]); - - -- IMF_EXPORT - virtual ~StdOFStream (); - -- IMF_EXPORT - virtual void write (const char c[/*n*/], int n); -- IMF_EXPORT - virtual Int64 tellp (); -- IMF_EXPORT - virtual void seekp (Int64 pos); - - private: -@@ -184,21 +164,16 @@ - // OPENEXR_IMF_INTERNAL_NAMESPACE::OStream, based on class std::ostringstream - //------------------------------------------------ - --class StdOSStream: public OPENEXR_IMF_INTERNAL_NAMESPACE::OStream -+class IMF_EXPORT StdOSStream: public OPENEXR_IMF_INTERNAL_NAMESPACE::OStream - { - public: - -- IMF_EXPORT - StdOSStream (); - -- IMF_EXPORT - virtual void write (const char c[/*n*/], int n); -- IMF_EXPORT - virtual Int64 tellp (); -- IMF_EXPORT - virtual void seekp (Int64 pos); - -- IMF_EXPORT - std::string str () const; - - private: diff --git a/tools/MINGW-packages/mingw-w64-openexr25/0013-no-py2.patch b/tools/MINGW-packages/mingw-w64-openexr25/0013-no-py2.patch deleted file mode 100644 index 56bb3fcc3..000000000 --- a/tools/MINGW-packages/mingw-w64-openexr25/0013-no-py2.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- openexr-2.4.0/PyIlmBase/CMakeLists.txt.orig 2019-09-18 03:02:06.000000000 +0200 -+++ openexr-2.4.0/PyIlmBase/CMakeLists.txt 2019-12-08 14:03:14.054387900 +0100 -@@ -38,7 +38,7 @@ - endif() - - # now determine which (or both), and compile for both --find_package(Python2 COMPONENTS Interpreter Development) -+#find_package(Python2 COMPONENTS Interpreter Development) - find_package(Python3 COMPONENTS Interpreter Development) - if(TARGET Python2::Python AND TARGET Python3::Python) - message(NOTICE ": Found Python ${Python2_VERSION} and ${Python3_VERSION}") diff --git a/tools/MINGW-packages/mingw-w64-openexr25/PKGBUILD b/tools/MINGW-packages/mingw-w64-openexr25/PKGBUILD deleted file mode 100644 index 100378307..000000000 --- a/tools/MINGW-packages/mingw-w64-openexr25/PKGBUILD +++ /dev/null @@ -1,124 +0,0 @@ -# Maintainer: Alexey Pavlov - -_realname=openexr -pkgbase=mingw-w64-${_realname} -pkgname=("${MINGW_PACKAGE_PREFIX}-ilmbase" - "${MINGW_PACKAGE_PREFIX}-${_realname}" - #"${MINGW_PACKAGE_PREFIX}-pyilmbase" - ) -pkgver=2.5.8 -pkgrel=99.2 -pkgdesc="Openexr library for EXR images (mingw-w64)" -arch=('any') -url="https://www.openexr.com/" -license=("custom") -makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" - "${MINGW_PACKAGE_PREFIX}-boost" - #"${MINGW_PACKAGE_PREFIX}-fltk" - "${MINGW_PACKAGE_PREFIX}-gcc" - "${MINGW_PACKAGE_PREFIX}-pkg-config" - "${MINGW_PACKAGE_PREFIX}-python" - #"${MINGW_PACKAGE_PREFIX}-python-numpy" - ) -options=('staticlibs' 'strip') -source=(${_realname}-${pkgver}.tar.gz::https://github.com/openexr/openexr/archive/v${pkgver}.tar.gz - 0001-mingw-w64-fix.patch - 0002-openexr-2.1.0-headers.patch - 0005-fix-dirs-in-pkgconfig.patch - 0006-cmake-soversion.patch - 0009-win-dwalookups.patch - 0012-exports.patch - 0013-no-py2.patch) -sha256sums=('db261a7fcc046ec6634e4c5696a2fc2ce8b55f50aac6abe034308f54c8495f55' - '68bedb3a4acc6f62b1486c7c47c9025f5ce4131468e17445f0c716545ddd00c1' - '460dcfd86b407241382ed4ba5a003ae251c9fdce68e7cfdea021b09898ad2705' - 'fba4e95d6921bcd253c8c644063b4c1334c84761a2a2232590d442ca81f8d7cd' - '313b0c98abdd792b8213ec9685a5a7b095ec69faa528f6fd0946f23576b6ef07' - '2ca841425ae676f75fa714a16f0124272224147fe40ea507ccc4bf74477f51ab' - 'da9e92f066e9b45583f2b12678a9f49fcbb7fa1f06805d9b472d39fa5f18a629' - '47e4e068439a1adaca41d7d7f966f65f1ae68b4dee1d1dd7c5778256edc3b3e8') - -prepare(){ - cd "${srcdir}/${_realname}-${pkgver}" - - sed -i 's/#define ZLIB_WINAPI/\/\/#define ZLIB_WINAPI/g' OpenEXR/IlmImf/ImfZipCompressor.cpp - sed -i 's/#define ZLIB_WINAPI/\/\/#define ZLIB_WINAPI/g' OpenEXR/IlmImf/ImfPxr24Compressor.cpp - - patch -p1 -i ${srcdir}/0001-mingw-w64-fix.patch - patch -p1 -i ${srcdir}/0002-openexr-2.1.0-headers.patch - #patch -p1 -i ${srcdir}/0005-fix-dirs-in-pkgconfig.patch - patch -p1 -i ${srcdir}/0006-cmake-soversion.patch - patch -p1 -i ${srcdir}/0009-win-dwalookups.patch - patch -p1 -i ${srcdir}/0012-exports.patch - #patch -p1 -i ${srcdir}/0013-no-py2.patch -} - -build() { - 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 "build-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}" - mkdir -p "${srcdir}/build-${MINGW_CHOST}" && cd "${srcdir}/build-${MINGW_CHOST}" - - MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ - ${MINGW_PREFIX}/bin/cmake \ - -G"MSYS Makefiles" \ - ${extra_config} \ - -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ - -DBUILD_SHARED_LIBS=ON \ - -DPYILMBASE_ENABLE=OFF \ - -DOPENEXR_NAMESPACE_VERSIONING=ON \ - -DOPENEXR_CXX_STANDARD=14 \ - ../${_realname}-${pkgver} - - make -} - -package_ilmbase() { - pkgdesc="Base libraries from ILM for OpenEXR (mingw-w64)" - depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") - - cd "${srcdir}/build-${MINGW_CHOST}/IlmBase" - make DESTDIR=${pkgdir} install -} - -package_openexr() { - pkgdesc="An high dynamic-range image file format library (mingw-w64)" - depends=("${MINGW_PACKAGE_PREFIX}-ilmbase=${pkgver}" - "${MINGW_PACKAGE_PREFIX}-zlib") - - cd "${srcdir}/build-${MINGW_CHOST}/OpenEXR" - make DESTDIR=${pkgdir} install -} - -#package_pyilmbase() { -# pkgdesc="Python bindings for OpenEXR library (mingw-w64)" -# depends=("${MINGW_PACKAGE_PREFIX}-openexr=${pkgver}" -# "${MINGW_PACKAGE_PREFIX}-boost" -# #"${MINGW_PACKAGE_PREFIX}-python-numpy" -# ) -# -# cd "${srcdir}/build-${MINGW_CHOST}/PyIlmBase" -# make DESTDIR=${pkgdir} install -# -# # Install python modules -# #local _py3ver=$(${MINGW_PREFIX}/bin/python -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))") -# -# #mkdir -p ${pkgdir}${MINGW_PREFIX}/lib/python${_py3ver}/site-packages -# #cp ${srcdir}/build-${MINGW_CHOST}/python${_py3ver//./_}/*.pyd ${pkgdir}${MINGW_PREFIX}/lib/python${_py3ver}/site-packages/ -#} - -# 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}-}" - _func="$(declare -f "${_short}")" - eval "${_func/#${_short}/package_${_name}}" -done -# template end; From de6ef458aff9087d763c4b0644c5ad1a6143d616 Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Mon, 5 Feb 2024 14:53:42 +0200 Subject: [PATCH 06/13] ffmpeg --- .../MINGW-packages/mingw-w64-ffmpeg/PKGBUILD | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 tools/MINGW-packages/mingw-w64-ffmpeg/PKGBUILD diff --git a/tools/MINGW-packages/mingw-w64-ffmpeg/PKGBUILD b/tools/MINGW-packages/mingw-w64-ffmpeg/PKGBUILD new file mode 100644 index 000000000..55bfed2b3 --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-ffmpeg/PKGBUILD @@ -0,0 +1,218 @@ +# Maintainer: Alexey Pavlov +# Contributor: Zach Bacon <11doctorwhocanada@gmail.com> +# Contributor: wirx6 +# Contributor: Ray Donnelly + +_realname=ffmpeg +pkgbase="mingw-w64-${_realname}" +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgver=6.1.1 +pkgrel=4 +pkgdesc="Complete solution to record, convert and stream audio and video (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://ffmpeg.org/" +license=('spdx:GPL-3.0-or-later') +depends=("${MINGW_PACKAGE_PREFIX}-aom" + "${MINGW_PACKAGE_PREFIX}-bzip2" + "${MINGW_PACKAGE_PREFIX}-frei0r-plugins" + "${MINGW_PACKAGE_PREFIX}-fribidi" + "${MINGW_PACKAGE_PREFIX}-fontconfig" + "${MINGW_PACKAGE_PREFIX}-dav1d" + "${MINGW_PACKAGE_PREFIX}-gmp" + "${MINGW_PACKAGE_PREFIX}-gnutls" + "${MINGW_PACKAGE_PREFIX}-gsm" + "${MINGW_PACKAGE_PREFIX}-lame" + "${MINGW_PACKAGE_PREFIX}-libass" + "${MINGW_PACKAGE_PREFIX}-libbluray" + "${MINGW_PACKAGE_PREFIX}-libcaca" + "${MINGW_PACKAGE_PREFIX}-libexif" + "${MINGW_PACKAGE_PREFIX}-libgme" + "${MINGW_PACKAGE_PREFIX}-libiconv" + "${MINGW_PACKAGE_PREFIX}-libmodplug" + "${MINGW_PACKAGE_PREFIX}-libssh" + "${MINGW_PACKAGE_PREFIX}-libplacebo" + "${MINGW_PACKAGE_PREFIX}-librsvg" + "${MINGW_PACKAGE_PREFIX}-libsoxr" + "${MINGW_PACKAGE_PREFIX}-libtheora" + "${MINGW_PACKAGE_PREFIX}-libva" + "${MINGW_PACKAGE_PREFIX}-libvorbis" + "${MINGW_PACKAGE_PREFIX}-libvpx" + "${MINGW_PACKAGE_PREFIX}-libwebp" + "${MINGW_PACKAGE_PREFIX}-libxml2" + "${MINGW_PACKAGE_PREFIX}-libvpl" + "${MINGW_PACKAGE_PREFIX}-openal" + "${MINGW_PACKAGE_PREFIX}-opencore-amr" + "${MINGW_PACKAGE_PREFIX}-openjpeg2" + "${MINGW_PACKAGE_PREFIX}-opus" + "${MINGW_PACKAGE_PREFIX}-rav1e" + "${MINGW_PACKAGE_PREFIX}-rtmpdump" + "${MINGW_PACKAGE_PREFIX}-SDL2" + "${MINGW_PACKAGE_PREFIX}-speex" + "${MINGW_PACKAGE_PREFIX}-srt" + $([[ "${CARCH}" == "i686" ]] || echo "${MINGW_PACKAGE_PREFIX}-svt-av1") + "${MINGW_PACKAGE_PREFIX}-vid.stab" + "${MINGW_PACKAGE_PREFIX}-vulkan" + "${MINGW_PACKAGE_PREFIX}-libx264" + "${MINGW_PACKAGE_PREFIX}-x265" + "${MINGW_PACKAGE_PREFIX}-xvidcore" + "${MINGW_PACKAGE_PREFIX}-zimg" + "${MINGW_PACKAGE_PREFIX}-zlib") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-pkgconf" + "${MINGW_PACKAGE_PREFIX}-dlfcn" + $([[ ${MINGW_PACKAGE_PREFIX} == *-clang-aarch64* ]] || echo "${MINGW_PACKAGE_PREFIX}-amf-headers") + $([[ ${MINGW_PACKAGE_PREFIX} == *-clang-aarch64* ]] || echo "${MINGW_PACKAGE_PREFIX}-ffnvcodec-headers") + $([[ ${MINGW_PACKAGE_PREFIX} == *-clang-aarch64* ]] || echo "${MINGW_PACKAGE_PREFIX}-nasm")) +source=(https://ffmpeg.org/releases/${_realname}-${pkgver}.tar.xz{,.asc} + "pathtools.c" + "pathtools.h" + "0005-Win32-Add-path-relocation-to-frei0r-plugins-search.patch" + "0009-wrong-null-type.patch") +validpgpkeys=('FCF986EA15E6E293A5644F10B4322F04D67658D8') +sha256sums=('8684f4b00f94b85461884c3719382f1261f0d9eb3d59640a1f4ac0873616f968' + 'SKIP' + 'ebf471173f5ee9c4416c10a78760cea8afaf1a4a6e653977321e8547ce7bf3c0' + '1585ef1b61cf53a2ca27049c11d49e0834683dfda798f03547761375df482a90' + '8c74e9b5800dbb41c33a60114712726ec768ad6de8f147c2eb30656fd4c899cc' + 'f76048e6e1944e15f646a52b75e75bc8906ca80f2a3124fba6a2050722750447') + +# 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() { + test ! -d "${startdir}/../mingw-w64-pathtools" || { + cmp "${startdir}/../mingw-w64-pathtools/pathtools.c" "${srcdir}/pathtools.c" && + cmp "${startdir}/../mingw-w64-pathtools/pathtools.h" "${srcdir}/pathtools.h" + } || exit 1 + + cd "${srcdir}/${_realname}-${pkgver}" + cp -fHv "${srcdir}"/pathtools.[ch] libavfilter/ + + apply_patch_with_msg \ + 0005-Win32-Add-path-relocation-to-frei0r-plugins-search.patch + + apply_patch_with_msg 0009-wrong-null-type.patch +} + +build() { + local -a common_config + common_config+=( + --disable-debug + --disable-stripping + --disable-doc + --enable-dxva2 + --enable-d3d11va + --enable-fontconfig + --enable-frei0r + --enable-gmp + --enable-gnutls + --enable-gpl + --enable-iconv + --enable-libaom + --enable-libass + --enable-libbluray + --enable-libcaca + --enable-libdav1d + --enable-libfreetype + --enable-libfribidi + --enable-libgme + --enable-libgsm + --enable-libmodplug + --enable-libmp3lame + --enable-libopencore_amrnb + --enable-libopencore_amrwb + --enable-libopenjpeg + --enable-libopus + --enable-libplacebo + --enable-librsvg + --enable-librtmp + --enable-libssh + --enable-libsoxr + --enable-libspeex + --enable-libsrt + --enable-libtheora + --enable-libvidstab + --enable-libvorbis + --enable-libx264 + --enable-libx265 + --enable-libxvid + --enable-libvpx + --enable-libwebp + --enable-libxml2 + --enable-libzimg + --enable-openal + --enable-pic + --enable-postproc + --enable-runtime-cpudetect + --enable-swresample + --enable-version3 + --enable-vulkan + --enable-zlib + --enable-librav1e + --enable-libvpl + ) + + if [[ "${CARCH}" != "i686" ]]; then + common_config+=( + --enable-libsvtav1 + ) + fi + + if [[ "${MINGW_PACKAGE_PREFIX}" != *clang-aarch64* ]]; then + common_config+=( + --enable-amf + --enable-nvenc + ) + fi + + for _variant in -static -shared; do + [[ -d "${srcdir}/build-${MSYSTEM}${_variant}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}${_variant}" + mkdir -p "${srcdir}/build-${MSYSTEM}${_variant}" && cd "${srcdir}/build-${MSYSTEM}${_variant}" + if [[ ${_variant} == -static ]]; then + ENABLE_VARIANT="--enable-static --pkg-config-flags=--static" + else + ENABLE_VARIANT=--enable-shared + fi + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --target-os=mingw32 \ + --arch=${CARCH%%-*} \ + --cc=${CC} \ + --cxx=${CXX} \ + "${common_config[@]}" \ + --logfile=config.log \ + ${ENABLE_VARIANT} + + make + done +} + +check() { + for _variant in -static -shared; do + cd "${srcdir}/build-${MSYSTEM}${_variant}" + # workaround for conflict with SDL main(), use it if you have SDL installed + # make check CC_C="-c -Umain" + make check || true + done +} + +package() { + for _variant in -static -shared; do + cd "${srcdir}/build-${MSYSTEM}${_variant}" + make DESTDIR="${pkgdir}" install + done + + rm -f ${pkgdir}/${MINGW_PREFIX}/lib/*.def + rm -f ${pkgdir}/${MINGW_PREFIX}/bin/*.lib + + local PREFIX_DEPS=$(cygpath -am ${MINGW_PREFIX}) + find ${pkgdir}${MINGW_PREFIX}/lib/pkgconfig -name *.pc -exec sed -i -e"s|${PREFIX_DEPS}|${MINGW_PREFIX}|g" {} \; +} From b6395be736822b49142876f4891ab4f92be8e002 Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Mon, 5 Feb 2024 14:54:40 +0200 Subject: [PATCH 07/13] ffmpeg --- ...-relocation-to-frei0r-plugins-search.patch | 45 ++ .../0009-wrong-null-type.patch | 66 ++ .../mingw-w64-ffmpeg/pathtools.c | 640 ++++++++++++++++++ .../mingw-w64-ffmpeg/pathtools.h | 65 ++ 4 files changed, 816 insertions(+) create mode 100644 tools/MINGW-packages/mingw-w64-ffmpeg/0005-Win32-Add-path-relocation-to-frei0r-plugins-search.patch create mode 100644 tools/MINGW-packages/mingw-w64-ffmpeg/0009-wrong-null-type.patch create mode 100644 tools/MINGW-packages/mingw-w64-ffmpeg/pathtools.c create mode 100644 tools/MINGW-packages/mingw-w64-ffmpeg/pathtools.h diff --git a/tools/MINGW-packages/mingw-w64-ffmpeg/0005-Win32-Add-path-relocation-to-frei0r-plugins-search.patch b/tools/MINGW-packages/mingw-w64-ffmpeg/0005-Win32-Add-path-relocation-to-frei0r-plugins-search.patch new file mode 100644 index 000000000..f5e0edc5b --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-ffmpeg/0005-Win32-Add-path-relocation-to-frei0r-plugins-search.patch @@ -0,0 +1,45 @@ +diff --git a/libavfilter/Makefile b/libavfilter/Makefile +index 03998dc064..c8c16a9332 100644 +--- a/libavfilter/Makefile ++++ b/libavfilter/Makefile +@@ -19,6 +19,7 @@ + framequeue.o \ + graphdump.o \ + graphparser.o \ ++ pathtools.o \ + version.o \ + video.o \ + +--- ffmpeg-6.0/libavfilter/vf_frei0r.c.orig 2023-02-27 21:43:45.000000000 +0100 ++++ ffmpeg-6.0/libavfilter/vf_frei0r.c 2023-11-06 19:53:02.978838800 +0100 +@@ -42,6 +42,7 @@ + #include "formats.h" + #include "internal.h" + #include "video.h" ++#include "pathtools.h" + + typedef f0r_instance_t (*f0r_construct_f)(unsigned int width, unsigned int height); + typedef void (*f0r_destruct_f)(f0r_instance_t instance); +@@ -192,12 +193,22 @@ + char *path; + int ret = 0; + int i; ++#ifdef _WIN32 ++ static char pathlist_entry[PATH_MAX]; ++ static const char* const frei0r_pathlist[] = { ++ &pathlist_entry[0] ++ }; ++ char *plugin_path = single_path_relocation_lib("/prefix/bin/", "/prefix/lib/frei0r-1/"); ++ av_strlcpy(pathlist_entry, plugin_path, sizeof (pathlist_entry) / sizeof (pathlist_entry[0])); ++ free(plugin_path); ++#else + static const char* const frei0r_pathlist[] = { + "/usr/local/lib/frei0r-1/", + "/usr/lib/frei0r-1/", + "/usr/local/lib64/frei0r-1/", + "/usr/lib64/frei0r-1/" + }; ++#endif + + if (!dl_name) { + av_log(ctx, AV_LOG_ERROR, "No filter name provided.\n"); diff --git a/tools/MINGW-packages/mingw-w64-ffmpeg/0009-wrong-null-type.patch b/tools/MINGW-packages/mingw-w64-ffmpeg/0009-wrong-null-type.patch new file mode 100644 index 000000000..4fde5a459 --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-ffmpeg/0009-wrong-null-type.patch @@ -0,0 +1,66 @@ +diff -Nur ffmpeg-6.1-orig/libavcodec/vulkan_av1.c ffmpeg-6.1/libavcodec/vulkan_av1.c +--- ffmpeg-6.1-orig/libavcodec/vulkan_av1.c 2023-11-11 01:25:17.000000000 +0100 ++++ ffmpeg-6.1/libavcodec/vulkan_av1.c 2023-11-11 10:45:06.826832600 +0100 +@@ -180,7 +180,7 @@ + .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR, + .pNext = &av1_params, + .videoSession = ctx->common.session, +- .videoSessionParametersTemplate = NULL, ++ .videoSessionParametersTemplate = VK_NULL_HANDLE, + }; + + err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create); +diff -Nur ffmpeg-6.1-orig/libavcodec/vulkan_decode.c ffmpeg-6.1/libavcodec/vulkan_decode.c +--- ffmpeg-6.1-orig/libavcodec/vulkan_decode.c 2023-11-11 01:25:17.000000000 +0100 ++++ ffmpeg-6.1/libavcodec/vulkan_decode.c 2023-11-11 10:47:06.921322700 +0100 +@@ -187,10 +187,10 @@ + if (vkpic->img_view_ref) + return 0; + +- vkpic->dpb_frame = NULL; +- vkpic->img_view_ref = NULL; +- vkpic->img_view_out = NULL; +- vkpic->img_view_dest = NULL; ++ vkpic->dpb_frame = VK_NULL_HANDLE; ++ vkpic->img_view_ref = VK_NULL_HANDLE; ++ vkpic->img_view_out = VK_NULL_HANDLE; ++ vkpic->img_view_dest = VK_NULL_HANDLE; + + vkpic->destroy_image_view = vk->DestroyImageView; + vkpic->wait_semaphores = vk->WaitSemaphores; +diff -Nur ffmpeg-6.1-orig/libavcodec/vulkan_h264.c ffmpeg-6.1/libavcodec/vulkan_h264.c +--- ffmpeg-6.1-orig/libavcodec/vulkan_h264.c 2023-11-11 01:25:17.000000000 +0100 ++++ ffmpeg-6.1/libavcodec/vulkan_h264.c 2023-11-11 10:45:57.371334900 +0100 +@@ -315,7 +315,7 @@ + .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR, + .pNext = &h264_params, + .videoSession = ctx->common.session, +- .videoSessionParametersTemplate = NULL, ++ .videoSessionParametersTemplate = VK_NULL_HANDLE, + }; + + /* SPS list */ +diff -Nur ffmpeg-6.1-orig/libavcodec/vulkan_hevc.c ffmpeg-6.1/libavcodec/vulkan_hevc.c +--- ffmpeg-6.1-orig/libavcodec/vulkan_hevc.c 2023-11-11 01:25:17.000000000 +0100 ++++ ffmpeg-6.1/libavcodec/vulkan_hevc.c 2023-11-11 10:46:24.663058100 +0100 +@@ -653,7 +653,7 @@ + .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR, + .pNext = &h265_params, + .videoSession = ctx->common.session, +- .videoSessionParametersTemplate = NULL, ++ .videoSessionParametersTemplate = VK_NULL_HANDLE, + }; + + HEVCHeaderSet *hdr; +diff -Nur ffmpeg-6.1-orig/libavcodec/vulkan_video.c ffmpeg-6.1/libavcodec/vulkan_video.c +--- ffmpeg-6.1-orig/libavcodec/vulkan_video.c 2023-11-11 01:25:17.000000000 +0100 ++++ ffmpeg-6.1/libavcodec/vulkan_video.c 2023-11-11 10:47:38.629188400 +0100 +@@ -287,7 +287,7 @@ + if (common->session) { + vk->DestroyVideoSessionKHR(s->hwctx->act_dev, common->session, + s->hwctx->alloc); +- common->session = NULL; ++ common->session = VK_NULL_HANDLE; + } + + if (common->nb_mem && common->mem) diff --git a/tools/MINGW-packages/mingw-w64-ffmpeg/pathtools.c b/tools/MINGW-packages/mingw-w64-ffmpeg/pathtools.c new file mode 100644 index 000000000..84b9ea1bd --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-ffmpeg/pathtools.c @@ -0,0 +1,640 @@ +/* + .Some useful path tools. + .ASCII only for now. + .Written by Ray Donnelly in 2014. + .Licensed under CC0 (and anything. + .else you need to license it under). + .No warranties whatsoever. + .email: . + */ + +#if defined(__APPLE__) +#include +#else +#include +#endif +#include +#include +#include +#if defined(__linux__) || defined(__CYGWIN__) || defined(__MSYS__) +#include +#endif +#include + +/* If you don't define this, then get_executable_path() + can only use argv[0] which will often not work well */ +#define IMPLEMENT_SYS_GET_EXECUTABLE_PATH + +#if defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) +#if defined(__linux__) || defined(__CYGWIN__) || defined(__MSYS__) +/* Nothing needed, unistd.h is enough. */ +#elif defined(__APPLE__) +#include +#elif defined(_WIN32) +#define WIN32_MEAN_AND_LEAN +#include +#include +#endif +#endif /* defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) */ + +#include "pathtools.h" + +static char * +malloc_copy_string(char const * original) +{ + char * result = (char *) malloc (sizeof (char*) * strlen (original)+1); + if (result != NULL) + { + strcpy (result, original); + } + return result; +} + +void +sanitise_path(char * path) +{ + size_t path_size = strlen (path); + + /* Replace any '\' with '/' */ + char * path_p = path; + while ((path_p = strchr (path_p, '\\')) != NULL) + { + *path_p = '/'; + } + /* Replace any '//' with '/' */ + path_p = path + !!*path; /* skip first character, if any, to handle UNC paths correctly */ + while ((path_p = strstr (path_p, "//")) != NULL) + { + memmove (path_p, path_p + 1, path_size--); + } + return; +} + +char * +get_relative_path(char const * from_in, char const * to_in) +{ + size_t from_size = (from_in == NULL) ? 0 : strlen (from_in); + size_t to_size = (to_in == NULL) ? 0 : strlen (to_in); + size_t max_size = (from_size + to_size) * 2 + 4; + char * scratch_space = (char *) alloca (from_size + 1 + to_size + 1 + max_size + max_size); + char * from; + char * to; + char * common_part; + char * result; + size_t count; + + /* No to, return "./" */ + if (to_in == NULL) + { + return malloc_copy_string ("./"); + } + + /* If alloca failed or no from was given return a copy of to */ + if ( from_in == NULL + || scratch_space == NULL ) + { + return malloc_copy_string (to_in); + } + + from = scratch_space; + strcpy (from, from_in); + to = from + from_size + 1; + strcpy (to, to_in); + common_part = to + to_size + 1; + result = common_part + max_size; + simplify_path (from); + simplify_path (to); + + result[0] = '\0'; + + size_t match_size_dirsep = 0; /* The match size up to the last /. Always wind back to this - 1 */ + size_t match_size = 0; /* The running (and final) match size. */ + size_t largest_size = (from_size > to_size) ? from_size : to_size; + int to_final_is_slash = (to[to_size-1] == '/') ? 1 : 0; + char from_c; + char to_c; + for (match_size = 0; match_size < largest_size; ++match_size) + { + /* To simplify the logic, always pretend the strings end with '/' */ + from_c = (match_size < from_size) ? from[match_size] : '/'; + to_c = (match_size < to_size) ? to[match_size] : '/'; + + if (from_c != to_c) + { + if (from_c != '\0' || to_c != '\0') + { + match_size = match_size_dirsep; + } + break; + } + else if (from_c == '/') + { + match_size_dirsep = match_size; + } + } + strncpy (common_part, from, match_size); + common_part[match_size] = '\0'; + from += match_size; + to += match_size; + size_t ndotdots = 0; + char const* from_last = from + strlen(from) - 1; + while ((from = strchr (from, '/')) && from != from_last) + { + ++ndotdots; + ++from; + } + for (count = 0; count < ndotdots; ++count) + { + strcat(result, "../"); + } + if (strlen(to) > 0) + { + strcat(result, to+1); + } + /* Make sure that if to ends with '/' result does the same, and + vice-versa. */ + size_t size_result = strlen(result); + if ((to_final_is_slash == 1) + && (!size_result || result[size_result-1] != '/')) + { + strcat (result, "/"); + } + else if (!to_final_is_slash + && size_result && result[size_result-1] == '/') + { + result[size_result-1] = '\0'; + } + + return malloc_copy_string (result); +} + +void +simplify_path(char * path) +{ + ssize_t n_toks = 1; /* in-case we need an empty initial token. */ + ssize_t i, j; + size_t tok_size; + size_t in_size = strlen (path); + int it_ended_with_a_slash = (path[in_size - 1] == '/') ? 1 : 0; + char * result = path; + if (path[0] == '/' && path[1] == '/') { + /* preserve UNC path */ + path++; + in_size--; + result++; + } + sanitise_path(result); + char * result_p = result; + + do + { + ++n_toks; + ++result_p; + } while ((result_p = strchr (result_p, '/')) != NULL); + + result_p = result; + char const ** toks = (char const **) alloca (sizeof (char const*) * n_toks); + n_toks = 0; + do + { + if (result_p > result) + { + *result_p++ = '\0'; + } + else if (*result_p == '/') + { + /* A leading / creates an empty initial token. */ + toks[n_toks++] = result_p; + *result_p++ = '\0'; + } + toks[n_toks++] = result_p; + } while ((result_p = strchr (result_p, '/')) != NULL); + + /* Remove all non-leading '.' and any '..' we can match + with an earlier forward path (i.e. neither '.' nor '..') */ + for (i = 1; i < n_toks; ++i) + { + int removals[2] = { -1, -1 }; + if ( strcmp (toks[i], "." ) == 0) + { + removals[0] = i; + } + else if ( strcmp (toks[i], ".." ) == 0) + { + /* Search backwards for a forward path to collapse. + If none are found then the .. also stays. */ + for (j = i - 1; j > -1; --j) + { + if ( strcmp (toks[j], "." ) + && strcmp (toks[j], ".." ) ) + { + removals[0] = j; + removals[1] = i; + break; + } + } + } + for (j = 0; j < 2; ++j) + { + if (removals[j] >= 0) /* Can become -2 */ + { + --n_toks; + memmove (&toks[removals[j]], &toks[removals[j]+1], (n_toks - removals[j])*sizeof (char*)); + --i; + if (!j) + { + --removals[1]; + } + } + } + } + result_p = result; + for (i = 0; i < n_toks; ++i) + { + tok_size = strlen(toks[i]); + memmove (result_p, toks[i], tok_size); + result_p += tok_size; + if ((!i || tok_size) && ((i < n_toks - 1) || it_ended_with_a_slash == 1)) + { + *result_p = '/'; + ++result_p; + } + } + *result_p = '\0'; +} + +int +get_executable_path(char const * argv0, char * result, ssize_t max_size) +{ + char * system_result = (char *) alloca (max_size); + ssize_t system_result_size = -1; + ssize_t result_size = -1; + + if (system_result != NULL) + { +#if defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) +#if defined(__linux__) || defined(__CYGWIN__) || defined(__MSYS__) + system_result_size = readlink("/proc/self/exe", system_result, max_size); +#elif defined(__APPLE__) + uint32_t bufsize = (uint32_t)max_size; + if (_NSGetExecutablePath(system_result, &bufsize) == 0) + { + system_result_size = (ssize_t)bufsize; + } +#elif defined(_WIN32) + unsigned long bufsize = (unsigned long)max_size; + system_result_size = GetModuleFileNameA(NULL, system_result, bufsize); + if (system_result_size == 0 || system_result_size == (ssize_t)bufsize) + { + /* Error, possibly not enough space. */ + system_result_size = -1; + } + else + { + /* Early conversion to unix slashes instead of more changes + everywhere else .. */ + char * winslash; + system_result[system_result_size] = '\0'; + while ((winslash = strchr (system_result, '\\')) != NULL) + { + *winslash = '/'; + } + } +#else +#warning "Don't know how to get executable path on this system" +#endif +#endif /* defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) */ + } + /* Use argv0 as a default in-case of failure */ + if (system_result_size != -1) + { + strncpy (result, system_result, system_result_size); + result[system_result_size] = '\0'; + } + else + { + if (argv0 != NULL) + { + strncpy (result, argv0, max_size); + result[max_size-1] = '\0'; + } + else + { + result[0] = '\0'; + } + } + result_size = strlen (result); + return result_size; +} + +#if defined(_WIN32) +int +get_dll_path(char * result, unsigned long max_size) +{ + HMODULE handle; + char * p; + int ret; + + if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | + GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, + (LPCSTR) &get_dll_path, &handle)) + { + return -1; + } + + ret = GetModuleFileNameA(handle, result, max_size); + if (ret == 0 || ret == (int)max_size) + { + return -1; + } + + /* Early conversion to unix slashes instead of more changes + everywhere else .. */ + result[ret] = '\0'; + p = result - 1; + while ((p = strchr (p + 1, '\\')) != NULL) + { + *p = '/'; + } + + return ret; +} +#endif + +static char const * +strip_n_prefix_folders(char const * path, size_t n) +{ + if (path == NULL) + { + return NULL; + } + + if (path[0] != '/') + { + return path; + } + + char const * last = path; + while (n-- && path != NULL) + { + last = path; + path = strchr (path + 1, '/'); + } + return (path == NULL) ? last : path; +} + +void +strip_n_suffix_folders(char * path, size_t n) +{ + if (path == NULL) + { + return; + } + while (n--) + { + if (strrchr (path + 1, '/')) + { + *strrchr (path + 1, '/') = '\0'; + } + else + { + return; + } + } + return; +} + +static size_t +split_path_list(char const * path_list, char split_char, char *** arr) +{ + size_t path_count; + size_t path_list_size; + char const * path_list_p; + + path_list_p = path_list; + if (path_list == NULL || path_list[0] == '\0') + { + return 0; + } + path_list_size = strlen (path_list); + + path_count = 0; + do + { + ++path_count; + ++path_list_p; + } + while ((path_list_p = strchr (path_list_p, split_char)) != NULL); + + /* allocate everything in one go. */ + char * all_memory = (char *) malloc (sizeof (char *) * path_count + strlen(path_list) + 1); + if (all_memory == NULL) + return 0; + *arr = (char **)all_memory; + all_memory += sizeof (char *) * path_count; + + path_count = 0; + path_list_p = path_list; + char const * next_path_list_p = 0; + do + { + next_path_list_p = strchr (path_list_p, split_char); + if (next_path_list_p != NULL) + { + ++next_path_list_p; + } + size_t this_size = (next_path_list_p != NULL) + ? next_path_list_p - path_list_p - 1 + : &path_list[path_list_size] - path_list_p; + memcpy (all_memory, path_list_p, this_size); + all_memory[this_size] = '\0'; + (*arr)[path_count++] = all_memory; + all_memory += this_size + 1; + } while ((path_list_p = next_path_list_p) != NULL); + + return path_count; +} + +static char * +get_relocated_path_list_ref(char const * from, char const * to_path_list, char *ref_path) +{ + char * temp; + if ((temp = strrchr (ref_path, '/')) != NULL) + { + temp[1] = '\0'; + } + + char **arr = NULL; + /* Ask Alexey why he added this. Are we not 100% sure + that we're dealing with unix paths here? */ + char split_char = ':'; + if (strchr (to_path_list, ';')) + { + split_char = ';'; + } + size_t count = split_path_list (to_path_list, split_char, &arr); + int result_size = 1 + (count - 1); /* count - 1 is for ; delim. */ + size_t ref_path_size = strlen (ref_path); + size_t i; + /* Space required is: + count * (ref_path_size + strlen (rel_to_datadir)) + rel_to_datadir upper bound is: + (count * strlen (from)) + (3 * num_slashes (from)) + + strlen(arr[i]) + 1. + .. pathalogically num_slashes (from) is strlen (from) + (from = ////////) */ + size_t space_required = (count * (ref_path_size + 4 * strlen (from))) + count - 1; + for (i = 0; i < count; ++i) + { + space_required += strlen (arr[i]); + } + char * scratch = (char *) alloca (space_required); + if (scratch == NULL) + return NULL; + for (i = 0; i < count; ++i) + { + char * rel_to_datadir = get_relative_path (from, arr[i]); + scratch[0] = '\0'; + arr[i] = scratch; + strcat (scratch, ref_path); + strcat (scratch, rel_to_datadir); + free (rel_to_datadir); + simplify_path (arr[i]); + size_t arr_i_size = strlen (arr[i]); + result_size += arr_i_size; + scratch = arr[i] + arr_i_size + 1; + } + char * result = (char *) malloc (result_size); + if (result == NULL) + { + return NULL; + } + result[0] = '\0'; + for (i = 0; i < count; ++i) + { + strcat (result, arr[i]); + if (i != count-1) + { +#if defined(_WIN32) + strcat (result, ";"); +#else + strcat (result, ":"); +#endif + } + } + free ((void*)arr); + return result; +} + +char * +get_relocated_path_list(char const *from, char const *to_path_list) +{ + char exe_path[MAX_PATH]; + get_executable_path (NULL, &exe_path[0], sizeof (exe_path) / sizeof (exe_path[0])); + + return get_relocated_path_list_ref(from, to_path_list, exe_path); +} + +char * +get_relocated_path_list_lib(char const *from, char const *to_path_list) +{ + char dll_path[PATH_MAX]; + get_dll_path (&dll_path[0], sizeof(dll_path)/sizeof(dll_path[0])); + + return get_relocated_path_list_ref(from, to_path_list, dll_path); +} + +static char * +single_path_relocation_ref(const char *from, const char *to, char *ref_path) +{ +#if defined(__MINGW32__) + if (strrchr (ref_path, '/') != NULL) + { + strrchr (ref_path, '/')[1] = '\0'; + } + char * rel_to_datadir = get_relative_path (from, to); + strcat (ref_path, rel_to_datadir); + free (rel_to_datadir); + simplify_path (&ref_path[0]); + return malloc_copy_string(ref_path); +#else + return malloc_copy_string(to); +#endif +} + +char * +single_path_relocation(const char *from, const char *to) +{ +#if defined(__MINGW32__) + char exe_path[PATH_MAX]; + get_executable_path (NULL, &exe_path[0], sizeof(exe_path)/sizeof(exe_path[0])); + return single_path_relocation_ref(from, to, exe_path); +#else + return malloc_copy_string(to); +#endif +} + +char * +single_path_relocation_lib(const char *from, const char *to) +{ +#if defined(__MINGW32__) + char dll_path[PATH_MAX]; + get_dll_path (&dll_path[0], sizeof(dll_path)/sizeof(dll_path[0])); + return single_path_relocation_ref(from, to, dll_path); +#else + return malloc_copy_string(to); +#endif +} + +char const * +msys2_get_relocated_single_path(char const * unix_path) +{ + char * unix_part = (char *) strip_n_prefix_folders (unix_path, 1); + char win_part[MAX_PATH]; + get_executable_path (NULL, &win_part[0], MAX_PATH); + strip_n_suffix_folders (&win_part[0], 2); /* 2 because the file name is present. */ + char * new_path = (char *) malloc (strlen (unix_part) + strlen (win_part) + 1); + strcpy (new_path, win_part); + strcat (new_path, unix_part); + return new_path; +} + +char * +msys2_get_relocated_path_list(char const * paths) +{ + char win_part[MAX_PATH]; + get_executable_path (NULL, &win_part[0], MAX_PATH); + strip_n_suffix_folders (&win_part[0], 2); /* 2 because the file name is present. */ + + char **arr = NULL; + + size_t count = split_path_list (paths, ':', &arr); + int result_size = 1 + (count - 1); /* count - 1 is for ; delim. */ + size_t i; + for (i = 0; i < count; ++i) + { + arr[i] = (char *) strip_n_prefix_folders (arr[i], 1); + result_size += strlen (arr[i]) + strlen (win_part); + } + char * result = (char *) malloc (result_size); + if (result == NULL) + { + return NULL; + } + result[0] = '\0'; + for (i = 0; i < count; ++i) + { + strcat (result, win_part); + strcat (result, arr[i]); + if (i != count-1) + { +#if defined(_WIN32) + strcat (result, ";"); +#else + strcat (result, ":"); +#endif + } + } + free ((void*)arr); + return result; +} diff --git a/tools/MINGW-packages/mingw-w64-ffmpeg/pathtools.h b/tools/MINGW-packages/mingw-w64-ffmpeg/pathtools.h new file mode 100644 index 000000000..1caf2000c --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-ffmpeg/pathtools.h @@ -0,0 +1,65 @@ +/* + .Some useful path tools. + .ASCII only for now. + .Written by Ray Donnelly in 2014. + .Licensed under CC0 (and anything. + .else you need to license it under). + .No warranties whatsoever. + .email: . + */ + +#ifndef PATHTOOLS_H +#define PATHTOOLS_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* In-place replaces any '\' with '/' and any '//' with '/' */ +void sanitise_path(char * path); + +/* Uses a host OS specific function to determine the path of the executable, + if IMPLEMENT_SYS_GET_EXECUTABLE_PATH is defined, otherwise uses argv0. */ +int get_executable_path(char const * argv0, char * result, ssize_t max_size); + +int get_dll_path(char * result, unsigned long max_size); + +/* Where possible, in-place removes occourances of '.' and 'path/..' */ +void simplify_path(char * path); + +/* Allocates (via malloc) and returns the path to get from from to to. */ +char * get_relative_path(char const * from, char const * to); + +/* NULL terminates path to remove n suffix folders. */ +void strip_n_suffix_folders(char * path, size_t n); + +char * get_relocated_path_list(char const * from, char const * to_path_list); +char * get_relocated_path_list_lib(char const * from, char const * to_path_list); + +char * single_path_relocation(const char *from, const char *to); +char * single_path_relocation_lib(const char *from, const char *to); + +/* Allocates (via malloc) and returns a relocated path from a single Unix path. + This function makes large assumptions regarding PREFIX and is therefore very + much an MSYS2-only function. It operates by removing the first folder of the + input and final folder of the program executable then appending the input to + that. +*/ +char const * msys2_get_relocated_single_path(char const * unix_path); + +/* Allocates (via malloc) and for each ':' delimited Unix sub-path, returns the + result of applying the procedure detailed for msys2_get_relocated_single_path + on that Unix sub-path with the results joined up again with a ';' delimiter. + It implements the same logic in msys2_get_relocated_single_path to reduce the + the number of mallocs. +*/ +char * msys2_get_relocated_path_list(char const * paths); + +#ifdef __cplusplus +} +#endif + +#endif /* PATHTOOLS_H */ From 6428d8026f81e0aa2af3ab2529bd80cbc0682caf Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Mon, 5 Feb 2024 16:13:47 +0200 Subject: [PATCH 08/13] Fix --- tools/MINGW-packages/mingw-w64-ffmpeg/PKGBUILD | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/MINGW-packages/mingw-w64-ffmpeg/PKGBUILD b/tools/MINGW-packages/mingw-w64-ffmpeg/PKGBUILD index 55bfed2b3..1410cf5af 100644 --- a/tools/MINGW-packages/mingw-w64-ffmpeg/PKGBUILD +++ b/tools/MINGW-packages/mingw-w64-ffmpeg/PKGBUILD @@ -4,10 +4,10 @@ # Contributor: Ray Donnelly _realname=ffmpeg -pkgbase="mingw-w64-${_realname}" -pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgbase="mingw-w64-natron_${_realname}" +pkgname="${MINGW_PACKAGE_PREFIX}-natron_${_realname}" pkgver=6.1.1 -pkgrel=4 +pkgrel=99.1 pkgdesc="Complete solution to record, convert and stream audio and video (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') From bebacd8d17b842dac0170207f503b391ac801e48 Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Mon, 5 Feb 2024 16:19:38 +0200 Subject: [PATCH 09/13] Fix --- tools/MINGW-packages/mingw-w64-libraw/PKGBUILD | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/MINGW-packages/mingw-w64-libraw/PKGBUILD b/tools/MINGW-packages/mingw-w64-libraw/PKGBUILD index b22c34192..106bc31c9 100644 --- a/tools/MINGW-packages/mingw-w64-libraw/PKGBUILD +++ b/tools/MINGW-packages/mingw-w64-libraw/PKGBUILD @@ -1,11 +1,11 @@ # Maintainer: Alexey Pavlov _realname=LibRaw -pkgbase=mingw-w64-libraw -pkgname="${MINGW_PACKAGE_PREFIX}-libraw" -provides=("${MINGW_PACKAGE_PREFIX}-${_realname}") -replaces=("${MINGW_PACKAGE_PREFIX}-${_realname}") -conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}") +pkgbase=mingw-w64-natron_libraw +pkgname="${MINGW_PACKAGE_PREFIX}-natron_libraw" +provides=("${MINGW_PACKAGE_PREFIX}-natron_${_realname}") +replaces=("${MINGW_PACKAGE_PREFIX}-natron_${_realname}") +conflicts=("${MINGW_PACKAGE_PREFIX}-natron_${_realname}") pkgver=0.21.2 pkgrel=99.1 pkgdesc="Library for reading RAW files obtained from digital photo cameras (mingw-w64)" From 8a58bb97d4bcacb6d2678e3b669ce93e0516800f Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Mon, 5 Feb 2024 16:22:54 +0200 Subject: [PATCH 10/13] Fix --- tools/MINGW-packages/mingw-w64-opencolorio/PKGBUILD | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/MINGW-packages/mingw-w64-opencolorio/PKGBUILD b/tools/MINGW-packages/mingw-w64-opencolorio/PKGBUILD index b76a99f8c..0d4002f03 100644 --- a/tools/MINGW-packages/mingw-w64-opencolorio/PKGBUILD +++ b/tools/MINGW-packages/mingw-w64-opencolorio/PKGBUILD @@ -1,10 +1,10 @@ # Maintainer: Alexey Pavlov _realname=opencolorio -pkgbase=mingw-w64-${_realname} -pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}-git") -replaces=("${MINGW_PACKAGE_PREFIX}-${_realname}-git") +pkgbase=mingw-w64-natron_${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-natron_${_realname}" +conflicts=("${MINGW_PACKAGE_PREFIX}-natron_${_realname}-git") +replaces=("${MINGW_PACKAGE_PREFIX}-natron_${_realname}-git") pkgver=2.3.1 pkgrel=99.1 pkgdesc="A color management framework for visual effects and animation (mingw-w64)" From 2bdf8744b7887e8e4bb9f6b58d3515c22df48493 Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Mon, 5 Feb 2024 16:25:40 +0200 Subject: [PATCH 11/13] build fix --- tools/MINGW-packages/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/MINGW-packages/build.sh b/tools/MINGW-packages/build.sh index 4c46741f4..80bddf6da 100644 --- a/tools/MINGW-packages/build.sh +++ b/tools/MINGW-packages/build.sh @@ -7,12 +7,12 @@ mingw-w64-shiboken mingw-w64-pyside mingw-w64-imath mingw-w64-openexr -mingw-w64-libraw-gpl2 -mingw-w64-opencolorio2-git +mingw-w64-libraw +mingw-w64-opencolorio mingw-w64-openimageio mingw-w64-seexpr-git mingw-w64-x264-git -mingw-w64-ffmpeg-gpl2 +mingw-w64-ffmpeg mingw-w64-sox mingw-w64-poppler mingw-w64-imagemagick From 331965c5d18475cf8a9150100aa2101e315b5351 Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Mon, 5 Feb 2024 16:27:17 +0200 Subject: [PATCH 12/13] build natron repo --- tools/MINGW-packages/build_natron_package_repo.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/MINGW-packages/build_natron_package_repo.sh b/tools/MINGW-packages/build_natron_package_repo.sh index dc08294d5..cd321837f 100644 --- a/tools/MINGW-packages/build_natron_package_repo.sh +++ b/tools/MINGW-packages/build_natron_package_repo.sh @@ -7,12 +7,12 @@ PKGS=" mingw-w64-natron-setup mingw-w64-imath mingw-w64-openexr -mingw-w64-libraw-gpl2 -mingw-w64-opencolorio2-git +mingw-w64-libraw +mingw-w64-opencolorio mingw-w64-openimageio mingw-w64-seexpr-git mingw-w64-x264-git -mingw-w64-ffmpeg-gpl2 +mingw-w64-ffmpeg mingw-w64-sox mingw-w64-poppler mingw-w64-imagemagick From f9b6f405b95f0fc759cd8719e5a162b6d53f409a Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Tue, 13 Feb 2024 07:41:13 +0200 Subject: [PATCH 13/13] Update OpenEXR 3.2.2 --- tools/MINGW-packages/mingw-w64-openexr/PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/MINGW-packages/mingw-w64-openexr/PKGBUILD b/tools/MINGW-packages/mingw-w64-openexr/PKGBUILD index dfc277627..ba5113189 100644 --- a/tools/MINGW-packages/mingw-w64-openexr/PKGBUILD +++ b/tools/MINGW-packages/mingw-w64-openexr/PKGBUILD @@ -3,7 +3,7 @@ _realname=openexr pkgbase=mingw-w64-natron_${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-natron_${_realname}") -pkgver=3.2.1 +pkgver=3.2.2 pkgrel=99.1 pkgdesc='A high dynamic-range image file format library (mingw-w64)' arch=('any') @@ -28,7 +28,7 @@ replaces=( source=("https://github.com/openexr/openexr/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz" 0006-cmake-soversion.patch 0007-export-TypedAttribute-value.patch) -sha256sums=('61e175aa2203399fb3c8c2288752fbea3c2637680d50b6e306ea5f8ffdd46a9b' +sha256sums=('65de6459c245a4977ce4d7777e70b30d7ef48ec38e0cfb10205706ca50a8bf2e' 'a5ce463815e8d05c879dbe6a255e9f8ac2697cd3ef4242dac1e5cb331f78ed02' '204777b48cde1c4d390789f10c5e429d5295be701f68a7937a90d0ecf271c048')