So I’m trying to contribute a python package to nixpkgs and have a couple of questions. This is my build file thus far.
This package has to other python package dependencies. Is it correct to place them in propagatedBuildInputs or should they be in nativeBuildInputs or buildInputs? The only thing I noticed when building this package is that it takes quite a bit of time (~20 min) since it’s also building the deps.
When the package finished building it didn’t add it to the PATH. How would I go about making it add the package to the PATH env var automatically?
From my experiences, you need to copy to ${out}/bin and it needs to have +x in the permissions.
Though you are using buildPythonPackage, which is for python libraries. Try buildPythonApplication instead, that is meant to be used for python packages that produce “runnable” output.
From my understanding:
nativeBuildInputs is for tools used to build the package, like compilers or make and therefore don’t need to be available at the packages runtime anymore.
buildINputs is used for libraries that the package needs to have available at compile time and runtime.
propagatedBuildInputs seems to be used for programs that need to be available at runtime, but that usage nix wasn’t able to figure out on their own.
I usually just use buildInputs until something does not work as expected This is from the view of an unexperienced beginner though!
"... ${foo} ..." is used to interpolate nix expression foo into a string. However, out is defined as a shell variable, so just use something like $out/bin in your hook (so without curly braces).
Thanks, that worked. What phase is the correct one to put this shell script though? Right now I’m using postInstall, but I’m not sure if that’s the one I should be using