You are not logged in.
Hi, I created a greeter for the greetd login daemon called ReGreet. Here's the PKGBUILD for an AUR package that I'd like to create for ReGreet:
# Maintainer: Harish Rajagopal <harish dot rajagopals at gmail dot com>
_pkgname=regreet
pkgname="greetd-$_pkgname-git"
pkgver=r74.a273b8a
pkgrel=1
pkgdesc="Clean and customizable greeter for greetd"
arch=('x86_64')
url="https://github.com/rharish101/ReGreet"
license=(GPL3)
install="$pkgname.install"
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')
makedepends=(cargo git)
depends=(greetd gtk4)
pkgver() {
cd "$pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "$pkgname"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd "$pkgname"
export RUSTUP_TOOLCHAIN=stable
export GREETD_CONFIG_DIR="/etc/greetd"
export CACHE_DIR="/var/cache/${_pkgname}"
export LOG_DIR="/var/log/${_pkgname}"
export SESSION_DIRS="/usr/share/xsessions:/usr/share/wayland-sessions"
cargo build --frozen --release --target-dir=target
}
package() {
cd "$pkgname"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$_pkgname"
install -Dm0644 -t "$pkgdir/usr/share/$_pkgname/" "$_pkgname.sample.toml"
}
I also created an install script for this:
post_install() {
_pkgname=regreet
echo "Sample configuration file installed at /usr/share/$_pkgname/$_pkgname.sample.toml"
# Create the cache and log directories.
mkdir -p "/var/cache/$_pkgname" "/var/log/$_pkgname"
chown greeter:greeter "/var/cache/$_pkgname" "/var/log/$_pkgname"
}
The purpose of the install script is to notify the user about the sample config file, and create directories for storing logs and caches. My main concern is whether there is a better way to do either of these.
Offline
Normally pkgname reflects what upstream calls the software.
Just use regreet-git as pkgname .
In the description on github you mention it's intended for use with a wayland compositor .
What will happen if there's none present ?
For the cache and log folders you could use systemd-tmpfiles and add conf-files for that to the sources.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Online
Thanks for your review!
Normally pkgname reflects what upstream calls the software.
Just use regreet-git as pkgname .
I added the "greetd-" prefix, since every other greetd greeter does so, such as greetd-gtkgreet (gtkgreet), greetd-qtreet (QtGreet), greetd-ddlm-git (ddlm). Should I stick with the naming convention, or change it to "regreet-git"?
In the description on github you mention it's intended for use with a wayland compositor .
What will happen if there's none present ?
Since the greeter is just a GTK4 app, it simply wouldn't run if executed from a TTY. The only way to run it is to either use a Wayland compositor or an X11 server. I didn't add any optdepends since none of the other Wayland compositor-based greeters (such as gtkgreet, QtGreet) did it. Should I still go ahead and add some sample compositors to optdepends, like cage or sway? Or should I add a message in the post-install script?
For the cache and log folders you could use systemd-tmpfiles and add conf-files for that to the sources.
Thanks for this! I created a config file for this and committed it to the repo with the following content:
# SPDX-FileCopyrightText: 2023 Harish Rajagopal <harish.rajagopals@gmail.com>
#
# SPDX-License-Identifier: CC0-1.0
# Create the log and cache directories.
d /var/log/regreet 0755 greeter greeter - -
d /var/cache/regreet 0755 greeter greeter - -
and changed the PKGBUILD to:
# Maintainer: Harish Rajagopal <harish dot rajagopals at gmail dot com>
_pkgname=regreet
pkgname="greetd-$_pkgname-git"
pkgver=r75.b0b21d1
pkgrel=1
pkgdesc="Clean and customizable greeter for greetd"
arch=('x86_64')
url="https://github.com/rharish101/ReGreet"
license=(GPL3)
install="$pkgname.install"
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')
makedepends=(cargo git)
depends=(greetd gtk4)
pkgver() {
cd "$pkgname"
printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "$pkgname"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd "$pkgname"
export RUSTUP_TOOLCHAIN=stable
export GREETD_CONFIG_DIR="/etc/greetd"
export CACHE_DIR="/var/cache/${_pkgname}"
export LOG_DIR="/var/log/${_pkgname}"
export SESSION_DIRS="/usr/share/xsessions:/usr/share/wayland-sessions"
cargo build --frozen --release --target-dir=target
}
package() {
cd "$pkgname"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$_pkgname"
install -Dm0644 -t "$pkgdir/usr/share/$_pkgname/" "$_pkgname.sample.toml"
install -Dm0644 "systemd-tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/$_pkgname.conf"
}
I also removed the corresponding lines in the post-install script to get:
post_install() {
_pkgname=regreet
echo "Sample configuration file installed at /usr/share/$_pkgname/$_pkgname.sample.toml"
}
Last edited by rharish (2023-02-07 16:56:58)
Offline
Looked up pkgname in wiki and there doesn't seem to a general recommendation. https://wiki.archlinux.org/title/Rust_p … age_naming does have a recommendation though.
I lean towards names without greetd prepended* , but I'm not a TU . You could start a discussion about this on aur-general mailing list.
wayland
I've ran lddtree on /usr/bin/regreet and didn't notice any wayland libraries, the greetd package also doesn't list runtime wayland dependencies.
Regreet does depend on Gtk4 which does have a dependency on wayland .
Does your code use any wayland exclusive functionality ?
* AUR supports keywords to make searches easier, setting greetd as keyword should help users to find these greeters.
Last edited by Lone_Wolf (2023-02-08 11:49:28)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Online
Looked up pkgname in wiki and there doesn't seem to a general recommendation. https://wiki.archlinux.org/title/Rust_p … age_naming does have a recommendation though.
I lean towards names without greetd prepended* , but I'm not a TU . You could start a discussion about this on aur-general mailing list.
While you do make a strong point for not keeping the "greetd-" prefix, I'll start a discussion on the mailing list, just to be sure.
Does your code use any wayland exclusive functionality ?
Nope, it's made to simply be a GTK4 app. In fact, not only did I take the screenshot in the README when running it on an Xfce session with X11, but I develop and test the app on this session, while dogfooding the greeter with a Sway (Wayland) session on login.
Offline
While you do make a strong point for not keeping the "greetd-" prefix, I'll start a discussion on the mailing list, just to be sure.
great.
Lone_Wolf wrote:Does your code use any wayland exclusive functionality ?
Nope, it's made to simply be a GTK4 app. In fact, not only did I take the screenshot in the README when running it on an Xfce session with X11, but I develop and test the app on this session, while dogfooding the greeter with a Sway (Wayland) session on login.
Then the dependencies as they are now are fine.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Online
Since I haven't received a reply on the mailing list yet, I'm going to rename the package to "regreet-git", as you suggested, and publish it to the AUR. Thanks a lot for your help Lone_Wolf!
Offline