nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchYarnDeps,
6 yarnConfigHook,
7 yarnBuildHook,
8 yarnInstallHook,
9 nodejs,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "postlight-parser";
14 version = "2.2.3";
15
16 src = fetchFromGitHub {
17 owner = "postlight";
18 repo = "parser";
19 rev = "v${finalAttrs.version}";
20 hash = "sha256-k6m95FHeJ+iiWSeY++1zds/bo1RtNXbnv2spaY/M+L0=";
21 };
22
23 offlineCache = fetchYarnDeps {
24 yarnLock = "${finalAttrs.src}/yarn.lock";
25 hash = "sha256-Vs8bfkhEbPv33ew//HBeDnpQcyWveByHi1gUsdl2CNI=";
26 };
27
28 nativeBuildInputs = [
29 yarnConfigHook
30 yarnBuildHook
31 yarnInstallHook
32 nodejs
33 ];
34 # Upstream doesn't include a script in package.json that only builds without
35 # testing, and tests fail because they need to access online websites. Hence
36 # we use the builtin interface of yarnBuildHook to lint, and in `postBuild`
37 # we run the rest of commands needed to create the js files eventually
38 # distributed and wrapped by npmHooks.npmInstallHook
39 yarnBuildScript = "lint";
40 postBuild = ''
41 yarn --offline run rollup -c
42 '';
43
44 meta = {
45 changelog = "https://github.com/postlight/parser/blob/${finalAttrs.src.rev}/CHANGELOG.md";
46 homepage = "https://reader.postlight.com";
47 description = "Extracts the bits that humans care about from any URL you give it";
48 license = lib.licenses.mit;
49 maintainers = with lib.maintainers; [ viraptor ];
50 mainProgram = "postlight-parser";
51 };
52})