mirror of
https://github.com/terrapkg/packages.git
synced 2026-05-31 09:01:55 +00:00
Fix (ipu6-camera-hal): Redo spec for upstream changes/fix GStreamer builds (#3028)
* Fix (ipu6-camera-hal): Redo spec for upstream changes and to fix GStreamer ICameraSrc plugin * Oops forgot to bump Signed-off-by: Gil <rockgrub@protonmail.com> --------- Signed-off-by: Gil <rockgrub@protonmail.com>
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
From 50bfe3c1d2d2d357b518e5951244dd244b03ad78 Mon Sep 17 00:00:00 2001
|
||||
From: Kate Hsuan <hpa@redhat.com>
|
||||
Date: Fri, 15 Mar 2024 14:09:39 +0800
|
||||
Subject: [PATCH] Patch lib path to align fedora path usage
|
||||
|
||||
---
|
||||
src/hal/hal_adaptor/HalAdaptor.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hal/hal_adaptor/HalAdaptor.cpp b/src/hal/hal_adaptor/HalAdaptor.cpp
|
||||
index e14418a..17e9697 100644
|
||||
--- ipu6-camera-hal-8863bda8b15bef415f112700d0fb04e00a48dbee.old/cmake/libcamhal.pc.cmakein 2024-08-06 08:24:01.897232057 +0200
|
||||
+++ ipu6-camera-hal-8863bda8b15bef415f112700d0fb04e00a48dbee/cmake/libcamhal.pc.cmakein 2024-08-06 08:25:08.361731743 +0200
|
||||
@@ -1,6 +1,6 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}/@CMAKE_INSTALL_SUB_PATH@
|
||||
-libdir=${prefix}/lib/@CMAKE_INSTALL_SUB_PATH@
|
||||
+libdir=${prefix}/lib64/@CMAKE_INSTALL_SUB_PATH@
|
||||
includedir=${prefix}/include/@CMAKE_INSTALL_SUB_PATH@/libcamhal
|
||||
|
||||
Name: libcamhal
|
||||
--- a/src/hal/hal_adaptor/HalAdaptor.cpp
|
||||
+++ b/src/hal/hal_adaptor/HalAdaptor.cpp
|
||||
@@ -62,7 +62,7 @@ static void load_camera_hal_library() {
|
||||
@@ -20,6 +19,14 @@ index e14418a..17e9697 100644
|
||||
if (IPU6_UPSTREAM) {
|
||||
if (strstr(pciID, "0x7d19") != nullptr /* MTL */) {
|
||||
libName += "ipu_mtl_upstream";
|
||||
--
|
||||
2.44.0
|
||||
|
||||
--- ipu6-camera-hal-8863bda8b15bef415f112700d0fb04e00a48dbee.old/src/platformdata/PlatformData.h 2024-08-06 08:24:01.919232222 +0200
|
||||
+++ ipu6-camera-hal-8863bda8b15bef415f112700d0fb04e00a48dbee/src/platformdata/PlatformData.h 2024-08-06 08:25:08.362731750 +0200
|
||||
@@ -89,7 +89,7 @@
|
||||
#define MAX_CAMERA_NUMBER 100
|
||||
// Temporarily using current path to save aiqd file for none CAL platforms.
|
||||
#define CAMERA_CACHE_DIR "./"
|
||||
-#define CAMERA_DEFAULT_CFG_PATH "/etc/camera/"
|
||||
+#define CAMERA_DEFAULT_CFG_PATH "/usr/share/camera/"
|
||||
#define CAMERA_GRAPH_DESCRIPTOR_FILE "gcss/graph_descriptor.xml"
|
||||
#define CAMERA_GRAPH_SETTINGS_DIR "gcss/"
|
||||
#endif
|
||||
|
||||
@@ -1,28 +1,16 @@
|
||||
# Tiger Lake
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", GOTO="ipu6_tgl"
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/usr/bin/echo /usr/lib64/ipu_tgl > /etc/ld.so.conf.d/ipu6-x86_64.conf"
|
||||
# Alder Lake-N
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", GOTO="ipu6_adl"
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/usr/bin/echo /usr/lib64/ipu_adl > /etc/ld.so.conf.d/ipu6-x86_64.conf"
|
||||
# Alder Lake-P
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x462e", GOTO="ipu6_adl"
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x462e", RUN+="/usr/bin/echo /usr/lib64/ipu_adl > /etc/ld.so.conf.d/ipu6-x86_64.conf"
|
||||
# Raptor Lake-P
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0xa75d", GOTO="ipu6_adl"
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0xa75d", RUN+="/usr/bin/echo /usr/lib64/ipu_adl > /etc/ld.so.conf.d/ipu6-x86_64.conf"
|
||||
# Meteor Lake
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x7d19", GOTO="ipu6_mtl"
|
||||
|
||||
GOTO="ipu6_end"
|
||||
|
||||
LABEL="ipu6_tgl"
|
||||
RUN+="/bin/ln -sf /usr/share/defaults/etc/camera/ipu_tgl/v4l2-relayd /run/v4l2-relayd"
|
||||
GOTO="ipu6_end"
|
||||
|
||||
LABEL="ipu6_adl"
|
||||
RUN+="/bin/ln -sf /usr/share/defaults/etc/camera/ipu_adl/v4l2-relayd /run/v4l2-relayd"
|
||||
GOTO="ipu6_end"
|
||||
|
||||
LABEL="ipu6_mtl"
|
||||
RUN+="/bin/ln -sf /usr/share/defaults/etc/camera/ipu_mtl/v4l2-relayd /run/v4l2-relayd"
|
||||
GOTO="ipu6_end"
|
||||
|
||||
LABEL="ipu6_end"
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x7d19", RUN+="/usr/bin/echo /usr/lib64/ipu_mtl > /etc/ld.so.conf.d/ipu6-x86_64.conf"
|
||||
# Lunar Lake
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x645d", RUN+="/usr/bin/echo /usr/lib64/ipu_lnl > /etc/ld.so.conf.d/ipu6-x86_64.conf"
|
||||
# Jasper Lake
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x4e19", RUN+="/usr/bin/echo /usr/lib64/ipu_jsl > /etc/ld.so.conf.d/ipu6-x86_64.conf"
|
||||
|
||||
KERNEL=="ipu-psys0", TAG+="uaccess"
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
%global commit 289e645dffbd0ea633f10bb4f93855f1e4429e9a
|
||||
%global commitdate 20240509
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global build_cflags %{__build_flags_lang_c} %{?_distro_extra_cflags} -Wno-alloc-size-larger-than
|
||||
%global build_cxxflags %{__build_flags_lang_cxx} %{?_distro_extra_cxxflags} -Wno-alloc-size-larger-than
|
||||
%global __cmake_in_source_build 1
|
||||
|
||||
Name: ipu6-camera-hal
|
||||
Summary: Hardware abstraction layer for Intel IPU6
|
||||
URL: https://github.com/intel/ipu6-camera-hal
|
||||
Version: %{commitdate}.%{shortcommit}
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
License: Apache-2.0
|
||||
Source0: https://github.com/intel/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
||||
Source1: 60-intel-ipu6.rules
|
||||
@@ -15,7 +17,7 @@ Source2: v4l2-relayd-adl
|
||||
Source3: v4l2-relayd-tgl
|
||||
Source4: icamera_ipu6_isys.conf
|
||||
Source5: ipu6-driver-select.sh
|
||||
### RPM Fusion | [ipu6-camera-hal] Update to the latest commit
|
||||
### RPM Fusion | [ipu6-camera-hal] Update to the latest commit | MODIFIED
|
||||
## https://lists.rpmfusion.org/archives/list/rpmfusion-commits@lists.rpmfusion.org/thread/O6IPZMHMP7A3LQBDY4AEORTDEX4P6ESY
|
||||
Patch00: 0000-lib-path.patch
|
||||
### intel/ipu6-camera-hal | PR #113 | CMakeLists fixes
|
||||
@@ -47,7 +49,7 @@ This provides the necessary header files for IPU6 HAL development.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{name}-%{commit}
|
||||
sed -i "s|/etc/camera/|/usr/share/defaults/etc/camera/|g" \
|
||||
sed -i "s|/etc/camera/|/usr/share/camera/|g" \
|
||||
src/platformdata/PlatformData.h
|
||||
|
||||
|
||||
@@ -65,10 +67,15 @@ for i in ipu_tgl ipu_adl ipu_mtl; do
|
||||
else
|
||||
IPU_VERSION=ipu
|
||||
fi
|
||||
%cmake -DCMAKE_BUILD_TYPE=Release -DIPU_VER=$IPU_VERSION \
|
||||
-DCMAKE_INSTALL_SUB_PATH:PATH="$i" \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR:PATH="share/defaults/etc" \
|
||||
-DBUILD_CAMHAL_TESTS=OFF -DUSE_PG_LITE_PIPE=ON ..
|
||||
%cmake \
|
||||
-DBUILD_CAMHAL_ADAPTOR=ON \
|
||||
-DBUILD_CAMHAL_PLUGIN=ON \
|
||||
-DBUILD_CAMHAL_TESTS=OFF \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_SUB_PATH:PATH="$i" \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR=%{_datadir} \
|
||||
-DIPU_VER="$IPU_VERSION" \
|
||||
-DUSE_PG_LITE_PIPE=ON ..
|
||||
%make_build
|
||||
popd
|
||||
done
|
||||
@@ -79,13 +86,11 @@ mkdir hal_adaptor && pushd hal_adaptor
|
||||
%make_build
|
||||
popd
|
||||
|
||||
|
||||
%install
|
||||
for i in ipu_tgl ipu_adl ipu_mtl; do
|
||||
pushd $i
|
||||
%make_install
|
||||
rm %{buildroot}%{_libdir}/$i/libcamhal.a
|
||||
### New icamerasrc must use hal_adaptor so drop libcamhal.pc!
|
||||
rm -r %{buildroot}%{_libdir}/$i/pkgconfig
|
||||
popd
|
||||
done
|
||||
@@ -94,20 +99,22 @@ pushd hal_adaptor
|
||||
%make_install
|
||||
popd
|
||||
|
||||
### udev-rules set the ipu_xxx /run/v4l2-relayd cfg link + /dev/ipu-psys0 uaccess
|
||||
install -p -m 0644 -D %{SOURCE1} %{buildroot}%{_udevrulesdir}/60-intel-ipu6.rules
|
||||
install -Dpm 0644 %{SOURCE1} %{buildroot}%{_udevrulesdir}/60-intel-ipu6.rules
|
||||
|
||||
### v4l2-relayd configuration examples (mtl uses same config as adl)
|
||||
install -p -m 0644 %{SOURCE2} %{buildroot}%{_datadir}/defaults/etc/camera/ipu_adl/v4l2-relayd
|
||||
install -p -m 0644 %{SOURCE2} %{buildroot}%{_datadir}/defaults/etc/camera/ipu_mtl/v4l2-relayd
|
||||
install -p -m 0644 %{SOURCE3} %{buildroot}%{_datadir}/defaults/etc/camera/ipu_tgl/v4l2-relayd
|
||||
install -Dpm 0644 %{SOURCE2} %{buildroot}%{_datadir}/camera/ipu_adl/v4l2-relayd
|
||||
install -Dpm 0644 %{SOURCE2} %{buildroot}%{_datadir}/camera/ipu_mtl/v4l2-relayd
|
||||
install -Dpm 0644 %{SOURCE3} %{buildroot}%{_datadir}/camera/ipu_tgl/v4l2-relayd
|
||||
|
||||
### Make kmod-intel-ipu6 use /dev/video7 leaving /dev/video0 for loopback
|
||||
install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_modprobedir}/icamera_ipu6_isys.conf
|
||||
install -Dpm 0644 %{SOURCE4} %{buildroot}%{_modprobedir}/icamera_ipu6_isys.conf
|
||||
|
||||
### Script to switch between proprietary and foss ipu6 stacks
|
||||
install -p -D -m 0755 %{SOURCE5} %{buildroot}%{_bindir}/ipu6-driver-select
|
||||
### Script to switch between proprietary and open IPU6 stacks
|
||||
install -Dpm 0755 %{SOURCE5} %{buildroot}%{_bindir}/ipu6-driver-select
|
||||
|
||||
### Needed for GStreamer ICamera builds.
|
||||
ln -sf hal_adaptor %{buildroot}%{_includedir}/libcamhal
|
||||
ln -sf hal_adaptor.pc %{buildroot}%{_libdir}/pkgconfig/libcamhal.pc
|
||||
|
||||
%posttrans
|
||||
### Ensure that v4l2-relayd service enabled if ipu6-driver-select is installed
|
||||
@@ -120,21 +127,22 @@ if [ -S /run/udev/control ]; then
|
||||
/usr/bin/udevadm trigger /sys/devices/pci0000:00/0000:00:05.0
|
||||
fi
|
||||
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%ghost %{_sysconfdir}/modprobe.d/ipu6-driver-select.conf
|
||||
%{_bindir}/ipu6-driver-select
|
||||
%{_libdir}/*/libcamhal.so*
|
||||
%{_libdir}/ipu*/libcamhal.so*
|
||||
%{_libdir}/libhal_adaptor.so.*
|
||||
%{_datadir}/defaults
|
||||
%{_datadir}/camera
|
||||
%{_modprobedir}/icamera_ipu6_isys.conf
|
||||
%{_udevrulesdir}/60-intel-ipu6.rules
|
||||
|
||||
%files devel
|
||||
%{_includedir}/hal_adaptor
|
||||
%{_includedir}/libcamhal
|
||||
%{_libdir}/libhal_adaptor.so
|
||||
%{_libdir}/pkgconfig/hal_adaptor.pc
|
||||
%{_libdir}/pkgconfig/libcamhal.pc
|
||||
|
||||
|
||||
%changelog
|
||||
|
||||
Executable → Regular
Reference in New Issue
Block a user