Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added installing on OS X #448

Merged
merged 1 commit into from Feb 12, 2015
Merged

Added installing on OS X #448

merged 1 commit into from Feb 12, 2015

Conversation

holgi
Copy link

@holgi holgi commented Nov 9, 2014

This should be considered as a primer to get you started on using pygit2 on OS X. Since I only have one Mac, I could not verify this on more OS Versions and / or settings.


.. code-block:: sh

$ export LIBGIT2=/usr/local/Cellar/libgit2/<libgit2 version>/lib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would then require you to set the path every time you want to use something which uses pygit2. A more common solution should be to brew link libgit2 which makes libgit2 available through /usr/local/, which is the path where non-system-provided software and libraries are installed and where the build system expects to see it (and where python will look when it needs to load libgit2).

@holgi
Copy link
Author

holgi commented Nov 10, 2014

I know about the brew linkcommand, but I am not very fond of linking optional packages into /usr/local.

I tried the following to test the libgit2 and pygit2 installation:

  • install libgit2 with homebrew
  • create a new OS X user
  • switch to this user
  • create a new virtualenv with python3
  • activate the virtualenv
  • run pip3 install pygit2

This worked without any problem. I didn't need to run brew link, nor did I edit any path information. (Now I'd like to have a new unaltered mac to try this out)

@carlosmn
Copy link
Member

I don't get what you mean by optional here. Everything in /usr/local is installed by the user/admin and cannot be necessary for the operation of the OS.

You likely didn't need to explicitly run brew link because brew did it automatically. It is not done for some libraries because they would interact with the system's own versions, but the point of brew is to put stuff in /usr/local so you can use it.

@holgi
Copy link
Author

holgi commented Nov 10, 2014

Sorry, you are completely right. I was looking in the wrong place (/usr/local/bin instead of /usr/local/lib). I shouldn't write something on Monday morning before my second coffee.

@jdavid jdavid mentioned this pull request Jan 11, 2015
@jdavid
Copy link
Member

jdavid commented Jan 19, 2015

Hello,

As I understand the PR has not been updated to take into account the @carlosmn comments, @holgi?

I would like to merge this...

@holgi
Copy link
Author

holgi commented Jan 19, 2015

I had the opportunity to try this on a new Mac with Yosemite installed (since my old one broke down). After installing Xcode and homebrew I could run the following commands without any problems:

brew update
brew install libgit2

and install pygit2 in a fresh virtualenv with

pip3 install pygit2

Maybe the stuff to export the libgit2 part could just be left out.

@jdavid
Copy link
Member

jdavid commented Jan 19, 2015

yes I think so, just leaving out that part would be enough

@jdavid jdavid merged commit d4fc701 into libgit2:master Feb 12, 2015
jdavid added a commit that referenced this pull request Feb 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants