about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorAleksana2024-07-06 17:24:55 +0800
committerGitHub2024-07-06 17:24:55 +0800
commit2d6884fa81a2a385aa17002436dc6bbcd2e293a9 (patch)
tree1755fe47ac4d03e7d2adaeb9c10c1aebc0060e48 /pkgs
parent951a65b25b665b53378f02bbc9008266f596d6e0 (diff)
parent01f7c8a1a317171a5a1b84086e955e0c28900523 (diff)
Merge pull request #324199 from atorres1985-contrib/nv-codec-headers-master
nv-codec-headers: recreate under by-name
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/nv/nv-codec-headers/package.nix38
-rw-r--r--pkgs/by-name/nv/nv-codec-headers/sources.nix42
-rw-r--r--pkgs/development/libraries/nv-codec-headers/default.nix32
-rw-r--r--pkgs/development/libraries/nv-codec-headers/make-nv-codec-headers.nix32
-rw-r--r--pkgs/top-level/all-packages.nix14
5 files changed, 84 insertions, 74 deletions
diff --git a/pkgs/by-name/nv/nv-codec-headers/package.nix b/pkgs/by-name/nv/nv-codec-headers/package.nix
new file mode 100644
index 000000000000..cb0c222434ce
--- /dev/null
+++ b/pkgs/by-name/nv/nv-codec-headers/package.nix
@@ -0,0 +1,38 @@
+{
+  lib,
+  callPackage,
+  stdenvNoCC,
+  # Configurable options
+  sources ? callPackage ./sources.nix { },
+  majorVersion ? "9",
+}:
+
+let
+  pick = {
+    "8" = sources.nv-codec-headers-8;
+    "9" = sources.nv-codec-headers-9;
+    "10" = sources.nv-codec-headers-10;
+    "11" = sources.nv-codec-headers-11;
+    "12" = sources.nv-codec-headers-12;
+  }.${majorVersion};
+in
+stdenvNoCC.mkDerivation {
+  inherit (pick) pname version src;
+
+  makeFlags = [
+    "PREFIX=$(out)"
+  ];
+
+  passthru = {
+    inherit sources;
+  };
+
+  meta = {
+    description = "FFmpeg version of headers for NVENC - version ${pick.version}";
+    homepage = "https://ffmpeg.org/";
+    downloadPage = "https://git.videolan.org/?p=ffmpeg/nv-codec-headers.git";
+    license = with lib.licenses; [ mit ];
+    maintainers = with lib.maintainers; [ AndersonTorres ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/pkgs/by-name/nv/nv-codec-headers/sources.nix b/pkgs/by-name/nv/nv-codec-headers/sources.nix
new file mode 100644
index 000000000000..cc3d1bce5a61
--- /dev/null
+++ b/pkgs/by-name/nv/nv-codec-headers/sources.nix
@@ -0,0 +1,42 @@
+{
+  fetchgit,
+}:
+
+let
+  nv-codec-headers-template =
+    {
+      version,
+      hash,
+    }:
+    {
+      pname = "nv-codec-headers";
+      inherit version;
+      src = fetchgit {
+        url = "https://git.videolan.org/git/ffmpeg/nv-codec-headers.git";
+        rev = "n${version}";
+        inherit hash;
+      };
+    };
+in
+{
+  nv-codec-headers-8 = nv-codec-headers-template {
+    version = "8.2.15.2";
+    hash = "sha256-TKYT8vXqnUpq+M0grDeOR37n/ffqSWDYTrXIbl++BG4=";
+  };
+  nv-codec-headers-9 = nv-codec-headers-template {
+    version = "9.1.23.1";
+    hash = "sha256-kF5tv8Nh6I9x3hvSAdKLakeBVEcIiXFY6o6bD+tY2/U=";
+  };
+  nv-codec-headers-10 = nv-codec-headers-template {
+    version = "10.0.26.2";
+    hash = "sha256-BfW+fmPp8U22+HK0ZZY6fKUjqigWvOBi6DmW7SSnslg=";
+  };
+  nv-codec-headers-11 = nv-codec-headers-template {
+    version = "11.1.5.2";
+    hash = "sha256-KzaqwpzISHB7tSTruynEOJmSlJnAFK2h7/cRI/zkNPk=";
+  };
+  nv-codec-headers-12 = nv-codec-headers-template {
+    version = "12.1.14.0";
+    hash = "sha256-WJYuFmMGSW+B32LwE7oXv/IeTln6TNEeXSkquHh85Go=";
+  };
+}
diff --git a/pkgs/development/libraries/nv-codec-headers/default.nix b/pkgs/development/libraries/nv-codec-headers/default.nix
deleted file mode 100644
index b582548d79f5..000000000000
--- a/pkgs/development/libraries/nv-codec-headers/default.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-{ lib
-, fetchgit
-, stdenvNoCC
-}:
-
-let
-  make-nv-codec-headers = (import ./make-nv-codec-headers.nix) {
-    inherit lib fetchgit stdenvNoCC;
-  };
-in
-{
-  nv-codec-headers-8 = make-nv-codec-headers {
-    version = "8.2.15.2";
-    hash = "sha256-TKYT8vXqnUpq+M0grDeOR37n/ffqSWDYTrXIbl++BG4=";
-  };
-  nv-codec-headers-9 = make-nv-codec-headers {
-    version = "9.1.23.1";
-    hash = "sha256-kF5tv8Nh6I9x3hvSAdKLakeBVEcIiXFY6o6bD+tY2/U=";
-  };
-  nv-codec-headers-10 = make-nv-codec-headers {
-    version = "10.0.26.2";
-    hash = "sha256-BfW+fmPp8U22+HK0ZZY6fKUjqigWvOBi6DmW7SSnslg=";
-  };
-  nv-codec-headers-11 = make-nv-codec-headers {
-    version = "11.1.5.2";
-    hash = "sha256-KzaqwpzISHB7tSTruynEOJmSlJnAFK2h7/cRI/zkNPk=";
-  };
-  nv-codec-headers-12 = make-nv-codec-headers {
-    version = "12.1.14.0";
-    hash = "sha256-WJYuFmMGSW+B32LwE7oXv/IeTln6TNEeXSkquHh85Go=";
-  };
-}
diff --git a/pkgs/development/libraries/nv-codec-headers/make-nv-codec-headers.nix b/pkgs/development/libraries/nv-codec-headers/make-nv-codec-headers.nix
deleted file mode 100644
index b6bdc6dd58d7..000000000000
--- a/pkgs/development/libraries/nv-codec-headers/make-nv-codec-headers.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-{ lib
-, stdenvNoCC
-, fetchgit
-}:
-
-{ pname ? "nv-codec-headers"
-, version
-, hash
-}:
-
-stdenvNoCC.mkDerivation {
-  inherit pname version;
-
-  src = fetchgit {
-    url = "https://git.videolan.org/git/ffmpeg/nv-codec-headers.git";
-    rev = "n${version}";
-    inherit hash;
-  };
-
-  makeFlags = [
-    "PREFIX=$(out)"
-  ];
-
-  meta = {
-    description = "FFmpeg version of headers for NVENC";
-    homepage = "https://ffmpeg.org/";
-    downloadPage = "https://git.videolan.org/?p=ffmpeg/nv-codec-headers.git";
-    license = with lib.licenses; [ mit ];
-    maintainers = with lib.maintainers; [ AndersonTorres ];
-    platforms = lib.platforms.all;
-  };
-}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 2498822c47fd..b2f8ea7e525b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -23368,16 +23368,10 @@ with pkgs;
   nuspell = callPackage ../development/libraries/nuspell { };
   nuspellWithDicts = dicts: callPackage ../development/libraries/nuspell/wrapper.nix { inherit dicts; };
 
-  # splicing magic
-  nv-codec-headers-versions = callPackages ../development/libraries/nv-codec-headers { };
-  inherit (nv-codec-headers-versions)
-    nv-codec-headers-9
-    nv-codec-headers-10
-    nv-codec-headers-11
-    nv-codec-headers-12
-  ;
-  # A default nv-codec-headers to make people happy
-  nv-codec-headers = nv-codec-headers-versions.nv-codec-headers-9;
+  nv-codec-headers-9 = nv-codec-headers.override { majorVersion = "9"; };
+  nv-codec-headers-10 = nv-codec-headers.override { majorVersion = "10"; };
+  nv-codec-headers-11 = nv-codec-headers.override { majorVersion = "11"; };
+  nv-codec-headers-12 = nv-codec-headers.override { majorVersion = "12"; };
 
   nvidiaCtkPackages =
     callPackage ../by-name/nv/nvidia-container-toolkit/packages.nix