Determine dependencies required when writing a PKGBUILD

Does anyone know of a good way to determine the required dependencies when writing a PKGBUILD?

For what?

For one, it depends if the developer specifies the required dependencies or not.

Maybe find-libdeps? (Need to download it from Arch though)

https://wiki.archlinux.org/index.php/Arch_package_guidelines#Package_dependencies

1 Like

I usually go with trial’n’error. :stuck_out_tongue:

1 Like

If you don’t know which packages provides a given library you can use pacman to search which package provides the file

If you don’t have it - install pkgfile from the repo. Then run

sudo pkgfile --update

Then search

pkgfile foo.so

Or to do a partially search

pkgfile -r foo

Or you can use pamac

pamac -f foo

For Simplenote for ARM devices:
https://aur.archlinux.org/packages/simplenote-electron-arm-bin

A while ago I persuaded the maintainer of the Simplenote AUR package to include the ARM builds in their package and make it multi-arch.

However, since then, the upstream developers have had issues building the ARM .deb binaries, so they dropped them. These were the binaries being sourced by the AUR package maintainer. Consequently, they dropped ARM support.

Recently, the upstream developers have begun producing ARM builds again, but have only built a .deb binary for armv7h, and not aarch64. However, they were able to produce an AppImage. I remember seeing that the 1Password AUR package used an AppImage as it’s source, so I had a go at using it as a template to make a new PKGBUILD for Simplenote on ARM devices.

I do normally too. Mostly, no-one uses what I maintain, so it probably goes unnoticed.

Thanks, I’ll take a look at this.

If the maintainer of the AUR package would have followed the same build steps as the upstream to build the binaries instead of extracting it from the .deb the problem would solve itself.
Never mix binaries between distro’s because they might use different libraries to link against or a different kernel etc.
It doesn’t matter if you build a .deb or package for Arch based systems, it all starts with compiling the sources in a correct way…
While building the sources you would know what other tools etc it needs, which in turn will be your dependencies in both kinds…

I agree, but some Simplenote is better than no Simplenote. I intend to have a go at using the source to build an ‘any’…ish arch package, but I only had an hour free yesterday to fiddle with this.

That being said, you may still miss a build or run dependency if you already had something installed that was required, but had not realised.

Not if you are not lazy to add all dependencies your build logic needs to compile the sources :wink:
Eg. instead of relying on the kernel headers etc to be “there” already in a system, you should add them to your dependencies…
That’s why some (all hopefully) builds test their build logic in a fresh VM.

No, you don’t.

❯ pacman -F find-libdeps
extra/manjaro-tools-pkg 0.15.10-1 (manjaro-tools)
    usr/bin/find-libdeps
extra/manjaro-tools-pkg-git r2939.0f896a2-1 (manjaro-tools) [installed]
    usr/bin/find-libdeps
2 Likes