Fix build issues for curl-impersonate and curl-impersonate-ff in flake.nix by adding necessary CMake patches for compatibility with CMake 4.0+. Update stream-dl.sh to remove curl-impersonate dependency.
This commit is contained in:
41
flake.nix
41
flake.nix
@@ -39,6 +39,47 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
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: {
|
||||||
|
# Patch before configure so Makefile.in is patched
|
||||||
|
postPatch = (oldAttrs.postPatch or "") + ''
|
||||||
|
# Patch Makefile.in to add CMAKE_POLICY_VERSION_MINIMUM flag
|
||||||
|
if [ -f Makefile.in ]; then
|
||||||
|
sed -i 's|cmake -DCMAKE_BUILD_TYPE=Release|cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release|g' Makefile.in
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
# Patch after configure when Makefile exists and brotli is extracted
|
||||||
|
postConfigure = (oldAttrs.postConfigure or "") + ''
|
||||||
|
# Patch brotli CMakeLists.txt after extraction
|
||||||
|
for brotli_dir in brotli-*/; do
|
||||||
|
if [ -d "$brotli_dir" ] && [ -f "$brotli_dir/CMakeLists.txt" ]; then
|
||||||
|
sed -i 's/cmake_minimum_required(VERSION [0-9.]\+)/cmake_minimum_required(VERSION 3.5)/g' "$brotli_dir/CMakeLists.txt"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# Also patch the generated Makefile
|
||||||
|
if [ -f Makefile ]; then
|
||||||
|
sed -i 's|cmake -DCMAKE_BUILD_TYPE=Release|cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release|g' Makefile
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
# Also fix curl-impersonate if it has the same issue
|
||||||
|
curl-impersonate = prev.curl-impersonate.overrideAttrs (oldAttrs: {
|
||||||
|
postPatch = (oldAttrs.postPatch or "") + ''
|
||||||
|
if [ -f Makefile.in ]; then
|
||||||
|
sed -i 's|cmake -DCMAKE_BUILD_TYPE=Release|cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release|g' Makefile.in
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
postConfigure = (oldAttrs.postConfigure or "") + ''
|
||||||
|
for brotli_dir in brotli-*/; do
|
||||||
|
if [ -d "$brotli_dir" ] && [ -f "$brotli_dir/CMakeLists.txt" ]; then
|
||||||
|
sed -i 's/cmake_minimum_required(VERSION [0-9.]\+)/cmake_minimum_required(VERSION 3.5)/g' "$brotli_dir/CMakeLists.txt"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -f Makefile ]; then
|
||||||
|
sed -i 's|cmake -DCMAKE_BUILD_TYPE=Release|cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release|g' Makefile
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
});
|
||||||
};
|
};
|
||||||
packages.x86_64-linux =
|
packages.x86_64-linux =
|
||||||
let
|
let
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#! nix-shell -i bash -p bash yt-dlp curl-impersonate
|
#! nix-shell -i bash -p bash yt-dlp
|
||||||
|
|
||||||
minutes=5
|
minutes=5
|
||||||
time_alive=60
|
time_alive=60
|
||||||
|
|||||||
Reference in New Issue
Block a user