Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New packages: dev-util/asar, net-im/discord and net-im/discord-canary #230

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-util/asar/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST asar-3.2.4.tar.gz 106327 BLAKE2B c577d4b5b384de15a542d97f4e99241f788632166aa0822135917351eaa0c20999d3078f68699c389d4a291be906c330ee60d539db8ed19b48e3af1e53e675e9 SHA512 5d7c8bcdb4ea4c596fe85a1912a05d8ddf54ea76877a0386efc73f46401fb5d8b71921a3844f82828fbd48dfc4cec1d835b80597fe6ca27f397b023302a1aa77
27 changes: 27 additions & 0 deletions dev-util/asar/asar-3.2.4.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Creating Electron app packages"
HOMEPAGE="https://github.com/electron/asar"

SRC_URI="https://github.com/electron/asar/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~ppc64"

DEPEND="net-libs/nodejs"
BDEPEND="net-libs/nodejs[npm]"

src_unpack() {
npm install -g --prefix "${P}/usr" "${DISTDIR}/${P}.tar.gz" || die
}

src_install() {
insinto "/usr/lib64/node_modules/@electron"
doins -r "${WORKDIR}/${P}/usr/lib64/node_modules/@electron/asar"
fperms ugo+rx "/usr/lib64/node_modules/@electron/asar/bin/asar.js"
dosym "/usr/lib64/node_modules/@electron/asar/bin/asar.js" "/usr/bin/asar"
}
11 changes: 11 additions & 0 deletions dev-util/asar/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Niccolò Belli</name>
</maintainer>
<upstream>
<remote-id type="github">develar/app-builder</remote-id>
</upstream>
</pkgmetadata>
1 change: 1 addition & 0 deletions net-im/discord-canary/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST discord-canary-0.0.156.tar.gz 92620916 BLAKE2B a3704d6489d2b0889c0f445708a861df935747b8a8d278273d892162c8624cc3a405b7a92fc3fe0675a16947c14301a18f89d938f85bd8a492558a3ce77fabd4 SHA512 f847d0e4f786ca7d91863424b4caf1ae921093e55ecd9e9a97678aafd9c465d9c6cd02539d6c7f143ab14d7f3823b51d31a7bf66dcb21101e1ddf5960e885114
92 changes: 92 additions & 0 deletions net-im/discord-canary/discord-canary-0.0.156.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit desktop flag-o-matic multilib xdg-utils

DESCRIPTION="All-in-one voice and text chat for gamers"
HOMEPAGE="https://discord.com"

SRC_URI="https://dl-canary.discordapp.net/apps/linux/${PV}/${P}.tar.gz"

SLOT="0"
KEYWORDS="~ppc64"

ELECTRON_SLOT_DEFAULT="22"
_pkgname=DiscordCanary

IUSE="electron-19 electron-20 electron-21 electron-23 electron-24"

COMMON_DEPEND="
electron-19? ( dev-util/electron:19 )
electron-20? ( dev-util/electron:20 )
electron-21? ( dev-util/electron:21 )
electron-23? ( dev-util/electron:23 )
electron-24? ( dev-util/electron:24 )
!electron-19? (
!electron-20? (
!electron-21? (
!electron-23? (
!electron-24? (
dev-util/electron:${ELECTRON_SLOT_DEFAULT}
) ) ) ) )
"

RDEPEND="${COMMON_DEPEND}"
DEPEND="${COMMON_DEPEND}"
BDEPEND="
net-libs/nodejs
dev-util/asar
"

src_unpack() {
if use electron-19; then
export ELECTRON_SLOT=19
elif use electron-20; then
export ELECTRON_SLOT=20
elif use electron-21; then
export ELECTRON_SLOT=21
elif use electron-23; then
export ELECTRON_SLOT=23
elif use electron-24; then
export ELECTRON_SLOT=24
else
export ELECTRON_SLOT=$ELECTRON_SLOT_DEFAULT
fi
mkdir "${P}" || die
cd "${P}" || die
unpack "${P}.tar.gz" || die
}

src_prepare() {
cp "${FILESDIR}/${PN}" "${WORKDIR}" || die
sed -i "s|@ELECTRON@|electron-${ELECTRON_SLOT}|" "${WORKDIR}/${PN}" || die
sed -i "s|@LIBDIR@|$(get_libdir)|" "${WORKDIR}/${PN}" || die
sed -i "s|Exec=.*|Exec=/usr/bin/${PN}|" "${WORKDIR}/${P}/${_pkgname}/${PN}.desktop" || die
asar e "${WORKDIR}/${P}/${_pkgname}/resources/app.asar" "${WORKDIR}/${P}/${_pkgname}/resources/app" || die
rm "${WORKDIR}/${P}/${_pkgname}/resources/app.asar" || die
sed -i "s|process.resourcesPath|'/usr/$(get_libdir)/${PN}'|" "${WORKDIR}/${P}/${_pkgname}/resources/app/app_bootstrap/buildInfo.js" || die
sed -i "s|exeDir,|'/usr/share/pixmaps',|" "${WORKDIR}/${P}/${_pkgname}/resources/app/app_bootstrap/autoStart/linux.js" || die
asar p "${WORKDIR}/${P}/${_pkgname}/resources/app" "${WORKDIR}/${P}/${_pkgname}/resources/app.asar" --unpack-dir '**' || die
rm -rf "${WORKDIR}/${P}/${_pkgname}/resources/app" || die
default
}

src_install() {
insinto "/usr/$(get_libdir)/${PN}"
doins -r ${_pkgname}/resources/*
newicon "${_pkgname}/discord.png" "${PN}.png"
domenu "${_pkgname}/${PN}.desktop"
dobin "${WORKDIR}/${PN}"
}

pkg_postrm() {
xdg_icon_cache_update
xdg_desktop_database_update
}

pkg_postinst() {
xdg_icon_cache_update
xdg_desktop_database_update
}
21 changes: 21 additions & 0 deletions net-im/discord-canary/files/discord-canary
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env sh

set -euo pipefail

name=@ELECTRON@
libdir=@LIBDIR@
flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"

declare -a flags

if [[ -f "${flags_file}" ]]; then
mapfile -t < "${flags_file}"
fi

for line in "${MAPFILE[@]}"; do
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
flags+=("${line}")
fi
done

exec /usr/${libdir}/${name}/electron /usr/${libdir}/discord-canary/app.asar "${flags[@]}" "$@"
11 changes: 11 additions & 0 deletions net-im/discord-canary/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Niccolò Belli</name>
</maintainer>
<upstream>
<remote-id type="github">develar/app-builder</remote-id>
</upstream>
</pkgmetadata>
1 change: 1 addition & 0 deletions net-im/discord/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST discord-0.0.27.tar.gz 92317071 BLAKE2B 5328abd5f6aba87c73ee26cc6387dd9af7745c003e67b70e168153a959f5f582d118d38ce0b45ff4a9165ff1423708b05d468824c880e4685755df41ceadd5e1 SHA512 285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f
91 changes: 91 additions & 0 deletions net-im/discord/discord-0.0.27.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit desktop flag-o-matic multilib xdg-utils

DESCRIPTION="All-in-one voice and text chat for gamers"
HOMEPAGE="https://discord.com"

SRC_URI="https://dl.discordapp.net/apps/linux/${PV}/${P}.tar.gz"

SLOT="0"
KEYWORDS="~ppc64"

ELECTRON_SLOT_DEFAULT="22"

IUSE="electron-19 electron-20 electron-21 electron-23 electron-24"

COMMON_DEPEND="
electron-19? ( dev-util/electron:19 )
electron-20? ( dev-util/electron:20 )
electron-21? ( dev-util/electron:21 )
electron-23? ( dev-util/electron:23 )
electron-24? ( dev-util/electron:24 )
!electron-19? (
!electron-20? (
!electron-21? (
!electron-23? (
!electron-24? (
dev-util/electron:${ELECTRON_SLOT_DEFAULT}
) ) ) ) )
"

RDEPEND="${COMMON_DEPEND}"
DEPEND="${COMMON_DEPEND}"
BDEPEND="
net-libs/nodejs
dev-util/asar
"

src_unpack() {
if use electron-19; then
export ELECTRON_SLOT=19
elif use electron-20; then
export ELECTRON_SLOT=20
elif use electron-21; then
export ELECTRON_SLOT=21
elif use electron-23; then
export ELECTRON_SLOT=23
elif use electron-24; then
export ELECTRON_SLOT=24
else
export ELECTRON_SLOT=$ELECTRON_SLOT_DEFAULT
fi
mkdir "${P}" || die
cd "${P}" || die
unpack "${P}.tar.gz" || die
}

src_prepare() {
cp "${FILESDIR}/${PN}" "${WORKDIR}" || die
sed -i "s|@ELECTRON@|electron-${ELECTRON_SLOT}|" "${WORKDIR}/${PN}" || die
sed -i "s|@LIBDIR@|$(get_libdir)|" "${WORKDIR}/${PN}" || die
sed -i "s|Exec=.*|Exec=/usr/bin/${PN}|" "${WORKDIR}/${P}/Discord/${PN}.desktop" || die
asar e "${WORKDIR}/${P}/Discord/resources/app.asar" "${WORKDIR}/${P}/Discord/resources/app" || die
rm "${WORKDIR}/${P}/Discord/resources/app.asar" || die
sed -i "s|process.resourcesPath|'/usr/$(get_libdir)/${PN}'|" "${WORKDIR}/${P}/Discord/resources/app/app_bootstrap/buildInfo.js" || die
sed -i "s|exeDir,|'/usr/share/pixmaps',|" "${WORKDIR}/${P}/Discord/resources/app/app_bootstrap/autoStart/linux.js" || die
asar p "${WORKDIR}/${P}/Discord/resources/app" "${WORKDIR}/${P}/Discord/resources/app.asar" --unpack-dir '**' || die
rm -rf "${WORKDIR}/${P}/Discord/resources/app" || die
default
}

src_install() {
insinto "/usr/$(get_libdir)/${PN}"
doins -r Discord/resources/*
doicon "Discord/${PN}.png"
domenu "Discord/${PN}.desktop"
dobin "${WORKDIR}/${PN}"
}

pkg_postrm() {
xdg_icon_cache_update
xdg_desktop_database_update
}

pkg_postinst() {
xdg_icon_cache_update
xdg_desktop_database_update
}
21 changes: 21 additions & 0 deletions net-im/discord/files/discord
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env sh

set -euo pipefail

name=@ELECTRON@
libdir=@LIBDIR@
flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"

declare -a flags

if [[ -f "${flags_file}" ]]; then
mapfile -t < "${flags_file}"
fi

for line in "${MAPFILE[@]}"; do
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
flags+=("${line}")
fi
done

exec /usr/${libdir}/${name}/electron /usr/${libdir}/discord/app.asar "${flags[@]}" "$@"
11 changes: 11 additions & 0 deletions net-im/discord/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Niccolò Belli</name>
</maintainer>
<upstream>
<remote-id type="github">develar/app-builder</remote-id>
</upstream>
</pkgmetadata>