www-apps/misskey: add 12.116.1

Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
tastytea 2022-07-17 02:11:32 +02:00
parent e86f4dfc91
commit b412f999ec
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 153 additions and 0 deletions

View File

@ -4,4 +4,6 @@ DIST misskey-12.115.0-deps.tar.xz 561393364 BLAKE2B b66b812d31778bc6ffa850d70bca
DIST misskey-12.115.0.tar.gz 19874071 BLAKE2B 040c6e7e357dab8c192c48bd58df59b01d1be05856a66e275f7eface1b5093be2405ce6ed52e0c5d4c8aa5fe4d942b67afe5c465b8891d3bcac729a19037ffc9 SHA512 ae9dc04b14702fba40a426f129a256bda1e7c6fe20eefae544b0a1772e9f3fc176f2444b33580caf41837a586a53b7c6a64b2f7523bcba34cec59751cef71b4a
DIST misskey-12.116.0-deps.tar.xz 561402336 BLAKE2B 107919431bd14b462d76a163e8bc0668357e69de55a71870ca29d432cb133fde8ae9e5462a70fa34970ac2c7fc2ad31dbf399bdb1759af45a4d14fa9f40cb1e6 SHA512 fb8914a29a7da03dd8d93a14c551df2dc5464a6e710dbb548dc9b2cdcae5af1f87bcbe3277e516520d62e6c7983c600d2cdb9651397928eaadfe68f9ce3f1ef8
DIST misskey-12.116.0.tar.gz 19876955 BLAKE2B c222bbdc69c099756290adc65b40a92ad6d1463f496b57bd0242571854aceec5896416910cfab034a626c88b9e56e50bf6c7d426dc4835b9150238a79b4ae2d4 SHA512 243e35d04622b245c3fa834f7a3ad15beb99dd1d739b5eaf294657b3bf658cab1c4b8997defa31b1332e151b594f1f51973c9da803a92b14ff79668437009a0b
DIST misskey-12.116.1-deps.tar.xz 561456076 BLAKE2B 496c1745ad02a5115a21901da6383536d93ff009c627a6f94350274b2a7b93f703badc446e45e816e682a3473f5d0d7a83cc24d3d53d6308667161aa78755780 SHA512 f3252443927f796fdae264d26f42fceeada8ae5e2e09e5566549f534a975b9b758307196296457e0d20172da764a9e4565ae418148e0bb50bc0c9d9a573baecf
DIST misskey-12.116.1.tar.gz 19877112 BLAKE2B 41083b6cb804d6bf3b0c4f90ced0909324a4196c9fff5fb592ef38691615be1985186acfa567f703651b38005f9b391187c693e4327b5e94f13a2b8561eae70a SHA512 254de07ec54056b29df71898f1a0f14310be886359ece046b527a17f9cd5347c2a0b3c2c02676fc3340843095a9dedf1bf4a63d9c42b689e6486b37aac15fadc
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: update for 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\!"
}