mirror of
https://github.com/lopsided98/nix-ros-overlay.git
synced 2025-06-12 02:34:50 +03:00
34 lines
882 B
Nix
34 lines
882 B
Nix
{ lib ? rosSelf.lib or self.lib
|
|
, self ? null
|
|
, rosSelf ? null }:
|
|
with lib;
|
|
{
|
|
patchVendorUrl = pkg: {
|
|
url, sha256,
|
|
originalUrl ? url,
|
|
file ? "CMakeLists.txt"
|
|
}: pkg.overrideAttrs ({
|
|
postPatch ? "", ...
|
|
}: {
|
|
postPatch = ''
|
|
substituteInPlace '${file}' \
|
|
--replace '${originalUrl}' '${self.fetchurl { inherit url sha256; }}'
|
|
'' + postPatch;
|
|
});
|
|
|
|
patchBoostPython = let
|
|
pythonVersion = rosSelf.python.sourceVersion;
|
|
pythonLib = "python${pythonVersion.major}${pythonVersion.minor}";
|
|
in ''
|
|
sed -Ei CMakeLists.txt \
|
|
-e 's/(Boost [^)]*)python[^ )]*([ )])/\1${pythonLib}\2/'
|
|
'';
|
|
|
|
patchBoostSignals = pkg: pkg.overrideAttrs ({
|
|
postPatch ? "", ...
|
|
}: {
|
|
postPatch = ''
|
|
sed -i '/find_package(Boost [^)]*/s/signals//g' CMakeLists.txt
|
|
'' + postPatch;
|
|
});
|
|
} // (import ./mk-overlay.nix { inherit lib; })
|