1 # Copyright 2018-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_6 python3_7 )
8 inherit python-single-r1
10 DESCRIPTION="Host app for the PassFF WebExtension"
11 HOMEPAGE="https://github.com/passff/passff-host"
14 https://github.com/passff/passff-host/releases/download/${PV}/passff.py -> ${P}.py
15 https://github.com/passff/passff-host/releases/download/${PV}/passff.json -> ${P}.json
20 KEYWORDS="~amd64 ~x86"
21 IUSE="chrome chromium firefox vivaldi"
23 ${PYTHON_REQUIRED_USE}
24 || ( chrome chromium firefox vivaldi )
27 RDEPEND="${PYTHON_DEPS}"
32 cp "${DISTDIR}/${P}.json" . || die
33 cp "${DISTDIR}/${P}.py" . || die
38 python_fix_shebang "${P}.py"
44 use chrome && target_dirs+=( "/etc/opt/chrome/native-messaging-hosts" )
45 use chromium && target_dirs+=( "/etc/chromium/native-messaging-hosts" )
46 use firefox && target_dirs+=( "/usr/$(get_libdir)/mozilla/native-messaging-hosts" )
47 use vivaldi && target_dirs+=( "/etc/vivaldi/native-messaging-hosts" )
49 for target_dir in "${target_dirs[@]}"; do
50 sed "s;PLACEHOLDER;${target_dir}/passff.py;g" "${P}.json" > "passff.json" || die
52 insinto "${target_dir}"
54 exeinto "${target_dir}"
55 newexe "${P}.py" passff.py