www-apps/misskey: use pnpm wrapper
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2023-01-16 19:32:34 +01:00
parent a30767e169
commit 887db10ad3
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 8 additions and 13 deletions

View File

@ -56,13 +56,12 @@ QA_PREBUILT="
/opt/misskey/misskey/packages/client/node_modules/microtime/prebuilds/*
"
enable_pnpm_temp() {
# enable pnpm (part of nodejs) temporarily if it isn't available
if ! type pnpm > /dev/null 2>&1; then
mkdir "${T}"/bin || die
ln -s /usr/$(get_libdir)/node_modules/corepack/dist/pnpm.js \
"${T}"/bin/pnpm || die "Could not symlink pnpm.js"
PATH="${T}/bin:${PATH}"
pnpm() {
# use the pnpm from nodejs if it isn't available otherwise
if type pnpm > /dev/null 2>&1; then
pnpm "${@}"
else
/usr/$(get_libdir)/node_modules/corepack/dist/pnpm.js "${@}"
fi
}
@ -79,6 +78,8 @@ src_prepare() {
export CYPRESS_CACHE_FOLDER="${T}"/packages-cache
export npm_config_cache="${T}"/packages-cache
export PNPMFLAGS="--verbose"
pnpm config set cache "${T}"/packages-cache
pnpm config set store-dir "${T}"/packages-cache
# use system node-gyp
PATH+=":/usr/lib64/node_modules/npm/bin/node-gyp-bin"
@ -90,10 +91,6 @@ src_prepare() {
die "No config file found"
fi
enable_pnpm_temp
pnpm config set cache "${T}"/packages-cache
pnpm config set store-dir "${T}"/packages-cache
default
}
@ -134,7 +131,6 @@ pkg_preinst() {
}
pkg_postinst() {
enable_pnpm_temp
# Only run migrations if database exists
if su --login --command "psql misskey -c ''" postgres; then
einfo "Running migration…"
@ -153,7 +149,6 @@ pkg_postinst() {
}
pkg_config() {
enable_pnpm_temp
einfo "Initialising PostgreSQL database"
echo -n "password for misskey user: "
read -r MY_PASSWORD || die "Reading password failed"