forked from tastytea/overlay
www-apps/misskey: add 13.10.3
Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
parent
ea52febab7
commit
f89dc26083
|
@ -1,5 +1,7 @@
|
||||||
DIST misskey-13.10.2-deps.tar.zst 421168474 BLAKE2B d9909227eca96a3e6a6943d620f54a2d085edead5f359c0624b8991e1b15dc287429048dec6f84c23c22f30424015a5a7c1e5fc6e1f5dded0ab240aaeba063ab SHA512 aadb5bdc709203041796a430d4bef805ad0bee830180437d639c84f8b22f1110500cd04329203ddf0e4e06f286e0e2ecd98d348db3868c88254d9a5f0f39e1c9
|
DIST misskey-13.10.2-deps.tar.zst 421168474 BLAKE2B d9909227eca96a3e6a6943d620f54a2d085edead5f359c0624b8991e1b15dc287429048dec6f84c23c22f30424015a5a7c1e5fc6e1f5dded0ab240aaeba063ab SHA512 aadb5bdc709203041796a430d4bef805ad0bee830180437d639c84f8b22f1110500cd04329203ddf0e4e06f286e0e2ecd98d348db3868c88254d9a5f0f39e1c9
|
||||||
DIST misskey-13.10.2.tar.gz 20761821 BLAKE2B aaa72ff30b06d2dc1706de6f07598cda614564e4dbfc8c2f3dbcb4ee9c5812000587dfe20cd4b9cab84b7df9099d32397d80ac9af8dc18b4e31375a4d8e3170c SHA512 478712902f220e78e6edaf154465bb60b202fbd4639096a951690554e95134e47975506241e6c9869efbd592ea6dd117397de0953394e5e6c38868f1ab9088b4
|
DIST misskey-13.10.2.tar.gz 20761821 BLAKE2B aaa72ff30b06d2dc1706de6f07598cda614564e4dbfc8c2f3dbcb4ee9c5812000587dfe20cd4b9cab84b7df9099d32397d80ac9af8dc18b4e31375a4d8e3170c SHA512 478712902f220e78e6edaf154465bb60b202fbd4639096a951690554e95134e47975506241e6c9869efbd592ea6dd117397de0953394e5e6c38868f1ab9088b4
|
||||||
|
DIST misskey-13.10.3-deps.tar.zst 414738703 BLAKE2B 5ae99fe130cf13585c196caba0f1b7c92274fed182a26f661fe1201ba11d23e2ede1bac376528d312ad03b9df98997a04b452a33a661c7099d70f8f89886d956 SHA512 15c30164a799c0769527d646384bfbbe463cccfd75ed36d552bf5f624eeebb88c177b89a0062b383ce93f77ec840e56016572eacdf7f0580cbb21956a1a7b6a8
|
||||||
|
DIST misskey-13.10.3.tar.gz 20774094 BLAKE2B d852a0fe43594524f6ef4479c53c54a97b0728e36163eccceff84a6c39713ec2dba9d128c879d4cff989f15f2afef5dcfc6fe639781be943fe21d586f1602a0f SHA512 71ff0eab6f77543807210051b12f2877c10b3de26feab4da60bea44bcc4114cc018c6eabc61fa240d57d1faf86e210f85292832d3206ef347b18c7c93ec58dc5
|
||||||
DIST misskey-13.9.2-deps.tar.zst 417170095 BLAKE2B 013f54bc0333664876dbcb3cee3f31e0b67339f69fcae56daf89ab422a28b70bd3d400595c557a63b570d8b4e98ad29a6f9773bd6e8e1a50afe0e4c0ac112132 SHA512 6e880ca9f3ca5a3792f0e61c08c1097b6b55b0bbf782a40824710112c2deb11c2223bffd5ce5ba04986b23aa4ec78870f1c0206f11f269f11011e4e183370c8e
|
DIST misskey-13.9.2-deps.tar.zst 417170095 BLAKE2B 013f54bc0333664876dbcb3cee3f31e0b67339f69fcae56daf89ab422a28b70bd3d400595c557a63b570d8b4e98ad29a6f9773bd6e8e1a50afe0e4c0ac112132 SHA512 6e880ca9f3ca5a3792f0e61c08c1097b6b55b0bbf782a40824710112c2deb11c2223bffd5ce5ba04986b23aa4ec78870f1c0206f11f269f11011e4e183370c8e
|
||||||
DIST misskey-13.9.2.tar.gz 20694074 BLAKE2B 166574116a3fd657c63dcf0203447551563bd9ad9d3410496e9de207b2a7896581e99a802ee1604a893058cd9c7f9da0832390fe27bc7512e2f7bb519c875ef1 SHA512 f2c36e5f0e49feefd873c1b60eb0e36a14d0122f1b7786d77d73674f2b11d21dc18a4ac820a5287eef41c4c15fd03bef1d140891f2065cdb34b1d9d70da5afd7
|
DIST misskey-13.9.2.tar.gz 20694074 BLAKE2B 166574116a3fd657c63dcf0203447551563bd9ad9d3410496e9de207b2a7896581e99a802ee1604a893058cd9c7f9da0832390fe27bc7512e2f7bb519c875ef1 SHA512 f2c36e5f0e49feefd873c1b60eb0e36a14d0122f1b7786d77d73674f2b11d21dc18a4ac820a5287eef41c4c15fd03bef1d140891f2065cdb34b1d9d70da5afd7
|
||||||
DIST misskey-assets-0179793ec891856d6f37a3be16ba4c22f67a81b5.tar.gz 40471635 BLAKE2B 5305b5b316aa9d27f860e0e2c86f55eeb4140fd76c9cc7a753f78f93c509a10237033ec2109d2e806605f302d3fc9e9b916d2967053a4bce9b2cdea14df5885b SHA512 b4de7d8ab43f27e14372bb7246be4b032b142f22913ceaaa01e7631a1f702ba77ccf25482038cf2341f7a0ae92d54a1200bb654cac1d409b1ddcc113513b3f16
|
DIST misskey-assets-0179793ec891856d6f37a3be16ba4c22f67a81b5.tar.gz 40471635 BLAKE2B 5305b5b316aa9d27f860e0e2c86f55eeb4140fd76c9cc7a753f78f93c509a10237033ec2109d2e806605f302d3fc9e9b916d2967053a4bce9b2cdea14df5885b SHA512 b4de7d8ab43f27e14372bb7246be4b032b142f22913ceaaa01e7631a1f702ba77ccf25482038cf2341f7a0ae92d54a1200bb654cac1d409b1ddcc113513b3f16
|
||||||
|
|
162
www-apps/misskey/misskey-13.10.3.ebuild
Normal file
162
www-apps/misskey/misskey-13.10.3.ebuild
Normal file
|
@ -0,0 +1,162 @@
|
||||||
|
# Copyright 2022-2023 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
EAPI=8
|
||||||
|
|
||||||
|
inherit optfeature savedconfig unpacker
|
||||||
|
|
||||||
|
# NOTE: check for updates on each bump
|
||||||
|
MY_COMMIT_ASSETS="0179793ec891856d6f37a3be16ba4c22f67a81b5"
|
||||||
|
MY_COMMIT_EMOJIS="cae981eb4c5189ea9ea3230e83b876a5068df7d1"
|
||||||
|
|
||||||
|
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://github.com/misskey-dev/emojis/archive/${MY_COMMIT_EMOJIS}.tar.gz -> ${PN}-emojis-${MY_COMMIT_EMOJIS}.tar.gz
|
||||||
|
https://tastytea.de/files/gentoo/${P}-deps.tar.zst
|
||||||
|
"
|
||||||
|
|
||||||
|
# NOTE: to generate the deps archive:
|
||||||
|
# export CYPRESS_CACHE_FOLDER="$(realpath ./packages-cache)"
|
||||||
|
# export npm_config_cache="$(realpath ./packages-cache)"
|
||||||
|
# pnpm config set store-dir "$(realpath ./packages-cache)"
|
||||||
|
# pnpm install --frozen-lockfile
|
||||||
|
# ZSTD_CLEVEL=9 tar -caf ${P}-deps.tar.zst packages-cache
|
||||||
|
# unset 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-18.13:=[npm]
|
||||||
|
"
|
||||||
|
BDEPEND="
|
||||||
|
${COMMON_DEPEND}
|
||||||
|
app-arch/zstd
|
||||||
|
dev-lang/nasm
|
||||||
|
virtual/pkgconfig
|
||||||
|
"
|
||||||
|
RDEPEND="
|
||||||
|
${COMMON_DEPEND}
|
||||||
|
acct-user/misskey
|
||||||
|
>=dev-db/postgresql-15
|
||||||
|
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/*
|
||||||
|
"
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
# check if pnpm from nodejs is installed
|
||||||
|
if ! type pnpm > /dev/null 2>&1; then
|
||||||
|
eerror "pnpm not found. It can be installed with 'corepack enable'"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
src_unpack() {
|
||||||
|
unpacker_src_unpack
|
||||||
|
mv --no-target-directory assets-${MY_COMMIT_ASSETS} ${P}/${PN}-assets \
|
||||||
|
|| die "Could not move assets"
|
||||||
|
mv --no-target-directory emojis-${MY_COMMIT_EMOJIS} ${P}/fluent-emojis \
|
||||||
|
|| die "Could not move emojis"
|
||||||
|
mv packages-cache "${T}"/ || die "Could not move packages cache"
|
||||||
|
}
|
||||||
|
|
||||||
|
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"
|
||||||
|
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() {
|
||||||
|
pnpm ${PNPMFLAGS} install --frozen-lockfile || die "dependency installation failed"
|
||||||
|
NODE_ENV=production pnpm ${PNPMFLAGS} run 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 node_modules packages \
|
||||||
|
fluent-emojis pnpm-workspace.yaml pnpm-lock.yaml
|
||||||
|
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 --command "psql misskey -c ''" postgres; then
|
||||||
|
einfo "Running migration…"
|
||||||
|
su --shell /bin/bash --login --command \
|
||||||
|
"cd misskey && pnpm run 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 -r MY_PASSWORD || die "Reading password failed"
|
||||||
|
echo "create database misskey with encoding = 'UTF8'; create user misskey with encrypted password '${MY_PASSWORD}'; grant all privileges on database misskey to misskey; \q" \
|
||||||
|
| su --command psql postgres || die "database creation failed"
|
||||||
|
|
||||||
|
su --shell /bin/bash --login --command \
|
||||||
|
"cd misskey && pnpm 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\!"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user