コード例 #1
0
def install(args=''):
    """Autobuilder install"""
    if can_access_file("autogen.sh"):
        autotools.install(args)
    if can_access_file("Makefile"):
        autotools.install(args)
    if can_access_file("meson.build"):
        mesontools.install(args)
    if can_access_file("CmakeLists.txt"):
        cmaketools.install(args)
コード例 #2
0
ファイル: cmaketools.py プロジェクト: paledega/inary
def rawInstall(parameters='', argument='install'):
    """install source into install directory with given parameters = PREFIX=get.installDIR()"""
    if can_access_file('makefile') or can_access_file(
            'Makefile') or can_access_file('GNUmakefile'):
        if system('make {0} {1} '.format(parameters, argument)):
            raise InstallError(_('Install failed.'))
        else:
            fixInfoDir()
    else:
        raise InstallError(_('No Makefile found.'))
コード例 #3
0
def configure(args=''):
    """Autobuilder setup"""
    if can_access_file("autogen.sh"):
        autotools.autogen(args)
    if can_access_file("configure"):
        autotools.configure(args)
    if can_access_file("meson.build"):
        mesontools.configure(args)
    if can_access_file("CmakeLists.txt"):
        cmaketools.configure(args)
コード例 #4
0
def configure(parameters=''):
    """configure source with given parameters."""
    export('PERL_MM_USE_DEFAULT', '1')
    if can_access_file('Build.PL'):
        if system('perl{0} Build.PL installdirs=vendor destdir={1}'.format(get.curPERL(), get.installDIR())):
            raise ConfigureError(_('Configure failed.'))
    elif can_access_file('Makefile.PL'):
        if system('perl{0} Makefile.PL {1} PREFIX=/usr INSTALLDIRS=vendor DESTDIR={2}'.format(get.curPERL(), parameters,
                                                                                              get.installDIR())):
            raise ConfigureError(_('Configure failed.'))
    else:
            raise ConfigureError(_('No configure script found. (\"{}\" file not found.)'.format("Build.PL/Makefile.PL")))
コード例 #5
0
def configure(parameters='',
              installPrefix='/{}'.format(get.defaultprefixDIR()),
              sourceDir='.'):
    """configure source with given cmake parameters = "-DCMAKE_BUILD_TYPE -DCMAKE_CXX_FLAGS ... " """
    if can_access_file(join_path(sourceDir, 'CMakeLists.txt')):
        args = 'cmake -DCMAKE_INSTALL_PREFIX={0} \
                      -DCMAKE_INSTALL_LIBDIR={1} \
                      -DCMAKE_BUILD_TYPE=RelWithDebInfo {2} {3}'.format(
            installPrefix,
            "/usr/lib32 " if get.buildTYPE() == "emul32" else "/usr/lib",
            parameters, sourceDir)
        if get.CFLAGS():
            args += ' -DCMAKE_C_FLAGS="{0} {1}"'.format(
                get.CFLAGS(),
                "-m32" if get.buildTYPE() == "emul32" else "-m64")
        if get.CXXFLAGS():
            args += ' -DCMAKE_CXX_FLAGS="{0} {1}"'.format(
                get.CXXFLAGS(),
                "-m32" if get.buildTYPE() == "emul32" else "-m64")
        if get.LDFLAGS():
            args += ' -DCMAKE_LD_FLAGS="{0}"'.format(get.LDFLAGS())

        if system(args):
            raise ConfigureError(_('Configure failed.'))
    else:
        raise ConfigureError(
            _('No configure script found. (\"{}\" file not found.)'.format(
                "CMakeLists.txt")))
コード例 #6
0
ファイル: cmaketools.py プロジェクト: paledega/inary
def install(parameters='', argument='install'):
    """install source into install directory with given parameters"""
    # You can't squeeze unix paths with things like 'bindir', 'datadir', etc with CMake
    # http://public.kitware.com/pipermail/cmake/2006-August/010748.html
    args = 'make DESTDIR="{0}" \
                 {1} \
                 {2}'.format(get.installDIR(), parameters, argument)

    if can_access_file('makefile') or can_access_file(
            'Makefile') or can_access_file('GNUmakefile'):
        if system('make {0} {1} '.format(parameters, argument)):
            raise InstallError(_('Install failed.'))
        else:
            fixInfoDir()
    else:
        raise InstallError(_('No Makefile found.'))
コード例 #7
0
def configure(parameters=''):
    """configure source with given parameters = "--with-nls --with-libusb --with-something-usefull"""

    if can_access_file('configure'):
        gnuconfig_update()

        prefix = get.emul32prefixDIR() if get.buildTYPE(
        ) == "emul32" else get.defaultprefixDIR()
        args = './configure \
                --prefix=/{0} \
                --build={1} \
                --mandir=/{2} \
                --infodir=/{3} \
                --datadir=/{4} \
                --sysconfdir=/{5} \
                --localstatedir=/{6} \
                --libexecdir=/{7} \
                {8}{9}'.format(
            prefix, get.HOST(), get.manDIR(), get.infoDIR(), get.dataDIR(),
            get.confDIR(), get.localstateDIR(), get.libexecDIR(),
            "--libdir=/usr/lib32 " if get.buildTYPE() == "emul32" else "",
            parameters)

        if system(args):
            raise ConfigureError(_('Configure failed.'))
    else:
        raise ConfigureError(
            _('No configure script found. (\"{}\" file not found.)'.format(
                "configure")))
コード例 #8
0
 def __init__(self, value=''):
     inary.actionsapi.Error.__init__(self, value)
     self.value = value
     ctx.ui.error("[AutoTools]: " + value)
     if can_access_file('config.log'):
         ctx.ui.error(
             _('Please attach the config.log to your bug report:\n{}/config.log').format(os.getcwd()))
コード例 #9
0
ファイル: perlmodules.py プロジェクト: sulincix/inary
def make(parameters=''):
    """make source with given parameters."""
    if can_access_file('Makefile'):
        if system('make {}'.format(parameters)):
            raise MakeError(_('Make failed.'))
    else:
        if system('perl{0} Build {1}'.format(get.curPERL(), parameters)):
            raise MakeError(_('\'perl build\' failed.'))
コード例 #10
0
def fixCompiledPy(lookInto='/usr/lib/{}/'.format(get.curPYTHON())):
    """ cleans *.py[co] from packages """
    for root, dirs, files in os.walk('{0}/{1}'.format(get.installDIR(),
                                                      lookInto)):
        for compiledFile in files:
            if compiledFile.endswith('.pyc') or compiledFile.endswith('.pyo'):
                if can_access_file('{0}/{1}'.format(root, compiledFile)):
                    unlink('{0}/{1}'.format(root, compiledFile))
コード例 #11
0
ファイル: perlmodules.py プロジェクト: sulincix/inary
def removePodfiles(path='usr/lib/perl5/'):
    """ cleans *.pod files from perl packages """
    full_path = '{0}/{1}'.format(get.installDIR(), path)
    for root, dirs, files in os.walk(full_path):
        for packFile in files:
            if packFile.endswith(".pod"):
                if can_access_file('{0}/{1}'.format(root, packFile)):
                    unlink('{0}/{1}'.format(root, packFile))
                    removeEmptydirs(root)
コード例 #12
0
ファイル: perlmodules.py プロジェクト: sulincix/inary
def removePacklist(path='usr/lib/perl5/'):
    """ cleans .packlist file from perl packages """
    full_path = '{0}/{1}'.format(get.installDIR(), path)
    for root, dirs, files in os.walk(full_path):
        for packFile in files:
            if packFile == ".packlist":
                if can_access_file('{0}/{1}'.format(root, packFile)):
                    unlink('{0}/{1}'.format(root, packFile))
                    removeEmptydirs(root)
コード例 #13
0
def rawConfigure(parameters=''):
    """configure source with given parameters = --prefix=/usr --libdir=/usr/lib --with-nls """
    if can_access_file('configure'):
        gnuconfig_update()

        if system('./configure {}'.format(parameters)):
            raise ConfigureError(_('Configure failed.'))
    else:
        raise ConfigureError(
            _('No configure script found. (\"{}\" file not found.)'.format("configure")))
コード例 #14
0
ファイル: perlmodules.py プロジェクト: sulincix/inary
def install(parameters='install'):
    """install source with given parameters."""
    if can_access_file('Makefile'):
        if system('make {}'.format(parameters)):
            raise InstallError(_('Install failed.'))
    else:
        if system('perl{} Build install'.format(get.curPERL())):
            raise MakeError(_('\'perl install\' failed.'))

    removePacklist()
    removePodfiles()
コード例 #15
0
def configure(projectfile='', parameters='', installPrefix=prefix):
    if projectfile != '' and not shelltools.can_access_file(projectfile):
        raise ConfigureError(
            _("Project file \"{}\" not found.").format(projectfile))

    profiles = glob.glob("*.pro")
    if len(profiles) > 1 and projectfile == '':
        raise ConfigureError(
            _("It seems there are more than one .pro file, you must specify one. (Possible .pro files: \"{}\")"
              ).format(", ".join(profiles)))

    shelltools.system(
        "{0} -makefile {1} PREFIX='{2}' QMAKE_CFLAGS+='{3}' QMAKE_CXXFLAGS+='{4}' {5}"
        .format(qmake, projectfile, installPrefix, get.CFLAGS(),
                get.CXXFLAGS(), parameters))
コード例 #16
0
def install():
    for tool in alsa_tools:
        shelltools.cd(tool)
        autotools.rawInstall("DESTDIR=\"%s\"" % get.installDIR())

        for doc in [d for d in docs if shelltools.can_access_file(d)]:
            if tool in gui_tools:
                srctag = "alsa-tools-gui"
            else:
                srctag = get.srcNAME()

            inarytools.insinto("/usr/share/doc/%s/%s" % (srctag, tool), doc)

        shelltools.cd("..")

    inarytools.remove("/usr/share/applications/hdspmixer.desktop")
    inarytools.remove("/usr/share/applications/hdspconf.desktop")
コード例 #17
0
def meson_configure(parameters=""):
    if can_access_file('meson.build'):
        prefix = get.defaultprefixDIR()
        args = "meson \
              --prefix=/{0} \
              --buildtype=plain \
              --libdir=/{0}/lib{1} \
              --libexecdir=/{2} \
              --sysconfdir=/{3} \
              --localstatedir=/{4} \
              {5} inaryPackageBuild".format(
            prefix, "32 " if get.buildTYPE() == "emul32" else "",
            get.libexecDIR(), get.confDIR(), get.localstateDIR(), parameters)

        if system(args):
            raise MesonError(_('Configure failed.'))
    else:
        raise ConfigureError(
            _('No configure script found. (\"{}\" file not found.)'.format(
                "meson.build")))
コード例 #18
0
def cmake_configure(parameters=""):
    makedirs("inaryPackageBuild")
    cd("inaryPackageBuild")

    if can_access_file(util.join_path("..", 'CMakeLists.txt')):
        args = 'cmake -DCMAKE_INSTALL_PREFIX=/{0} \
                      -DCMAKE_INSTALL_LIBDIR={1} \
                      -DCMAKE_C_FLAGS="{6} {2}" \
                      -DCMAKE_CXX_FLAGS="{6} {3}" \
                      -DCMAKE_LD_FLAGS="{4}" \
                      -DCMAKE_BUILD_TYPE=RelWithDebInfo {5} -G Ninja ..'.format(
            get.defaultprefixDIR(),
            "/usr/lib32 " if get.buildTYPE() == "emul32" else "/usr/lib",
            get.CFLAGS(), get.CXXFLAGS(), get.LDFLAGS(), parameters,
            "-m32" if get.buildTYPE() == "emul32" else "-m64")

        if system(args):
            raise ConfigureError(_('CMake configure failed.'))
    else:
        raise ConfigureError(
            _('No configure script found. (\"{}\" file not found.)'.format(
                "CMakeLists.txt")))
コード例 #19
0
ファイル: gotools.py プロジェクト: sulincix/inary
def configure(parameters='', installPrefix='', sourceDir='.'):
    """configure source with given Go parameters = "-DGo_BUILD_TYPE -DGo_CXX_FLAGS ... " """
    if not can_access_file(join_path(sourceDir, 'main.go')):
        raise ConfigureError(_('{} not found'.format("main.go")))
コード例 #20
0
ファイル: autotools.py プロジェクト: SulinOS/inary
def fixInfoDir():
    infoDir = '{}/usr/share/info/dir'.format(get.installDIR())
    if can_access_file(infoDir):
        unlink(infoDir)
コード例 #21
0
 def testCanAccessFile(self):
     from inary.actionsapi.shelltools import can_access_file
     self.assertTrue(can_access_file(__file__))
     self.assertFalse(can_access_file('actionsapi/set.py'))