about summary refs log tree commit diff
path: root/pkgs/build-support/node
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2023-08-18 12:41:05 +0200
committerPierre Bourdon <delroth@gmail.com>2023-08-18 12:41:05 +0200
commit28693fb1c3f8ace1b8fdcc23218d9b3d29955ad1 (patch)
tree2b4567656d08a836b392200304ef0cee97866b4e /pkgs/build-support/node
parent84ffd8cabe5c7e635dd04e9eda732d306697369a (diff)
buildNpmPackage: symlink manpages to the correct output directory
Diffstat (limited to 'pkgs/build-support/node')
-rw-r--r--pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh b/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
index b17fb552cc6b5..efbe7fbffc198 100644
--- a/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
+++ b/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
@@ -24,6 +24,13 @@ npmInstallHook() {
         elif $typ == "object" then .bin | to_entries | map(.key + " " + .value) | join("\n")
         else "invalid type " + $typ | halt_error end' "${npmWorkspace-.}/package.json")
 
+    while IFS= read -r man; do
+        mkdir -p "$out/share/man"
+        ln -s "$packageOut/$man" "$out/share/man"
+    done < <(@jq@ --raw-output '(.man | type) as $typ | if $typ == "string" then .man
+        elif $typ == "list" then .man | join("\n")
+        else "invalid type " + $typ | halt_error end' "${npmWorkspace-.}/package.json")
+
     local -r nodeModulesPath="$packageOut/node_modules"
 
     if [ ! -d "$nodeModulesPath" ]; then