101 lines
2.3 KiB
Bash
Executable File
101 lines
2.3 KiB
Bash
Executable File
# Copyright 2020-2023 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
CRATES="
|
|
"
|
|
|
|
inherit meson cargo xdg desktop gnome2-utils
|
|
|
|
DESCRIPTION="Sketch and take handwritten notes."
|
|
HOMEPAGE="https://github.com/flxzt/rnote"
|
|
|
|
|
|
if [[ ${PV} == "9999" ]] ; then
|
|
inherit git-r3
|
|
EGIT_REPO_URI="https://github.com/flxzt/rnote.git"
|
|
else
|
|
SRC_URI="
|
|
https://github.com/flxzt/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
|
${CARGO_CRATE_URIS}
|
|
"
|
|
KEYWORDS="~amd64 ~ppc64"
|
|
fi
|
|
|
|
BDEPEND="
|
|
dev-libs/appstream
|
|
app-text/poppler
|
|
"
|
|
|
|
# LICENSE=""
|
|
SLOT="0"
|
|
KEYWORDS="~amd64"
|
|
IUSE="cli +gui"
|
|
|
|
|
|
# Rust packages ignore CFLAGS and LDFLAGS so let's silence the QA warnings
|
|
# QA_FLAGS_IGNORED="usr/bin/btm"
|
|
|
|
|
|
src_unpack() {
|
|
if [[ "${PV}" == *9999* ]]; then
|
|
git-r3_src_unpack
|
|
cargo_live_src_unpack
|
|
else
|
|
cargo_src_unpack
|
|
fi
|
|
}
|
|
|
|
src_prepare() {
|
|
# Stripping symbols should be the choice of the user.
|
|
sed -i '/strip = "symbols"/d' Cargo.toml || die "Unable to patch out symbol stripping"
|
|
|
|
eapply_user
|
|
}
|
|
|
|
src_configure() {
|
|
local emesonargs=(
|
|
$(meson_use cli)
|
|
$(meson_use gui ui)
|
|
)
|
|
local myfeatures=(
|
|
$(usev cli)
|
|
$(usev debug)
|
|
$(usex gui ui)
|
|
)
|
|
|
|
cargo_src_configure --frozen --no-default-features
|
|
meson_src_configure
|
|
}
|
|
|
|
src_compile() {
|
|
cargo_src_compile
|
|
meson_src_compile rnote-gmo
|
|
mv -v ${WORKDIR}/${P}/target/release/rnote ${WORKDIR}/${P}-build/
|
|
mv -v ${WORKDIR}/${P}-build/crates/rnote-ui/data/app.desktop.in ${WORKDIR}/${P}-build/crates/rnote-ui/data/com.github.flxzt.rnote.desktop
|
|
mv -v ${WORKDIR}/${P}-build/crates/rnote-ui/data/app.metainfo.xml.in ${WORKDIR}/${P}-build/crates/rnote-ui/data/com.github.flxzt.rnote.metainfo.xml
|
|
|
|
}
|
|
|
|
# post_src_compile() {
|
|
# meson_src_compile rnote-gmo
|
|
# mv -v ${WORKDIR}/${P}/target/release/rnote ${WORKDIR}/${P}-build/
|
|
# mv -v ${WORKDIR}/${P}-build/crates/rnote-ui/data/app.desktop.in ${WORKDIR}/${P}-build/crates/rnote-ui/data/com.github.flxzt.rnote.desktop
|
|
# mv -v ${WORKDIR}/${P}-build/crates/rnote-ui/data/app.metainfo.xml.in ${WORKDIR}/${P}-build/crates/rnote-ui/data/com.github.flxzt.rnote.metainfo.xml
|
|
# }
|
|
|
|
src_install() {
|
|
insinto /usr/share/glib-2.0/schemas
|
|
doins ${WORKDIR}/${P}-build/crates/rnote-ui/data/com.github.flxzt.rnote.gschema.xml
|
|
meson_src_install
|
|
}
|
|
|
|
pkg_postinst() {
|
|
gnome2_schemas_update
|
|
}
|
|
|
|
pkg_postrm() {
|
|
gnome2_schemas_update
|
|
}
|