stream-dl fixed?
This commit is contained in:
44
flake.nix
44
flake.nix
@@ -39,10 +39,52 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
download = _final.python3Packages.download;
|
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 =
|
packages.x86_64-linux =
|
||||||
let
|
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 =
|
pkgsBin =
|
||||||
path: _name:
|
path: _name:
|
||||||
let
|
let
|
||||||
|
|||||||
Reference in New Issue
Block a user