I’m trying to package a certain python program from Github to use in my personal overlay, but I have very limited experience doing this and in particular have never attempted to package a Python program, so I would really appreciate any help.
For reference, I’ve looked at expressions for packaging similar programs that are in Nixpkgs, but there are still some issues. Here is the code I have at the moment:
{ lib
, buildPythonPackage
#, python311Packages.exif - how do I abstract it out from a specific package set? "exif" package in nixpkgs is not the same program
, fetchFromGitHub
, pyqt6
#, pyqt6-qt6 - doesn't exist?
#,rectangle-packer - this program is not in nixpkgs!
}:
buildPythonPackage rec {
pname = "beeref";
version = "0.3.0-dev";
format = "setuptools"; # is this correct?
src = fetchFromGitHub {
owner = "rbreu";
repo = "beeref";
rev = "cf55d1a5e304da707f2cc9a9ca793ee24503a0bc";
hash = "sha256-Qx1dV5yHK6SxCEh+vXfeeBR8qU7GdFoH9n4dNl4PVbw=";
};
nativeBuildInputs = [];
propagatedBuildInputs = [
#exif - python311Packages version, or other?
pyqt6
#pyqt6-qt6 ?
#rectangle-packer
];
meta = with lib; {
description = "A simple reference image viewer";
homepage = "https://github.com/rbreu/beeref";
license = licenses.gpl3Only;
#maintainers = with maintainers; [];
};
}
One of the issues is that rectangle-packer, while it exists on PyPi, is not part of Nixpkgs, and I’m not sure what would be the idiomatic way to include this in my expression. Would it involve the use of the fetchPypi function?
Another issue is that the setup file specifies both pyQt6 and pyQt6-Qt6 as dependencies. These packages both exist on PyPi, but the latter does not seem to be in Nixpkgs. Is it perhaps contained within the first one? I basically know next to nothing about how Python stuff is packaged for Nixpkgs, nor do I know much about Python development in general. How would I go about referencing them independently, if it even matters?
The last problem is the exif dependency, which seems to refer to this program (an outdated version of which is in Nixpkgs). The problem is that this is not the base exif package contained in Nixpkgs (which is actually an unrelated program), but instead the one contained within python package sets - for example, python311Packages.exif. Is there a way of referencing this dependency more abstractly outside of the context of the package set for a specific Python version, or is that just the way I have to do it? Not sure which is the desirable solution, either.
Again, I really appreciate any help! Thanks.
Edit: Now that I look at this again, I see that I missed the fact that the pyqt6 package is also part of python311Packages or similar package sets, so the same issue as for exif would apply, I think.