I'm using the Arch Linux and trying to create an AUR file that would download the source of a driver, compile and install it. What I wonder is - how can I check which packages are required for the compilation to succeed (just so I could declare those dependencies in my AUR)? Do I really have to analyze the very long configure file or is there a better way?

Edit: or maybe I'm not supposed to add build-dependencies to the usage dependencies in AUR?

Edit #2: I'm trying to create AUR for this: http://www.acs.com.hk/download-driver-unified/6258/ACS-Unified-Driver-Lnx-Mac-113-P.zip

  • That depends on the type of configure script it uses. autoconf produces configure.log which is easier to parse, but few kernel drivers use autoconf. On the other hand most kernel drivers have simple configure scripts or, sometimes, not even have a configure script (just a makefile). It might be useful to post which driver you want to compile (i believe it is not your own, since then you would know the dependencies). – grochmal Aug 11 '16 at 19:11
  • @grochmal I added link to the source. – Łukasz Zaroda Aug 11 '16 at 19:17
  • Hey! You did not read the README :) . It is there in the first couple of lines there: You need pcsclite 1.8.3 or above, libusb 1.0.9 or above, flex, perl and pkg-config. Let me just dig out one of my AURs and i'll write something on how to check for things like libraries from a readme. – grochmal Aug 11 '16 at 19:25
  • omg, you are right, I'm ashamed ;_; . Thanks, that would be helpful :) . – Łukasz Zaroda Aug 11 '16 at 19:29

Most packages want to be helpful when installing them so they will have some dependency information in the README or the INSTALL file. Otherwise yes, checking the configure script it the only real option (Note: autoconf produces configure.log that enumerates dependencies, and several other configure scripts print a dependency summary at the end to make this easier for packagers).

For the problem at hand the README is most useful, it says:

- pcsclite 1.8.3 or above
- libusb 1.0.9 or above
- flex
- perl
- pkg-config

Now, let us have a look at that. An AUR package can assume that base and base-devel groups of packages are installed, which make things easier to reason about. Enumerating the dependencies we see:

  • pkg-config: is in base-devel, we do not need to care about it.

  • perl: is part of base, fine.

  • flex: base-devel again.

  • libusb 1.0.9 or above and pcsclite 1.8.3 or above

    pacman -Ss libusb
    core/libusb 1.0.20-1
        Library that provides generic access to USB devices
    pacman -Ss pcsclite
    community/pcsclite 1.8.16-1
        PC/SC Architecture smartcard middleware library

The beauty of a rolling forward distribution is that you can assume that the user has the latest packages (if he is a sane user he will do pacman -Syu before installing your AUR package). Therefore we can simply do (inside PKGBUILD):

depends=(libusb pcsclite)

Extra note: Sometimes it is not as easy to find the package a README or INSTALL talks about. In this case google-fu is needed. Yet, arch also has pkgfile which is the database of which files are in which packages.

For finding dependencies to be added to AUR packages I strongly recommend installing pkgfile, i.e.

pacman -S pkgfile

And then you can query suspicious packages for libraries, e.g.

pkgfile -l <package> | grep lib

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.