meta-wayland/recipes-gtk/nwg-shell/nwg-dock-hyprland_git.bb
2024-10-30 11:35:37 +01:00

52 lines
1.5 KiB
BlitzBasic

SUMMARY = "GTK3-based dock for hyprland."
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=fffa55ad1c828db5e334374fb1182530"
DEPENDS = " \
gtk+3 \
gtk-layer-shell \
"
RDEPENDS:${PN} = "go-runtime"
GO_IMPORT = "github.com/nwg-piotr/nwg-dock-hyprland.git"
SRC_URI = "git://${GO_IMPORT};destsuffix=src/${GO_IMPORT};nobranch=1;protocol=https"
PV = "0.2.2"
SRCREV = "445baf061525c546a9906874fbb0ca161df239ed"
S = "${WORKDIR}/sources"
UNPACKDIR = "${S}"
inherit go go-mod pkgconfig
GO_INSTALL = "${GO_IMPORT}"
GO_LINKSHARED = ""
do_install:append() {
# remove precompiled x86 binaries
rm -rf ${D}${libdir}/go/src/${GO_IMPORT}/bin
rm -rf ${D}${libdir}/go/pkg/mod/github.com/dlasky/gotk3-layershell*/example
install -d ${D}${datadir}/nwg-dock-hyprland ${D}${systemd_user_unitdir}
install -m 0644 ${S}/src/${GO_IMPORT}/config/style.css ${D}${datadir}/nwg-dock-hyprland
cp -rf ${S}/src/${GO_IMPORT}/images ${D}${datadir}/nwg-dock-hyprland
cat >${D}${systemd_user_unitdir}/nwg-dock-hyprland.service <<EOF
[Unit]
Description=Nwg Dock Hyprland - gtk3 based dock for Hyprland, written in go
BindsTo=graphical-session.target
Before=graphical-session.target
Wants=xdg-desktop-autostart.target
Wants=graphical-session-pre.target
After=graphical-session-pre.target
[Service]
Type=simple
ExecStartPre=systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XAUTHORITY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP
ExecStart=nwg-dock-hyprland -d -hd 2000
Restart=on-failure
EOF
}
do_compile[network] = "1"
FILES:${PN} += "${systemd_user_unitdir}"