8000 Merge pull request #985 from ivanov/alternative-to-982 · matplotlib/matplotlib@97b3166 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97b3166

Browse files
committed
Merge pull request #985 from ivanov/alternative-to-982
Support current and future FreeBSD releases in the setupext.py build script.
2 parents f6b7f28 + c28e8d7 commit 97b3166

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

setupext.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,31 +47,23 @@
4747
import re
4848
import subprocess
4949
from distutils import sysconfig, version
50-
51-
basedir = {
50+
from collections import defaultdict
51+
52+
# basedir is a dictionary keyed by sys.platform, and on most platforms it is
53+
# set to ['/usr/local', '/usr']. Giving this defaultdict a factory that
54+
# returns this default removes the need to update this code every time a new
55+
# version of freebsd comes out, for example, provided that the default basedir
56+
# remains sufficient on that platform
57+
basedir = defaultdict(lambda: ['/usr/local', '/usr'], {
58+
# execptions to the ['/usr/local', '/usr'] defaults
5259
'win32' : ['win32_static',],
53-
'linux2-alpha' : ['/usr/local', '/usr'],
54-
'linux2-hppa' : ['/usr/local', '/usr'],
55-
'linux2-mips' : ['/usr/local', '/usr'],
56-
'linux2-sparc' : ['/usr/local', '/usr'],
57-
'linux2' : ['/usr/local', '/usr'],
58-
'linux3' : ['/usr/local', '/usr'],
59-
'linux' : ['/usr/local', '/usr',],
60-
'cygwin' : ['/usr/local', '/usr',],
6160
'darwin' : ['/usr/local/', '/usr', '/usr/X11'],
62-
'freebsd4' : ['/usr/local', '/usr'],
63-
'freebsd5' : ['/usr/local', '/usr'],
64-
'freebsd6' : ['/usr/local', '/usr'],
6561
'sunos5' : [os.getenv('MPLIB_BASE') or '/usr/local',],
66-
'gnukfreebsd5' : ['/usr/local', '/usr'],
67-
'gnukfreebsd6' : ['/usr/local', '/usr'],
68-
'gnukfreebsd7' : ['/usr/local', '/usr'],
69-
'gnukfreebsd8' : ['/usr/local', '/usr'],
7062
'gnu0' : ['/usr'],
7163
'aix5' : ['/usr/local'],
72-
}
64+
})
7365

74-
import sys, os, stat
66+
import sys
7567

7668
from textwrap import fill
7769
from distutils.core import Extension

0 commit comments

Comments
 (0)
0