paru icon indicating copy to clipboard operation
paru copied to clipboard

Makedepends should be installed before the sources get fetched

Open RubenKelevra opened this issue 2 years ago • 4 comments

Affected Version

paru v1.10.0 - libalpm v13.0.1

Description

Paru is unable to handle sources which need an extra program to get fetched - while the program is properly specified as makedepends:

# Maintainer: Jesse McClure <code at jessemcclure dot org>
_fossil=nkk
pkgname=${_fossil}-fossil
pkgver=r25.d3d9016a07
pkgrel=1
pkgdesc='Wayland client library w/ cairo drawing'
arch=('x86_64')
license=('MIT')
depends=(cairo glib2 glibc harfbuzz libxkbcommon pango wayland)
makedepends=(fossil)
provides=(nkk)
url=https://code.jessemcclure.org/${_fossil}
source=(fossil+${url})
sha256sums=(SKIP)

pkgver() {
	cd "${srcdir}/${_fossil}"
	printf '%sr%s.%s\n' \
		"$(fossil tag list | grep '[0-9\.*]' | sort -r | sed 1q)" \
		"$(fossil info | sed -n '$s/[a-z:-]* *//p')" \
		"$(fossil timeline -n 1 -t ci -F %h | sed 1q)"
}

build() {
	cd "${srcdir}/${_fossil}"
	make PREFIX=/usr
}

package() {
	cd "${srcdir}/${_fossil}"
	make PREFIX=/usr DESTDIR="$pkgdir" install
}

Output

[rubenk@i5 ~]$ paru nkk-fossil
1 aur/nkk-fossil r25.d3d9016a07-1 [+0 ~0.00]
    Wayland client library w/ cairo drawing
:: Packages to install (eg: 1 2 3, 1-3):
:: 1
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

Repo Make (1) fossil-2.17-1
Aur (1) nkk-fossil-r25.d3d9016a07-1

:: Proceed with installation? [Y/n]: 

:: Downloading PKGBUILDs...
 PKGBUILDs up to date
fetching devel info...
:: Synchronizing package databases...
 core                                                                                                             156.2 KiB   160 KiB/s 00:01 [---------------------------------------------------------------------------------------] 100%
 extra                                                                                                           1694.7 KiB  1369 KiB/s 00:01 [---------------------------------------------------------------------------------------] 100%
 community                                                                                                          6.5 MiB  7.10 MiB/s 00:01 [---------------------------------------------------------------------------------------] 100%
 multilib                                                                                                         172.8 KiB   248 KiB/s 00:01 [---------------------------------------------------------------------------------------] 100%
 endeavouros                                                                                                       31.3 KiB  1239   B/s 00:26 [---------------------------------------------------------------------------------------] 100%
 chaotic-aur                                                                                                     1706.8 KiB   275 KiB/s 00:06 [---------------------------------------------------------------------------------------] 100%
 aur                                                                                                               10.4 KiB  10.4 KiB/s 00:01 [---------------------------------------------------------------------------------------] 100%
:: Starting full system upgrade...
 there is nothing to do
==> Synchronizing chroot copy [/var/lib/paru/aur_chroot/root] -> [rubenk]...done
:: Synchronizing package databases...
 core                                                                                                             156.2 KiB   476 KiB/s 00:00 [---------------------------------------------------------------------------------------] 100%
 extra                                                                                                           1694.7 KiB  3.09 MiB/s 00:01 [---------------------------------------------------------------------------------------] 100%
 community                                                                                                          6.5 MiB  11.8 MiB/s 00:01 [---------------------------------------------------------------------------------------] 100%
 multilib                                                                                                         172.8 KiB   271 KiB/s 00:01 [---------------------------------------------------------------------------------------] 100%
 endeavouros                                                                                                       31.3 KiB  4.08 KiB/s 00:08 [---------------------------------------------------------------------------------------] 100%
 chaotic-aur is up to date
 aur is up to date
:: Starting full system upgrade...
 there is nothing to do
==> Making package: nkk-fossil r25.d3d9016a07-1 (2022-04-14T11:37:04 CEST)
==> Retrieving sources...
  -> Cloning /home/rubenk/.cache/paru/clone/nkk-fossil/nkk.fossil fossil repo...
/usr/share/makepkg/source/fossil.sh: line 50: fossil: command not found
==> ERROR: Failure while downloading /home/rubenk/.cache/paru/clone/nkk-fossil/nkk.fossil fossil repo
    Aborting...
==> ERROR: Could not download sources.
error: failed to download sources for 'nkk-fossil-r25.d3d9016a07-1': failed to run: makechrootpkg -cu -r /var/lib/paru/aur_chroot -D /var/lib/paru/aur_chroot -d /var/cache/pacman/pkg/ -- -ofA: 
error: packages failed to build: nkk-fossil-r25.d3d9016a07-1

Don't cut parts of the input always include the FULL thing

paru.conf and pacman.conf are usually always relevant

paru.conf:

[options]
PgpFetch
Devel
Provides
DevelSuffixes = -git -cvs -svn -bzr -darcs -always -hg -fossil
BottomUp
RemoveMake
SudoLoop
CombinedUpgrade
CleanAfter
UpgradeMenu
NewsOnUpgrade
SkipReview
BatchInstall
LocalRepo
Chroot = /var/lib/paru/aur_chroot

RubenKelevra avatar Apr 14 '22 09:04 RubenKelevra

This is quite annoying. Sources are downloaded on the host. Makepkg doesn't even check deps when running makepkg --verifysource. A solution to this would involve installing all package deps to the host system before building which kind of defeats the point of chroot builds.

Looks like this may just have to be something the user has to deal with.

Morganamilo avatar Apr 14 '22 13:04 Morganamilo

How does this work for other systems like svn, git, etc? Are they assumed to be installed by base-devel or something like that?

RubenKelevra avatar Apr 14 '22 13:04 RubenKelevra

paru depends on git so it's not really come up as git covers 99% of this issue.

Morganamilo avatar Apr 14 '22 13:04 Morganamilo

Hm. How about parsing the package name and if it's contained in the development suffixes we install the right tool to fetch it? 🤔

Or we parse the protocol section of the sources and add the handlers to be installed before calling makepkg?

RubenKelevra avatar Apr 15 '22 04:04 RubenKelevra

I'm not a fan of special cases cases and i think the inconvenience is minor.

Morganamilo avatar Oct 08 '23 12:10 Morganamilo