From 6e556daefc3a146c8f438b6f362b982f85c90e33 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Thu, 9 Jul 2026 16:41:56 +0300 Subject: [PATCH] Initial commit --- .gitignore | 3 + check-version.sh | 4 ++ info.yml | 40 +++++++++++ recipe.sh | 70 +++++++++++++++++++ ...-media-sdk-libcttmetrics-static-only.patch | 12 ++++ .../030-intel-media-sdk-gcc13-fix.patch | 10 +++ .../040-intel-media-sdk-gcc15-fix.patch | 17 +++++ 7 files changed, 156 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 info.yml create mode 100644 recipe.sh create mode 100644 source-files/020-intel-media-sdk-libcttmetrics-static-only.patch create mode 100644 source-files/030-intel-media-sdk-gcc13-fix.patch create mode 100644 source-files/040-intel-media-sdk-gcc15-fix.patch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d96df7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignore BPM archives and signatures +*.bpm +*.bpm.sig diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..cd89e29 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Ignore this package +echo "ignore" diff --git a/info.yml b/info.yml new file mode 100644 index 0000000..9d6416a --- /dev/null +++ b/info.yml @@ -0,0 +1,40 @@ +name: intel-media-sdk +description: Legacy API for hardware video acceleration on Intel GPUs (Broadwell to Rocket Lake) +version: 23.2.2 +revision: 1 +url: https://github.com/Intel-Media-SDK/MediaSDK/ +license: MIT +maintainers: + - enumdev@enumerated.dev +architecture: any +type: source +make_depends: + - cmake + - intel-media-driver + - libdrm + - libpciaccess + - libva + - libx11 + - libxcb + - python3 + - wayland +downloads: + - url: https://github.com/Intel-Media-SDK/MediaSDK/archive/refs/tags/intel-mediasdk-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 12f23a78104edc1c9bfa755effd2723866d107ad752f72d3839fcc8db0503cec +split_packages: + - name: intel-media-sdk + depends: + - gcc-libs + - glibc + - intel-media-driver + - libdrm + - libmfx + - libva + - wayland + - name: libmfx + description: Intel Media SDK dispatcher library + depends: + - gcc-libs + - glibc diff --git a/recipe.sh b/recipe.sh new file mode 100644 index 0000000..9c1a9c2 --- /dev/null +++ b/recipe.sh @@ -0,0 +1,70 @@ +# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + patch -Np1 -i "$BPM_WORKDIR"/020-intel-media-sdk-libcttmetrics-static-only.patch + patch -Np1 -i "$BPM_WORKDIR"/030-intel-media-sdk-gcc13-fix.patch + patch -Np1 -i "$BPM_WORKDIR"/040-intel-media-sdk-gcc15-fix.patch +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_ALL=ON \ + -DBUILD_TOOLS=ON \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DENABLE_ITT=OFF \ + -DENABLE_OPENCL=OFF \ + -DENABLE_WAYLAND=ON \ + -DENABLE_X11_DRI3=ON \ + -DMFX_APPS_DIR="/usr/lib/mfx" \ + -Wno-dev + cmake --build build +} + +# The check function is executed in the source directory +# This function is used to run tests to verify the package has been compiled correctly +check() { + ctest --test-dir build --output-on-failure +} + +_pick() { + local p="$1" f d; shift + for f; do + [ -d "$BPM_WORKDIR"/output_"$p" ] || { echo "Split package $p not found"; exit 1; } + d="$BPM_WORKDIR"/output_"$p"/"${f#$BPM_OUTPUT}" + mkdir -p "$(dirname "$d")" + mv "$f" "$d" + rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")" + done +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package_intel-media-sdk() { + DESTDIR="$BPM_OUTPUT" cmake --install build + + # Move file + mv "$BPM_OUTPUT"/usr/lib/libcttmetrics.a "$BPM_OUTPUT"/usr/lib/mfx/samples/libcttmetrics.a + + cd "$BPM_OUTPUT" + + # Move libmfx files into split package + _pick libmfx usr/include/mfx + _pick libmfx usr/lib/libmfx.so* + _pick libmfx usr/lib/pkgconfig/{,lib}mfx.pc + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/intel-media-sdk/LICENSE +} + +package_libmfx() { + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/libmfx/LICENSE +} diff --git a/source-files/020-intel-media-sdk-libcttmetrics-static-only.patch b/source-files/020-intel-media-sdk-libcttmetrics-static-only.patch new file mode 100644 index 0000000..ad2dba8 --- /dev/null +++ b/source-files/020-intel-media-sdk-libcttmetrics-static-only.patch @@ -0,0 +1,12 @@ +--- a/samples/metrics_monitor/CMakeLists.txt ++++ b/samples/metrics_monitor/CMakeLists.txt +@@ -11,8 +11,7 @@ if( PKG_LIBDRM_FOUND AND ("${PKG_LIBDRM_VERSION}" VERSION_GREATER 2.4.91)) + + set(DEPENDENCIES libdrm ) + +- make_library( cttmetrics none shared ) +- make_library( cttmetrics_static none static ) ++ make_library( cttmetrics none static ) + + install( TARGETS cttmetrics LIBRARY DESTINATION ${MFX_SAMPLES_INSTALL_BIN_DIR} ) + diff --git a/source-files/030-intel-media-sdk-gcc13-fix.patch b/source-files/030-intel-media-sdk-gcc13-fix.patch new file mode 100644 index 0000000..8033d0f --- /dev/null +++ b/source-files/030-intel-media-sdk-gcc13-fix.patch @@ -0,0 +1,10 @@ +--- a/api/mfx_dispatch/linux/mfxparser.cpp ++++ b/api/mfx_dispatch/linux/mfxparser.cpp +@@ -23,6 +23,7 @@ + #include + #include + ++#include + #include + + #include "mfxloader.h" diff --git a/source-files/040-intel-media-sdk-gcc15-fix.patch b/source-files/040-intel-media-sdk-gcc15-fix.patch new file mode 100644 index 0000000..55cb688 --- /dev/null +++ b/source-files/040-intel-media-sdk-gcc15-fix.patch @@ -0,0 +1,17 @@ +--- a/samples/sample_vpp/src/sample_vpp_frc_adv.cpp ++++ b/samples/sample_vpp/src/sample_vpp_frc_adv.cpp +@@ -17,6 +17,7 @@ The original version of this sample may + or https://software.intel.com/en-us/media-client-solutions-support. + \**********************************************************************************/ + ++#include + #include + #include "vm/strings_defs.h" + #include "sample_vpp_frc_adv.h" +@@ -212,4 +213,4 @@ mfxU64 FRCAdvancedChecker::GetExpectedP + + } // mfxU64 FRCAdvancedChecker::GetExpectedPTS( mfxU32 frameNumber, mfxU64 timeOffset, mfxU64 timeJump ) + +-/* EOF */ +\ No newline at end of file ++/* EOF */