def setup(self, args): if not os.path.exists(self.options.msys2_path): print( "msys2 not found in %s. Please make sure to install" " (from http://msys2.github.io/) specify --msys2-path" " if you did not install in the default directory.", flush=True) return False for path in ['mingw64/bin', 'bin', 'usr/bin']: os.environ['PATH'] = os.environ.get( 'PATH', '') + os.pathsep + os.path.normpath( os.path.join(self.options.msys2_path, path)) os.environ['PATH'] = os.environ['PATH'].replace(';;', ';') os.environ['PKG_CONFIG_PATH'] = os.environ.get( 'PKG_CONFIG_PATH', '') + ':/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig' subprocess.check_call(['pacman', '-S', '--needed', '--noconfirm'] + self.DEPENDENCIES) source_path = os.path.abspath(os.path.curdir) print('Making sure meson is present in root folder... ', end='', flush=True) if not os.path.isdir(os.path.join(source_path, 'meson')): print('\nCloning meson', flush=True) git('clone', self.MESON_GIT, repository_path=source_path) else: print('\nDONE', flush=True) print("Making libs", flush=True) self.make_libs() print("Done making .lib files.", flush=True) if not os.path.exists(os.path.join(source_path, 'build', 'build.ninja')) or \ self.options.reconfigure: print("Running meson", flush=True) if not self.configure_meson(): return False try: if not args: print("Getting into msys2 environment", flush=True) subprocess.check_call([ sys.executable, os.path.join(source_path, 'gst-uninstalled.py'), '--builddir', os.path.join(source_path, 'build') ]) else: print("Running %s" ' '.join(args), flush=True) res = subprocess.check_call(args) except subprocess.CalledProcessError as e: return False return True
def setup(self, args): if not os.path.exists(self.options.msys2_path): print("msys2 not found in %s. Please make sure to install" " (from http://msys2.github.io/) specify --msys2-path" " if you did not install in the default directory.", flush=True) return False for path in ['mingw64/bin', 'bin', 'usr/bin']: os.environ['PATH'] = os.environ.get( 'PATH', '') + os.pathsep + os.path.normpath(os.path.join(self.options.msys2_path, path)) os.environ['PATH'] = os.environ['PATH'].replace(';;', ';') os.environ['PKG_CONFIG_PATH'] = os.environ.get( 'PKG_CONFIG_PATH', '') + ':/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig' subprocess.check_call(['pacman', '-S', '--needed', '--noconfirm'] + self.DEPENDENCIES) source_path = os.path.abspath(os.path.curdir) print('Making sure meson is present in root folder... ', end='', flush=True) if not os.path.isdir(os.path.join(source_path, 'meson')): print('\nCloning meson', flush=True) git('clone', self.MESON_GIT, repository_path=source_path) else: print('\nDONE', flush=True) print("Making libs", flush=True) self.make_libs() print("Done making .lib files.", flush=True) if not os.path.exists(os.path.join(source_path, 'build', 'build.ninja')) or \ self.options.reconfigure: print("Running meson", flush=True) if not self.configure_meson(): return False try: if not args: print("Getting into msys2 environment", flush=True) subprocess.check_call([sys.executable, os.path.join(source_path, 'gst-uninstalled.py'), '--builddir', os.path.join(source_path, 'build')]) else: print("Running %s" ' '.join(args), flush=True) res = subprocess.check_call(args) except subprocess.CalledProcessError as e: return False return True
options, args = parser.parse_known_args() if not os.path.exists(options.builddir): print("GStreamer not built in %s\n\nBuild it and try again" % options.builddir) exit(1) options.builddir = os.path.abspath(options.builddir) if not os.path.exists(options.srcdir): print("The specified source dir does not exist" % options.srcdir) exit(1) # The following incantation will retrieve the current branch name. gst_version = git("rev-parse", "--symbolic-full-name", "--abbrev-ref", "HEAD", repository_path=options.srcdir).strip('\n') if not args: if os.name is 'nt': args = [os.environ.get("COMSPEC", r"C:\WINDOWS\system32\cmd.exe")] else: args = [os.environ.get("SHELL", os.path.realpath("/bin/sh"))] if "bash" in args[0]: bashrc = os.path.expanduser('~/.bashrc') if os.path.exists(bashrc): tmprc = tempfile.NamedTemporaryFile(mode='w') with open(bashrc, 'r') as src: shutil.copyfileobj(src, tmprc) tmprc.write('\nexport PS1="[gst-%s] $PS1"' % gst_version)
#!/usr/bin/env python3 import os import subprocess import sys from common import git SCRIPTDIR = os.path.realpath(os.path.dirname(__file__)) if __name__ == "__main__": subprojects_dir = os.path.join(SCRIPTDIR, "..", "subprojects") exitcode = 0 for repo_name in os.listdir(subprojects_dir): repo_dir = os.path.normpath( os.path.join(SCRIPTDIR, subprojects_dir, repo_name)) if not os.path.exists(os.path.join(repo_dir, '.git')): continue diff = git('diff', repository_path=repo_dir).strip('\n') if diff: print('ERROR: Repository %s is not clean' % repo_dir) print( 'NOTE: Make sure to commit necessary changes in the gst_plugins_cache.json files' ) print(diff) exitcode += 1 sys.exit(exitcode)