eloquent: foonathan-memory-vendor: work around the poorly designed build system

This commit is contained in:
Ben Wolsieffer 2019-12-09 22:39:31 -05:00
parent 8555484451
commit 2c19fe0545
3 changed files with 33 additions and 1 deletions

View file

@ -2,4 +2,22 @@
self:
# Distro package set
rosSelf: rosSuper: with rosSelf.lib; {
# This build system contains fractal levels of stupidity
foonathan-memory-vendor = patchVendorGit rosSuper.foonathan-memory-vendor {
url = "https://github.com/foonathan/memory.git";
sha256 = "1n7xxi61wzpixb3kldnl826syb4yml613q4i38d0cciydhy1gwzl";
fetchgitArgs = {
# Needed by the postFetch, then removed there
leaveDotGit = true;
# Prevent the build system from trying to download random files
postFetch = ''
cd "$out/cmake/comp"
git fetch https://github.com/foonathan/compatibility.git
git checkout -f cf13bff238397aab0d8c49b7f6263233cf8a2396
sed -i 's|\(set(COMP_REMOTE_URL\s\).*|\1"file://''${CMAKE_CURRENT_LIST_DIR}/")|' \
comp_base.cmake
rm -rf "$out/.git"
'';
};
};
}

View file

@ -13,7 +13,7 @@ rosSelf: rosSuper: with rosSelf.lib; {
];
});
# If anyone actually needs this package, its your problem to get it to
# If anyone actually needs this package, it's your problem to get it to
# compile.
astra-camera = null;

View file

@ -16,6 +16,20 @@ with lib;
'' + postPatch;
});
patchVendorGit = pkg: {
url, sha256,
file ? "CMakeLists.txt",
fetchgitArgs ? {}
}: pkg.overrideAttrs ({
postPatch ? "", ...
}: {
postPatch = ''
sed -i '\|GIT_REPOSITORY\s.*${escapeShellArg url}|c\
URL "${self.fetchgit ({ inherit url sha256; } // fetchgitArgs)}"' \
'${file}'
'' + postPatch;
});
patchBoostPython = pkg: pkg.overrideAttrs ({
postPatch ? "", ...
}: {