mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 17:53:37 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
{ lib, buildNpmPackage, fetchFromGitHub, chromium, makeWrapper }:
|
|
|
|
buildNpmPackage rec {
|
|
pname = "percollate";
|
|
version = "4.2.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "danburzo";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-JpdSEockALXtuuMMi5mgD5AXcayojyK0qMMWF+XFfZE=";
|
|
};
|
|
|
|
npmDepsHash = "sha256-qWu1YYi4ddpAUtbDxF4YA8OO6BLZ6gfeb4pw0n9BaZw=";
|
|
|
|
dontNpmBuild = true;
|
|
|
|
# Dev dependencies include an unnecessary Java dependency (epubchecker)
|
|
# https://github.com/danburzo/percollate/blob/v4.2.3/package.json#L40
|
|
npmInstallFlags = [ "--omit=dev" ];
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
env = {
|
|
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = true;
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace package.json --replace "git config core.hooksPath .git-hooks" ""
|
|
'';
|
|
|
|
postInstall = ''
|
|
wrapProgram $out/bin/percollate \
|
|
--set PUPPETEER_EXECUTABLE_PATH ${chromium}/bin/chromium
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Command-line tool to turn web pages into readable PDF, EPUB, HTML, or Markdown docs";
|
|
homepage = "https://github.com/danburzo/percollate";
|
|
license = licenses.mit;
|
|
maintainers = [ maintainers.austinbutler ];
|
|
mainProgram = "percollate";
|
|
};
|
|
}
|