From 790506db2af5a00e4dcaad7e2fe5376eb90c0c09 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Thu, 5 Dec 2024 13:39:29 +0000 Subject: [PATCH] libva: Build static library for ffmpeg static linking --- .../0002-libva-allow-static-library.patch | 20 +++++++++++ mingw-w64-libva/PKGBUILD | 36 +++++++++++++------ 2 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 mingw-w64-libva/0002-libva-allow-static-library.patch diff --git a/mingw-w64-libva/0002-libva-allow-static-library.patch b/mingw-w64-libva/0002-libva-allow-static-library.patch new file mode 100644 index 0000000000..cc5927243c --- /dev/null +++ b/mingw-w64-libva/0002-libva-allow-static-library.patch @@ -0,0 +1,20 @@ +--- a/va/meson.build ++++ b/va/meson.build +@@ -68,7 +68,7 @@ + + install_headers(libva_headers, subdir : 'va') + +-libva = shared_library( ++libva = library( + 'va', + sources : libva_sources + + libva_headers + +@@ -310,7 +310,7 @@ + + install_headers(libva_win32_headers, subdir : 'va') + +- libva_win32 = shared_library( ++ libva_win32 = library( + 'va_win32', + sources : libva_win32_sources + + libva_win32_headers, diff --git a/mingw-w64-libva/PKGBUILD b/mingw-w64-libva/PKGBUILD index e3b52496b7..8d9966cb94 100644 --- a/mingw-w64-libva/PKGBUILD +++ b/mingw-w64-libva/PKGBUILD @@ -4,7 +4,7 @@ _realname=libva pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=2.22.0 -pkgrel=1 +pkgrel=2 pkgdesc='Video Acceleration (VA) API (mingw-w64)' arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') @@ -15,32 +15,48 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-meson" "${MINGW_PACKAGE_PREFIX}-ninja" "${MINGW_PACKAGE_PREFIX}-cc") source=("${_realname}-${pkgver}.tar.gz::https://github.com/intel/libva/archive/refs/tags/${pkgver}.tar.gz" - "0001-libva-add-driver-path-relocation.patch") + "0001-libva-add-driver-path-relocation.patch" + "0002-libva-allow-static-library.patch") sha256sums=('467c418c2640a178c6baad5be2e00d569842123763b80507721ab87eb7af8735' - '1cc40ae0b25f462fa0cb4c4717ea7728e8ff0d83c13197035525ff76c0947ad3') + '1cc40ae0b25f462fa0cb4c4717ea7728e8ff0d83c13197035525ff76c0947ad3' + 'd2892f008523a24fca707b501a56141eae2aee3b2ea1d708a15cc50da6082430') prepare() { cd "${srcdir}"/${_realname}-${pkgver} patch -Np1 -i "${srcdir}/0001-libva-add-driver-path-relocation.patch" + patch -Np1 -i "${srcdir}/0002-libva-allow-static-library.patch" } build() { - mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM} - MSYS2_ARG_CONV_EXCL="--prefix=" \ - ${MINGW_PREFIX}/bin/meson.exe setup \ + meson setup \ --prefix="${MINGW_PREFIX}" \ --wrap-mode=nodownload \ --auto-features=enabled \ --buildtype=plain \ - ../${_realname}-${pkgver} + --default-library=static \ + "build-${MSYSTEM}-static" \ + "${_realname}-${pkgver}" - ${MINGW_PREFIX}/bin/meson.exe compile + meson compile -C "build-${MSYSTEM}-static" + + MSYS2_ARG_CONV_EXCL="--prefix=" \ + meson setup \ + --prefix="${MINGW_PREFIX}" \ + --wrap-mode=nodownload \ + --auto-features=enabled \ + --buildtype=plain \ + --default-library=shared \ + "build-${MSYSTEM}-shared" \ + "${_realname}-${pkgver}" + + meson compile -C "build-${MSYSTEM}-shared" } package() { - cd "${srcdir}/build-${MSYSTEM}" - DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/meson.exe install + meson install -C "build-${MSYSTEM}-static" --destdir "${pkgdir}" + meson install -C "build-${MSYSTEM}-shared" --destdir "${pkgdir}" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" }