File:  [NetBSD Developer Wiki] / wikisrc / pkgsrc / Attic / how_to_use_pkgsrc_on_mac_os_x.mdwn
Revision 1.1: download - view: text, annotated - select for diffs
Sun Nov 20 20:28:27 2011 UTC (12 years ago) by mspo
Branches: MAIN
CVS tags: HEAD
import a bunch of pkgsrc articles from the old pkgsrc.se wiki

    1: In this article I'll explain, how to install and use pkgsrc on Mac OS X (> 10.4.8)
    2: 
    3: **Contents**
    4: 
    5: [[!toc]]
    6: 
    7: #Requirements
    8: 
    9: On a stock Mac OS X you are missing a compiler and important tools for development. Therefore you will need to install the Xcode package that Apple provides upfront. The compressed Xcode disk image (.dmg) is rather big and has a size of currently 924 MB. You will need about 3 GB of free disk space to install it.
   10: 
   11: You can download the Xcode dmg at <http://developer.apple.com/tools/download/> which requires a free membership at ADC.
   12: 
   13: To install Xcode you will need Administrator privileges.
   14: #Checking out pkgsrc
   15: 
   16: After you have downloaded and installed Xcode, you have cvs on your system and can now check out the latest pkgsrc tree from your closest mirror.
   17: 
   18: To do this, please set following environment variables:
   19: 
   20:     $ export CVS_RSH=ssh
   21:     $ export CVSROOT=anoncvs@anoncvs.se.netbsd.org:/cvsroot
   22: 
   23: and check out using the command:
   24: 
   25:     $ cvs co -PA pkgsrc
   26: 
   27: the checkout takes a few minutes and requires currently about 368 MB (growing steadily).
   28: #Bootstrapping Mac OS X
   29: 
   30: By default Mac OS runs with an HFS+ file system. This is by default created to be case-insensitive. HFS+ supports case-sensitivity, if you pass the option -s, when creating your HFS+ file system.
   31: 
   32: As pkgsrc needs to be run on a case-sensitive file system, you can either choose to create an additional case-sensitive file system for pkgsrc or, you can tell pkgsrc to ignore-cases to be able to use it, without modifying anything. In the latter case, please be aware that some packages (only a few) may not work.
   33: 
   34:     $ cd pkgsrc/bootstrap
   35: 
   36: If you choose to bootstrap pkgsrc to use your default case-insensitive file system use following option:
   37: 
   38:     $ sudo ./bootstrap --ignore-case-check
   39: 
   40: If you wish to bootstrap as non-root in your own home folder for testing purposes, please change to your home folder and then change into the bootstrap directory (pkgsrc/bootstrap) and run:
   41: <pre><code>
   42: $ ./bootstrap --ignore-case-check --unprivileged
   43: ...
   44: ===========================================================================
   45: 
   46: Please remember to add /Users/Zafer/pkg/bin to your PATH environment variable
   47: and /Users/Zafer/pkg/man to your MANPATH environment variable, if necessary.
   48: 
   49: An example mk.conf file with the settings you provided to "bootstrap"
   50: has been created for you. It can be found in:
   51: 
   52:       /Users/Zafer/pkg/etc/mk.conf
   53: 
   54: You can find extensive documentation of the NetBSD Packages Collection
   55: in /Users/Zafer/pkgsrc/doc/pkgsrc.txt and packages(7).
   56: 
   57: Hopefully everything is now complete.
   58: Thank you
   59: 
   60: ===========================================================================
   61: 
   62: ===> bootstrap started: Thu Mar  1 13:34:34 CET 2007
   63: ===> bootstrap ended:   Thu Mar  1 13:38:20 CET 2007
   64: </code></pre>
   65: When done, please add your **pkg/bin** directory to your PATH variable **and** pkg/man to your MANPATH variable as mentioned above.
   66: #Installing a new package
   67: 
   68: Installing packages is straightforward works like on other platforms. At first, pick a program you wish to install from the pkgsrc repository. For example misc/figlet. Change in that directory and run bmake.
   69: <pre><code>
   70: $ cd pkgsrc/misc/figlet
   71: $ bmake install clean
   72: ..
   73: => Registering installation for figlet-2.2.2
   74: ===> Cleaning for figlet-2.2.2
   75: 
   76: You can now simply run it by entering:
   77: 
   78: $ figlet MacOS X
   79:  __  __             ___  ____   __  __
   80: |  \/  | __ _  ___ / _ \/ ___|  \ \/ /
   81: | |\/| |/ _` |/ __| | | \___ \   \  / 
   82: | |  | | (_| | (__| |_| |___) |  /  \ 
   83: |_|  |_|\__,_|\___|\___/|____/  /_/\_\
   84: 
   85: $ uname -a
   86: Darwin macmini.aydogan.net 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep  8 17:18:57 PDT 2006;
   87: root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh powerpc
   88: </code></pre>
   89: That's it. Have fun.
   90: #See also
   91: 
   92: * [[pkgsrc/How to use pkgsrc on Solaris]]
   93: * [[pkgsrc/How to use pkgsrc on Linux]]
   94: * [[pkgsrc/The pkgsrc portability guide]]

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb