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