Anonymous avatar Anonymous committed 7510754

Automated package setup (update_packages()).
Added lib folder for freetype module.
(pgreloaded)

Comments (0)

Files changed (3)

lib/freetype/__init__.py

+from pygame2.freetype.base import *
     create_cref.create_c_header (os.path.join (docpath, docfile),
                                  os.path.join (docincpath, incfile))
 
-def update_packages (cfg, packages, package_dir, package_data):
-    if cfg.build['SDL']:
-        packages += [ "pygame2.sdl", "pygame2.sdlext" ]
-        package_dir["pygame2.sdl"] = "lib/sdl"
-        package_dir["pygame2.sdlext"] = "lib/sdlext"
-        
-        if cfg.build['SDL_MIXER']:
-            packages += [ "pygame2.sdlmixer" ]
-            package_dir["pygame2.sdlmixer"] = "lib/sdlmixer"
-        if cfg.build['SDL_TTF']:
-            packages += [ "pygame2.sdlttf" ]
-            package_dir["pygame2.sdlttf"] = "lib/sdlttf"
-        if cfg.build['SDL_IMAGE']:
-            packages += [ "pygame2.sdlimage" ]
-            package_dir["pygame2.sdlimage"] = "lib/sdlimage"
-        if cfg.build['SDL_GFX']:
-            packages += [ "pygame2.sdlgfx" ]
-            package_dir["pygame2.sdlgfx"] = "lib/sdlgfx"
+def update_packages (modules, packages, package_dir, package_data):
+
+    pkg_list = set([m.name.split('.')[1] for m in modules])
+
+    for p in pkg_list:
+        pkg_name = "pygame2." + p
+        pkg_dir = os.path.join("lib", p)
+
+        if os.path.isdir(pkg_dir):
+            packages.append(pkg_name)
+            package_dir[pkg_name] = pkg_dir
+
         "pygame2.examples" : find_pkg_data ("examples"),
         "pygame2.test" : find_pkg_data ("test", ["c_api", "util"]),
         }
-    modules.update_packages (cfg, packages, package_dir, package_data)
 
     dllfiles = [ os.path.join ("pygame2", "dll"),
                  config_modules.get_install_libs (buildsystem, cfg) ]
     ext_modules = modules.get_extensions (buildsystem)
+    modules.update_packages (ext_modules, packages, package_dir, package_data)
 
     headerfiles = []
     print ("The following modules will be built:")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.