How to find dependencies of a source package that is not in a Linux distro repos?

0

There is no shortage of discussions on how to find dependencies of a package that exists in a distro repos, but I haven't been able to find how to get the dependencies of an arbitrary source package that I want to build.

Specifically, I want to build Python 3.7 on my Debian 9 system. I don't trust the various blog posts I have found on the net about this, I want to find the dependencies myself. Since Python 3.7 is not in the Debian 9 repos, the build-dep option to apt-get doesn't help.

Also, I would like to know how to do this more generally, not just in relation to Python 3.7. I'm new to building from source... Have opened a few files in the source folder, to see if I could find the list of dependencies, with no luck.

Theo d'Or

Posted 2019-01-03T14:34:52.053

Reputation: 103

Answers

1

Usually, source package have a mechanism shipped with it to check those dependencies:

  • setup.py for python modules.
  • configure.ac / configure or CMakeList.txt for C/C++ sources
  • etc...

Simply launch the build process and look how it fails :-)

Anyway, badly packaged sources may not have this dependency check during build time.

In this case, it's often because of hand-written Makefiles and the solution is quite easy: check Makefile-s for link dependencies (ie: gcc [..] -lblabla: the -l flag is for 'link against library blabla, so you need libblabla). Nevertheless, even if you will be able to check which libraries are needed to build the sources, you won't be able to determine which version of it...

binarym

Posted 2019-01-03T14:34:52.053

Reputation: 320

1

In addition to binarym's answer, which is good, it is helpful to look up packages on LFS (Linux from scratch). If you have everything that has been compiled up to a given package, then your dependencies are fine.

Furthermore, a more expansive selection of packages are described in BLFS (Beyond Linux from scratch - from the same site), and those package descriptions contain dependies and optional dependencies.

Good luck.

Guy Gastineau

Posted 2019-01-03T14:34:52.053

Reputation: 301