Newbie Question about Binary Packages

Ryan Schmidt ryandesign at macports.org
Fri May 2 18:39:14 PDT 2008


On May 2, 2008, at 2:02 PM, EmmGunn wrote:

> On May 2, 2008, at 2:17 AM, Anders F Björklund wrote:
>>
>> Mikael wrote:
>>
>>> I'm a complete newbie to compiling binaries, and UNIX for that  
>>> matter, so please forgive me for any ignorant questions.  I'm  
>>> hoping to use MacPorts to compile binary packages that can be  
>>> distributed and installed on other computers.  I've been  
>>> practicing with hexedit.  After some trial and error I've been  
>>> able to compile it and it runs fine on my computer.  I then tried  
>>> "port pkg hexedit" which I was under the impression would give me  
>>> a package that would install all the files needed to run hexedit  
>>> on other computers.  I created the pkg file but when I tested it  
>>> on another computer, the installed binary wouldn't run.  I get  
>>> the impression that needed libraries are not being installed on  
>>> the target computer.  Can anybody point me in the right direction  
>>> to accomplish my goal.  Thanks in advance for any help.
>>
>> Use "port mpkg" instead (includes dependencies).
>
> Thanks for the help.  I'll give it a try when I get home.  If I  
> may, I have a few more questions:
>
> 1) I've been using the guide at - http://guide.macports.org/.  It's  
> a great reference, however there is no mention of mpkg that I could  
> find regarding binary packages.  Are there any other good  
> references out there?

If the guide doesn't mention mpkg, please file a ticket in the issue  
tracker requesting that this be documented.

> 2) I'm assuming that the binary package will use the already  
> intalled ports, so the packaged binaries will have the variants I  
> included when I installed the the ports.  Is that correct?

Yes.

> 3) I'm also assuming the files will be installed in a folder opt  
> when installed via the package.  Can this folder be moved to  
> somewhere hidden from the user.  The binaries will be controlled by  
> an applescript so the location won't matter in terms of trying to  
> run things from the terminal, but will this break the dependencies?

You can install MacPorts into any prefix you want, but you can't  
change it after the fact. So if you want to install into /some/other/ 
dir you can download the source of MacPorts, configure it with -- 
prefix=/some/other/dir, make it, install it, install your ports, then  
mpkg them. But the user installing the resulting package will not be  
able to move the ports to another directory; they'll then have to  
live in /some/other/dir. Making ports relocatable is non-trivial  
because it's different for every port, and there's no strong need to  
have this capability in MacPorts.




More information about the macports-users mailing list