forked from tastytea/overlay
www-apps/misskey: add 13.12.2
Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
parent
e7f02c7f53
commit
58cf9b6c62
|
@ -4,5 +4,7 @@ DIST misskey-13.11.2-deps.tar.zst 470418974 BLAKE2B c80ac5730791e9bce4c38c1ae897
|
||||||
DIST misskey-13.11.2.tar.gz 20925230 BLAKE2B 976665c2ede71903fd4a67cb26647c2332a17d2b495442006b16814ce4e66bc53baa6cc06cde7936545c989db7dde188b6b9b79f3c88a0e74119101375f94512 SHA512 5cf014c66beaa67e99f81d302786e8b2e2d1563bdc81a1db588657da72c71c5cca19af3e12a0ffa743fb0b6206916bf62e3677a6bb16bcb38cf1c966be07ad0d
|
DIST misskey-13.11.2.tar.gz 20925230 BLAKE2B 976665c2ede71903fd4a67cb26647c2332a17d2b495442006b16814ce4e66bc53baa6cc06cde7936545c989db7dde188b6b9b79f3c88a0e74119101375f94512 SHA512 5cf014c66beaa67e99f81d302786e8b2e2d1563bdc81a1db588657da72c71c5cca19af3e12a0ffa743fb0b6206916bf62e3677a6bb16bcb38cf1c966be07ad0d
|
||||||
DIST misskey-13.11.3-deps.tar.zst 470416726 BLAKE2B a634d4a09a01cae838862098fa559ca59a588cde46cbabce444ad56858e672352a5c7124bcea73aa050e72114eefa5cf9fdae27121e6d37ae0534a199071b341 SHA512 0b92470a41c13760702a3a2c7bba03aebf335af34c09ac023125f1a6cf22fceee87c177b617da5b268d137517dbc51342354d356555d8885b9fdbd7b7f6cce1a
|
DIST misskey-13.11.3-deps.tar.zst 470416726 BLAKE2B a634d4a09a01cae838862098fa559ca59a588cde46cbabce444ad56858e672352a5c7124bcea73aa050e72114eefa5cf9fdae27121e6d37ae0534a199071b341 SHA512 0b92470a41c13760702a3a2c7bba03aebf335af34c09ac023125f1a6cf22fceee87c177b617da5b268d137517dbc51342354d356555d8885b9fdbd7b7f6cce1a
|
||||||
DIST misskey-13.11.3.tar.gz 20939328 BLAKE2B 4aa45f3e362154514d6187163cd328aa7209a4418ec9a04d06ba197b808313862014b05997a4d81724160799ee8140f78935f79fd02ae38fff10b20bea072461 SHA512 5edc4c755bd1db43ea178c682b3aa528fbf02f105f85b55f380626b9551bfa6636b44056b45448b18b18497d637c4f3c68a854620d4b61bf0395e7e0245f7f8b
|
DIST misskey-13.11.3.tar.gz 20939328 BLAKE2B 4aa45f3e362154514d6187163cd328aa7209a4418ec9a04d06ba197b808313862014b05997a4d81724160799ee8140f78935f79fd02ae38fff10b20bea072461 SHA512 5edc4c755bd1db43ea178c682b3aa528fbf02f105f85b55f380626b9551bfa6636b44056b45448b18b18497d637c4f3c68a854620d4b61bf0395e7e0245f7f8b
|
||||||
|
DIST misskey-13.12.2-deps.tar.zst 474230015 BLAKE2B d5716d896a0426859a2b0acbe8d9b1770eed1a9731be1a8344a972cc0e66ef228aa906cdde0b29779a42e21f530c430c13c4dcf2b23fa2316a5feb05270d47a5 SHA512 748d2bf9c0e3cdb18a44d7acfae031fb357687a3a0de55239c777318b43591ea50a32faf8385a02de5ce2db0354783b1753de64235b473fe199ef5b7c2be8421
|
||||||
|
DIST misskey-13.12.2.tar.gz 21195706 BLAKE2B 54eb0238e32a522363ae921b8b289332e8fe785ac72572fb79c61803984388a8aff054ff50d0af1349cd6773dc0d972343fedf92ebe405f59c2c02f467c64420 SHA512 16395f7440fc6b77f5cb159f9eeaa5ca1cdbadff72b806c91f52702ee72a06644d60f0a171b863cee72f7c6a1f970fbe6074443ed280abf552227cf4946cda31
|
||||||
DIST misskey-assets-0179793ec891856d6f37a3be16ba4c22f67a81b5.tar.gz 40471635 BLAKE2B 5305b5b316aa9d27f860e0e2c86f55eeb4140fd76c9cc7a753f78f93c509a10237033ec2109d2e806605f302d3fc9e9b916d2967053a4bce9b2cdea14df5885b SHA512 b4de7d8ab43f27e14372bb7246be4b032b142f22913ceaaa01e7631a1f702ba77ccf25482038cf2341f7a0ae92d54a1200bb654cac1d409b1ddcc113513b3f16
|
DIST misskey-assets-0179793ec891856d6f37a3be16ba4c22f67a81b5.tar.gz 40471635 BLAKE2B 5305b5b316aa9d27f860e0e2c86f55eeb4140fd76c9cc7a753f78f93c509a10237033ec2109d2e806605f302d3fc9e9b916d2967053a4bce9b2cdea14df5885b SHA512 b4de7d8ab43f27e14372bb7246be4b032b142f22913ceaaa01e7631a1f702ba77ccf25482038cf2341f7a0ae92d54a1200bb654cac1d409b1ddcc113513b3f16
|
||||||
DIST misskey-emojis-cae981eb4c5189ea9ea3230e83b876a5068df7d1.tar.gz 12933900 BLAKE2B e37df7009b21276debd2118d1fb12bc917aa148a088e186a2fe85597cb5ea1a9aa79600919e7d0196af2bf8dfc6fee7f1b9cc6b898cda00810ece2969291e5a7 SHA512 68fce9f6afd7bd3db40ca5e990514f9d88506253f100b7c9db2032be97594919c36ab4bdc235ebb98647b7cc827f88d53bf9bdb59b4017888a1ec3a68e2e06fb
|
DIST misskey-emojis-cae981eb4c5189ea9ea3230e83b876a5068df7d1.tar.gz 12933900 BLAKE2B e37df7009b21276debd2118d1fb12bc917aa148a088e186a2fe85597cb5ea1a9aa79600919e7d0196af2bf8dfc6fee7f1b9cc6b898cda00810ece2969291e5a7 SHA512 68fce9f6afd7bd3db40ca5e990514f9d88506253f100b7c9db2032be97594919c36ab4bdc235ebb98647b7cc827f88d53bf9bdb59b4017888a1ec3a68e2e06fb
|
||||||
|
|
162
www-apps/misskey/misskey-13.12.2.ebuild
Normal file
162
www-apps/misskey/misskey-13.12.2.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-7
|
||||||
|
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