about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/ipu6-camera-hal
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-01-20 12:31:50 +0100
committerAlyssa Ross <hi@alyssa.is>2024-01-20 12:32:25 +0100
commitb7baf40e099b4215181fe7b0c63083b12ef2c7fb (patch)
treea6efabd31d05b6d0a36624729e80377bbbfb0149 /nixpkgs/pkgs/development/libraries/ipu6-camera-hal
parent710028664e26e85cb831a869b3da9f6993902255 (diff)
parent0799f514b1cd74878174939df79ac60ca5036673 (diff)
downloadnixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.gz
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.bz2
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.lz
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.xz
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.zst
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/ipu6-camera-hal')
-rw-r--r--nixpkgs/pkgs/development/libraries/ipu6-camera-hal/default.nix41
1 files changed, 26 insertions, 15 deletions
diff --git a/nixpkgs/pkgs/development/libraries/ipu6-camera-hal/default.nix b/nixpkgs/pkgs/development/libraries/ipu6-camera-hal/default.nix
index 7fce11d21a43..3ec63fd0807d 100644
--- a/nixpkgs/pkgs/development/libraries/ipu6-camera-hal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ipu6-camera-hal/default.nix
@@ -8,20 +8,32 @@
 
 # runtime
 , expat
-, ipu6-camera-bin
+, ipu6-camera-bins
 , libtool
 , gst_all_1
-}:
 
+# Pick one of
+# - ipu6 (Tiger Lake)
+# - ipu6ep (Alder Lake)
+# - ipu6epmtl (Meteor Lake)
+, ipuVersion ? "ipu6"
+}:
+let
+  ipuTarget = {
+    "ipu6" = "ipu_tgl";
+    "ipu6ep" = "ipu_adl";
+    "ipu6epmtl" = "ipu_mtl";
+  }.${ipuVersion};
+in
 stdenv.mkDerivation {
-  pname = "${ipu6-camera-bin.ipuVersion}-camera-hal";
-  version = "unstable-2023-02-08";
+  pname = "${ipuVersion}-camera-hal";
+  version = "unstable-2023-09-25";
 
   src = fetchFromGitHub {
     owner = "intel";
     repo = "ipu6-camera-hal";
-    rev = "884b81aae0ea19a974eb8ccdaeef93038136bdd4";
-    hash = "sha256-AePL7IqoOhlxhfPRLpCman5DNh3wYS4MUcLgmgBUcCM=";
+    rev = "9fa05a90886d399ad3dda4c2ddc990642b3d20c9";
+    hash = "sha256-yS1D7o6dsQ4FQkjfwcisOxcP7Majb+4uQ/iW5anMb5c=";
   };
 
   nativeBuildInputs = [
@@ -29,25 +41,23 @@ stdenv.mkDerivation {
     pkg-config
   ];
 
+  PKG_CONFIG_PATH = "${lib.makeLibraryPath [ ipu6-camera-bins ]}/${ipuTarget}/pkgconfig";
+
   cmakeFlags = [
-    "-DIPU_VER=${ipu6-camera-bin.ipuVersion}"
+    "-DIPU_VER=${ipuVersion}"
     # missing libiacss
     "-DUSE_PG_LITE_PIPE=ON"
-    # missing libipu4
-    "-DENABLE_VIRTUAL_IPU_PIPE=OFF"
   ];
 
   NIX_CFLAGS_COMPILE = [
     "-Wno-error"
-    "-I${lib.getDev ipu6-camera-bin}/include/ia_imaging"
-    "-I${lib.getDev ipu6-camera-bin}/include/ia_camera"
   ];
 
   enableParallelBuilding = true;
 
   buildInputs = [
     expat
-    ipu6-camera-bin
+    ipu6-camera-bins
     libtool
     gst_all_1.gstreamer
     gst_all_1.gst-plugins-base
@@ -59,12 +69,13 @@ stdenv.mkDerivation {
   '';
 
   postFixup = ''
-    substituteInPlace $out/lib/pkgconfig/libcamhal.pc \
-      --replace 'prefix=/usr' "prefix=$out"
+    for lib in $out/lib/*.so; do
+      patchelf --add-rpath "${lib.makeLibraryPath [ ipu6-camera-bins ]}/${ipuTarget}" $lib
+    done
   '';
 
   passthru = {
-    inherit (ipu6-camera-bin) ipuVersion;
+    inherit ipuVersion;
   };
 
   meta = with lib; {