def ensure_ninja_binary(self):
        for f in ['ninja', 'ninja-build']:
            if inpath(f, os.environ['PATH'].split(os.pathsep)):
                self.ninja_binary = f
                return

        raise CommandError(_('%s not found') % 'ninja')
Example #2
0
 def do_configure(self, buildscript):
     buildscript.set_action(_('Configuring'), self)
     srcdir = self.get_srcdir(buildscript)
     builddir = self.get_builddir(buildscript)
     if os.path.exists(builddir):
         try:
             # Clear CMake files so we get a clean configure.
             os.unlink(os.path.join(builddir, 'CMakeCache.txt'))
             shutil.rmtree(os.path.join(builddir, 'CMakeFiles'))
         except:
             pass
     else:
         os.makedirs(builddir)
     prefix = os.path.expanduser(buildscript.config.prefix)
     if not inpath('cmake', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'cmake')
     baseargs = '-DCMAKE_INSTALL_PREFIX=%s -DCMAKE_INSTALL_LIBDIR=lib' % prefix
     cmakeargs = self.get_cmakeargs()
     if self.use_ninja:
         baseargs += ' -G Ninja'
     # CMake on Windows generates VS projects or NMake makefiles by default.
     # When using MSYS "MSYS Makefiles" is the best guess. "Unix Makefiles"
     # and "MinGW Makefiles" could also work (each is a bit different).
     if os.name == 'nt' and os.getenv("MSYSCON") and '-G' not in cmakeargs:
         baseargs += ' -G "MSYS Makefiles"'
     cmakedir = os.path.join(srcdir, self.cmakedir) if self.cmakedir else srcdir
     cmd = 'cmake %s %s %s' % (baseargs, cmakeargs, cmakedir)
     buildscript.execute(cmd, cwd = builddir, extra_env = self.extra_env)
Example #3
0
    def ensure_ninja_binary(self):
        for f in ['ninja', 'ninja-build']:
            if inpath(f, os.environ['PATH'].split(os.pathsep)):
                self.ninja_binary = f
                return

        raise CommandError(_('%s not found') % 'ninja')
Example #4
0
 def do_configure(self, buildscript):
     buildscript.set_action(_('Configuring'), self)
     srcdir = self.get_srcdir(buildscript)
     builddir = self.get_builddir(buildscript)
     if os.path.exists(builddir):
         try:
             # Clear CMake files so we get a clean configure.
             os.unlink(os.path.join(builddir, 'CMakeCache.txt'))
             shutil.rmtree(os.path.join(builddir, 'CMakeFiles'))
         except:
             pass
     else:
         os.makedirs(builddir)
     prefix = os.path.expanduser(buildscript.config.prefix)
     if not inpath('cmake', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'cmake')
     baseargs = '-DCMAKE_INSTALL_PREFIX=%s -DCMAKE_INSTALL_LIBDIR=lib' % prefix
     cmakeargs = self.get_cmakeargs()
     if self.use_ninja:
         baseargs += ' -G Ninja'
     # CMake on Windows generates VS projects or NMake makefiles by default.
     # When using MSYS "MSYS Makefiles" is the best guess. "Unix Makefiles"
     # and "MinGW Makefiles" could also work (each is a bit different).
     if os.name == 'nt' and os.getenv("MSYSCON") and '-G' not in cmakeargs:
         baseargs += ' -G "MSYS Makefiles"'
     cmd = 'cmake %s %s %s' % (baseargs, cmakeargs, srcdir)
     buildscript.execute(cmd, cwd=builddir, extra_env=self.extra_env)
Example #5
0
 def get_ninjacmd(self, config):
     if self.ninjacmd:
         return self.ninjacmd
     for cmd in ['ninja', 'ninja-build']:
         if inpath(cmd, os.environ['PATH'].split(os.pathsep)):
             self.ninjacmd = cmd
             break
     return self.ninjacmd
Example #6
0
 def get_ninjacmd(self, config):
     if self.ninjacmd:
         return self.ninjacmd
     for cmd in ['ninja', 'ninja-build']:
         if inpath(cmd, os.environ['PATH'].split(os.pathsep)):
             self.ninjacmd = cmd
             break
     return self.ninjacmd
Example #7
0
 def do_build(self, buildscript):
     buildscript.set_action(_('Building'), self)
     srcdir = self.get_srcdir(buildscript)
     builddir = self.get_builddir(buildscript)
     ant = os.environ.get('ANT', 'ant')
     if not inpath(ant, os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('Missing ant build tool'))
     cmd = [ant]
     #if srcdir != builddir:
     #    cmd.extend(['--build-base', builddir])
     buildscript.execute(cmd, cwd=srcdir)
Example #8
0
 def do_configure(self, buildscript):
     buildscript.set_action(_('Configuring'), self)
     srcdir = self.get_srcdir(buildscript)
     builddir = self.get_builddir(buildscript)
     if not os.path.exists(builddir):
         os.makedirs(builddir)
     prefix = os.path.expanduser(buildscript.config.prefix)
     if not inpath('meson', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'meson')
     baseargs = '--prefix %s' % prefix
     mesonargs = self.get_mesonargs()
     cmd = 'meson %s %s %s' % (baseargs, mesonargs, srcdir)
     buildscript.execute(cmd, cwd=builddir, extra_env=self.extra_env)
Example #9
0
    def do_configure(self, buildscript):
        buildscript.set_action(_('Configuring'), self)
        builddir = self.get_builddir(buildscript)
        destdir = self.prepare_installroot(buildscript)

        if not inpath('qmake', os.environ['PATH'].split(os.pathsep)):
            raise CommandError(_('%s not found') % 'qmake')

        # qmake leaves Makefiles that cannot be updated
        if hasattr(self.branch, 'delete_unknown_files'):
            self.branch.delete_unknown_files(buildscript)

        qmakeargs = self.eval_args(self.qmakeargs)
        qmakeargs = qmakeargs.replace('${destdir}', destdir)
        cmd = 'qmake %s' % qmakeargs
        buildscript.execute(cmd, cwd = builddir, extra_env = self.extra_env)
 def do_configure(self, buildscript):
     buildscript.set_action(_('Configuring'), self)
     srcdir = self.get_srcdir(buildscript)
     builddir = self.get_builddir(buildscript)
     # meson does not allow configuring if the builddir already exists,
     # so we'll need to get rid of it and start over to configure again.
     if os.path.exists(builddir):
         shutil.rmtree(builddir)
     os.makedirs(builddir)
     prefix = os.path.expanduser(buildscript.config.prefix)
     if not inpath('meson', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'meson')
     baseargs = '--prefix %s --libdir %s' % (prefix, self.get_libdir())
     mesonargs = self.get_mesonargs()
     cmd = 'meson %s %s %s' % (baseargs, mesonargs, srcdir)
     buildscript.execute(cmd, cwd=builddir, extra_env=self.extra_env)
Example #11
0
 def do_configure(self, buildscript):
     buildscript.set_action(_('Configuring'), self)
     srcdir = self.get_srcdir(buildscript)
     builddir = self.get_builddir(buildscript)
     # meson does not allow configuring if the builddir already exists,
     # so we'll need to get rid of it and start over to configure again.
     if os.path.exists(builddir):
         shutil.rmtree(builddir)
     os.makedirs(builddir)
     prefix = os.path.expanduser(buildscript.config.prefix)
     if not inpath('meson', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'meson')
     baseargs = '--prefix %s --libdir %s' % (prefix, self.get_libdir())
     mesonargs = self.get_mesonargs()
     cmd = 'meson %s %s %s' % (baseargs, mesonargs, srcdir)
     buildscript.execute(cmd, cwd=builddir, extra_env=self.extra_env)
Example #12
0
 def do_configure(self, buildscript):
     buildscript.set_action(_('Configuring'), self)
     srcdir = self.get_srcdir(buildscript)
     builddir = self.get_builddir(buildscript)
     if not os.path.exists(builddir):
         os.mkdir(builddir)
     prefix = os.path.expanduser(buildscript.config.prefix)
     if not inpath('cmake', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'cmake')
     baseargs = '-DCMAKE_INSTALL_PREFIX=%s -DLIB_INSTALL_DIR=%s -Dlibdir=%s' % (
                     prefix, buildscript.config.libdir, buildscript.config.libdir)
     cmd = 'cmake %s %s %s' % (baseargs, self.get_cmakeargs(), srcdir)
     if os.path.exists(os.path.join(builddir, 'CMakeCache.txt')):
         # remove that file, as it holds the result of a previous cmake
         # configure run, and would be reused unconditionnaly
         # (cf https://bugzilla.gnome.org/show_bug.cgi?id=621194)
         os.unlink(os.path.join(builddir, 'CMakeCache.txt'))
     buildscript.execute(cmd, cwd = builddir, extra_env = self.extra_env)
Example #13
0
    def checkout(self, buildscript):
        # XXX: doesn't support alternative checkout modes
        if not inpath('mtn', os.environ['PATH'].split(os.pathsep)):
            raise CommandError(_('%s not found') % 'mtn')

        if not os.path.exists(self.repository.database):
            self._init(buildscript)

        self._pull(buildscript)

        if os.path.exists(self.srcdir):
            try:
                self._check_for_conflict()
            except CommandError:
                buildscript.execute(['mtn', 'heads'], 'mtn', cwd=self.srcdir)
                raise

            self._update(buildscript)
        else:
            self._checkout(buildscript)
Example #14
0
    def checkout(self, buildscript):
        # XXX: doesn't support alternative checkout modes
        if not inpath('mtn', os.environ['PATH'].split(os.pathsep)):
            raise CommandError(_('%s not found') % 'mtn')

        if not os.path.exists(self.repository.database):
            self._init(buildscript)

        self._pull(buildscript)

        if os.path.exists(self.srcdir):
            try:
                self._check_for_conflict()
            except CommandError:
                buildscript.execute(['mtn', 'heads'], 'mtn', cwd=self.srcdir)
                raise

            self._update(buildscript)
        else:
            self._checkout(buildscript)
Example #15
0
 def do_configure(self, buildscript):
     buildscript.set_action(_('Configuring'), self)
     srcdir = self.get_srcdir(buildscript)
     builddir = self.get_builddir(buildscript)
     if not os.path.exists(builddir):
         os.makedirs(builddir)
     prefix = os.path.expanduser(buildscript.config.prefix)
     if not inpath('cmake', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'cmake')
     baseargs = '-DCMAKE_INSTALL_PREFIX=%s -DCMAKE_INSTALL_LIBDIR=lib' % prefix
     cmakeargs = self.get_cmakeargs()
     # CMake on Windows generates VS projects or NMake makefiles by default.
     # When using MSYS "MSYS Makefiles" is the best guess. "Unix Makefiles"
     # and "MinGW Makefiles" could also work (each is a bit different).
     if os.name == 'nt' and os.getenv("MSYSCON") and '-G' not in cmakeargs:
         baseargs += ' -G "MSYS Makefiles"'
     cmd = 'cmake %s %s %s' % (baseargs, cmakeargs, srcdir)
     if os.path.exists(os.path.join(builddir, 'CMakeCache.txt')):
         # remove that file, as it holds the result of a previous cmake
         # configure run, and would be reused unconditionnaly
         # (cf https://bugzilla.gnome.org/show_bug.cgi?id=621194)
         os.unlink(os.path.join(builddir, 'CMakeCache.txt'))
     buildscript.execute(cmd, cwd = builddir, extra_env = self.extra_env)
Example #16
0
 def do_configure(self, buildscript):
     buildscript.set_action(_('Configuring'), self)
     srcdir = self.get_srcdir(buildscript)
     builddir = self.get_builddir(buildscript)
     if not os.path.exists(builddir):
         os.makedirs(builddir)
     prefix = os.path.expanduser(buildscript.config.prefix)
     if not inpath('cmake', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'cmake')
     baseargs = '-DCMAKE_INSTALL_PREFIX=%s -DCMAKE_INSTALL_LIBDIR=lib' % prefix
     cmakeargs = self.get_cmakeargs()
     # CMake on Windows generates VS projects or NMake makefiles by default.
     # When using MSYS "MSYS Makefiles" is the best guess. "Unix Makefiles"
     # and "MinGW Makefiles" could also work (each is a bit different).
     if os.name == 'nt' and os.getenv("MSYSCON") and '-G' not in cmakeargs:
         baseargs += ' -G "MSYS Makefiles"'
     cmd = 'cmake %s %s %s' % (baseargs, cmakeargs, srcdir)
     if os.path.exists(os.path.join(builddir, 'CMakeCache.txt')):
         # remove that file, as it holds the result of a previous cmake
         # configure run, and would be reused unconditionnaly
         # (cf https://bugzilla.gnome.org/show_bug.cgi?id=621194)
         os.unlink(os.path.join(builddir, 'CMakeCache.txt'))
     buildscript.execute(cmd, cwd=builddir, extra_env=self.extra_env)
Example #17
0
File: hg.py Project: aissat/jhbuild
 def checkout(self, buildscript):
     if not inpath("hg", os.environ["PATH"].split(os.pathsep)):
         raise CommandError(_("%s not found") % "hg")
     Branch.checkout(self, buildscript)
Example #18
0
 def checkout(self, buildscript):
     if not inpath('darcs', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'darcs')
     Branch.checkout(self, buildscript)
     self._fix_permissions()
Example #19
0
 def checkout(self, buildscript):
     if not inpath('git', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'git')
     Branch.checkout(self, buildscript)
Example #20
0
 def checkout(self, buildscript):
     if not inpath('darcs', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'darcs')
     Branch.checkout(self, buildscript)
     self._fix_permissions()
Example #21
0
 def checkout(self, buildscript):
     if not inpath('hg', os.environ['PATH'].split(os.pathsep)):
         raise CommandError(_('%s not found') % 'hg')
     Branch.checkout(self, buildscript)