You are not logged in.

#1 2023-09-14 05:16:01

Frontear
Member
Registered: 2023-05-22
Posts: 29

[SOLVED] xdg-desktop-portal deps cause issues with custom impl package

I'm trying to write a PKGBUILD for xdg-desktop-portal-hyprland because the AUR one is out of date. The portal requires xdg-desktop-portal as a dependency before being used, not for building but instead for being run, but xdg-desktop-portal pulls an "xdg-desktop-portal-impl", which are all unnecessary for this package since "xdg-desktop-portal-hyprland" IS an implementation.

Basically, my package is an implementation, or valid "xdg-desktop-portal-impl", but instead of realizing that, the PKGBUILD pulls a different impl, by default the -gnome one, which adds an unnecessary package to the system.

I've posted my PKGBUILD on github since I don't think mine is ready for the AUR nor do I know if it's good enough to replace an already, "working" package. https://github.com/Frontear/xdg-desktop … prland-git

I'd appreciate any advice, I've tried "provides=(xdg-desktop-portal-impl)", and depends=(xdg-desktop-portal) but it will still pull -gnome.

Last edited by Frontear (2023-09-14 20:26:24)

Offline

#2 2023-09-14 07:00:23

seth
Member
Registered: 2012-09-03
Posts: 54,562

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

https://aur.archlinux.org/packages/xdg- … prland-git is a git package, it's not "out of date" (though apparently it misses some dependencies)

On topic: https://wiki.archlinux.org/title/PKGBUILD#depends - first paragraph.

Offline

#3 2023-09-14 12:57:16

loqs
Member
Registered: 2014-03-06
Posts: 17,765

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

Does https://archlinux.org/packages/extra/x8 … -hyprland/ work as expected in regards to xdg-desktop-portal-impl?

Offline

#4 2023-09-14 14:56:45

Frontear
Member
Registered: 2023-05-22
Posts: 29

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

loqs wrote:

Does https://archlinux.org/packages/extra/x8 … -hyprland/ work as expected in regards to xdg-desktop-portal-impl?

Yes it does, it will correctly install xdg-desktop-portal, then -hyprland afterwards.

$ sudo pacman -S xdg-desktop-portal-hyprland
resolving dependencies...
looking for conflicting packages...
warning: dependency cycle detected:
warning: xdg-desktop-portal will be installed before its xdg-desktop-portal-hyprland dependency

Package (2)                        New Version  Net Change  Download Size

extra/xdg-desktop-portal           1.16.0-3       1.96 MiB               
extra/xdg-desktop-portal-hyprland  0.5.0-1        0.19 MiB       0.07 MiB

Total Download Size:   0.07 MiB
Total Installed Size:  2.15 MiB

:: Proceed with installation? [Y/n] 

Offline

#5 2023-09-14 15:00:20

Frontear
Member
Registered: 2023-05-22
Posts: 29

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

seth wrote:

https://aur.archlinux.org/packages/xdg- … prland-git is a git package, it's not "out of date" (though apparently it misses some dependencies)

On topic: https://wiki.archlinux.org/title/PKGBUILD#depends - first paragraph.

This is what I've followed. My current git commit doesn't have these in there because I wasn't satisfied with the build problems, hence left them out, but this is what my original PKGBUILD, with the proper deps looked like:

# Maintainer: Ali Rizvi <frontear4594@gmail.com>
pkgname="xdg-desktop-portal-hyprland-git"
pkgver="r298.8f45a64"
pkgrel=1
pkgdesc="an xdg-desktop-portal implementation for Hyprland"
arch=("x86_64")
url="https://github.com/hyprwm/xdg-desktop-portal-hyprland"
license=("custom:BSD-3-Clause") #$pkgdir/usr/share/licences/$pkgname/
depends=("xdg-desktop-portal")
makedepends=("base-devel" "cmake" "git" "ninja" "pipewire" "qt6-wayland" "wayland-protocols")
provides=("${pkgname%-git}" "xdg-desktop-portal-impl")
conflicts=("${pkgname%-git}")
replaces=()
source=("${pkgname%-git}::git+https://github.com/hyprwm/xdg-desktop-portal-hyprland.git"
        "portal_services.patch")
md5sums=('SKIP'
         '4a495199d0eeeabcbe82f8404f9b0ff2')

pkgver() {
	cd "$srcdir/${pkgname%-git}"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	cd "$srcdir/${pkgname%-git}"
    git submodule update --init
    patch -p1 -i "../portal_services.patch"
    rename ".in" "" ./org.freedesktop.impl.portal.desktop.hyprland.service.in ./contrib/systemd/xdg-desktop-portal-hyprland.service.in
}

build() {
	cd "$srcdir/${pkgname%-git}"
	make all
}

package() {
	cd "$srcdir/${pkgname%-git}"
    
    install -Dm0755 -t "${pkgdir}/usr/bin" ./build/hyprland-share-picker/hyprland-share-picker
    install -Dm0644 -t "${pkgdir}/usr/lib" ./build/xdg-desktop-portal-hyprland
    install -Dm0644 -t "${pkgdir}/usr/share/xdg-desktop-portal/portals" ./hyprland.portal
    install -Dm0644 -t "${pkgdir}/usr/share/dbus-1/services" ./org.freedesktop.impl.portal.desktop.hyprland.service
    install -Dm0644 -t "${pkgdir}/usr/lib/systemd/user" ./contrib/systemd/xdg-desktop-portal-hyprland.service
}

Whenever I run it in a clean chroot, it will always try to pull an -impl dependency, which usually results in -gnome being pulled alongside a crap ton of other deps. This is not the behaviour I want.

Offline

#6 2023-09-14 15:09:52

seth
Member
Registered: 2012-09-03
Posts: 54,562

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

The wiki wrote:

An array of packages that must be installed for the software to build and run. Dependencies defined inside the package() function are only required to run the software.

Offline

#7 2023-09-14 16:09:21

loqs
Member
Registered: 2014-03-06
Posts: 17,765

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

Note depends only being xdg-desktop-portal is not right but it illustrates the concept.

# Maintainer: Ali Rizvi <frontear4594@gmail.com>
pkgname="xdg-desktop-portal-hyprland-git"
pkgver="r298.8f45a64"
pkgrel=1
pkgdesc="an xdg-desktop-portal implementation for Hyprland"
arch=("x86_64")
url="https://github.com/hyprwm/xdg-desktop-portal-hyprland"
license=("custom:BSD-3-Clause") #$pkgdir/usr/share/licences/$pkgname/
makedepends=("git" "meson" "ninja" "pipewire" "qt6-wayland" "sdbus-cpp-git" "wayland-protocols")
provides=("${pkgname%-git}" "xdg-desktop-portal-impl")
conflicts=("${pkgname%-git}")
source=("${pkgname%-git}::git+https://github.com/hyprwm/xdg-desktop-portal-hyprland.git")
md5sums=('SKIP')

pkgver() {
	cd ${pkgname%-git}
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	cd ${pkgname%-git}
	git submodule update --init
}

build() {
	meson setup ${pkgname%-git} build --prefix=/usr --libexecdir lib
	meson compile -C build
}

package() {
	depends=("xdg-desktop-portal")
	meson install -C build --destdir "$pkgdir"
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" ${pkgname%-git}/LICENSE
}

Last edited by loqs (2023-09-14 16:22:52)

Offline

#8 2023-09-14 17:41:13

Frontear
Member
Registered: 2023-05-22
Posts: 29

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

seth wrote:
The wiki wrote:

An array of packages that must be installed for the software to build and run. Dependencies defined inside the package() function are only required to run the software.

I'm not quite sure I understand what youre trying to tell me. Afaik xdg-desktop-portal is required as the frontend, whereas my -hyprland is the implementation backend. Am I able to separately define dependencies inside the function?

Edit: I think I see your point. I added depends+=("xdg-desktop-portal") inside the package() function, and checking with pacman -Qip on the compiled package shows that it depends on xdg-desktop-portal.

Last edited by Frontear (2023-09-14 17:46:20)

Offline

#9 2023-09-14 17:49:22

Frontear
Member
Registered: 2023-05-22
Posts: 29

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

loqs wrote:

Note depends only being xdg-desktop-portal is not right but it illustrates the concept.

# Maintainer: Ali Rizvi <frontear4594@gmail.com>
pkgname="xdg-desktop-portal-hyprland-git"
pkgver="r298.8f45a64"
pkgrel=1
pkgdesc="an xdg-desktop-portal implementation for Hyprland"
arch=("x86_64")
url="https://github.com/hyprwm/xdg-desktop-portal-hyprland"
license=("custom:BSD-3-Clause") #$pkgdir/usr/share/licences/$pkgname/
makedepends=("git" "meson" "ninja" "pipewire" "qt6-wayland" "sdbus-cpp-git" "wayland-protocols")
provides=("${pkgname%-git}" "xdg-desktop-portal-impl")
conflicts=("${pkgname%-git}")
source=("${pkgname%-git}::git+https://github.com/hyprwm/xdg-desktop-portal-hyprland.git")
md5sums=('SKIP')

pkgver() {
	cd ${pkgname%-git}
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	cd ${pkgname%-git}
	git submodule update --init
}

build() {
	meson setup ${pkgname%-git} build --prefix=/usr --libexecdir lib
	meson compile -C build
}

package() {
	depends=("xdg-desktop-portal")
	meson install -C build --destdir "$pkgdir"
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" ${pkgname%-git}/LICENSE
}

I wonder if it's possible for you to elaborate on how you came about using meson instead of the make recommendations in the package readme. How did you know that these commands would compile in the same way, achieving parity with the Makefile, reading through the meson file, or just a general understanding of meson?

Lastly, would you recommend using meson, since it seems to make packaging easier since you can specify a --destdir, whereas with make I couldn't do that and needed to manually make all the paths + move files there via install.

Offline

#10 2023-09-14 18:18:15

loqs
Member
Registered: 2014-03-06
Posts: 17,765

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

Frontear wrote:

I wonder if it's possible for you to elaborate on how you came about using meson instead of the make recommendations in the package readme. How did you know that these commands would compile in the same way, achieving parity with the Makefile, reading through the meson file, or just a general understanding of meson?

I compared the packages both generated.

Frontear wrote:

Lastly, would you recommend using meson, since it seems to make packaging easier since you can specify a --destdir, whereas with make I couldn't do that and needed to manually make all the paths + move files there via install.

The Makefile is a wrapper around cmake.  The meson recipe appears to be the only one that has integrated systemd support which simplifies the PKGBUILD so I would recommend you use it in this case.

Offline

#11 2023-09-14 18:49:20

seth
Member
Registered: 2012-09-03
Posts: 54,562

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

Frontear wrote:

I added depends+=("xdg-desktop-portal") inside the package() function, and checking with pacman -Qip on the compiled package shows that it depends on xdg-desktop-portal.

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#12 2023-09-14 20:27:10

Frontear
Member
Registered: 2023-05-22
Posts: 29

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

loqs wrote:
Frontear wrote:

I wonder if it's possible for you to elaborate on how you came about using meson instead of the make recommendations in the package readme. How did you know that these commands would compile in the same way, achieving parity with the Makefile, reading through the meson file, or just a general understanding of meson?

I compared the packages both generated.

Frontear wrote:

Lastly, would you recommend using meson, since it seems to make packaging easier since you can specify a --destdir, whereas with make I couldn't do that and needed to manually make all the paths + move files there via install.

The Makefile is a wrapper around cmake.  The meson recipe appears to be the only one that has integrated systemd support which simplifies the PKGBUILD so I would recommend you use it in this case.

I see, so its a case-by-case thing. I'll transition over to meson and remove all the manual install things, thanks a lot.

Offline

#13 2023-09-14 20:27:45

Frontear
Member
Registered: 2023-05-22
Posts: 29

Re: [SOLVED] xdg-desktop-portal deps cause issues with custom impl package

seth wrote:
Frontear wrote:

I added depends+=("xdg-desktop-portal") inside the package() function, and checking with pacman -Qip on the compiled package shows that it depends on xdg-desktop-portal.

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Done, thanks again for your help

Offline

Board footer

Powered by FluxBB