I am having a dilemma creating an ebuild for the following software: Astal.
The instructions for building and installing this software are rather simple and clear. After cloning the repository, one must simply do the following:
astal-io
Code: Select all
cd /tmp/astal/lib/astal/io
meson setup --prefix /usr build
meson install -C build
Code: Select all
cd /tmp/astal/lib/astal/gtk3
meson setup --prefix /usr build
meson install -C build
Code: Select all
EAPI=8
inherit git-r3
DESCRIPTION="Astal Gtk Shell"
HOMEPAGE="https://aylur.github.io/astal"
EGIT_REPO_URI="https://github.com/aylur/astal.git"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
DEPEND="
dev-build/meson
dev-lang/vala
x11-libs/gtk+:3
gui-libs/gtk-layer-shell
dev-libs/gobject-introspection
"
src_unpack() {
einfo "Fetching distfiles..."
git-r3_src_unpack
}
src_compile() {
einfo "Compiling..."
export VALAC=/usr/bin/valac-0.56
export VALADOC=/usr/bin/valadoc-0.56
cd "${WORKDIR}/astal-1.0/lib/astal/io" || die
meson setup --prefix="/usr" build || die "Meson setup failed Astal IO module"
meson compile -C build || die "Meson setup failed Astal IO module"
cd "${WORKDIR}/astal-1.0/lib/astal/gtk" || die
meson setup --prefix="/usr" build || die "Meson setup failed for Astal GTK3 module"
meson compile -C build || die "Meson setup failed for Astal GTK3 module"
}
src_install() {
cd "${WORKDIR}/astal-1.0/lib/astal/io" || die "Failed to cd into IO module"
meson install -C build --prefix=/usr || die "Meson install for IO module failed"
cd "${WORKDIR}/astal-1.0/lib/astal/gtk3" || die "Failed to cd into GTK3 module"
meson install -C build --prefix=/usr || die "Meson install for GTK3 module failed"
}
I have been testing this ebuild with "ebuild astal-01.ebuild {unpack,compile,install}" with no success. The main issue is that the GTK3 module depends on the IO module being installed in the relevant directories system-wide(it looks for astal-io as a dependency in /usr/bin). This conflicts in the ebuild because the src_install function is called after src_compile, resulting in the GTK module not compiling properly. That said, I tried using "meson install -C build" inside the src_compile function, but was met with the sandbox Portage uses for compiling and installing packages, for which I have yet to learn a lot about it seems.
Given that, I then tried playing around with meson settings but also had no success, mostly due to my ignorance with both the meson build system and ebuild writing. Additionally I attempted a separate ebuild approach, with one ebuild for the IO module and another for the GTK module, and make the GTK module ebuild dependant on the IO module ebuild. I did not have any luck on that for mostly the same reasons, although I was able to successfully compile the IO module on its own, but not install it also due to permission.
Another idea I am considering is to modify the meson build files with a .patch file so that the compile succeeds, but I would like to ask if anyone here has a better approach for resolving this. I would like to learn how to write good ebuilds, so hopefully someone here can shed some light or perhaps some tips and tricks I could use to improve this one.
Thanks in advance!



