Add use flags to riot-web

This commit is contained in:
rexy712 2019-10-25 15:13:25 -07:00
parent c046d3054c
commit 6196a89ec2
4 changed files with 30 additions and 9 deletions

View File

@ -14,6 +14,9 @@
<use>
<flag name="emoji">Include support for rendering emoji</flag>
<flag name="proxy">Use http_proxy environment variable with `yarn install`</flag>
<flag name="darkmode">Use riot.im's dark mode by default</flag>
<flag name="labs">Enable use of riot.im's labs settings</flag>
<flag name="savedconfig">Copy the config.json file from a previous install instead of the default one</flag>
</use>
</pkgmetadata>

View File

@ -21,7 +21,7 @@ KEYWORDS="~amd64"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="+emoji proxy"
IUSE="+emoji proxy +darkmode +labs +savedconfig"
REQUIRED_USE=""
RESTRICT="network-sandbox" #need network sandbox disabled for `yarn install` to work
@ -75,13 +75,19 @@ src_prepare() {
fi
if [[ "${PV}" == "9999" ]]; then
if use "proxy";then
"${S}"/scripts/fetch-develop.deps.sh
else
http_proxy="" "${S}"/scripts/fetch-develop.deps.sh
fi
fi
if [ -e "${DESTINATION}/config.json" ];then
if [ -e "${DESTINATION}/config.json" ] && use savedconfig;then
cp "${DESTINATION}/config.json" "${S}"/config.json
else
cp "${S}"/config.sample.json "${S}"/config.json
use "darkmode" && sed -e 's/^\([[:space:]]*"default_theme":[[:space:]]*\)"light"/\1"dark"/' "${S}"/config.json -i
use "labs" && sed -e 's/^\([[:space:]]*"showLabsSettings":[[:space:]]*\)false/\1true/' "${S}"/config.json -i
fi
}

View File

@ -21,7 +21,7 @@ KEYWORDS="~amd64"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="+emoji proxy"
IUSE="+emoji proxy +darkmode +labs +savedconfig"
REQUIRED_USE=""
RESTRICT="network-sandbox" #need network sandbox disabled for `yarn install` to work
@ -75,13 +75,19 @@ src_prepare() {
fi
if [[ "${PV}" == "9999" ]]; then
if use "proxy";then
"${S}"/scripts/fetch-develop.deps.sh
else
http_proxy="" "${S}"/scripts/fetch-develop.deps.sh
fi
fi
if [ -e "${DESTINATION}/config.json" ];then
if [ -e "${DESTINATION}/config.json" ] && use savedconfig;then
cp "${DESTINATION}/config.json" "${S}"/config.json
else
cp "${S}"/config.sample.json "${S}"/config.json
use "darkmode" && sed -e 's/^\([[:space:]]*"default_theme":[[:space:]]*\)"light"/\1"dark"/' "${S}"/config.json -i
use "labs" && sed -e 's/^\([[:space:]]*"showLabsSettings":[[:space:]]*\)false/\1true/' "${S}"/config.json -i
fi
}

View File

@ -21,7 +21,7 @@ KEYWORDS="~amd64"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="+emoji proxy"
IUSE="+emoji proxy +darkmode +labs +savedconfig"
REQUIRED_USE=""
RESTRICT="network-sandbox" #need network sandbox disabled for `yarn install` to work
@ -75,13 +75,19 @@ src_prepare() {
fi
if [[ "${PV}" == "9999" ]]; then
if use "proxy";then
"${S}"/scripts/fetch-develop.deps.sh
else
http_proxy="" "${S}"/scripts/fetch-develop.deps.sh
fi
fi
if [ -e "${DESTINATION}/config.json" ];then
if [ -e "${DESTINATION}/config.json" ] && use savedconfig;then
cp "${DESTINATION}/config.json" "${S}"/config.json
else
cp "${S}"/config.sample.json "${S}"/config.json
use "darkmode" && sed -e 's/^\([[:space:]]*"default_theme":[[:space:]]*\)"light"/\1"dark"/' "${S}"/config.json -i
use "labs" && sed -e 's/^\([[:space:]]*"showLabsSettings":[[:space:]]*\)false/\1true/' "${S}"/config.json -i
fi
}