www-apps/misskey: add 13.2.3
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
parent
e7a78e4bf8
commit
f588468e75
1
www-apps/misskey/.npmrc
Normal file
1
www-apps/misskey/.npmrc
Normal file
|
@ -0,0 +1 @@
|
|||
store-dir=/home/tastytea/Projekte/overlay-tastytea/www-apps/misskey/packages-cache
|
|
@ -2,5 +2,7 @@ DIST misskey-12.119.2-deps.tar.xz 565595040 BLAKE2B 78bd1f8f51614c57d56fbbdc506b
|
|||
DIST misskey-12.119.2.tar.gz 19901911 BLAKE2B 5ceba5ba122308d0998b86e0f7de4a227058b7a64784f6a02372fb7fb9d16e0f0e213cd671eb17144570d10022aa51c5b7b5aeb9e833a696fd48bdbf7c0c860f SHA512 91b11453751e387611c1e66c7b94137cbbe74c2e4df7ef45f2c6a2a15b4d398e77c1c71490038408b8ee1ded6206c330d628ade49da7b930dbd95312e3d00e65
|
||||
DIST misskey-13.1.8-deps.tar.xz 349024960 BLAKE2B ce57c73e72893ec14c0956d2f2782811ae90eb236636e7764b231ea473dcef625663a53cb527025eb5773e2a3471bfbdcf9ee04f43470510f88d3b2a173cde61 SHA512 caf97180ef469dd3e199f3391394cd0e1b77a0348c5c6263e7ccb172c5e533661fc2a3f7102ed7abdbd08e948f1cba2616cf14a2d0beb5b707bd16c00dd94409
|
||||
DIST misskey-13.1.8.tar.gz 20094262 BLAKE2B 42f038d176d4dd7c78dc1bbe9fb7c24f33eaac4ab59b21fc4d4fdae7a75d043bbbf9ff528b55e3b0c1dcfb9b6ea08b84fa85d2eb584ab757f5b9e09acc4f4be0 SHA512 d36f0c67bf451d1de97576685fe5833274b2f39ebcd32abf61fd2ed74df082e7821a075f0c9bdefc5e40117d9c7f20249b4dba2bf9c11f6229cd96cc2f84725e
|
||||
DIST misskey-13.2.3-deps.tar.xz 331635912 BLAKE2B f54ecc60f3a5ed6a7e624ee5b642f0c6f7097047c6e0f2693f978e6a7f81fa924dc55a10bce1cdb127d3cf512dda408712651f939c967a3a453e0bc80df9034b SHA512 4b32bcdc93a8f5a1272afbc55eddaca76c027dd48030334a4a5e5df3c80761dac1eda169933e6b07fd0a1ef9dd6eed151d1df66974d3f3cbcb4b9d8db2c5b49a
|
||||
DIST misskey-13.2.3.tar.gz 20096840 BLAKE2B 6cc2919e9dfdc69130af98bc7d797f889a4be960cce230612156b08af31cd641a3fdde39690a4e8f51c0b230433a397e62f2af53290e4f5e4d30c7073d2f18fe SHA512 eaa572cc321ee41c48400dffd443fc3bc68bbe7e58beea34b79215431875e141436e5cf6ca4483fc65d90ff84bcf44c2f6cd355601a431047b65440bc309ce10
|
||||
DIST misskey-assets-0179793ec891856d6f37a3be16ba4c22f67a81b5.tar.gz 40471635 BLAKE2B 5305b5b316aa9d27f860e0e2c86f55eeb4140fd76c9cc7a753f78f93c509a10237033ec2109d2e806605f302d3fc9e9b916d2967053a4bce9b2cdea14df5885b SHA512 b4de7d8ab43f27e14372bb7246be4b032b142f22913ceaaa01e7631a1f702ba77ccf25482038cf2341f7a0ae92d54a1200bb654cac1d409b1ddcc113513b3f16
|
||||
DIST misskey-emojis-cae981eb4c5189ea9ea3230e83b876a5068df7d1.tar.gz 12933900 BLAKE2B e37df7009b21276debd2118d1fb12bc917aa148a088e186a2fe85597cb5ea1a9aa79600919e7d0196af2bf8dfc6fee7f1b9cc6b898cda00810ece2969291e5a7 SHA512 68fce9f6afd7bd3db40ca5e990514f9d88506253f100b7c9db2032be97594919c36ab4bdc235ebb98647b7cc827f88d53bf9bdb59b4017888a1ec3a68e2e06fb
|
||||
|
|
160
www-apps/misskey/misskey-13.2.3.ebuild
Normal file
160
www-apps/misskey/misskey-13.2.3.ebuild
Normal file
|
@ -0,0 +1,160 @@
|
|||
# Copyright 2022-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit optfeature savedconfig
|
||||
|
||||
# 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.xz
|
||||
"
|
||||
|
||||
# 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
|
||||
# tar -caf ${P}-deps.tar.xz 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:=[npm]
|
||||
"
|
||||
BDEPEND="
|
||||
${COMMON_DEPEND}
|
||||
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() {
|
||||
default
|
||||
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
|
||||
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\!"
|
||||
}
|
Reference in New Issue
Block a user