ya2 · news · projects · code · about

removed next/prev/rewind
[pmachines.git] / setup.py
index f04d8f14a0b7721abde225c3e4fe7c1dd1dc761e..83b73304830a3879a71b5ba43160a7ea6187c473 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -7,18 +7,20 @@ from os import system, getcwd, chdir
 from sys import argv, executable
 from collections import namedtuple
 from subprocess import Popen
-from distutils.cmd import Command
-from setuptools import setup
+from setuptools import setup, Command
 from setuptools.command.develop import develop
+from multiprocessing import cpu_count
 from direct.dist.commands import bdist_apps
 from lib.build.build import branch, files, ver, files, bld_dpath
 from lib.build.docs import bld_docs
 from lib.build.models import ModelsBuilder
 from lib.build.images import bld_images
+from lib.build.screenshots import bld_screenshots
 from lib.build.lang import LanguageBuilder
 from p3d_appimage import AppImageBuilder
 from p3d_flatpak import FlatpakBuilder
 import lib.engine.log  # so logging's info/debug are logged
+from game.app import PmachinesApp
 
 
 appname = longname = 'pmachines'
@@ -43,7 +45,7 @@ class AbsCmd(Command):
     '''Common functionalities for commands.'''
 
     user_options = [('cores=', None, '#cores')]
-    cores = 1
+    cores = cpu_count()
 
     def initialize_options(self):
         for arg in argv[:]:
@@ -75,6 +77,7 @@ class ImagesCmd(AbsCmd):
 
     def run(self):
         '''Builds the images.'''
+        bld_screenshots(PmachinesApp.scenes)
         bld_images(
             files(['jpg', 'png'], ['models', 'gltf', 'bam'], ['_png.png']), int(AbsCmd.cores))
 
@@ -86,15 +89,15 @@ class LangCmd(AbsCmd):
 
     def _process_lang(self, lang_code):
         '''Processes a single language.'''
-        poname = 'assets/po/%s.po' % lang_code
-        LanguageBuilder.merge(lang_code, 'assets/po/', self.lang_path, appname)
+        poname = 'assets/locale/po/%s.po' % lang_code
+        LanguageBuilder.merge(lang_code, 'assets/locale/po/', self.lang_path, appname)
         mo_tmpl = '%s%s/LC_MESSAGES/%s.mo'
         moname = mo_tmpl % (self.lang_path, lang_code, appname)
         LanguageBuilder.mo(moname, self.lang_path, appname)
 
     def run(self):
         '''Builds the language files.'''
-        LanguageBuilder.pot(appname, 'assets/po/')
+        LanguageBuilder.pot(appname, 'assets/locale/po/')
         list(map(self._process_lang, ['it_IT']))
 
 
@@ -125,15 +128,15 @@ class BDistAppsCmd(bdist_apps):
         if not self.nolinux:
             hbranch = {'master': 'alpha', 'rc': 'rc', 'stable': ''}[branch]
             AppImageBuilder(self).build(longname, hbranch,
-                                        'http://www.ya2tech.it/downloads/')
+                                        'https://www.ya2.it/downloads/')
             fbranch = {'master': 'alpha', 'rc': 'rc', 'stable': 'stable'}[branch]
             bld = FlatpakBuilder(
                 self,
                 'it.ya2.Pmachines',
-                '/home/flavio/pmachines_builder/flatpak',
+                '/home/flavio/builders/pmachines_builder/flatpak',
                 'D43B6D401912B520B6805FCC8E019E6340E3BAB5',
-                '/home/flavio/pmachines_builder/gpg',
-                'http://www.ya2tech.it/flatpak',
+                '/home/flavio/builders/pmachines_builder/gpg',
+                'https://www.ya2.it/flatpak',
                 ['options*.ini'],
                 fbranch,
                 ['assets'])
@@ -146,8 +149,8 @@ if __name__ == '__main__':
         platform_lst += ['win_amd64']
         installers_dct['win_amd64'] = ['nsis']
     if all('--nolinux' not in arg for arg in argv):
-        platform_lst += ['manylinux1_x86_64']
-        installers_dct['manylinux1_x86_64'] = []
+        platform_lst += ['manylinux2010_x86_64']
+        installers_dct['manylinux2010_x86_64'] = []
     log_path = '$USER_APPDATA/pmachines/logs/%Y/%B/%d/%H_%M_%S.log'
     package_data_dirs = {'simplepbr': [('simplepbr/shaders*', '', {})]}
     setup(
@@ -166,7 +169,7 @@ if __name__ == '__main__':
                 'exclude_patterns': [
                     'build/*', 'built/*', 'setup.py', 'requirements.txt',
                     'venv/*', '.git*', '*.pyc', 'options.ini', '__pycache__',
-                    'assets/gltf/*', 'assets/models/**/*.blend',
+                    'assets/models/gltf/*', 'assets/models/**/*.blend',
                     'assets/models/**/models/*.png',
                     'assets/models/**/models/*.jpg'],
                 'log_filename_strftime': True,
@@ -183,11 +186,11 @@ if __name__ == '__main__':
                         'assets/images/icon/icon16_png.png']},
                 'icons': {
                     appname: [
-                        'assets/icon/icon256.png',
-                        'assets/icon/icon128.png',
-                        'assets/icon/icon48.png',
-                        'assets/icon/icon32.png',
-                        'assets/icon/icon16.png']},
+                        'assets/images/icon/icon256.png',
+                        'assets/images/icon/icon128.png',
+                        'assets/images/icon/icon48.png',
+                        'assets/images/icon/icon32.png',
+                        'assets/images/icon/icon16.png']},
                 'include_patterns': [
                     '**/lib/licenses/*',
                     '**/licenses/*',