You are not logged in.

#1 2023-02-07 11:21:45

rharish
Member
Registered: 2018-02-19
Posts: 24

PKGBUILD Review Request: greetd-regreet-git

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

#2 2023-02-07 12:09:30

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: PKGBUILD Review Request: greetd-regreet-git

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.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2023-02-07 14:22:04

rharish
Member
Registered: 2018-02-19
Posts: 24

Re: PKGBUILD Review Request: greetd-regreet-git

Thanks for your review!

Lone_Wolf wrote:

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"?

Lone_Wolf wrote:

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?

Lone_Wolf wrote:

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

#4 2023-02-08 11:48:54

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: PKGBUILD Review Request: greetd-regreet-git

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.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2023-02-09 04:45:08

rharish
Member
Registered: 2018-02-19
Posts: 24

Re: PKGBUILD Review Request: greetd-regreet-git

Lone_Wolf wrote:

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.

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.

Offline

#6 2023-02-09 08:53:39

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: PKGBUILD Review Request: greetd-regreet-git

rharish wrote:

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.

rharish wrote:
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.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2023-02-13 04:39:52

rharish
Member
Registered: 2018-02-19
Posts: 24

Re: PKGBUILD Review Request: greetd-regreet-git

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

Board footer

Powered by FluxBB