-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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 #237463 from marsam/add-readabilty-cli
readability-cli: repackage using buildNpmPackage
- Loading branch information
Showing
6 changed files
with
43 additions
and
202 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ lib, buildNpmPackage, fetchFromGitLab, installShellFiles }: | ||
|
||
buildNpmPackage rec { | ||
pname = "readability-cli"; | ||
version = "2.4.4"; | ||
|
||
src = fetchFromGitLab { | ||
owner = "gardenappl"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
hash = "sha256-pvAp3ZJ8/FPhrSMC8B4U1m5zuBNRP/HcsXkrW6QYgSQ="; | ||
}; | ||
|
||
postPatch = '' | ||
# Set a script name to avoid yargs using index.js as $0 | ||
substituteInPlace common.mjs \ | ||
--replace '.version(false)' '.version(false).scriptName("readable")' | ||
''; | ||
|
||
npmDepsHash = "sha256-X1pcgDm8C4G+hIsgx3sAVFQPadWsULvXrdLAIHnpjmE="; | ||
|
||
nativeBuildInputs = [ installShellFiles ]; | ||
|
||
dontNpmBuild = true; | ||
|
||
postInstall = '' | ||
installManPage readability-cli.1 | ||
installShellCompletion --cmd readable \ | ||
--bash <(SHELL=bash $out/bin/readable --completion) \ | ||
--zsh <(SHELL=zsh $out/bin/readable --completion) | ||
''; | ||
|
||
meta = with lib; { | ||
description = "Firefox Reader Mode in your terminal - get useful text from a web page using Mozilla's Readability library"; | ||
homepage = "https://gitlab.com/gardenappl/readability-cli"; | ||
license = licenses.gpl3Only; | ||
maintainers = [ maintainers.marsam ]; | ||
mainProgram = "readable"; | ||
}; | ||
} |
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