blob: f7b3f3b05fda00c2b5d0d0c6f05f016093cc3c2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit check-reqs multiprocessing shards systemd
COMMIT="5160d8bae39dc5cc5d51abee90571a03c08d0f2b"
MOCKS_COMMIT="dfd53ea6ceb3cbcbbce6004f6ce60b330ad0f9b1"
MOCKS_P="${PN}-mocks-${MOCKS_COMMIT:0:7}"
DESCRIPTION="Invidious is an alternative front-end to YouTube"
HOMEPAGE="
https://invidious.io/
https://github.com/iv-org/invidious
"
IV_ORG="https://github.com/iv-org"
NPM="https://registry.npmjs.org"
SRC_URI="
${IV_ORG}/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz
${NPM}/video.js/-/video.js-7.12.1.tgz
${NPM}/videojs-contrib-quality-levels/-/videojs-contrib-quality-levels-2.1.0.tgz
${NPM}/videojs-http-source-selector/-/videojs-http-source-selector-1.1.6.tgz
${NPM}/videojs-markers/-/videojs-markers-1.0.1.tgz
${NPM}/videojs-mobile-ui/-/videojs-mobile-ui-0.6.1.tgz
${NPM}/videojs-overlay/-/videojs-overlay-2.1.4.tgz
${NPM}/videojs-share/-/videojs-share-3.2.1.tgz
${NPM}/videojs-vr/-/videojs-vr-1.8.0.tgz
${NPM}/videojs-vtt-thumbnails/-/videojs-vtt-thumbnails-0.0.13.tgz
test? (
${IV_ORG}/mocks/archive/${MOCKS_COMMIT}.tar.gz -> ${MOCKS_P}.tar.gz
)
"
S="${WORKDIR}/${PN}-${COMMIT}"
LICENSE="AGPL-3 Apache-2.0 MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
COMMON_DEPEND="
dev-db/sqlite:3
dev-libs/boehm-gc
dev-libs/libevent:=
dev-libs/libpcre:3
dev-libs/libxml2:2
dev-libs/libyaml
dev-libs/openssl:=
sys-libs/zlib:=
"
RDEPEND="${COMMON_DEPEND}
acct-user/invidious
gnome-base/librsvg
"
DEPEND="${COMMON_DEPEND}
dev-crystal/athena-negotiation
dev-crystal/crystal-pg
dev-crystal/crystal-sqlite3
~dev-crystal/kemal-1.1.2
dev-crystal/kilt
dev-crystal/protodec
test? (
dev-crystal/spectator
)
"
DOCS=( {CHANGELOG,README}.md TRANSLATION )
CHECKREQS_MEMORY="2G"
src_unpack() {
local src depname destname js css
for src in ${A}; do
if [[ ${src} == "${P}.tar.gz" ]]; then
unpack ${src}
elif [[ ${src} == "${MOCKS_P}.tar.gz" ]]; then
unpack "${src}"
mkdir -p "${S}"/mocks || die
rmdir "${S}"/mocks || die
mv mocks-${MOCKS_COMMIT} "${S}"/mocks || die
else
depname="${src%-*}"
case ${depname} in
video.js)
js="video.js" ;;
*)
js="${depname}.js" ;;
esac
case ${depname} in
video.js)
css="video-js.css" ;;
videojs-markers)
css="videojs.markers.css" ;;
*)
css="${depname}.css" ;;
esac
# Create the destination directory
destname="${S}/assets/videojs/${depname}"
mkdir -p "${destname}" || die
# Create a temporary directory
mkdir -p "${WORKDIR}"/${depname} || die
cd "${WORKDIR}"/${depname} || die
# Copy assets
unpack ${src}
cd package/dist || die
mv ${js} ${destname} || die
if [[ -f ${css} ]]; then
mv ${css} ${destname} || die
fi
cd "${WORKDIR}" || die
fi
done
}
src_prepare() {
default
local datadir="${EPREFIX}/usr/share/invidious"
sed -i src/invidious.cr \
-e 's/\(CURRENT_BRANCH \) = .*/\1 = "master"/' \
-e "s/\(CURRENT_COMMIT \) = .*/\1 = \"${COMMIT:0:7}\"/" \
-e "s/\(CURRENT_VERSION\) = .*/\1 = \"${PV}\"/" \
-e "s/\(ASSET_COMMIT\) = .*/\1 = \"${COMMIT:0:7}\"/" || die
# fix paths
sed -i src/invidious.cr \
-e "s|\(public_folder\) \"assets\"|\1 \"${datadir}/assets\"|" || die
sed -i src/invidious/helpers/i18n.cr \
-e "s|File.read(\"locales/|File.read(\"${datadir}/locales/|" || die
sed -i src/invidious/database/base.cr \
-e "s|config/sql|${datadir}/\0|g" || die
rm shard.lock || die
}
src_configure() {
local mycrystalargs=(
-Dskip_videojs_download
-Ddisable_quic
)
shards_src_configure
}
src_compile() {
ecrystal build src/invidious.cr --verbose --threads=$(makeopts_jobs)
}
src_install() {
dobin invidious
einstalldocs
insinto /usr/share/invidious
doins -r assets config locales
insinto /etc/invidious
newins config/config.example.yml config.yml
systemd_dounit "${FILESDIR}"/invidious.service
newinitd "${FILESDIR}"/invidious.initd ${PN}
newconfd "${FILESDIR}"/invidious.confd ${PN}
}
|