I have a derivation A that builds a python extension (using CMake and pybind11). I have another derivation B that uses buildPythonPackage to build a python pacakage.
How do I:
Just create an output .whl file for B
Make sure that the .whl file contains the native extension (shared library) from A?
A python package is basically a module installed into a site-packages directory. For packages in nixpkgs this means copying the resulting python module below $out/${python.sitePackages}/.
The buildPythonPackage function in its build step crease a wheel, only to unpack it in the next phase to install it into a nix store output. This means you can likely skip the build step (dontBuild) and overwrite the installPhase.
That helps a bit, but using the installPhase that way the resulting nix package contains the files installed, not in a wheel. I can’t seem to figure out how to have buildPythonPackage output a wheel with the native extension.