Unverified Commit 14b1b887 authored by Florian Klink's avatar Florian Klink Committed by GitHub
Browse files

Merge pull request #268618 from Princemachiavelli/linux_6_6_ipu6

nixos/hardware/ipu6: update all related packages
parents 384d12a4 85169ed6
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -13,11 +13,12 @@ in
    enable = mkEnableOption (lib.mdDoc "support for Intel IPU6/MIPI cameras");

    platform = mkOption {
      type = types.enum [ "ipu6" "ipu6ep" ];
      type = types.enum [ "ipu6" "ipu6ep" "ipu6epmtl" ];
      description = lib.mdDoc ''
        Choose the version for your hardware platform.

        Use `ipu6` for Tiger Lake and `ipu6ep` for Alder Lake respectively.
        Use `ipu6` for Tiger Lake, `ipu6ep` for Alder Lake or Raptor Lake,
        and `ipu6epmtl` for Meteor Lake.
      '';
    };

@@ -29,9 +30,7 @@ in
      ipu6-drivers
    ];

    hardware.firmware = with pkgs; [ ]
      ++ optional (cfg.platform == "ipu6") ipu6-camera-bin
      ++ optional (cfg.platform == "ipu6ep") ipu6ep-camera-bin;
    hardware.firmware = [ pkgs.ipu6-camera-bins ];

    services.udev.extraRules = ''
      SUBSYSTEM=="intel-ipu6-psys", MODE="0660", GROUP="video"
@@ -44,14 +43,13 @@ in

      extraPackages = with pkgs.gst_all_1; [ ]
        ++ optional (cfg.platform == "ipu6") icamerasrc-ipu6
        ++ optional (cfg.platform == "ipu6ep") icamerasrc-ipu6ep;
        ++ optional (cfg.platform == "ipu6ep") icamerasrc-ipu6ep
        ++ optional (cfg.platform == "ipu6epmtl") icamerasrc-ipu6epmtl;

      input = {
        pipeline = "icamerasrc";
        format = mkIf (cfg.platform == "ipu6ep") (mkDefault "NV12");
        format = mkIf (cfg.platform != "ipu6") (mkDefault "NV12");
      };
    };

  };

}
+4 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
, Security
, VideoToolbox
, ipu6ep-camera-hal
, ipu6epmtl-camera-hal
}:

{
@@ -47,6 +48,9 @@
  icamerasrc-ipu6ep = callPackage ./icamerasrc {
    ipu6-camera-hal = ipu6ep-camera-hal;
  };
  icamerasrc-ipu6epmtl = callPackage ./icamerasrc {
    ipu6-camera-hal = ipu6epmtl-camera-hal;
  };

  # note: gst-python is in ../../python-modules/gst-python - called under python3Packages
}
+4 −4
Original line number Diff line number Diff line
@@ -8,15 +8,15 @@
, libdrm
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation {
  pname = "icamerasrc-${ipu6-camera-hal.ipuVersion}";
  version = "unstable-2023-03-09";
  version = "unstable-2023-10-23";

  src = fetchFromGitHub {
    owner = "intel";
    repo = "icamerasrc";
    rev = "17841ab6249aaa69bd9b3959262bf182dee74111";
    hash = "sha256-j8ZYe4nyy5yfo10CGeXDwbAaAPvdr0ptMWB8hQDyESQ=";
    rev = "528a6f177732def4d5ebc17927220d8823bc8fdc";
    hash = "sha256-Ezcm5OpF/NKvJf5sFeJyvNc2Uq0166GukC9MuNUV2Fs=";
  };

  nativeBuildInputs = [
+26 −15
Original line number Diff line number Diff line
@@ -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; {
+9 −28
Original line number Diff line number Diff line
@@ -4,26 +4,19 @@
, autoPatchelfHook
, expat
, zlib

# Pick one of
# - ipu6 (Tiger Lake)
# - ipu6ep (Alder Lake)
, ipuVersion ? "ipu6"
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "${ipuVersion}-camera-bin";
  version = "unstable-2023-02-08";
  pname = "ipu6-camera-bins";
  version = "unstable-2023-10-26";

  src = fetchFromGitHub {
    owner = "intel";
    repo = "ipu6-camera-bins";
    rev = "276859fc6de83918a32727d676985ec40f31af2b";
    hash = "sha256-QnedM2UBbGyd2wIF762Mi+VkDZYtC6MifK4XGGxlUzw=";
    rev = "af5ba0cb4a763569ac7514635013e9d870040bcf";
    hash = "sha256-y0pT5M7AKACbquQWLZPYpTPXRC5hipLNL61nhs+cst4=";
  };

  sourceRoot = "${finalAttrs.src.name}/${ipuVersion}";

  nativeBuildInputs = [
    autoPatchelfHook
    stdenv.cc.cc.lib
@@ -40,32 +33,20 @@ stdenv.mkDerivation (finalAttrs: {
      include \
      $out/

    install -m 0644 -D ../LICENSE $out/share/doc/LICENSE
    install -m 0644 -D LICENSE $out/share/doc/LICENSE

    runHook postInstall
  '';

  postFixup = ''
    for pcfile in $out/lib/pkgconfig/*.pc; do
    for pcfile in $out/lib/*/pkgconfig/*.pc; do
      substituteInPlace $pcfile \
        --replace 'exec_prefix=/usr' 'exec_prefix=''${prefix}' \
        --replace 'prefix=/usr' "prefix=$out" \
        --replace 'libdir=/usr/lib' 'libdir=''${prefix}/lib' \
        --replace 'includedir=/usr/include' 'includedir=''${prefix}/include'
        --replace 'prefix=/usr' "prefix=$out"
    done
  '';

  passthru = {
    inherit ipuVersion;
  };

  meta = let
    generation = {
      ipu6 = "Tiger Lake";
      ipu6ep = "Alder Lake";
    }.${ipuVersion};
  in with lib; {
    description = "${generation} IPU firmware and proprietary image processing libraries";
  meta = with lib; {
    description = "IPU firmware and proprietary image processing libraries";
    homepage = "https://github.com/intel/ipu6-camera-bins";
    license = licenses.issl;
    sourceProvenance = with sourceTypes; [
Loading