www-apps/misskey: enable pnpm everywhere it is needed
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2023-01-16 19:20:11 +01:00
parent 16c7e19b05
commit a30767e169
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 13 additions and 7 deletions

View File

@ -56,6 +56,16 @@ 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}"
fi
}
src_unpack() {
default
mv --no-target-directory assets-${MY_COMMIT_ASSETS} ${P}/${PN}-assets \
@ -80,13 +90,7 @@ src_prepare() {
die "No config file found"
fi
# 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}"
fi
enable_pnpm_temp
pnpm config set cache "${T}"/packages-cache
pnpm config set store-dir "${T}"/packages-cache
@ -130,6 +134,7 @@ 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…"
@ -148,6 +153,7 @@ 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"