Aur package maintenance

Good day! (heads up I don’t know anything about coding)

I realize few month ago that some package on AUR was outdated, I reported them and flag them but nothing is happening so I decided to learn how to build PKGBUILD. Well I copy the one outdated change it for the new version and try to make it work on Yay. KEEP IN MIND THIS IS JUST FOR TRAINING so be cool. (Again I’m doing it for science purpose)

Here is the package I’m trying to run with the correct update:

https://aur.archlinux.org/packages/sparrow-wallet

Here is the PKGBUILD (old):

# Maintainer: Cybafunk Monkey <cybafunk-monkey@posteo.eu>

_pkgname=Sparrow
pkgname=sparrow-wallet
pkgver=1.8.2
pkgrel=1
pkgdesc="Bitcoin wallet with pro functionalities like single- and multisig, Transaction Editor, built-in Tor, connection to private Electrum and much more. Different Hardware Wallets like Trezor and BitBox supported."
arch=('x86_64')
url="https://sparrowwallet.com/"
license=('Apache')
depends=('hicolor-icon-theme' 'alsa-lib' 'libxtst' 'libxrender' 'java-runtime' 'freetype2' 'libxcrypt-compat')
makedepends=('p7zip' 'gendesk')
validpgpkeys=('D4D0D3202FC06849A257B38DE94618334C674B40')
source=("https://github.com/sparrowwallet/sparrow/releases/download/$pkgver/sparrow-$pkgver-$CARCH.tar.gz")
sha256sums=('ffb7f86e978ab312dcc169d7c70b33048256dcf3280aecb1cb9392124eac31b9')

prepare() {
	# Comment
	gendesk --pkgname "${_pkgname}" --pkgdesc "$pkgdesc" --name=$_pkgname --exec="/usr/bin/"${_pkgname} -n --categories="Utility;Finance;"
}

package() {

	install -dm755 "${pkgdir}"/opt/${pkgname}/lib/
	install -dm755 "${pkgdir}"/usr/bin/
	
	cp -a "${srcdir}"/${_pkgname}/bin			"${pkgdir}"/opt/${pkgname}/
	cp -a "${srcdir}"/${_pkgname}/lib/app 		"${pkgdir}"/opt/${pkgname}/lib/
	cp -a "${srcdir}"/${_pkgname}/lib/runtime 	"${pkgdir}"/opt/${pkgname}/lib/
	cp -a "${srcdir}"/${_pkgname}/lib/*.so 		"${pkgdir}"/opt/${pkgname}/lib/
	
	install -Dm644 	"${srcdir}"/${_pkgname}/lib/${_pkgname}.png -t 	"${pkgdir}"/usr/share/icons/hicolor/256x256/apps/
    install -Dm644 	"${srcdir}"/${_pkgname}.desktop 				"${pkgdir}"/usr/share/applications/${_pkgname,,}-wallet.desktop
    ln -s 			"/opt/$pkgname/bin/${_pkgname}" 				"${pkgdir}"/usr/bin/
}

And I decided to replace it with the newer version:

# Maintainer: Cybafunk Monkey <cybafunk-monkey@posteo.eu>

_pkgname=Sparrow
pkgname=sparrow-wallet
pkgver=1.8.4
pkgrel=1
pkgdesc="Bitcoin wallet with pro functionalities like single- and multisig, Transaction Editor, built-in Tor, connection to private Electrum and much more. Different Hardware Wallets like Trezor and BitBox supported."
arch=('x86_64')
url="https://sparrowwallet.com/"
license=('Apache')
depends=('hicolor-icon-theme' 'alsa-lib' 'libxtst' 'libxrender' 'java-runtime' 'freetype2' 'libxcrypt-compat')
makedepends=('p7zip' 'gendesk')
validpgpkeys=('D4D0D3202FC06849A257B38DE94618334C674B40')
source=("https://github.com/sparrowwallet/sparrow/releases/download/1.8.4/sparrow-1.8.4-x86_64.tar.gz")
sha256sums=('6b050131368f639c33e52a88eb6fb03678acc009f8e464eccfbe353e3cac8156')

prepare() {
	# Comment
	gendesk --pkgname "${_pkgname}" --pkgdesc "$pkgdesc" --name=$_pkgname --exec="/usr/bin/"${_pkgname} -n --categories="Utility;Finance;"
}

package() {

	install -dm755 "${pkgdir}"/opt/${pkgname}/lib/
	install -dm755 "${pkgdir}"/usr/bin/

	cp -a "${srcdir}"/${_pkgname}/bin			"${pkgdir}"/opt/${pkgname}/
	cp -a "${srcdir}"/${_pkgname}/lib/app 		"${pkgdir}"/opt/${pkgname}/lib/
	cp -a "${srcdir}"/${_pkgname}/lib/runtime 	"${pkgdir}"/opt/${pkgname}/lib/
	cp -a "${srcdir}"/${_pkgname}/lib/*.so 		"${pkgdir}"/opt/${pkgname}/lib/

	install -Dm644 	"${srcdir}"/${_pkgname}/lib/${_pkgname}.png -t 	"${pkgdir}"/usr/share/icons/hicolor/256x256/apps/
    install -Dm644 	"${srcdir}"/${_pkgname}.desktop 				"${pkgdir}"/usr/share/applications/${_pkgname,,}-wallet.desktop
    ln -s 			"/opt/$pkgname/bin/${_pkgname}" 				"${pkgdir}"/usr/bin/
}

So as you can see I changed the Sha to the right one and the source to the new one. Now of course this doesn’t work. I’m pretty sure the SHA are correct tho! And my other question is where should the PKGBUILD fie should be? At the moment I just in my Downloads directory should it be somewhere else? or Yay will actually put it at the right spot after the install? Thanks for the help :slight_smile:

markpkg

You can just type updpkgsums in the same directory as the PKGBUILD and it will update the sums for you automatically as long as you know the source is good.

This is not the correct sum for that file.

>> sha256sum sparrow-1.8.4-x86_64.tar.gz                                                                                                          
a8ed2e84455747df5cff7870790423e9e20e06662bd5e232be8e5f9d3841df70  sparrow-1.8.4-x86_64.tar.gz
2 Likes

Ahhhh I was looking at the older version :confounded: Where shoud I put the MAKEPKG package? Does Downloads folder is okay?
Thank you for the help much appreciated!!!

You mean the PKGBUILD? You should put it in it’s own directory since it will download and the build the package there. That directory can go wherever you want. It doesn’t really make much difference.

O really? The thing is I already got the version 1.8.2-1 that I can find in endeavour/var/lib/pacman/local I thought I had to cd local and then makepkg -si. Is this better practice of that really doesn’t matter?

That gets created when you install the package on it’s own. You shouldn’t put your own files there.

The PKGBUILD is not a package. It is instructions to build the package.

Got cha!

I found the old version it actually store there diff --git /home/hsdredgun/.cache/yay/sparrow-wallet/.gitignore /home/hsdredgun/.cache/yay/sparrow-wallet/.gitignore !

Thanks again for the help much appreciate!

Wowo this actually work! Awesome! Cheers!!!

2 Likes

Have a look at

man makepkg