Beispiel #1
0
    def __write_setup_file(self, file):
        setup_info = dict(self.__setup_info)

        setup_args = []

        packages = setup_info.pop('packages', None)
        if packages is None:
            # no 'packages' option was given, or it is None
            setup_args.append('packages=find_packages()')
        else:
            setup_args.append('packages={0!r}'.format(packages))

        for key, value in setup_info.iteritems():
            val = self.options.get(key, value)
            setup_args.append('{0}={1!r}'.format(key, val))

        setup = LazyFileWriter(file)
        setup.create()
        setup.write('''#!{0}
#########################################################################
#                                                                       #
#               -----------------------------------------               #
#                THIS FILE WAS AUTOGENERATED BY MIRBUILD                #
#               -----------------------------------------               #
#                                                                       #
#  You can put your own customisations in this file, just remove this   #
#  header and the file won't be cleaned up automatically.               #
#                                                                       #
#########################################################################

from setuptools import setup, find_packages

setup({1})
'''.format(sys.executable, ",\n      ".join(setup_args)))
        setup.commit()
Beispiel #2
0
    def __write_setup_file(self, file):
        setup_info = dict(self.__setup_info)

        setup_args = []

        packages = setup_info.pop('packages', None)
        if packages is None:
            # no 'packages' option was given, or it is None
            setup_args.append('packages=find_packages()')
        else:
            setup_args.append('packages={0!r}'.format(packages))

        for key, value in setup_info.iteritems():
            val = self.options.get(key, value)
            setup_args.append('{0}={1!r}'.format(key, val))

        setup = LazyFileWriter(file)
        setup.create()
        setup.write('''#!{0}
#########################################################################
#                                                                       #
#               -----------------------------------------               #
#                THIS FILE WAS AUTOGENERATED BY MIRBUILD                #
#               -----------------------------------------               #
#                                                                       #
#  You can put your own customisations in this file, just remove this   #
#  header and the file won't be cleaned up automatically.               #
#                                                                       #
#########################################################################

from setuptools import setup, find_packages

setup({1})
'''.format(sys.executable, ",\n      ".join(setup_args)))
        setup.commit()
Beispiel #3
0
    def do_configure(self):
        slc = {
            'CPPPATH': list(os.path.realpath(i) for i in self.__incpath),
            'LIBPATH': list(os.path.realpath(i) for i in self.__libpath),
            'CPPDEFINES': self.__defines,
            'CCFLAGS': ['-Wall'],
            'LINKFLAGS': {},
            'PREFIX' :self.opt.prefix,
            }
        if self.env.has_tool('cxx'):
            slc['CXX'] = self.env.tool('cxx')
        if self.env.has_tool('cc'):
            slc['CC'] = self.env.tool('cc')

        getattr(self, 'configure_' + self.build_config)(slc)

        slcfile = LazyFileWriter('scons-local-config.py')
        slcfile.create()
        slcfile.write('# build configuration for {0} (generated by {1})\n'.format(self.project_name, self.ident))
        slcfile.write("".join(("{0} = {1!r}\n".format(i, slc[i])) for i in sorted(slc)))
        slcfile.commit()
Beispiel #4
0
    def __write_file(self):
        pkgs = DebianControl().packages
        tmpdir = pkgs[0] if len(pkgs) == 1 and not os.path.exists(
            os.path.join('debian', pkgs[0] + '.install')) else 'tmp'

        fh = LazyFileWriter(self.rules_file, executable=True)
        fh.create()
        fh.write('''#!/usr/bin/make -f
#########################################################################
#                                                                       #
#               -----------------------------------------               #
#                THIS FILE WAS AUTOGENERATED BY MIRBUILD                #
#               -----------------------------------------               #
#                                                                       #
#  If you really have to customise the rules file, please remove this   #
#  header and I'll never bother you again. Please try to keep in mind   #
#  that this means you can't take advantage of any future improvements  #
#  an autogenerated rules file might bring. You have been warned! ;-)   #
#                                                                       #
#########################################################################

PYTHON={0}{1}
TMP=$(CURDIR)/debian/{2}/
'''.format(self.python_executable, ' -d' if self.debug else '', tmpdir))
        if self.verbose or self.debug:
            fh.write('\nexport DH_VERBOSE=1\n')
        fh.write('''
%:
\tdh $@{0}

'''.format(''.join((' ' + i) for i in self.dh_options)))
        for target in sorted(self.__targets):
            fh.write('\n{0}:\n'.format(target))
            for line in self.__targets[target]:
                fh.write('\t{0}\n'.format(line.format(**self.__dict__)))
            fh.write('\n')

        fh.commit()
        self._set_created()
Beispiel #5
0
    def __write_file(self):
        pkgs = DebianControl().packages
        tmpdir = pkgs[0] if len(pkgs) == 1 and not os.path.exists(os.path.join('debian', pkgs[0] + '.install')) else 'tmp'

        fh = LazyFileWriter(self.rules_file, executable = True)
        fh.create()
        fh.write('''#!/usr/bin/make -f
#########################################################################
#                                                                       #
#               -----------------------------------------               #
#                THIS FILE WAS AUTOGENERATED BY MIRBUILD                #
#               -----------------------------------------               #
#                                                                       #
#  If you really have to customise the rules file, please remove this   #
#  header and I'll never bother you again. Please try to keep in mind   #
#  that this means you can't take advantage of any future improvements  #
#  an autogenerated rules file might bring. You have been warned! ;-)   #
#                                                                       #
#########################################################################

PYTHON={0}{1}
TMP=$(CURDIR)/debian/{2}/
'''.format(self.python_executable, ' -d' if self.debug else '', tmpdir))
        if self.verbose or self.debug:
            fh.write('\nexport DH_VERBOSE=1\n')
        fh.write('''
%:
\tdh $@{0}

'''.format(''.join((' '+i) for i in self.dh_options)))
        for target in sorted(self.__targets):
            fh.write('\n{0}:\n'.format(target))
            for line in self.__targets[target]:
                fh.write('\t{0}\n'.format(line.format(**self.__dict__)))
            fh.write('\n')

        fh.commit()
        self._set_created()
Beispiel #6
0
    def do_configure(self):
        slc = {
            'CPPPATH': list(os.path.realpath(i) for i in self.__incpath),
            'LIBPATH': list(os.path.realpath(i) for i in self.__libpath),
            'CPPDEFINES': self.__defines,
            'CCFLAGS': ['-Wall'],
            'LINKFLAGS': {},
            'PREFIX': self.opt.prefix,
        }
        if self.env.has_tool('cxx'):
            slc['CXX'] = self.env.tool('cxx')
        if self.env.has_tool('cc'):
            slc['CC'] = self.env.tool('cc')

        getattr(self, 'configure_' + self.build_config)(slc)

        slcfile = LazyFileWriter('scons-local-config.py')
        slcfile.create()
        slcfile.write(
            '# build configuration for {0} (generated by {1})\n'.format(
                self.project_name, self.ident))
        slcfile.write("".join(
            ("{0} = {1!r}\n".format(i, slc[i])) for i in sorted(slc)))
        slcfile.commit()