www-apps/misskey: add 12.116.0

Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
tastytea 2022-07-16 18:45:58 +02:00
parent 25979789e5
commit ef91c71dca
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.112.3-deps.tar.xz 581620200 BLAKE2B e2a0db68cc77f97fbcc881b9e4cb
DIST misskey-12.112.3.tar.gz 19866516 BLAKE2B 5b5e921a61f281488ce0bcdeea49c0a50be89fcf108f4083c65039a0b474968c1ad26cb68ac1bc017c59400ba2033c6a85f4ed216e33ed9698a941bd40269774 SHA512 bbfe0d791ec7b16bbe3dd1a393c0cf60d9e58e0d039a53dcc1b71c610b3b362e22aae1c29f0ab91e3a77c05a8e25e167df41da58a4b1170acb056b9b0dacc0bb DIST misskey-12.112.3.tar.gz 19866516 BLAKE2B 5b5e921a61f281488ce0bcdeea49c0a50be89fcf108f4083c65039a0b474968c1ad26cb68ac1bc017c59400ba2033c6a85f4ed216e33ed9698a941bd40269774 SHA512 bbfe0d791ec7b16bbe3dd1a393c0cf60d9e58e0d039a53dcc1b71c610b3b362e22aae1c29f0ab91e3a77c05a8e25e167df41da58a4b1170acb056b9b0dacc0bb
DIST misskey-12.115.0-deps.tar.xz 561393364 BLAKE2B b66b812d31778bc6ffa850d70bca5b862765d2798185971a710d0be04e8515a66e9b9f4870475611840bf26bb1ba98aa960605d92c6d3c59bacd245520dde28b SHA512 46f4da31cce61e3800b7e7fd9a5d5a29548d6afb5a384f1bc9f06e25a352ecff8618649c49e7e96bbbdd565edbc94909d9ed537aa2ba192c8a361b3f6cae7fd7 DIST misskey-12.115.0-deps.tar.xz 561393364 BLAKE2B b66b812d31778bc6ffa850d70bca5b862765d2798185971a710d0be04e8515a66e9b9f4870475611840bf26bb1ba98aa960605d92c6d3c59bacd245520dde28b SHA512 46f4da31cce61e3800b7e7fd9a5d5a29548d6afb5a384f1bc9f06e25a352ecff8618649c49e7e96bbbdd565edbc94909d9ed537aa2ba192c8a361b3f6cae7fd7
DIST misskey-12.115.0.tar.gz 19874071 BLAKE2B 040c6e7e357dab8c192c48bd58df59b01d1be05856a66e275f7eface1b5093be2405ce6ed52e0c5d4c8aa5fe4d942b67afe5c465b8891d3bcac729a19037ffc9 SHA512 ae9dc04b14702fba40a426f129a256bda1e7c6fe20eefae544b0a1772e9f3fc176f2444b33580caf41837a586a53b7c6a64b2f7523bcba34cec59751cef71b4a 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-assets-0179793ec891856d6f37a3be16ba4c22f67a81b5.tar.gz 40471635 BLAKE2B 5305b5b316aa9d27f860e0e2c86f55eeb4140fd76c9cc7a753f78f93c509a10237033ec2109d2e806605f302d3fc9e9b916d2967053a4bce9b2cdea14df5885b SHA512 b4de7d8ab43f27e14372bb7246be4b032b142f22913ceaaa01e7631a1f702ba77ccf25482038cf2341f7a0ae92d54a1200bb654cac1d409b1ddcc113513b3f16 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\!"
}