pkgname=invidious pkgver=v2.20240825.2 _commit=4782a6703819e0babfa4792892b691dd096eeac3 pkgrel=0 pkgdesc="Alternative front-end to YouTube" url="https://github.com/iv-org/invidious" arch="x86_64" license="AGPL-3.0-or-later" depends=" rsvg-convert " options="!check" # testing breaks for now fixing later makedepends=" crystal git libxml2-dev openssl-dev shards sqlite-dev yaml-dev zlib-dev " install="$pkgname.pre-install" pkgusers="$pkgname" pkggroups="$pkgname" subpackages="$pkgname-openrc" source=" $pkgname-$pkgver.tar.gz::https://github.com/iv-org/invidious/archive/refs/tags/$pkgver.tar.gz $pkgname.initd " builddir="$srcdir/$pkgname-${pkgver:1}" prepare() { default_prepare sed \ -e 's/^CURRENT_BRANCH =.*/CURRENT_BRANCH = "release"/' \ -e 's/^CURRENT_COMMIT =.*/CURRENT_COMMIT = "'$pkgver'"/' \ -e 's/^CURRENT_VERSION =.*/CURRENT_VERSION = "'$pkgver'"/' \ -e 's/^ASSET_COMMIT =.*/ASSET_COMMIT = "'$pkgver'"/' \ -i src/invidious.cr datadir=/usr/share/webapps/invidious # fix paths sed -i src/invidious.cr \ -e "s|\(public_folder\) \"assets\"|\1 \"$datadir/assets\"|" sed -i src/invidious/helpers/i18n.cr \ -e "s|File.read(\"locales/|File.read(\"$datadir/locales/|" sed -i src/invidious/database/base.cr \ -e "s|config/sql|/etc/$pkgname/\0|g" } build() { shards install crystal build \ --release \ -Ddisable_quic \ src/invidious.cr } package() { install -Dm755 "$pkgname" "$pkgdir"/usr/bin/invidious install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname mkdir -p "$pkgdir"/usr/share/webapps/invidious cp -r "$builddir"/assets "$builddir"/locales \ "$pkgdir"/usr/share/webapps/invidious install -Dm644 "$builddir"/config/config.example.yml \ "$pkgdir"/etc/"$pkgname"/config.yml } sha512sums=" 1f22e6a8042b440d303508c8fcf394241560ccbaf44078e350dc227ac0d845b9bb0d1d829eb3c8737426c779e7a58d553da03d7e094458dab78a28c9065ceb8a invidious-v2.20240825.2.tar.gz ed0a2e498751927c1ad82619395a07c169f7353a9c1453381ad288ad501b915010df5b799e4f102e034f0483b9101b9a8ae40d150b3d7db80605f87b9ca6f596 invidious.initd "