I built my own package with this derivation:
{ buildPythonPackage, fetchPypi, lib, python-dateutil }:
buildPythonPackage rec {
pname = "vcard";
version = "0.12.2";
propagatedBuildInputs = [ python-dateutil ];
src = fetchPypi {
inherit pname version;
sha256 = "063b64ec0a4cff4e0f6a995cad04308524d3367a9521c2bff00daf2a430635b7";
};
# Not packaged with tests; see repo/CI
doCheck = false;
meta = with lib; {
homepage = https://gitlab.com/victor-engmark/vcard;
description = "vCard validator, class and utility functions";
license = licenses.agpl3Plus;
maintainers = [ maintainers.l0b0 ];
};
}
I realized the resulting package was missing something (the test files), so I made another release and updated only the version and hash:
{ buildPythonPackage, fetchPypi, lib, python-dateutil }:
buildPythonPackage rec {
pname = "vcard";
version = "0.13.0";
propagatedBuildInputs = [ python-dateutil ];
src = fetchPypi {
inherit pname version;
sha256 = "2e6f6ff19d804636dd4da3e38e5586c17e2d3d66fdbb53623775c20d34371cd0";
};
meta = with lib; {
homepage = https://gitlab.com/victor-engmark/vcard;
description = "vCard validator, class and utility functions";
license = licenses.agpl3Plus;
maintainers = [ maintainers.l0b0 ];
};
}
However, now the package won’t build:
$ nix-build --attr vcard
these derivations will be built:
/nix/store/5rlkv4q2bik5hdgjszkq8qrc81fvdvvz-vcard-0.13.0.tar.gz.drv
/nix/store/sfh7y0krpxk0hc100vkrbmk34i35nz2q-python3.7-vcard-0.13.0.drv
building '/nix/store/5rlkv4q2bik5hdgjszkq8qrc81fvdvvz-vcard-0.13.0.tar.gz.drv'...
trying https://files.pythonhosted.org/packages/source/v/vcard/vcard-0.13.0.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 18455 100 18455 0 0 185k 0 --:--:-- --:--:-- --:--:-- 185k
hash mismatch in fixed-output derivation '/nix/store/n83qcz9vabax61cxmaql45787f0k78jk-vcard-0.13.0.tar.gz':
wanted: sha256:1l0w6ws0vhkm6xi57fzxcqyjszn1hraqxqx39pfkcil0kpqnyvrf
got: sha256:0nnfvcakzg8ywkn2ln5xcj5adkh904adi35a08z9ijh0161hzh5s
cannot build derivation '/nix/store/sfh7y0krpxk0hc100vkrbmk34i35nz2q-python3.7-vcard-0.13.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/sfh7y0krpxk0hc100vkrbmk34i35nz2q-python3.7-vcard-0.13.0.drv' failed
I don’t even know where the checksums are coming from. Neither the “wanted” nor “got” checksums match the old or new checksum of my own package. There is no /nix/store/1l0w6ws0vhkm6xi57fzxcqyjszn1hraqxqx39pfkcil0kpqnyvrf* file.
I tried to nix-store --delete '/nix/store/n83qcz9vabax61cxmaql45787f0k78jk-vcard-0.13.0.tar.gz' '/nix/store/sfh7y0krpxk0hc100vkrbmk34i35nz2q-python3.7-vcard-0.13.0.drv'
, but that didn’t help any.
Update: WTF? Turns out I had copied the wheel checksum rather than the tarball one, so that was the mismatch. But even the tarball checksum (bac00f830900ca983e02aa8cd8140109cea68a64bd582aece41ebd3f15dbce5a) doesn’t match either the “wanted” or “got” checksums, so that’s an extremely unhelpful error message.