Add element-desktop ebuild

This commit is contained in:
layman 2020-07-19 10:48:41 -07:00
parent bdb5edaf1a
commit f6f114ef37
4 changed files with 154 additions and 0 deletions

View File

@ -0,0 +1,2 @@
DIST element-desktop-1.7.1.tar.gz 1868544 BLAKE2B b91966b601351a34e0e343297a28d2efad58571e90c5d06bc2809abcdb96cd0d6a01dae6807ec31d128b0db2063b8ee30eb5fc9d507961f198bc5c4ebad8f3d3 SHA512 4122456e361c3d043659e3c00f2035ed544b8b4fde95726482399f65420113e2bd19329ea8477b90468dad9ae5e749855004a76d059cdac2caba8c7106e75d5c
DIST element-web-1.7.1.tar.gz 1162742 BLAKE2B 3d235b1c0700d725a36ee16d5815de895817e693973fc378438c7070395c168da9c7f52f4238941f888ced34333804525be3057dd25b61e70b3b4a343fc5c75b SHA512 1444fbf7872019e25e230317aff600beb44b0c7cb1497d34f8e78fb7298413a565bf705750fde8158bf1ffcd16bc5af5321678c09abd4ccb5d7e076902f196c9

View File

@ -0,0 +1,123 @@
# Copyright 2020 rexy712
# Distributed under the terms of the GNU General Public License v3
EAPI=7
DESCRIPTION="A glossy Matrix collaboration client for desktop"
HOMEPAGE="https://element.io"
inherit eutils desktop
if [ "${PR}" != "r0" ];then
rc_num="${PR:1}"
MY_PV="${PV}-rc.${rc_num}"
else
MY_PV="${PV}"
fi
MY_PF="${PN}-${MY_PV}"
S="${WORKDIR}"
ELEMENT_WEB="element-web-${MY_PV}"
ELEMENT_DESKTOP="element-desktop-${MY_PV}"
RIOT_WEB="riot-web-${MY_PV}"
RIOT_DESKTOP="riot-desktop-${MY_PV}"
WEB_S="${S}/${RIOT_WEB}"
DESKTOP_S="${S}/${RIOT_DESKTOP}"
SRC_URI="
https://github.com/vector-im/riot-web/archive/v${MY_PV}.tar.gz -> ${ELEMENT_WEB}.tar.gz
https://github.com/vector-im/riot-desktop/archive/v${MY_PV}.tar.gz -> ${ELEMENT_DESKTOP}.tar.gz
"
KEYWORDS="~amd64"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="+emoji proxy native-modules"
REQUIRED_USE=""
RESTRICT="network-sandbox" #need network sandbox disabled for `yarn install` to work
COMMON_DEPEND="
!net-im/riot-web
!net-im/riot-desktop
>=net-libs/nodejs-13.0
>=sys-apps/yarn-1.20
x11-libs/libXScrnSaver
net-print/cups
dev-libs/nss
gnome-base/gconf
>=media-video/ffmpeg-4.0
native-modules? (
dev-lang/tcl:=
dev-db/sqlcipher:=
)
"
DEPEND="
${COMMON_DEPEND}
native-modules? (
|| ( dev-lang/rust-bin dev-lang/rust )
sys-devel/make
)
"
RDEPEND="
${COMMON_DEPEND}
emoji? ( >=media-fonts/noto-emoji-20180823 )
"
PATCHES=()
DESTINATION="/opt/Element"
get_proxy() {
if ! use "proxy";then
echo ""
else
echo "$http_proxy"
fi
}
src_prepare() {
my_proxy="$(get_proxy)"
cd "${WEB_S}" || die
http_proxy="$my_proxy" yarn install || die "Yarn module installation failed"
cd "${DESKTOP_S}" || die
http_proxy="$my_proxy" yarn install || die "Yarn module installation failed"
ln -s "${WEB_S}/webapp" "${DESKTOP_S}/" || die
default
}
src_compile() {
my_proxy="$(get_proxy)"
einfo "Building element-web..."
cd "${WEB_S}" || die
yarn build || die "Element web build failed"
einfo "Building element-desktop..."
cd "${DESKTOP_S}" || die
http_proxy="$my_proxy" yarn build || die "Element desktop build failed"
if use native-modules;then
einfo "Building native modules..."
http_proxy="$my_proxy" yarn run build:native || die
fi
}
src_install() {
insinto "${DESTINATION}"
cp "${FILESDIR}/${PN}.desktop" "${T}"
sed -e 's@{::install_location::}@'"${DESTINATION}"'@g' "${T}/${PN}.desktop" -i
domenu "${T}/${PN}.desktop"
cp -r "${DESKTOP_S}/dist/linux-unpacked/"* "${D}/${DESTINATION}/"
insinto "${DESTINATION}/resources/"
doins -r "${WEB_S}/webapp/"
insinto "${DESTINATION}/resources/webapp/"
doins "${DESKTOP_S}/element.io/release/config.json"
dosym "${DESTINATION}/${PN}" "/usr/bin/${PN}"
}

View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=Element Desktop
Comment=A glossy Matrix collaboration client for the web.
Exec=/usr/bin/element-desktop
Icon={::install_location::}/resources/img/element
Terminal=false
Type=Application
Categories=Network;Chat;Telephony;VideoConference;
StartupNotify=true

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>rexerton.rexy@tutamail.com</email>
<name>rexy712</name>
</maintainer>
<longdescription>
Riot is a glossy Matrix client built on top of matrix-react-sdk with an emphasis on performance and usability.
</longdescription>
<use>
<flag name="emoji">Include support for rendering emoji</flag>
<flag name="proxy">Use http_proxy environment variable with `yarn install`</flag>
<flag name="native-modules">Build native rust modules</flag>
</use>
</pkgmetadata>