3

I am considering packaging a Python program for Arch Linux to be distributed with the AUR. I have created a PKGBUILD file that I can use with makepkg to build the package. The package builds and installs fine on my machine, but that doesn't seem very robust since if a dependency is missing from the PKGBUILD but already installed on my machine I will miss it.

I was thinking that I could do this in a virtual machine, but that seems like potential overkill. I also thought about trying to use a chroot environment, but I am not sure that will work. The Python program creates a GUI so it requires at least a portion of xorg/X11.

How do I go about building/creating a package and testing that all the dependencies are included?

2 Answers 2

4

You build it in a clean chroot.

To quote the Arch Wiki:

Building in a clean chroot prevents missing dependencies in packages, whether due to unwanted linking or packages missing in the depends array in the PKGBUILD. It also allows users to build a package for the stable repositories (core, extra, community) while having packages from [testing] installed.

The requirement for Xorg is easily handled as the chroot uses packages you already have installed.

2

I have been both packaging Python programs for PyPI and as .deb/.rpm packages (but not anything for Arch Linux).

The best way to test, in my experience, is have a clean virtual machine on which you can install the package. For that I use VirtualBox, with a snapshot of a fresh installation. After testing I roll back to the snapshot point, and have a fresh installation in a matter of seconds.

5
  • also debian and arch should not have that big differences Commented Mar 4, 2014 at 12:03
  • @Kiwy my understanding is that Debian packages should handle a huge number of different architectures whereas Arch only supports X86_64. Commented Mar 4, 2014 at 12:09
  • I was thinking about a VM, but it seems like potentially overkill. I thought maybe something like a chroot might work but then you don't have snapshots. Commented Mar 4, 2014 at 12:11
  • you can install a vbox with clean minimal install then try to install your package and see if the only depencies you set are correct. @DanielE.Shub Is it compile python code ? why would it be different between different architecture ? Commented Mar 4, 2014 at 12:15
  • @DanielE.Shub chroot might work as well, I am just not sure how to get about with that. If I were you I would mention that in the original Q, so potential answerers could jump on that bandwagon. Another possibility is asking the actual packagers of ofter Python packages for Arch what process they follow. Commented Mar 4, 2014 at 13:17

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.