summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKillswitch2020-08-15 15:10:51 +0200
committerKillswitch2020-08-15 15:10:51 +0200
commit60ee0bb32b07d39bed729b55f8b76f52bfd395b4 (patch)
treed00d7a556325b08788c69ecbca34549f1fa2eb83
downloadaur-60ee0bb32b07d39bed729b55f8b76f52bfd395b4.tar.gz
Initial version
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD64
2 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b3663e76f89b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = powercord-git
+ pkgdesc = A lightweight discord client mod focused on simplicity and performance.
+ pkgver = r1178.41cb7ce
+ pkgrel = 1
+ url = https://github.com/powercord-org/powercord
+ arch = any
+ license = Parkord
+ makedepends = git
+ makedepends = npm
+ makedepends = jq
+ depends = nodejs
+ options = !strip
+ source = git+https://github.com/powercord-org/powercord#branch=v2
+ source = git+https://github.com/botiapa/powercord-patches
+ md5sums = SKIP
+ md5sums = SKIP
+
+pkgname = powercord-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..709b09211d3a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,64 @@
+# Maintainer: Szentesi Botond
+pkgname=powercord-git
+_pkgname=powercord
+patches=powercord-patches
+
+pkgver=r1178.41cb7ce
+pkgrel=1
+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"
+ "git+https://github.com/botiapa/powercord-patches"
+ )
+md5sums=('SKIP'
+ 'SKIP'
+ )
+options=('!strip')
+
+prepare() {
+ patch -u ${srcdir}/${_pkgname}/injectors/index.js -i ${srcdir}/${patches}/index.js.patch
+ patch -u ${srcdir}/${_pkgname}/injectors/main.js -i ${srcdir}/${patches}/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}"
+ chmod 755 "${install_dir}/${_pkgname}"
+
+ 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}/${patches}/powercord.8" -t ${pkgdir}/usr/share/man/man8/
+ gzip ${pkgdir}/usr/share/man/man8/powercord.8
+
+ 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"
+}