Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7973 from oxij/fetchurl-meta
fetchurl: allow adding meta info; fetchFrom*: add meta.homepage
- Loading branch information
Showing
2 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8981061
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing something, but doesn't this only add the meta attribute to the src attribute/derivation and not the resulting derivation of package itself (at least I haven't found something where this is properly propagated)? So you still need to use something like:
To avoid this we might need to modify the generic stdenv to pass the meta info from the
src
attribute (if it exists) to the resulting derivation and also allow it to get overridden bymkDerivation
meta attributes (because it's not always the case that the project's homepage is the project page of the various hosters).8981061
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, never mind, the pull request and commit message states this, but the post in the mailing list does not.
8981061
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cc @oxij
8981061
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, this extension goes only half the way precisely because it doesn't add
meta
to the generated derivation. We'd needmkGithubDerivation
just like we havefetchFromGitHub
to ensure thatmeta
is populated with meaningful default values. Once you have that, however, the need forsrc
providing those defaults kind-of goes away, no?8981061
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it's worth using
mkGithubDerivation
instead ofmkDerivation
just to avoid lineinherit (src.meta) homepage
.8981061
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd get all the benefits you'd get from using
fetchFromGitHub
, and you'd also get an automaticmeta.homepage
url. Personally, I'd rather havemkGitHubDerivation
and specify nofetchurl
at all than havingmkDerivation
andfetchFromGitHub
. Just my 2 cents ...8981061
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
mkGitHubDerivation
is a good idea because it's not compositional - we'd also need abuildGitHubPerlPackage
,buildGitHubPythonPackage
and so on.8981061
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get compositional, we could have it just return an augmented attrset, e.g.: