Remove dep on dev-util/cargo-make for firefox PWA connector.

This commit is contained in:
projectmoon 2023-03-16 21:45:12 +01:00
parent aab2f80695
commit bebfa186fe
3 changed files with 29 additions and 20 deletions

View File

@ -10,6 +10,5 @@ How to create new version of the Firefox PWA Connector:
- Check the Cargo.toml of the connector for any new git deps, and add to
the git crates if necessary. Cargo.lock can be checked to find the
proper commit hashes.
- Run `ebuild clean install` and make sure everything ends up where its
supposed to be. A sandbox violation likely indicates need for new
`sed` to patch Maefile.toml to respect `DESTDIR`.
- Check repo Makefile.toml for any new installation instructions for the
Linux target. Replicate in `src_install` phase.

View File

@ -1,5 +1,5 @@
DIST WebAppManifestRS-89ee187e6300bbd2d6f773651a4fcc07e4e7ede6.gh.tar.gz 20964 BLAKE2B 30a1aab01c5f2a2f52e1f47edf1bd3235724fd9da699013e0cfcd4fe73edaa1410f93bc875a223b996a43026b6f96c19ac89ff43828313dba302582699fc893a SHA512 614c69fadf2cfe2a973175a2939edcaa4faeed7e8b4d5640f5eda354dc24fa375c9f9055c86e11be041abd1e6b0bd81dd47eb434896078c5a28b4400a29e4ff3
DIST firefox-pwa-connector-2.4.1.zip 735659 BLAKE2B f25bccbe74c914c37b9cccc5cb1b613c7c0789148142cb096c7f71ab72356bff23a3f936d119194d284c8193c035c43875aec05452424590374ca244ddf20d87 SHA512 e3affcb010adfd318c1385b5e58fe21a4f4b252490d5d3543a9f48131137a0dcc5856be27d0b7d01536078a2fc16d256cefea480a9b0c83731ff512633193586
DIST firefox-pwa-connector-2.4.1.tar.gz 663129 BLAKE2B 61c04d67349c005530f4283e5d30a9514b2cbd012cb0d0353be17a9ad80ee424c15b390694e37f9c454da569b6c034978b4d57f364e58ad58d9045d8507bc21d SHA512 dad3c4d11bc21d33ec36559ebed37a8502f18b93e5be60e22a2d6626b4e80f8594408e4fe35eff3b0d878f9ddaa5257cabe5a1bab271b8a86accec911178b2fd
DIST mime-57416f447a10c3343df7fe80deb0ae8a7c77cf0a.gh.tar.gz 22313 BLAKE2B a659e06d1316c7b5102f4a87f02bc35cb05947ff496167cc5acf9ba038c2091ef732bd43f298d9897aee2ce9e0f0e58253a5b06a1105251c0cdbb869db9410b8 SHA512 0d6726f66e34c83895b92928da4b8a1284d5e1d98bc7b01af1036fd92b0299fbc1dbcd0605c2323619db5cb807dcdcdb76da0026058c74c07e54959be1c75dde
DIST rust-url-0032b9e8328f1a7ce2773f71adf316542ee8ddc9.gh.tar.gz 384127 BLAKE2B 8ff1c840742730713494c48e2376201ab114634e5480d66d97661186dd3b218b7bf74024331af64afeec56dfce10dcb7db6349d1c2657b797cf9d199b9c98a75 SHA512 2826c77f9fe57cd5d8686e407994b5917818399f2bcb02050f08101709bf8ea0394615268e5059f2f8825c864f2ba768c3d902534ed309d0b9ad48eafe714191
DIST vendor.tar.gz 56937356 BLAKE2B f29fd480b134da2fa747548cff8aecfb55c95d24b7d33f65388b9483b025d782649b34d1eafa07c94ebdac1681eb5820c376fd597397784450fad931e4dd2f95 SHA512 0951b409d0835e8303654ed3f0c429d118ba43159342f38a02e0481c5973330fd2a50403599f2197ce40d2296423839085fe784ed9df3cb82602e9a2785894f1

View File

@ -21,17 +21,16 @@ DESCRIPTION="The native part of the PWAsForFirefox project"
HOMEPAGE="https://github.com/filips123/PWAsForFirefox"
SRC_URI="
$(cargo_crate_uris)
https://github.com/filips123/PWAsForFirefox/archive/refs/tags/v${PV}.zip -> ${P}.zip
https://git.agnos.is/projectmoon/projectmoon-overlay-files/media/branch/main/www-plugins/firefox-pwa-connector/vendor-2.4.1.tar.gz -> vendor.tar.gz
https://github.com/filips123/PWAsForFirefox/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
https://git.agnos.is/projectmoon/projectmoon-overlay-files/media/branch/main/www-plugins/firefox-pwa-connector/vendor-${PV}.tar.gz -> vendor.tar.gz
"
LICENSE="0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Boost-1.0 LGPL-3+ MIT MPL-2.0 Unicode-DFS-2016 Unlicense ZLIB"
LICENSE="MPL-2.0"
SLOT="0"
KEYWORDS="~amd64"
DEPEND=""
RDEPEND="${DEPEND}"
BDEPEND="dev-util/cargo-make" # from guru
# Needed as source is in a subdirectory
S="${WORKDIR}/PWAsForFirefox-${PV}/native"
@ -44,25 +43,36 @@ src_prepare() {
# Link vendored cargo deps in.
ln -s "${WORKDIR}/vendor/"* "${CARGO_HOME}/gentoo/"
# Patch makefile according to from-source install instructions.
# Patch makefile according to upstream from-source install
# instructions.
sed -i "s/version = \"0.0.0\"/version = \"${PV}\"/g" Cargo.toml \
|| die 'could not set Cargo.toml version'
sed -i "s/DISTRIBUTION_VERSION = '0.0.0'/DISTRIBUTION_VERSION = '${PV}'/g" \
"${S}"/userchrome/profile/chrome/pwa/chrome.jsm || die 'could not set chrome.jsm version'
sed -i 's/SUDO=$(which sudo) || $(echo "")/SUDO=""/' Makefile.toml
# patch makefile to respect DESTDIR
sed -i 's/\/usr\/bin\/firefoxpwa/$DESTDIR\/usr\/bin\/firefoxpwa/g' Makefile.toml
sed -i 's/\/usr\/libexec\/firefoxpwa-connector/$DESTDIR\/usr\/libexec\/firefoxpwa-connector/g' Makefile.toml
sed -i 's/\/usr\/lib\/mozilla\/native-messaging-hosts\/firefoxpwa.json/$DESTDIR\/usr\/lib\/mozilla\/native-messaging-hosts\/firefoxpwa.json/g' Makefile.toml
sed -i 's/\/usr\/lib64\/mozilla\/native-messaging-hosts\/firefoxpwa.json/$DESTDIR\/usr\/lib64\/mozilla\/native-messaging-hosts\/firefoxpwa.json/g' Makefile.toml
sed -i 's/\/usr\/share\/firefoxpwa\/userchrome/$DESTDIR\/usr\/share\/firefoxpwa\/userchrome/g' Makefile.toml
default
}
src_install() {
export DESTDIR="${D}"
makers install
# Upstream uses cargo-make, but this is not packaged in Gentoo, nor
# does it support DESTDIR, so portage sandboxes occur. The makefile
# installation instructions are very simple, so replicate them here.
# Actual binaries
into /usr
dobin target/release/firefoxpwa
exeinto /usr/libexec/
doexe target/release/firefoxpwa-connector
# Install native messaging host
insinto /usr/lib/mozilla/native-messaging-hosts/
newins manifests/linux.json firefoxpwa.json
insinto /usr/lib64/mozilla/native-messaging-hosts/
newins manifests/linux.json firefoxpwa.json
# Copy the userchrome directory to the correct location
insinto /usr/share/firefoxpwa/userchrome/
doins -r userchrome/*
}