15 src = fetchFromGitHub {
18 rev = "03c9dcf1fcd965031a68553ccaf6487d1fe87f79";
19 hash = "sha256-MoY95lSIQK1K4aIlMdPm93YxJuez9HYx2zlUhHvDao0=";
23 # fsevents is needed on Darwin, but its dependency "nan" in the upstream package-lock.json
24 # is too old for the Node 18.x in Nixpkgs.
25 # This patch is generated by checking out the upstream source and running
26 # npm update nan --lockfile-version 1
30 npmDepsHash = "sha256-mV6rWNf2p2w4H0ESUT0/Ybtx9YEdvO5l2gCvlWFXK+U=";
32 buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.CoreServices ];
33 nativeBuildInputs = [ nodePackages.node-gyp python3 ]
34 ++ lib.optionals stdenv.isDarwin [ darwin.cctools ];
37 # Only keep the necessary parts of build/Release to reduce closure size
38 cd $out/lib/node_modules/nodehun
41 cp -r build_old/Release build/
43 rm -rf build/Release/.deps
44 # Remove a development script to eliminate runtime dependency on node
45 rm node_modules/node-addon-api/tools/conversion.js
48 doInstallCheck = true;
49 nativeCheckInputs = [ nodejs ];
51 # Smoke check: require() works
52 export NODE_PATH=$out/lib/node_modules
53 echo 'require("nodehun")' | node -
56 disallowedReferences = [ nodejs ];
59 description = "The Hunspell binding for NodeJS that exposes as much of Hunspell as possible and also adds new features";
60 homepage = "https://github.com/Wulf/nodehun";
61 license = licenses.mit;
62 maintainers = [ maintainers.thomasjm ];