www-apps/misskey: add 12.119.1

Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
tastytea 2022-12-03 16:51:31 +01:00
parent 9673462aa3
commit f49b35d0ae
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 153 additions and 0 deletions

View File

@ -2,4 +2,6 @@ DIST misskey-12.118.1-deps.tar.xz 562837316 BLAKE2B 73ae63271722e852cbbe4b15d272
DIST misskey-12.118.1.tar.gz 19890715 BLAKE2B 14b7ff60edc0a5292e3a3988d0d28ec3d8b928ca2e42eac32622a0b92b9f25ded4a9140fdaf0733516d73c179e343f0832662538cef92194b8917261c17a863b SHA512 c59698321f904f2494bad48ed058ac457458293334a955e4880dc862e9603d49fefa7c8ab435044b5f3074fe9e95dd06f40de0307ee6fc352f1c914feef93b1a
DIST misskey-12.119.0-deps.tar.xz 572218940 BLAKE2B e01c376bc415e54d995ea744b60a54ad9913a390ca1b26217a2cc3e545ad3e9183e0180373e2d55ca62109886d3ab8f8cd9d3c18685dddf513a230d80749e5dd SHA512 f95c81d05ce096467fbfd480a37a92aa82909608480d9469ed22f103fcb5557354922ee51e63246c45c5316ca3b651e8a9c7bfdafad1c9c554b0ed2584dab464
DIST misskey-12.119.0.tar.gz 19901643 BLAKE2B d5f990ca46ee1ac21d95cef3df37eb6502ac674b6c71585fbc13e5b63be3693e2d8542e9c1acab599edbadcc954cf5f1bf2eca01f4e9fe4a8020ef4f97d02ed9 SHA512 8d462180cbc02759c931b08b93b9a4cc124dabc4dbe8c9c962d8940778349b53725fa05a4868d350afc49f68cf3a7c249a8cc68ed51a213faca29f52913103bc
DIST misskey-12.119.1-deps.tar.xz 565592072 BLAKE2B 4b5b434d05d96420533409036d25b7379737ffafb302a15a2e3b3d3c7805d3d4429d740040ad3671232b5e430bf628adfcfb5bdd27b690b29c68cf54fe753c13 SHA512 36a102f021bcad1ba03c19636df537967259653805755c0501d50484630d772a654927e48a558fada31cbabdf9427314f15eb50831ebc308488df6ed7d5e1cd5
DIST misskey-12.119.1.tar.gz 19901808 BLAKE2B 4fcb267127cf2fdeed6faa8bd13d7af7b26a8e7635a048f5d8e51ee1f765af88a6ab97ddef0db9240b2bd836d572c5eefe2a0e8ef2154859f5fb8915e7a0033a SHA512 4b8778dad482e747e5f60ff697ac2b9998dcbff5ad017be2c4b3e74db5e80edac63fad71729567b586f1b41824a5259dfb74b2b4264256c40af480cb8cfb0449
DIST misskey-assets-0179793ec891856d6f37a3be16ba4c22f67a81b5.tar.gz 40471635 BLAKE2B 5305b5b316aa9d27f860e0e2c86f55eeb4140fd76c9cc7a753f78f93c509a10237033ec2109d2e806605f302d3fc9e9b916d2967053a4bce9b2cdea14df5885b SHA512 b4de7d8ab43f27e14372bb7246be4b032b142f22913ceaaa01e7631a1f702ba77ccf25482038cf2341f7a0ae92d54a1200bb654cac1d409b1ddcc113513b3f16

View File

@ -0,0 +1,151 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit optfeature savedconfig
# NOTE: check for updates on each bump
MY_COMMIT_ASSETS="0179793ec891856d6f37a3be16ba4c22f67a81b5"
DESCRIPTION="An interplanetary microblogging platform"
HOMEPAGE="https://misskey-hub.net/"
SRC_URI="
https://github.com/misskey-dev/misskey/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
https://github.com/misskey-dev/assets/archive/${MY_COMMIT_ASSETS}.tar.gz -> ${PN}-assets-${MY_COMMIT_ASSETS}.tar.gz
https://tastytea.de/files/gentoo/${P}-deps.tar.xz
"
# NOTE: to generate the deps archive:
# export YARN_CACHE_FOLDER="$(realpath ./packages-cache)"
# export CYPRESS_CACHE_FOLDER="$(realpath ./packages-cache)"
# export npm_config_cache="$(realpath ./packages-cache)"
# yarn install
# tar -caf ${P}-deps.tar.xz packages-cache
# unset YARN_CACHE_FOLDER CYPRESS_CACHE_FOLDER npm_config_cache
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="nginx +savedconfig source"
REQUIRED_USE="savedconfig"
RESTRICT="strip network-sandbox"
COMMON_DEPEND="
>=net-libs/nodejs-16:=[npm]
<net-libs/nodejs-19
sys-apps/yarn
"
BDEPEND="
${COMMON_DEPEND}
dev-lang/nasm
virtual/pkgconfig
"
RDEPEND="
${COMMON_DEPEND}
acct-user/misskey
dev-db/postgresql
dev-db/redis
nginx? ( www-servers/nginx )
"
QA_PREBUILT="
/opt/misskey/misskey/packages/backend/node_modules/msgpackr-extract/prebuilds/*
/opt/misskey/misskey/packages/client/node_modules/microtime/prebuilds/*
"
src_unpack() {
default
mv --no-target-directory assets-${MY_COMMIT_ASSETS} ${P}/${PN}-assets \
|| die "Could not move assets"
mv packages-cache "${T}"/ || die "Could not move packages cache"
}
src_prepare() {
export YARNFLAGS="--offline --verbose --frozen-lockfile"
export YARN_CACHE_FOLDER="${T}"/packages-cache
export CYPRESS_CACHE_FOLDER="${T}"/packages-cache
export npm_config_cache="${T}"/packages-cache
# use system node-gyp
PATH+=":/usr/lib64/node_modules/npm/bin/node-gyp-bin"
export npm_config_nodedir=/usr/include/node/
restore_config .config/default.yml
if [[ ! -f .config/default.yml ]]; then
eerror "Edit .config/example.yml and save it to the location mentioned above"
die "No config file found"
fi
default
}
src_compile() {
yarn ${YARNFLAGS} install || die "dependency installation failed"
NODE_ENV=production yarn ${YARNFLAGS} build || die "build failed"
}
src_install() {
insinto opt/misskey/misskey
insopts -o misskey -g misskey
if use source; then
doins -r .
else
doins -r package.json .node-version .config built packages
fi
# insopts doesn't affect directories
chown --recursive misskey:misskey "${ED}"/opt/misskey/misskey
chmod o= "${ED}"/opt/misskey/misskey
newinitd "${FILESDIR}"/${PN}.initd ${PN}
if use nginx; then
sed -i 's/use logger$/use logger nginx/' "${ED}"/etc/init.d/${PN} \
|| die "Could not modify OpenRC init script"
fi
einstalldocs
}
pkg_preinst() {
# Apparently Misskey creates files at runtime that can interfere
# after an upgrade. Normally you would run 'yarn cleanall'.
einfo "Cleaning up Misskey directory …"
su --shell /bin/bash --login --command \
"rm -rf misskey/{built,node_modules} && rm -rf misskey/packages/{backend,client,sw}/{built,node_modules}" \
misskey || die "cleanup failed"
}
pkg_postinst() {
# Only run migrations if database exists
if su --login --command "psql misskey -c ''" postgres; then
einfo "Running 'yarn migrate'"
su --shell /bin/bash --login --command \
"cd misskey && yarn ${YARNFLAGS} --verbose migrate" \
misskey || die "migration failed"
else
elog "Run emerge --config ${CATEGORY}/${PN} to initialise the PostgreSQL database"
fi
if use nginx; then
einfo "An nginx example config can be found at <https://misskey-hub.net/en/docs/admin/nginx.html>"
fi
optfeature "thumbnail generation support" media-video/ffmpeg
}
pkg_config() {
einfo "Initialising PostgreSQL database"
echo -n "password for misskey user: "
read MY_PASSWORD || die "Reading password failed"
echo "create database misskey; create user misskey with encrypted password '${MY_PASSWORD}'; grant all privileges on database misskey to misskey; \q" \
| su --login --command psql postgres || die "database creation failed"
su --shell /bin/bash --login --command \
"cd misskey && yarn ${YARNFLAGS} run init" \
misskey || die "database initialisation failed"
ewarn "When you first start Misskey you will be asked to add an admin account via the web interface, and registrations are enabled."
ewarn "Do not expose the web interface to the public until after you configured your instance\!"
}