Changes between Version 1 and Version 2 of howto/ShareArchives


Ignore:
Timestamp:
Jun 25, 2008, 3:17:06 AM (16 years ago)
Author:
alex.malinovich@…
Comment:

formatting fixes

Legend:

Unmodified
Added
Removed
Modified
  • howto/ShareArchives

    v1 v2  
    1414=== '''Enable Archive Mode''' ===
    1515
    16 For starters, lets edit your macports.conf file and enable archive mode. Your macports.conf is found in ${prefix}/etc/macports/macports.conf. For most people, this will be /opt/local/etc/macports/macports.conf. Edit this file in your editor of choice and look for "portarchivemode". It will probably be set to "no" by default. Change it to a "yes" and then save the file.
     16For starters, lets edit your {{{macports.conf}}} file and enable archive mode. Your {{{macports.conf}}} is found in {{{${prefix}/etc/macports/macports.conf}}}. For most people, this will be {{{/opt/local/etc/macports/macports.conf}}}. Edit this file in your editor of choice and look for {{{portarchivemode}}}. It will probably be set to {{{no}}} by default. Change it to a {{{yes}}} and then save the file.
    1717
    1818== Share archives between identical architectures ==
    1919
    20 If you're using two machines that are both the same architecture (i386 or powerpc) then you have it relatively easy. Lets say that you want to copy a compiled copy of sqlite3 over to your other machine. We'll use the terms 'source' and 'target' to describe the two machines here. The source is the one that already has it installed.
    21 === Build the archive on the source machine ===
     20If you're using two machines that are both the same architecture (''i386'' or ''powerpc'') then you have it relatively easy. Lets say that you want to copy a compiled copy of ''sqlite3'' over to your other machine. We'll use the terms __source__ and __target__ to describe the two machines here. The __source__ is the machine that already has the package installed.
     21=== Build the archive on the __source__ machine ===
    2222{{{
    2323sudo port archive sqlite3
    2424}}}
    25 === Install the archive on the target machine ===
    26 Now if you look on your source machine in ${prefix}/var/macports/packages/darwin/${arch} (where ${arch} is either i386 or powerpc) you should find a file named 'sqlite3-x.x.x_x.i386.tgz'. (The x's are the version number.) Copy that file to the same location on your target machine. Now on the target do:
     25=== Install the archive on the __target__ machine ===
     26Now if you look on your __source__ machine in {{{${prefix}/var/macports/packages/darwin/${arch} }}} (where ${arch} is either ''i386'' or ''powerpc'') you should find a file named {{{sqlite3-x.x.x_x.i386.tgz}}}. (The x's are the version number.) Copy that file to the same location on your __target__ machine. Now on the __target__ do:
    2727{{{
    2828sudo port unarchive sqlite3
     
    3838== Share archives between '''different''' architectures ==
    3939
    40 '''WARNING!!!''' Sharing archives between different architectures ''could'', in theory, seriously b0rk your system! You have been warned!
     40'''WARNING!!!''' Sharing archives between different architectures could, in theory, seriously '''b0rk''' your system! You have been warned!
    4141
    42 Now, here's the fun part. Say you have an i386 machine and a powerpc machine. Chances are that the i386 machine is a fair bit faster. But you can't share binaries between them... or can you? Thanks to the '''+universal''' variant, it's possible. Here's a good primer on [[wiki:howto/buildUniversal building universal binaries]].
     42Now, here's the fun part. Say you have an ''i386'' machine and a ''powerpc'' machine. Chances are that the ''i386'' machine is a fair bit faster. But you can't share binaries between them... or can you? Thanks to the '''+universal''' variant, it's possible. Here's a good primer on [[wiki:howto/buildUniversal building universal binaries]].
    4343
    44 Unfortunately, just doing this is not enough. The archive system still knows where the archive was built, so by default a powerpc system will not use an i386 archive and vice versa. So what do we do? Well, we start with the simple steps. We'll be using the same example as above (sqlite3) going from a source i386 machine to a target powerpc machine.
     44Unfortunately, just doing this is not enough. The archive system still knows where the archive was built, so by default a ''powerpc'' system will not use an ''i386'' archive and vice versa. So what do we do? Well, we start with the simple steps. We'll be using the same example as above (''sqlite3'') going from a __source__ ''i386'' machine to a __target__ ''powerpc'' machine.
    4545
    46 === Build the archive on the source machine ===
     46=== Build the archive on the __source__ machine ===
    4747{{{
    4848sudo port archive sqlite3 +universal
    4949}}}
    50 === Install the archive on the target machine ===
    51 Now we're going to copy the file to the same location on the target machine. On our source machine we're going to find the file {{{/opt/local/var/macports/packages/darwin/i386/sqlite3-x.x.x_x+universal.i386.tgz}}} We're going to copy that file to the target machine. But the target won't have the appropriate directory, since it's a different architecture. So we're going to copy it into {{{/opt/local/var/macports/packages/darwin/powerpc/}}} instead.
     50=== Install the archive on the __target__ machine ===
     51Now we're going to copy the file to the same location on the target machine. On our source machine we're going to find the file {{{/opt/local/var/macports/packages/darwin/i386/sqlite3-x.x.x_x+universal.i386.tgz}}} We're going to copy that file to the __target__ machine. But the __target__ won't have the appropriate directory, since it's a different architecture. So we're going to copy it into {{{/opt/local/var/macports/packages/darwin/powerpc/}}} instead.
    5252
    53 You'll also notice that the archive has the architecture in the name. So we'll need to change that as well. Just rename the file and change i386 to powerpc.
     53You'll also notice that the archive has the architecture in the name. So we'll need to change that as well. Just rename the file and change ''i386'' to ''powerpc''. The new name should be something like {{{sqlite3-x.x.x_x+universal.powerpc.tgz}}}.
    5454
    5555Finally, we can proceed with the installation:
     
    6161sudo port install sqlite3 +universal
    6262}}}
    63 Note that we're specifying the variant in both cases. Otherwise the commands wouldn't find the archive file and this wouldn't work. (Because the archive file has +universal in the name.)
     63Note that we're specifying the variant in both cases. Otherwise the commands wouldn't find the archive file and this wouldn't work. (Because the archive file has ''+universal'' in the name.)
    6464
    6565So that's it! Enjoy! :)