diff options
| author | Danilo M. <danix@danix.xyz> | 2026-06-20 11:37:13 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-06-20 11:37:13 +0200 |
| commit | 87f2960597635cf27f0ac07e234f8ed3130dc9c2 (patch) | |
| tree | b616f6e5de4e54d2a0dcf97d836ad2301c4e550f | |
| parent | 5583e2e7aea4c730858de1609626fa6afa383586 (diff) | |
| download | my-slackbuilds-87f2960597635cf27f0ac07e234f8ed3130dc9c2.tar.gz my-slackbuilds-87f2960597635cf27f0ac07e234f8ed3130dc9c2.zip | |
playwright-cli: fix missing launcher and lib64 path
npm did not create the bin launcher under DESTDIR staging, so the package
shipped an empty /usr/bin. Create the playwright-cli symlink explicitly.
Also move node_modules from the arch-specific /usr/lib64 to /usr/lib,
correct for a noarch package.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| -rw-r--r-- | playwright-cli/playwright-cli.SlackBuild | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/playwright-cli/playwright-cli.SlackBuild b/playwright-cli/playwright-cli.SlackBuild index b85f0d9..407b5e1 100644 --- a/playwright-cli/playwright-cli.SlackBuild +++ b/playwright-cli/playwright-cli.SlackBuild @@ -68,8 +68,6 @@ SRCTGZ=$CWD/$PRGNAM-$VERSION.tgz # Install the npm tarball and its dependencies into the package, globally, # under /usr. npm reads the source tarball directly; no extraction needed. -# noarch: modules go to /usr/lib/node_modules regardless of $ARCH. -mkdir -p $PKG/usr/lib DESTDIR=$PKG npm install \ --user root \ --location=global \ @@ -79,11 +77,27 @@ DESTDIR=$PKG npm install \ --no-fund \ $SRCTGZ +# noarch: pure-JS modules must live in /usr/lib, never the arch-specific +# /usr/lib64. node's default prefix may land them in lib64, so normalise. +if [ -d "$PKG/usr/lib64/node_modules" ]; then + mkdir -p $PKG/usr/lib + mv $PKG/usr/lib64/node_modules $PKG/usr/lib/node_modules + rmdir $PKG/usr/lib64 2>/dev/null || true +fi + NODE_MODULES=$PKG/usr/lib/node_modules # Remove the stray "root" module npm sometimes creates from --user root rm -rf $NODE_MODULES/root +# Create the launcher symlink. npm's --prefix/global bin-linking is +# unreliable under DESTDIR staging, so make it explicitly. The bin name and +# target come from the package's own "bin" field (playwright-cli.js). +mkdir -p $PKG/usr/bin +ln -sf ../lib/node_modules/@playwright/cli/playwright-cli.js \ + $PKG/usr/bin/playwright-cli +chmod 0755 $NODE_MODULES/@playwright/cli/playwright-cli.js + # Remove VCS / CI leftovers find $PKG/usr \( -name '.git*' -o -name '.travis.yml' \) -exec rm -f {} \; |
