about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-07-24 22:13:22 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-07-24 22:13:22 +0200
commit228841e04c7cc7038732f0cdbcb61c1f65e18d0d (patch)
treee6b41c65037f71ed4a813d378cf1ee2b1ccecab1
parentpkgs/i3status-rust: Inline the patches (diff)
downloadnixos-config-228841e04c7cc7038732f0cdbcb61c1f65e18d0d.zip
pkgs/yt: 1.7.1 -> 1.8.0
-rw-r--r--pkgs/by-name/yt/yt/package.nix50
1 files changed, 21 insertions, 29 deletions
diff --git a/pkgs/by-name/yt/yt/package.nix b/pkgs/by-name/yt/yt/package.nix
index 63a37a47..b17e9120 100644
--- a/pkgs/by-name/yt/yt/package.nix
+++ b/pkgs/by-name/yt/yt/package.nix
@@ -15,14 +15,13 @@
   gitUpdater,
   # buildInputs
   mpv-unwrapped,
-  python3Packages,
-  python3,
   ffmpeg,
   openssl,
   libffi,
   zlib,
   curl,
   # NativeBuildInputs
+  python3,
   makeWrapper,
   llvmPackages_latest,
   glibc,
@@ -32,7 +31,8 @@
   pkg-config,
   SDL2,
 }: let
-  version = "1.7.1";
+  version = "1.8.0";
+  python = python3.withPackages (ps: [ps.yt-dlp]);
 in
   rustPlatform.buildRustPackage (finalAttrs: {
     inherit version;
@@ -41,17 +41,19 @@ in
     src = fetchgit {
       url = "https://git.foss-syndicate.org/bpeetz/clients/yt";
       tag = "v${version}";
-      hash = "sha256-FKEMbxJI7OOXakY/JMyoz1rVU57xPuJ49m/JsB2b5Cc=";
+      hash = "sha256-J1fGNV/0vjNzF/no7ffE4Sxyr3g5/zDzb2EPcSiqN2o=";
     };
 
+    cargoHash = "sha256-U7yLOhrDBnzNotW+zWjR9s0VzoropSJneo3LPn9VcAA=";
+
     buildInputs = [
-      python3Packages.yt-dlp
       mpv-unwrapped.dev
       ffmpeg
       openssl
       libffi
       zlib
       curl.dev
+      python
     ];
 
     nativeBuildInputs = [
@@ -81,6 +83,9 @@ in
       # Required by yt_dlp
       FFMPEG_LOCATION = "${lib.getExe ffmpeg}";
 
+      # Tell pyo3 which python to use.
+      PYO3_PYTHON = lib.getExe python;
+
       # Needed for the libmpv2.
       C_INCLUDE_PATH = "${glibc.dev}/include";
       LIBCLANG_INCLUDE_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/clang/${clang_version}/include";
@@ -88,34 +93,22 @@ in
     };
 
     doCheck = true;
+    checkFlags = [
+      # All of these tests try to connect to the internet to download test data.
+      "--skip=select::base::test_base"
+      "--skip=select::file::test_file"
+      "--skip=select::options::test_options"
+      "--skip=subscriptions::import_export::test_import_export"
+      "--skip=subscriptions::naming_subscriptions::test_naming_subscriptions"
+      "--skip=videos::downloading::test_downloading"
+    ];
 
     prePatch = ''
       # Generate the sqlite db, so that we can run the comp-time sqlite checks.
       bash ./scripts/mkdb.sh
     '';
 
-    cargoHash = "sha256-E5kMlXIoagidovGonTqbz9SMmvgKitJ9+zZW9U8WK7s=";
-
-    postInstall = let
-      collectDeps = pkg: let
-        next = pkg.propagatedBuildInputs or [];
-      in
-        [pkg]
-        ++ next
-        ++ (lib.flatten (builtins.map collectDeps next));
-
-      loadPythonDep = der: "${der}/lib/python${lib.versions.majorMinor python3.version}/site-packages";
-
-      pythonPath = builtins.concatStringsSep ":" (lib.lists.unique (
-        builtins.map loadPythonDep (
-          (collectDeps python3Packages.yt-dlp)
-          ++ [
-            # HACK(@bpeetz): These packages are not picked up in the traversal up top. <2025-06-16>
-            python3Packages.chardet
-          ]
-        )
-      ));
-    in ''
+    postInstall = ''
       installShellCompletion --cmd yt \
         --bash <(COMPLETE=bash $out/bin/yt) \
         --fish <(COMPLETE=fish $out/bin/yt) \
@@ -124,7 +117,6 @@ in
       # NOTE: We cannot clear the path, because we need access to the $EDITOR. <2025-04-04>
       wrapProgram $out/bin/yt \
         --prefix PATH : ${lib.makeBinPath finalAttrs.buildInputs} \
-        --set YTDLP_NO_PLUGINS 1 \
-        --set PYTHONPATH ${pythonPath}
+        --set YTDLP_NO_PLUGINS 1
     '';
   })