diff options
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | BetterDiscord.install | 33 | ||||
-rw-r--r-- | LICENSE | 21 | ||||
-rw-r--r-- | PKGBUILD | 37 |
5 files changed, 114 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..1e3434471be1 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +# Generated by mksrcinfo v8 +# Sat Apr 1 18:53:04 UTC 2017 +pkgbase = betterdiscord + pkgdesc = Discord extension that introduces new features like BTTV emotes and plugin support. + pkgver = 0.2.81 + pkgrel = 1 + url = https://betterdiscord.net/home/ + install = BetterDiscord.install + arch = any + license = MIT + makedepends = asar + depends = discord + source = git+https://github.com/Jiiks/BetterDiscordApp.git#commit=114572e51f5ba776f52842794adced2c0843c026 + source = LICENSE + md5sums = SKIP + md5sums = 8414480728c5dc0d4ca9a93cfaf67acb + +pkgname = betterdiscord + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..d26b6ffa1f7e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +BetterDiscordApp/ +pkg/ +src/ +betterdiscord-0.2.81-1-any.pkg.tar.xz diff --git a/BetterDiscord.install b/BetterDiscord.install new file mode 100644 index 000000000000..f7f17461df64 --- /dev/null +++ b/BetterDiscord.install @@ -0,0 +1,33 @@ +pre_install() { + pre_remove +} + +post_install() { + echo ">>> Unpacking Discord asar..." + sudo asar e "/opt/discord/resources/app.asar" "/opt/discord/resources/app" + + echo ">>> Preparing Discord files..." + sed "/_fs2/ a var _betterDiscord = require('betterdiscord'); var _betterDiscord2;" "/opt/discord/resources/app/index.js" > "/usr/lib/betterdiscord/index.js" + sudo mv "/usr/lib/betterdiscord/index.js" "/opt/discord/resources/app/index.js" + sed "/mainWindow = new/ a _betterDiscord2 = new _betterDiscord.BetterDiscord(mainWindow);" "/opt/discord/resources/app/index.js" > "/usr/lib/betterdiscord/index.js" + sudo mv "/usr/lib/betterdiscord/index.js" "/opt/discord/resources/app/index.js" + + echo ">>> Finishing up..." + sudo cp -rf "/usr/lib/betterdiscord/" "/opt/discord/resources/app/node_modules/betterdiscord" +} + +pre_upgrade() { + pre_remove +} + +post_upgrade() { + post_install +} + +pre_remove() { + echo ">>> Killing Discord..." + killall -SIGKILL Discord + + echo ">>> Removing app folder from Discord directory..." + sudo rm -rf "/opt/discord/resources/app" +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..0fdeb2edf64e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016 Jiiks | https://jiiks.net/ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f7eb6be0f8b4 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: Ilya Trukhanov <lahvuun@gmail.com> +# +# This package is based on discorddownloader by simonizor +# http://www.simonizor.gq/discorddownloader.html + +pkgname=betterdiscord +pkgver=0.2.81 +pkgrel=1 +pkgdesc='Discord extension that introduces new features like BTTV emotes and plugin support.' +arch=('any') +url='https://betterdiscord.net/home/' +license=('MIT') +depends=('discord') +makedepends=('asar') +install='BetterDiscord.install' +source=('git+https://github.com/Jiiks/BetterDiscordApp.git#commit=114572e51f5ba776f52842794adced2c0843c026' LICENSE) +md5sums=('SKIP' + '8414480728c5dc0d4ca9a93cfaf67acb') + +package() { + install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + # Get rid of git files. + mkdir -p "package" + cp -rf "./BetterDiscordApp/" "./package/" + cd "./package/BetterDiscordApp/" + rm -rf ".git" + rm "./.gitignore" + + install -d "${pkgdir}/usr/lib/${pkgname}/" + cp -a "./." "${pkgdir}/usr/lib/${pkgname}" + mv "${pkgdir}/usr/lib/${pkgname}/lib/Utils.js" "${pkgdir}/usr/lib/${pkgname}/lib/utils.js" + + # Patch BetterDiscord files. + sed -i "s/'\/var\/local'/process.env.HOME + '\/.config'/g" "${pkgdir}/usr/lib/${pkgname}/lib/BetterDiscord.js" + sed -i "s/bdstorage/bdStorage/g" "${pkgdir}/usr/lib/${pkgname}/lib/BetterDiscord.js" +} |