blob: 84196371be3afac979008fb9bbda78f8678d0203 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
{ lib, stdenv, fetchFromGitHub, nodejs, python3, callPackage, removeReferencesTo
, pkg-config, libsecret, xcbuild, Security, AppKit, fetchNpmDeps, npmHooks }:
let
pinData = lib.importJSON ./pin.json;
in stdenv.mkDerivation rec {
pname = "keytar";
inherit (pinData) version;
src = fetchFromGitHub {
owner = "atom";
repo = "node-keytar";
rev = "v${version}";
hash = pinData.srcHash;
};
nativeBuildInputs = [
nodejs python3 pkg-config
npmHooks.npmConfigHook
]
++ lib.optional stdenv.isDarwin xcbuild;
buildInputs = lib.optionals (!stdenv.isDarwin) [ libsecret ]
++ lib.optionals stdenv.isDarwin [ Security AppKit ];
npmDeps = fetchNpmDeps {
inherit src;
hash = pinData.npmHash;
};
doCheck = false;
installPhase = ''
runHook preInstall
shopt -s extglob
rm -rf node_modules
mkdir -p $out
cp -r ./!(build) $out
install -D -t $out/build/Release build/Release/keytar.node
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $out/build/Release/keytar.node
runHook postInstall
'';
disallowedReferences = [ stdenv.cc.cc ];
}
|