Maintaining source code for selected ports.

Ben Tompkins nbits.spoken at gmail.com
Wed Feb 2 15:35:30 PST 2011


Sorry about that. I will henceforth use "reply all." 

The fundamental assumption underlying my desire to "compile things by hand" is that IDEs (I currently use Xcode 3 or 4), debuggers, profilers, code-coverage tools and such like, which perform static analyses of source code, are often tightly coupled to the compiler that they ship with. At the same time, I must admit that this bias stems from past experience with different tools running on non-MacIntosh platforms.


On Feb 2, 2011, at 5:20 PM, Ryan Schmidt wrote:

> Ben, let's keep the discussion on the mailing list; use Reply All when you reply.
> 
> On Feb 2, 2011, at 15:30, Ben Tompkins wrote:
> 
>> On Feb 2, 2011, at 12:07 PM, Ryan Schmidt wrote:
>> 
>>> If you want to keep the work directory (containing the source and build products, and the destroot) only for particular port runs, supply the -k ("keep") flag, as in:
>>> 
>>> sudo port -k install portname
>>> 
>>> See "man port" for more options that you might like to use in other circumstances.
>>> 
>>> Since MacPorts keeps the distfiles elsewhere, you can extract the source code from them yourself, to any location you like, if you just want to take a look at the original source. The distfiles are in /opt/local/var/macports/distfiles/portname.
>> 
>> Thanks Ryan! That helped a lot. I had no idea that the sources were still on my system. I assume that as long as I don't compile as root, my working installation is safe. Of course, I will need to divert the output of the build to a user-level directory. Is this always going to be as simple as changing the prefix in a 'configure' script? Also, how hard would it be to create a self-contained build
>> that compiles the transitive closure of all dependencies from source, and how much harder would it be to do this efficiently, without excessive duplication of source-level dependencies across multiple unrelated ports. It is also possible that achieving space-efficiency just isn't worth the effort because storage is cheap and/or there isn't much duplication to begin with. 
> 
> Ah, I didn't realize you wanted to compile things by hand; I thought you just wanted to look at the source for informational purposes.
> 
> Why do you want to compile things manually that are available in MacPorts? Is there something insufficient about the way MacPorts has compiled things for you?
> 
> The --prefix parameter to standard configure scripts tells it where you want things to get installed to when you run "make install". Where things get built before they're installed, however, is generally still the source directory itself. Some projects offer or even recommend out-of-source builds (building in a different directory than the source), and will usually provide instructions on how to do so.
> 
> 



More information about the macports-users mailing list