(self)
Build dist file from PyInstaller info
Build dist file from PyInstaller info
Build dist file from PyInstaller info
def build_dist(self):
        '''
           Build dist file from PyInstaller info
        '''
        for sdir in self.staging_dirs:
            if os.path.exists(sdir):
                shutil.rmtree(sdir)
        main_stage, ninja_stage = self.staging_dirs
        modules = get_modules()

        pyinstaller = shutil.which('pyinstaller')
        if not pyinstaller:
            print("ERROR: This script requires pyinstaller.")
            sys.exit(1)

        pyinstaller_tmpdir = 'pyinst-tmp'
        if os.path.exists(pyinstaller_tmpdir):
            shutil.rmtree(pyinstaller_tmpdir)
        pyinst_cmd = [pyinstaller,
                      '--clean',
                      '--distpath',
                      pyinstaller_tmpdir]
        for m in modules:
            pyinst_cmd += ['--hidden-import', m]
        pyinst_cmd += ['meson.py']
        subprocess.check_call(pyinst_cmd)
        shutil.move(pyinstaller_tmpdir + '/meson', main_stage)
        self.del_infodirs(main_stage)
        if not os.path.exists(os.path.join(main_stage, 'meson.exe')):
            sys.exit('Meson exe missing from staging dir.')
        os.mkdir(ninja_stage)
        shutil.copy(shutil.which('ninja'), ninja_stage)
        if not os.path.exists(os.path.join(ninja_stage, 'ninja.exe')):
            sys.exit('Ninja exe missing from staging dir.')
def build_dist ( self ) : for sdir in self . staging_dirs : if os . path . exists ( sdir ) : shutil . rmtree ( sdir ) main_stage , ninja_stage = self . staging_dirs modules = get_modules ( ) pyinstaller = shutil . which ( 'pyinstaller' ) if not pyinstaller : print ( "ERROR: This script requires pyinstaller." ) sys . exit ( 1 ) pyinstaller_tmpdir = 'pyinst-tmp' if os . path . exists ( pyinstaller_tmpdir ) : shutil . rmtree ( pyinstaller_tmpdir ) pyinst_cmd = [ pyinstaller , '--clean' , '--distpath' , pyinstaller_tmpdir ] for m in modules : pyinst_cmd += [ '--hidden-import' , m ] pyinst_cmd += [ 'meson.py' ] subprocess . check_call ( pyinst_cmd ) shutil . move ( pyinstaller_tmpdir + '/meson' , main_stage ) self . del_infodirs ( main_stage ) if not os . path . exists ( os . path . join ( main_stage , 'meson.exe' ) ) : sys . exit ( 'Meson exe missing from staging dir.' ) os . mkdir ( ninja_stage ) shutil . copy ( shutil . which ( 'ninja' ) , ninja_stage ) if not os . path . exists ( os . path . join ( ninja_stage , 'ninja.exe' ) ) : sys . exit ( 'Ninja exe missing from staging dir.' )