Skip to content

Commit bdd44eb

Browse files
committed
Mac OS X installation fixes
1 parent f34824f commit bdd44eb

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

setup.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,29 @@
55
import glob
66
import os
77

8-
from os.path import expanduser
9-
HOMEDIR = expanduser("~")
108

9+
includedirs = []
10+
libdirs = []
11+
if platform.system() == "Darwin":
12+
#we are running on Mac OS X with homebrew, stuff is in specific locations:
13+
libdirs.append("/usr/local/opt/icu4c/lib")
14+
includedirs.append("/usr/local/opt/icu4c/include")
15+
libdirs.append("/usr/local/opt/libxml2/lib")
16+
includedirs.append("/usr/local/opt/libxml2/include")
1117

12-
includedirs = [HOMEDIR + '/local/include/','/usr/include/', '/usr/include/libxml2','/usr/local/include/' ]
13-
libdirs = [HOMEDIR + '/local/lib/','/usr/lib','/usr/local/lib']
18+
#add some common default paths
19+
includedirs += ['/usr/include/', '/usr/include/libxml2','/usr/local/include/' ]
20+
libdirs += ['/usr/lib','/usr/local/lib']
1421
if 'VIRTUAL_ENV' in os.environ:
1522
includedirs.insert(0,os.environ['VIRTUAL_ENV'] + '/include')
1623
libdirs.insert(0,os.environ['VIRTUAL_ENV'] + '/lib')
24+
if 'INCLUDE_DIRS' in os.environ:
25+
includedirs = list(os.environ['INCLUDE_DIRS'].split(':')) + includedirs
26+
if 'LIBRARY_DIRS' in os.environ:
27+
libdirs = list(os.environ['LIBRARY_DIRS'].split(':')) + libdirs
1728

1829
if platform.system() == "Darwin":
19-
extra_options = ["-stdlib=libc++"]
30+
extra_options = ["--stdlib=libc++"]
2031
else:
2132
extra_options = []
2233

@@ -32,7 +43,7 @@
3243

3344
setup(
3445
name = 'python-frog',
35-
version = '0.3.5',
46+
version = '0.3.6',
3647
author_email = "proycon@anaproy.nl",
3748
description = ("Python binding to FROG, an NLP suite for Dutch doing part-of-speech tagging, lemmatisation, morphological analysis, named-entity recognition, shallow parsing, and dependency parsing."),
3849
requires = ['frog (>=0.13.6)'],

0 commit comments

Comments
 (0)