tuigreet icon indicating copy to clipboard operation
tuigreet copied to clipboard

Fixed PKGBUILD for Arch AUR

Open ava1ar opened this issue 3 years ago • 12 comments

Hey! Thanks for the great package! There are few issues in PKGBUILD in AUR right now, I modified it a bit to address them: https://github.com/ava1ar/PKGBUILDs/tree/master/greetd-tuigreet. Similar changes to be done for other packages for tuigreet.

ava1ar avatar Feb 14 '21 18:02 ava1ar

Could you enumerate the changes you performed to make sure I got them all? As far as I can see, they are:

  • greetd added as a dependency
  • tuigreet's cache directory is added to systemd's list of temporary files instaed of creating it directly

Is there something I missed?

apognu avatar May 26 '21 11:05 apognu

I am running into what I think is a related issue. I build AUR packages on a local server which are separately installed on my laptop. Is there a way for the tuigreet build script to not depend on the greeter user when its built? This fails on my server where greetd isn't actually installed.

nyonson avatar May 31 '21 20:05 nyonson

Do you mean that our PKGBUILD depends on the greetd package, and not the greeter user? Or is there something I am missing?

If the former, yeah I just learned that depends declares dependencies for both build- and runtime. So I should either remove the dependency or move it runtime-only.

Do you have any log output of your error?

EDIT: apparently, AUR-dependencies in AUR packages is not something that can be resolved (or I missed something), so I might remove the dependency on greetd altogether for the next release.

apognu avatar May 31 '21 22:05 apognu

Can you try building the package from your clean environment with the following PKGBUILD (edited from the latest version published a few hours ago)? If it works properly, I'll submit an updated buildscript tomorrow.

# Maintainer: Antoine POPINEAU <antoine at popineau dot eu>

pkgname=greetd-tuigreet
pkgver=0.3.1
pkgrel=2

pkgdesc='A console UI greeter for greetd'
url='https://github.com/apognu/tuigreet'
license=(GPL3)
conflicts=(greetd-tuigreet-bin greetd-tuigreet-git)

arch=(x86_64)
makedepends=(rust)

source=("${url}/archive/${pkgver}.tar.gz"
        'tuigreet.conf')
sha256sums=('7ee71be9719d99950028724300090faa4b5a281ebf1cb9b1564f74b636754c6c'
            '8f83aee7874aab5d06981a1d1cd05df906368a79dbca90d157a33a2f023b67d3')

build() {
  cd "tuigreet-${pkgver}"
  cargo build --release
}

package() {
  install -Dm755 "${srcdir}/tuigreet-${pkgver}/target/release/tuigreet" "${pkgdir}/usr/bin/tuigreet"
  install -Dm644 "${srcdir}/tuigreet-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/tuigreet/LICENSE"

  install -Dm644 "${srcdir}/tuigreet.conf" "${pkgdir}/usr/lib/tmpfiles.d/tuigreet.conf"
}

apognu avatar May 31 '21 22:05 apognu

I am not super confident in my AUR abilities, but I gave it a shot:

  • removed greetd which had been installed with the latest version
  • updated the greetd-tuigreet PKGBUILD to what you pasted above
  • built greetd-tuigreet with makepkg -s

It ran smoothly, but maybe this isn't a totally clean environment?

EDIT: I went back and made sure to actually remove the greeter user which had been installed on the system and the build still worked fine. However, this reddit thread on AUR dependencies has me thinking my request to drop the depends on greetd might be a bad call.

nyonson avatar May 31 '21 22:05 nyonson

Thank you for trying it out!

I'm looking at the PKGBUILD for other greetd greeters, and they do not define greetd as a dependency at all. I like clean dependency trees, mais there might be a reason they do not do it themselves.

There is a documented way to declare runtime-only dependencies (depends in package()) but yay does not find the dependency when installed manually with -U so I'm a bit wary of publishing something like that.

apognu avatar Jun 01 '21 09:06 apognu

I removed the dependency on greetd in a new pkgrel for all three AUR packages. Can you try again the build that used to fail and report if it is fixed?

apognu avatar Jun 08 '21 20:06 apognu

Any news about this? Did you have the opportunity to try?

apognu avatar Jun 13 '21 16:06 apognu

I'll close this since I believe this issue is fixed. Please respond if you still encounter issues building tuigreet.

apognu avatar Jun 19 '21 18:06 apognu

Greetings,

greetd should be a dependency. Ask yourself: Is it possible (=does it make sense) to run tuigreet standalone, without greetd? If the answer is NO (which I am convinced is the case), then greetd belongs to depends=().

https://wiki.archlinux.org/title/PKGBUILD#depends

At the very least:

Dependencies defined inside the package() function are only required to run the software.

So even if you don't want to add it to depends=() on a global level, it should at least belong to depends=() within the package() function. For example, 1Password does this: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=1password

thiagowfx avatar Aug 01 '21 08:08 thiagowfx

I don't have powers to re-open this issue, let me know if you would prefer that a new one be filed.

thiagowfx avatar Aug 01 '21 08:08 thiagowfx

Can you please also fix the below issue of greetd-tuigreet-git? The git package solves #40 so I cannot switch to greetd-tuigreet or greed-tuigreetd-bin.

andreafeletto mentioned in the comment section:

Current pkgver function returns tip.r124.64a41c3-1 so AUR helpers like yay always think the package has to be updated. I suggest using: git describe --long | sed 's/-/.r/;s/-/./' as suggested by the wiki. This would return 0.7.1.r10.g64a41c3.

equalis3r avatar Dec 10 '21 11:12 equalis3r