overrides.gdal: disable python bindings in gdal from nixpkgs

This collides with the version built from pypi, and if the version
mismatches the build process attempts an uninstall of the nixpkgs
gdal package.

We can avoid this by only building the native library and ignore the Python bindings.
This commit is contained in:
adisbladis 2023-03-20 17:09:35 +13:00
parent 9ce2252803
commit 0f962934ed

View file

@ -670,15 +670,28 @@ lib.composeManyExtensions [
VERSION = old.version;
});
gdal = super.gdal.overridePythonAttrs (
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.gdal ];
preBuild = (old.preBuild or "") + ''
substituteInPlace setup.cfg \
--replace "../../apps/gdal-config" '${pkgs.gdal}/bin/gdal-config'
'';
}
);
gdal =
let
# Build gdal without python bindings to prevent version mixing
# We're only interested in the native libraries, not the python ones
# as we build that separately.
gdal = pkgs.gdal.overrideAttrs (old: {
doInstallCheck = false;
doCheck = false;
cmakeFlags = (old.cmakeFlags or [ ]) ++ [
"-DBUILD_PYTHON_BINDINGS=OFF"
];
});
in
super.gdal.overridePythonAttrs (
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ gdal ];
preBuild = (old.preBuild or "") + ''
substituteInPlace setup.cfg \
--replace "../../apps/gdal-config" '${gdal}/bin/gdal-config'
'';
}
);
grandalf = super.grandalf.overridePythonAttrs (
old: {