@ -15,14 +15,16 @@ parser.add_argument('--extra-extension-path', action="append", default=[])
parser . add_argument ( ' --name ' )
parser . add_argument ( ' --name ' )
parser . add_argument ( ' --builddir ' )
parser . add_argument ( ' --builddir ' )
parser . add_argument ( ' --project-version ' )
parser . add_argument ( ' --project-version ' )
parser . add_argument ( ' --docdir ' )
def run ( argv : T . List [ str ] ) - > int :
def run ( argv : T . List [ str ] ) - > int :
options , args = parser . parse_known_args ( argv )
options , args = parser . parse_known_args ( argv )
subenv = os . environ . copy ( )
subenv = os . environ . copy ( )
for ext_path in options . extra_extension_path :
val = subenv . get ( ' PYTHONPATH ' )
subenv [ ' PYTHONPATH ' ] = subenv . get ( ' PYTHONPATH ' , ' ' ) + ' : ' + ext_path
paths = [ val ] if val else [ ]
subenv [ ' PYTHONPATH ' ] = os . pathsep . join ( paths + options . extra_extension_path )
res = subprocess . call ( args , cwd = options . builddir , env = subenv )
res = subprocess . call ( args , cwd = options . builddir , env = subenv )
if res != 0 :
if res != 0 :
@ -31,9 +33,7 @@ def run(argv: T.List[str]) -> int:
if options . install :
if options . install :
source_dir = os . path . join ( options . builddir , options . install )
source_dir = os . path . join ( options . builddir , options . install )
destdir = os . environ . get ( ' DESTDIR ' , ' ' )
destdir = os . environ . get ( ' DESTDIR ' , ' ' )
installdir = destdir_join ( destdir ,
installdir = destdir_join ( destdir , options . docdir )
os . path . join ( os . environ [ ' MESON_INSTALL_PREFIX ' ] ,
' share/doc/ ' , options . name , " html " ) )
shutil . rmtree ( installdir , ignore_errors = True )
shutil . rmtree ( installdir , ignore_errors = True )
shutil . copytree ( source_dir , installdir )
shutil . copytree ( source_dir , installdir )