Use a recursive set instead of a let in before calling
stdenv.mkDerivation. This allows to properly override the derivation
with overrideAttrs.
Do not re-use the pname in the fetcher function. Otherwise you cannot
override the pname of a derivation while still fetching the same
sources. However, this is something you sometimes want to do.