-
-
Notifications
You must be signed in to change notification settings - Fork 19.7k
nix-prefetch: 0.3.0 -> 0.3.1 #85367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
nix-prefetch: 0.3.0 -> 0.3.1 #85367
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,67 +1,74 @@ | ||
| { stdenv, fetchFromGitHub, makeWrapper | ||
| , asciidoc, docbook_xml_dtd_45, docbook_xsl, libxml2, libxslt | ||
| , coreutils, gawk, gnugrep, gnused, jq, nix }: | ||
| { stdenv, fetchFromGitHub, installShellFiles, makeWrapper, asciidoc | ||
| , docbook_xml_dtd_45, git, docbook_xsl, libxml2, libxslt, coreutils, gawk | ||
| , gnugrep, gnused, jq, nix }: | ||
|
|
||
| stdenv.mkDerivation rec { | ||
| let | ||
| binPath = stdenv.lib.makeBinPath [ coreutils gawk git gnugrep gnused jq nix ]; | ||
|
|
||
| in stdenv.mkDerivation rec { | ||
| pname = "nix-prefetch"; | ||
| version = "0.3.0"; | ||
| version = "0.3.1"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "msteen"; | ||
| repo = "nix-prefetch"; | ||
| rev = version; | ||
| sha256 = "0b9gdi7xzmfq0j258x724xsll8gi31m0m4pzfjkqinlm6zwr3sgm"; | ||
| sha256 = "15h6f743nn6sdq8l771sjxh92cyzqznkcs7szrc7nm066xvx8rd4"; | ||
| # the stat call has to be in a subshell or we get the current date | ||
| extraPostFetch = '' | ||
| echo $(stat -c %Y $out) > $out/.timestamp | ||
| ''; | ||
| }; | ||
|
|
||
| postPatch = '' | ||
| lib=$out/lib/${pname} | ||
|
|
||
| substituteInPlace doc/nix-prefetch.1.asciidoc \ | ||
| --subst-var-by version $version | ||
|
|
||
| substituteInPlace src/main.sh \ | ||
| --subst-var-by lib $lib \ | ||
| --subst-var-by version $version | ||
|
|
||
| substituteInPlace src/tests.sh \ | ||
| --subst-var-by bin $out/bin | ||
| ''; | ||
|
|
||
| nativeBuildInputs = [ | ||
| asciidoc | ||
| docbook_xml_dtd_45 | ||
| docbook_xsl | ||
| installShellFiles | ||
| libxml2 | ||
| libxslt | ||
| makeWrapper | ||
| asciidoc docbook_xml_dtd_45 docbook_xsl libxml2 libxslt | ||
| ]; | ||
|
|
||
| configurePhase = '' | ||
| . configure.sh | ||
| ''; | ||
| dontConfigure = true; | ||
|
|
||
| buildPhase = '' | ||
| a2x -f manpage doc/nix-prefetch.1.asciidoc | ||
| a2x -a revdate=$(date --date=@$(cat $src/.timestamp) +%d/%m/%Y) \ | ||
| -f manpage doc/nix-prefetch.1.asciidoc | ||
| ''; | ||
|
|
||
| installPhase = '' | ||
| lib=$out/lib/${pname} | ||
| mkdir -p $lib | ||
| substitute src/main.sh $lib/main.sh \ | ||
| --subst-var-by lib $lib \ | ||
| --subst-var-by version '${version}' | ||
| chmod +x $lib/main.sh | ||
| patchShebangs $lib/main.sh | ||
| cp lib/*.nix $lib/ | ||
|
|
||
| mkdir -p $out/bin | ||
| install -Dm555 -t $lib src/*.sh | ||
| install -Dm444 -t $lib lib/* | ||
| makeWrapper $lib/main.sh $out/bin/${pname} \ | ||
| --prefix PATH : '${stdenv.lib.makeBinPath [ coreutils gawk gnugrep gnused jq nix ]}' | ||
|
|
||
| substitute src/tests.sh $lib/tests.sh \ | ||
| --subst-var-by bin $out/bin | ||
| chmod +x $lib/tests.sh | ||
| patchShebangs $lib/tests.sh | ||
| --prefix PATH : ${binPath} | ||
|
|
||
| mkdir -p $out/share/man/man1 | ||
| substitute doc/nix-prefetch.1 $out/share/man/man1/nix-prefetch.1 \ | ||
| --subst-var-by version '${version}' \ | ||
| --replace '01/01/1970' "$date" | ||
| installManPage doc/nix-prefetch.? | ||
|
|
||
| install -D contrib/nix-prefetch-completion.bash $out/share/bash-completion/completions/nix-prefetch | ||
| install -D contrib/nix-prefetch-completion.zsh $out/share/zsh/site-functions/_nix_prefetch | ||
| installShellCompletion --name ${pname} contrib/nix-prefetch-completion.{bash,zsh} | ||
|
|
||
| mkdir -p $out/share/doc/${pname}/contrib | ||
| cp -r contrib/hello_rs $out/share/doc/${pname}/contrib/ | ||
| cp -r contrib/hello_rs $out/share/doc/${pname}/contrib | ||
| ''; | ||
|
|
||
| meta = with stdenv.lib; { | ||
| description = "Prefetch any fetcher function call, e.g. package sources"; | ||
| homepage = "https://github.com/msteen/nix-prefetch"; | ||
| license = licenses.mit; | ||
| maintainers = with maintainers; [ msteen ]; | ||
| platforms = platforms.all; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this removed because it is the default? Just so I know for future reference.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
| inherit (src.meta) homepage; | ||
| }; | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure if Nix already does this for us, but do we need to add
--utcto make it more pure?