diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 64 |
1 files changed, 64 insertions, 0 deletions
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" +} |