@@ -1079,7 +1079,8 @@ def build_ft2font(ext_modules, packages):
10791079 deps .extend (glob .glob ('CXX/*.cxx' ))
10801080 deps .extend (glob .glob ('CXX/*.c' ))
10811081
1082- module = Extension ('matplotlib.ft2font' , deps )
1082+ module = Extension ('matplotlib.ft2font' , deps ,
1083+ define_macros = [('PY_ARRAYAUNIQUE_SYMBOL' , 'MPL_ARRAY_API' )])
10831084 add_ft2font_flags (module )
10841085 ext_modules .append (module )
10851086 BUILT_FT2FONT = True
@@ -1100,12 +1101,13 @@ def build_ttconv(ext_modules, packages):
11001101def build_gtkagg (ext_modules , packages ):
11011102 global BUILT_GTKAGG
11021103 if BUILT_GTKAGG : return # only build it if you you haven't already
1103- deps = ['src/_gtkagg .cpp' , 'src/mplutils .cpp' ] # , 'src/_transforms .cpp']
1104+ deps = ['src/agg_py_transforms .cpp' , 'src/_gtkagg .cpp' , 'src/mplutils .cpp' ]
11041105 deps .extend (glob .glob ('CXX/*.cxx' ))
11051106 deps .extend (glob .glob ('CXX/*.c' ))
11061107
11071108 module = Extension ('matplotlib.backends._gtkagg' ,
11081109 deps ,
1110+ define_macros = [('PY_ARRAY_UNIQUE_SYMBOL' , 'MPL_ARRAY_API' )]
11091111 )
11101112
11111113 # add agg flags before pygtk because agg only supports freetype1
@@ -1164,6 +1166,7 @@ def build_macosx(ext_modules, packages):
11641166 module = Extension ('matplotlib.backends._macosx' ,
11651167 ['src/_macosx.m' ],
11661168 extra_link_args = ['-framework' ,'Cocoa' ],
1169+ define_macros = [('PY_ARRAY_UNIQUE_SYMBOL' , 'MPL_ARRAY_API' )]
11671170 )
11681171 add_numpy_flags (module )
11691172 ext_modules .append (module )
@@ -1182,6 +1185,7 @@ def build_png(ext_modules, packages):
11821185 'matplotlib._png' ,
11831186 deps ,
11841187 include_dirs = numpy_inc_dirs ,
1188+ define_macros = [('PY_ARRAY_UNIQUE_SYMBOL' , 'MPL_ARRAY_API' )]
11851189 )
11861190
11871191 add_png_flags (module )
@@ -1194,7 +1198,6 @@ def build_agg(ext_modules, packages):
11941198 global BUILT_AGG
11951199 if BUILT_AGG : return # only build it if you you haven't already
11961200
1197-
11981201 agg = (
11991202 'agg_trans_affine.cpp' ,
12001203 'agg_bezier_arc.cpp' ,
@@ -1204,22 +1207,20 @@ def build_agg(ext_modules, packages):
12041207 'agg_image_filters.cpp' ,
12051208 )
12061209
1207-
12081210 deps = ['%s/src/%s' % (AGG_VERSION , name ) for name in agg ]
1209- deps .extend (( 'src/_image .cpp' , 'src/ft2font .cpp' , 'src/mplutils.cpp' ) )
1211+ deps .extend ([ 'src/mplutils .cpp' , 'src/agg_py_transforms .cpp' ] )
12101212 deps .extend (glob .glob ('CXX/*.cxx' ))
12111213 deps .extend (glob .glob ('CXX/*.c' ))
1212-
12131214 temp_copy ('src/_backend_agg.cpp' , 'src/backend_agg.cpp' )
12141215 deps .append ('src/backend_agg.cpp' )
12151216 module = Extension (
12161217 'matplotlib.backends._backend_agg' ,
12171218 deps ,
12181219 include_dirs = numpy_inc_dirs ,
1220+ define_macros = [('PY_ARRAY_UNIQUE_SYMBOL' , 'MPL_ARRAY_API' )]
12191221 )
12201222
12211223 add_numpy_flags (module )
1222-
12231224 add_agg_flags (module )
12241225 add_ft2font_flags (module )
12251226 ext_modules .append (module )
@@ -1242,11 +1243,14 @@ def build_path(ext_modules, packages):
12421243 deps .extend (glob .glob ('CXX/*.c' ))
12431244
12441245 temp_copy ('src/_path.cpp' , 'src/path.cpp' )
1245- deps .extend (['src/path.cpp' ])
1246+ deps .extend (['src/agg_py_transforms.cpp' ,
1247+ 'src/path_cleanup.cpp' ,
1248+ 'src/path.cpp' ])
12461249 module = Extension (
12471250 'matplotlib._path' ,
12481251 deps ,
12491252 include_dirs = numpy_inc_dirs ,
1253+ define_macros = [('PY_ARRAY_UNIQUE_SYMBOL' , 'MPL_ARRAY_API' )]
12501254 )
12511255
12521256 add_numpy_flags (module )
@@ -1275,6 +1279,7 @@ def build_image(ext_modules, packages):
12751279 'matplotlib._image' ,
12761280 deps ,
12771281 include_dirs = numpy_inc_dirs ,
1282+ define_macros = [('PY_ARRAY_UNIQUE_SYMBOL' , 'MPL_ARRAY_API' )]
12781283 )
12791284
12801285 add_numpy_flags (module )
@@ -1294,7 +1299,9 @@ def build_delaunay(ext_modules, packages):
12941299 "delaunay_utils.cpp" , "natneighbors.cpp" ]
12951300 sourcefiles = [os .path .join ('lib/matplotlib/delaunay' ,s ) for s in sourcefiles ]
12961301 delaunay = Extension ('matplotlib._delaunay' ,sourcefiles ,
1297- include_dirs = numpy_inc_dirs )
1302+ include_dirs = numpy_inc_dirs ,
1303+ define_macros = [('PY_ARRAY_UNIQUE_SYMBOL' , 'MPL_ARRAY_API' )]
1304+ )
12981305 add_numpy_flags (delaunay )
12991306 add_base_flags (delaunay )
13001307 ext_modules .append (delaunay )
@@ -1310,6 +1317,7 @@ def build_contour(ext_modules, packages):
13101317 'matplotlib._cntr' ,
13111318 [ 'src/cntr.c' ],
13121319 include_dirs = numpy_inc_dirs ,
1320+ define_macros = [('PY_ARRAY_UNIQUE_SYMBOL' , 'MPL_ARRAY_API' )]
13131321 )
13141322 add_numpy_flags (module )
13151323 add_base_flags (module )
@@ -1325,6 +1333,7 @@ def build_nxutils(ext_modules, packages):
13251333 'matplotlib.nxutils' ,
13261334 [ 'src/nxutils.c' ],
13271335 include_dirs = numpy_inc_dirs ,
1336+ define_macros = [('PY_ARRAY_UNIQUE_SYMBOL' , 'MPL_ARRAY_API' )]
13281337 )
13291338 add_numpy_flags (module )
13301339 add_base_flags (module )
@@ -1343,6 +1352,7 @@ def build_gdk(ext_modules, packages):
13431352 ['src/backend_gdk.c' ],
13441353 libraries = [],
13451354 include_dirs = numpy_inc_dirs ,
1355+ define_macros = [('PY_ARRAY_UNIQUE_SYMBOL' , 'MPL_ARRAY_API' )]
13461356 )
13471357
13481358 add_numpy_flags (module )
0 commit comments