diff --git a/nodejs-libpath.patch b/nodejs-libpath.patch index 392bf0f..7416139 100644 --- a/nodejs-libpath.patch +++ b/nodejs-libpath.patch @@ -14,7 +14,7 @@ Index: node-v20.12.0/tools/install.py try_unlink(target_path) # prevent ETXTBSY errors return shutil.copy2(source_path, target_path) -+def libdir(): ++def libdir(options): + libdir_fq = sysconfig.get_config_var("LIBDIR") + return re.sub("^" + re.escape(options.prefix + "/"), "", libdir_fq) + @@ -26,7 +26,7 @@ Index: node-v20.12.0/tools/install.py def package_files(options, action, name, bins): - target_path = os.path.join('lib/node_modules', name) -+ target_path = os.path.join(libdir(), 'node_modules', name) ++ target_path = os.path.join(libdir(options), 'node_modules', name) # don't install npm if the target path is a symlink, it probably means # that a dev version of npm is installed there @@ -35,7 +35,7 @@ Index: node-v20.12.0/tools/install.py action(options, [link_path], os.path.join('bin', bin_name)) elif action == install: - try_symlink(options, os.path.join('../lib/node_modules', name, bin_target), link_path) -+ try_symlink(options, os.path.join('..', libdir(), 'node_modules', name, bin_target), link_path) ++ try_symlink(options, os.path.join('..', libdir(options), 'node_modules', name, bin_target), link_path) else: assert 0 # unhandled action type diff --git a/versioned.patch b/versioned.patch index 05cb9b6..f3968b1 100644 --- a/versioned.patch +++ b/versioned.patch @@ -29,8 +29,8 @@ Index: node-v20.12.0/tools/install.py try_remove(options, path, dest) def package_files(options, action, name, bins): -- target_path = os.path.join(libdir(), 'node_modules', name) -+ target_path = os.path.join(libdir(), 'node_modules', name + '20') +- target_path = os.path.join(libdir(options), 'node_modules', name) ++ target_path = os.path.join(libdir(options), 'node_modules', name + '20') # don't install npm if the target path is a symlink, it probably means # that a dev version of npm is installed there @@ -38,8 +38,8 @@ Index: node-v20.12.0/tools/install.py if action == uninstall: action(options, [link_path], os.path.join('bin', bin_name)) elif action == install: -- try_symlink(options, os.path.join('..', libdir(), 'node_modules', name, bin_target), link_path) -+ try_symlink(options, os.path.join('..', libdir(), 'node_modules', name + '20', bin_target), link_path) +- try_symlink(options, os.path.join('..', libdir(options), 'node_modules', name, bin_target), link_path) ++ try_symlink(options, os.path.join('..', libdir(options), 'node_modules', name + '20', bin_target), link_path) else: assert 0 # unhandled action type