@@ -291,14 +291,6 @@ class CheckFailed(Exception):
291
291
292
292
class SetupPackage (object ):
293
293
optional = False
294
- pkg_names = {
295
- "apt-get" : None ,
296
- "yum" : None ,
297
- "dnf" : None ,
298
- "brew" : None ,
299
- "port" : None ,
300
- "windows_url" : None
301
- }
302
294
303
295
def check (self ):
304
296
"""
@@ -333,56 +325,6 @@ def do_custom_build(self):
333
325
"""
334
326
pass
335
327
336
- def install_help_msg (self ):
337
- """
338
- Do not override this method !
339
-
340
- Generate the help message to show if the package is not installed.
341
- To use this in subclasses, simply add the dictionary `pkg_names` as
342
- a class variable:
343
-
344
- pkg_names = {
345
- "apt-get": <Name of the apt-get package>,
346
- "yum": <Name of the yum package>,
347
- "dnf": <Name of the dnf package>,
348
- "brew": <Name of the brew package>,
349
- "port": <Name of the port package>,
350
- "windows_url": <The url which has installation instructions>
351
- }
352
-
353
- All the dictionary keys are optional. If a key is not present or has
354
- the value `None` no message is provided for that platform.
355
- """
356
- def _try_managers (* managers ):
357
- for manager in managers :
358
- pkg_name = self .pkg_names .get (manager , None )
359
- if pkg_name :
360
- if shutil .which (manager ) is not None :
361
- if manager == 'port' :
362
- pkgconfig = 'pkgconfig'
363
- else :
364
- pkgconfig = 'pkg-config'
365
- return ('Try installing {0} with `{1} install {2}` '
366
- 'and pkg-config with `{1} install {3}`'
367
- .format (self .name , manager , pkg_name ,
368
- pkgconfig ))
369
-
370
- message = None
371
- if sys .platform == "win32" :
372
- url = self .pkg_names .get ("windows_url" , None )
373
- if url :
374
- message = ('Please check {0} for instructions to install {1}'
375
- .format (url , self .name ))
376
- elif sys .platform == "darwin" :
377
- message = _try_managers ("brew" , "port" )
378
- elif sys .platform == "linux" :
379
- release = platform .linux_distribution ()[0 ].lower ()
380
- if release in ('debian' , 'ubuntu' ):
381
- message = _try_managers ('apt-get' )
382
- elif release in ('centos' , 'redhat' , 'fedora' ):
383
- message = _try_managers ('dnf' , 'yum' )
384
- return message
385
-
386
328
387
329
class OptionalPackage (SetupPackage ):
388
330
optional = True
@@ -552,14 +494,6 @@ def add_flags(self, ext, add_sources=True):
552
494
553
495
class FreeType (SetupPackage ):
554
496
name = "freetype"
555
- pkg_names = {
556
- "apt-get" : "libfreetype6-dev" ,
557
- "yum" : "freetype-devel" ,
558
- "dnf" : "freetype-devel" ,
559
- "brew" : "freetype" ,
560
- "port" : "freetype" ,
561
- "windows_url" : "http://gnuwin32.sourceforge.net/packages/freetype.htm"
562
- }
563
497
564
498
def add_flags (self , ext ):
565
499
ext .sources .insert (0 , 'src/checkdep_freetype2.c' )
@@ -708,14 +642,6 @@ def get_extension(self):
708
642
709
643
class Png (SetupPackage ):
710
644
name = "png"
711
- pkg_names = {
712
- "apt-get" : "libpng12-dev" ,
713
- "yum" : "libpng-devel" ,
714
- "dnf" : "libpng-devel" ,
715
- "brew" : "libpng" ,
716
- "port" : "libpng" ,
717
- "windows_url" : "http://gnuwin32.sourceforge.net/packages/libpng.htm"
718
- }
719
645
720
646
def get_extension (self ):
721
647
sources = [
0 commit comments