mac笔记三

5.使用homebrew进行包管理

   homebrew是在Mac中进行包管理的比较好的一个工具,是基于ruby脚本定制的包,名为formula

   类似与centos中的yum

   

5.1首先需要在Mac上安装homebrew,使用命令

   ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

   ruby -e command  -e参数是执行命令的选项

   安装过程如下:中间会提示输入密码


==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir /usr/local

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local
==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> Installing the Command Line Tools (expect a GUI popup):
==> /usr/bin/sudo /usr/bin/xcode-select --install
xcode-select: note: install requested for command line developer tools
Press any key when the installation has completed.

注:中途会提示安装xcode-select,按照提示下载执行就可以了

==> Downloading and installing Homebrew...

remote: Counting objects: 219958, done.
remote: Compressing objects: 100% (57968/57968), done.
remote: Total 219958 (delta 160769), reused 219935 (delta 160753)
Receiving objects: 100% (219958/219958), 49.44 MiB | 724.00 KiB/s, done.
Resolving deltas: 100% (160769/160769), done.
From https://github.com/Homebrew/homebrew
 * [new branch]      master     -> origin/master
HEAD is now at 44f2790 eigen: update 3.2.3 bottle.
==> Installation successful!
==> Next steps
Run `brew doctor` before you install anything
Run `brew help` to get started


测试执行一下brew help

Example usage:
  brew [info | home | options ] [FORMULA...]
  brew install FORMULA...
  brew uninstall FORMULA...
  brew search [foo]
  brew list [FORMULA...]
  brew update
  brew upgrade [FORMULA...]
  brew pin/unpin [FORMULA...]

Troubleshooting:
  brew doctor
  brew install -vd FORMULA
  brew [--env | config]

Brewing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]
  open https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md

Further help:
  man brew
  brew home


5.2 使用brew安装相关vim

brew install vim
brew install macvim
brew install ctags
brew install cscope
brew install vim
==> Downloading http://ftp.debian.org/debian/pool/main/v/vim/vim_7.4.488.orig.ta
######################################################################## 100.0%
==> ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/7.4.488/share
==> make
==> make install prefix=/usr/local/Cellar/vim/7.4.488 STRIP=true
�  /usr/local/Cellar/vim/7.4.488: 1600 files, 26M, built in 2.6 minutes
lizhiyongdeMacBook-Pro:~ lizhiyong$ brew install macvim
macvim: A full installation of Xcode.app is required to compile this software.
Installing just the Command Line Tools is not sufficient.
Xcode can be installed from the App Store.
Error: An unsatisfied requirement failed this build.
lizhiyongdeMacBook-Pro:~ lizhiyong$ brew install macvim
macvim: A full installation of Xcode.app is required to compile this software.
Installing just the Command Line Tools is not sufficient.
Xcode can be installed from the App Store.
Error: An unsatisfied requirement failed this build.

注:安装macvim提示需要xcode,因此要安装xcode

lizhiyongdeMacBook-Pro:~ lizhiyong$ brew install macvim
==> Installing macvim dependency: cscope
==> Downloading https://downloads.sourceforge.net/project/cscope/cscope/15.8a/cs
######################################################################## 100.0%
==> Patching
patching file src/constants.h
==> ./configure --prefix=/usr/local/Cellar/cscope/15.8a --mandir=/usr/local/Cell
==> make install
�  /usr/local/Cellar/cscope/15.8a: 10 files, 736K, built in 18 seconds
==> Installing macvim
==> Downloading https://github.com/b4winckler/macvim/archive/snapshot-73.tar.gz
######################################################################## 100.0%
==> ./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 -
==> make
==> Caveats
.app bundles were installed.
Run `brew linkapps macvim` to symlink these to /Applications.
==> Summary
�  /usr/local/Cellar/macvim/7.4-73_1: 1810 files, 28M, built in 21.0 minutes


lizhiyongdeMacBook-Pro:~ lizhiyong$ brew install ctags
==> Downloading https://downloads.sourceforge.net/ctags/ctags-5.8.tar.gz
######################################################################## 100.0%
==> Patching
patching file read.c
patching file read.h
==> ./configure --prefix=/usr/local/Cellar/ctags/5.8 --enable-macro-patterns --m
==> make install
==> Caveats
Under some circumstances, emacs and ctags can conflict. By default,
emacs provides an executable `ctags` that would conflict with the
executable of the same name that ctags provides. To prevent this,
Homebrew removes the emacs `ctags` and its manpage before linking.


However, if you install emacs with the `--keep-ctags` option, then
the `ctags` emacs provides will not be removed. In that case, you
won't be able to install ctags successfully. It will build but not
link.
==> Summary
�  /usr/local/Cellar/ctags/5.8: 8 files, 364K, built in 13 seconds


lizhiyongdeMacBook-Pro:~ lizhiyong$ brew install cscope
Warning: cscope-15.8a already installed


后续具体配置参考http://blog.csdn.net/oklizy/article/details/42146015

你可能感兴趣的:(MAC&IOS)