resholve: fix mangled pname/meta integrations

Two items in resholve's mkDerivation are causing trouble for
some ecosystem tools:

1. I didn't pass through the original package's meta, which breaks the
   ability of at least nixos package search and r-ryantm to find the
   right source file (in the latter case breaking auto updates).

2. I was prepending "resholved-" to the pname, which at least nixos
   package search picks up as the package's name. Repology also tries
   to do this, but their current nix updater will prefer to get this
   data from the name. For now, this means changing to name will not
   stop repology from picking up the `resholved-<package>` names.

   Repology's code makes it clear that they *want* to use the pname/
   version, so I was inclined to settle with what I've got for now,
   but thiagokokada clarified that we aren't just waiting for nixpkgs
   fixes, but because Nix itself isn't exporting the pname/version in
   its JSON. See also:

   - https://github.com/repology/repology-updater/issues/854
   - https://github.com/repology/repology-updater/commit/9313110121df5

   For now, at least, I'll switch to appending "-unresholved" to the
   inner derivation's pname.
This commit is contained in:
Travis A. Everett 2022-09-12 20:46:44 -05:00
parent a0bf05315c
commit 9f6310d611

View File

@ -167,7 +167,8 @@ rec {
*/
unresholved = (stdenv.mkDerivation ((removeAttrs attrs [ "solutions" ])
// {
inherit pname version src;
inherit version src;
pname = "${pname}-unresholved";
}));
in
/*
@ -178,8 +179,7 @@ rec {
*/
lib.extendDerivation true passthru (stdenv.mkDerivation {
src = unresholved;
version = unresholved.version;
pname = "resholved-${unresholved.pname}";
inherit version pname;
buildInputs = [ resholve ];
# retain a reference to the base
@ -199,5 +199,8 @@ rec {
# supports default python.logging levels
# LOGLEVEL="INFO";
preFixup = phraseSolutions solutions unresholved;
# don't break the metadata...
meta = unresholved.meta;
});
}