HPR1688: Some useful tools when compiling software




Hacker Public Radio show

Summary: introduction Hi this is Rho`n and welcome to my first submission to Hacker Public Radio. I have been working on an application using the Python programming language with the Enlightenment Foundation Libraries (EFL) libraries for the GUI interface. After acquiring a new laptop and installing a fresh copy of Ubuntu on it, I decided to set up the build environment I needed to be able to work on my project. I have been building from source the EFL libraries along with the Python-EFL wrapper libraries. For the last couple machines on which I have built the software, I would use the standard configure, make, and make install procedure. This time around I decided to create a debian package to use for installing the libraries. It had been a few years since I had created a .deb, so I googled for some tutorials, and found mention of the checkinstall program. After reading a couple blog posts about it I decided to try it out. checkinstall is run instead of "make install" , and will create a .deb file, and then install the newly created package. cut and tr commands To help speed up the configure process, I had previously created a file from my other builds that is a grep of my history for all the various "apt get install" commands of the libraries the EFL software needs to compile. Since my current operating system was a freshly installed distribution of Ubuntu, I needed to install the build-essential package first. After looking through my install file, and I decided to create a single apt-get install line with all the packages listed, instead of running each of the installs seperately. I knew I could grep the file, and then pass that to awk or sed, but my skill with either isn't that great. I did a little searching to see what other tools were out there and found the cut command and the tr command. Cut lets you print part of a line. You can extract set a field delimeter with the -d option and then list a range of fields to be printed with the -f option. The tr command can replace a character. I used this to replace the new line character that was printed by the cut command to generate a single line of packages which I piped to a file. A quick edit of the file to add "sudo apt-get install" at the beginning, add execute permissions to the file, and now I have a nice, easy way to install all the needed libraries. https://stackoverflow.com/questions/15580144/concatenate-many-lines-of-output-to-one-line https://stackoverflow.com/questions/7857090/awk-extract-specific-columns-from-delimited-file apt-file and checkinstall At least that was the idea. After installing the libraries, and running configure, I still received errors that libraries were missing. The machines from which my list of libraries was generated, had all been used for various development purposes, so some needed libraries were already installed on them, and so their installation had passed out of my history. Besides echoing to standard out the file configure can't find, it also creates a log file: config.log. Between the two it is relatively easy to figure out what library is needed. Often the libraries needed included their name in the .deb which has to be installed, and finding them is easy with an apt-cache search and grep of the library name. The hardest ones to find were often the X11 based references. In this case, I needed the scrnsaver.h header file. After googling, I found a reference to the needed package (libxss-dev) on Stack Exchange. The answer also showed how to use the apt-file command to determine in which package a file is included. I wish I had run into this before, there a few times where it took a number of searches on the internet to figure o