stream-dl fixed?

This commit is contained in:
Danilo Reyes
2025-12-20 17:47:22 -06:00
parent 5f3418f061
commit 3d86a2b288

View File

@@ -39,10 +39,52 @@
};
};
download = _final.python3Packages.download;
# Fix curl-impersonate-ff build issue with CMake 4.0+ requiring CMake >= 3.5
curl-impersonate-ff = prev.curl-impersonate-ff.overrideAttrs (oldAttrs: {
postPatch = (oldAttrs.postPatch or "") + ''
# Fix brotli CMake build by adding CMAKE_POLICY_VERSION_MINIMUM flag
substituteInPlace Makefile.in \
--replace 'cmake -DCMAKE_BUILD_TYPE=Release' 'cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release'
'';
});
# Also fix curl-impersonate if it has the same issue
curl-impersonate = prev.curl-impersonate.overrideAttrs (oldAttrs: {
postPatch = (oldAttrs.postPatch or "") + ''
# Fix brotli CMake build by adding CMAKE_POLICY_VERSION_MINIMUM flag
substituteInPlace Makefile.in \
--replace 'cmake -DCMAKE_BUILD_TYPE=Release' 'cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release'
'';
});
};
packages.x86_64-linux =
let
scriptBin = path: name: pkgs.writeScriptBin name (builtins.readFile path);
# Handle nix-shell shebangs by extracting packages and using writeShellApplication
scriptBin = path: name:
let
content = builtins.readFile path;
# Match the nix-shell package line: #! nix-shell -i bash -p package1 package2 ...
nixShellMatch = builtins.match ".*#! nix-shell -i [^ ]+ -p ([^\n]+).*" content;
in
if nixShellMatch != null then
let
packagesStr = builtins.head nixShellMatch;
# Split by spaces and filter empty strings
packages = builtins.filter (s: s != "") (pkgs.lib.splitString " " packagesStr);
# Get package references from pkgs
runtimeInputs = builtins.map (pkgName: pkgs.${pkgName}) packages;
# Remove the nix-shell shebang lines
scriptContent = builtins.replaceStrings
[ "#!/usr/bin/env nix-shell\n" "#! nix-shell -i bash -p ${packagesStr}\n" ]
[ "" "" ]
content;
in
pkgs.writeShellApplication {
inherit name;
runtimeInputs = runtimeInputs;
text = scriptContent;
}
else
pkgs.writeScriptBin name content;
pkgsBin =
path: _name:
let