1{ lib
2, stdenv
3, buildNpmPackage
4, fetchFromGitHub
5, pkg-config
6, libsecret
7, darwin
8, python3
9, testers
10, vsce
11}:
12
13buildNpmPackage rec {
14 pname = "vsce";
15 version = "2.19.0";
16
17 src = fetchFromGitHub {
18 owner = "microsoft";
19 repo = "vscode-vsce";
20 rev = "v${version}";
21 hash = "sha256-U3ZsM18bijQ+WPC0MrXifMGV2ceNkzGdzLs3TWtMaO4=";
22 };
23
24 npmDepsHash = "sha256-KIokSqoBFOQ3Ei5aAeSvWYiv1QdFwUYZJDsza/MypAg=";
25
26 postPatch = ''
27 substituteInPlace package.json --replace '"version": "0.0.0"' '"version": "${version}"'
28 '';
29
30 nativeBuildInputs = [ pkg-config python3 ];
31
32 buildInputs = [ libsecret ]
33 ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Security ]);
34
35 makeCacheWritable = true;
36 npmFlags = [ "--legacy-peer-deps" ];
37
38 passthru.tests.version = testers.testVersion {
39 package = vsce;
40 };
41
42 meta = with lib; {
43 homepage = "https://github.com/microsoft/vscode-vsce";
44 description = "Visual Studio Code Extension Manager";
45 maintainers = with maintainers; [ aaronjheng ];
46 license = licenses.mit;
47 };
48}