blob: cb86c3ca05f0cfc597729b909f5172e473e04ee0 (
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
|
# Maintainer: Szentesi Botond
pkgname=powercord-git
_pkgname=powercord
pkgver=r1178.41cb7ce
pkgrel=2
pkgdesc="A lightweight discord client mod focused on simplicity and performance."
arch=("any")
url="https://github.com/powercord-org/$_pkgname"
license=('Parkord')
depends=('nodejs')
makedepends=('git' 'npm' 'jq')
source=(
"git+https://github.com/powercord-org/powercord#branch=v2"
"index.js.patch"
"main.js.patch"
"powercord.8"
)
md5sums=(
'SKIP'
'SKIP'
'SKIP'
'SKIP'
)
options=('!strip')
prepare() {
patch -u ${srcdir}/${_pkgname}/injectors/index.js -i ${srcdir}/index.js.patch
patch -u ${srcdir}/${_pkgname}/injectors/main.js -i ${srcdir}/main.js.patch
}
pkgver() {
cd "${srcdir}/${_pkgname}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
package() {
cd "${srcdir}/${_pkgname}"
local install_dir="${pkgdir}/opt"
install -d "${install_dir}"
cp -a "${srcdir}/${_pkgname}" "${install_dir}"
cd "${install_dir}/${_pkgname}"
npm install --only=prod
install -m755 "${srcdir}/${_pkgname}/injectors/index.js" ${install_dir}/${_pkgname}/injectors/index.js
install -dm755 "${pkgdir}/usr/bin"
ln -s "/opt/${_pkgname}/injectors/index.js" "${pkgdir}/usr/bin/powercord"
find "${install_dir}" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
local tmppackage="$(mktemp)"
local pkgjson="${install_dir}/${_pkgname}/package.json"
jq '.|=with_entries(select(.key|test("_.+")|not))' "${pkgjson}" > "${tmppackage}"
mv "${tmppackage}" "${pkgjson}"
chmod 644 "${pkgjson}"
chown -R root:root "${install_dir}/${_pkgname}/"
find "${pkgdir}/usr" -type d -exec chmod 755 {} +
install -g 0 -o 0 -Dm 0644 "${srcdir}/powercord.8" -t ${pkgdir}/usr/share/man/man8/
gzip ${pkgdir}/usr/share/man/man8/powercord.8
# This is not ideal. It's only required because it seems like discord needs write and execute permissions.
chmod -R 757 "${install_dir}/${_pkgname}"
echo -e "\e[5m\e[101mWARNING"
echo -e "\e[5m\e[101mWARNING\e[49m \e[91m \e[4mUsing this tool could get you banned. Read the whole disclaimer on the github page!\e[0m\e[39m"
echo -e "\e[5m\e[101mWARNING\e[39m\e[49m"
}
|