Unverified Commit f3a4b072 authored by Moritz Sanft's avatar Moritz Sanft Committed by GitHub
Browse files

libnvidia-container: 1.17.2 -> 1.17.6 (#402488)

parents fa428010 bed3e806
Loading
Loading
Loading
Loading
+15 −18
Original line number Diff line number Diff line
@@ -12,14 +12,11 @@
  makeWrapper,
  removeReferencesTo,
  replaceVars,
  go_1_23,
  applyPatches,
  nvidia-modprobe,
  go,
}:
let
  # https://github.com/NVIDIA/libnvidia-container/pull/297
  go = go_1_23;

  modprobeVersion = "550.54.14";
  patchedModprobe = applyPatches {
    src = nvidia-modprobe.src.override {
@@ -33,15 +30,15 @@ let
    ];
  };
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "libnvidia-container";
  version = "1.17.2";
  version = "1.17.6";

  src = fetchFromGitHub {
    owner = "NVIDIA";
    repo = "libnvidia-container";
    rev = "v${version}";
    hash = "sha256-JmJKvAOEPyjVx2Frd0tAMBjnAUTMpMh1KBt6wr5RRmk=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-kveP0Px9Fds7pS39aW+cqg2jtiQCMN2zG4GTGRqRrc0=";
  };

  patches = [
@@ -65,13 +62,13 @@ stdenv.mkDerivation rec {

  postPatch = ''
    sed -i \
      -e 's/^REVISION ?=.*/REVISION = ${src.rev}/' \
      -e 's/^REVISION ?=.*/REVISION = ${finalAttrs.src.tag}/' \
      -e 's/^COMPILER :=.*/COMPILER = $(CC)/' \
      mk/common.mk

    sed -i \
      -e 's/^GIT_TAG ?=.*/GIT_TAG = ${version}/' \
      -e 's/^GIT_COMMIT ?=.*/GIT_COMMIT = ${src.rev}/' \
      -e 's/^GIT_TAG ?=.*/GIT_TAG = ${finalAttrs.version}/' \
      -e 's/^GIT_COMMIT ?=.*/GIT_COMMIT = ${finalAttrs.src.tag}/' \
      versions.mk

    mkdir -p deps/src/nvidia-modprobe-${modprobeVersion}
@@ -108,7 +105,7 @@ stdenv.mkDerivation rec {
  postFixup = ''
    for lib in libnvidia-container libnvidia-container-go; do
      rm -f "$out/lib/$lib.so"
      ln -s "$out/lib/$lib.so.${version}" "$out/lib/$lib.so.1"
      ln -s "$out/lib/$lib.so.${finalAttrs.version}" "$out/lib/$lib.so.1"
      ln -s "$out/lib/$lib.so.1" "$out/lib/$lib.so"
    done
  '';
@@ -164,20 +161,20 @@ stdenv.mkDerivation rec {
      ];
    in
    ''
      remove-references-to -t "${go}" $out/lib/libnvidia-container-go.so.${version}
      remove-references-to -t "${go}" $out/lib/libnvidia-container-go.so.${finalAttrs.version}
      wrapProgram $out/bin/nvidia-container-cli --prefix LD_LIBRARY_PATH : ${libraryPath}
    '';
  disallowedReferences = [ go ];

  meta = with lib; {
  meta = {
    homepage = "https://github.com/NVIDIA/libnvidia-container";
    description = "NVIDIA container runtime library";
    license = licenses.asl20;
    platforms = platforms.linux;
    license = lib.licenses.asl20;
    platforms = lib.platforms.linux;
    mainProgram = "nvidia-container-cli";
    maintainers = with maintainers; [
    maintainers = with lib.maintainers; [
      cpcloud
      msanft
    ];
  };
}
})