Example #1
0
    def _write_cluster_feed(self, cluster):
        feed_name = self._cluster_feed_name(cluster)
        
        subdirs = dict((self._src_dir_name(x),x) for x in cluster)
        
        interface = _.interface(
            uri=boost_feed_uri(feed_name)
            , xmlns='http://zero-install.sourceforge.net/2004/injector/interface'
            , **{
                'xmlns:compile':'http://zero-install.sourceforge.net/2006/namespaces/0compile'
                , 'xmlns:dc':'http://purl.org/dc/elements/1.1/'
                })[
            _.name['%s (built state)' % ', '.join(cluster),]
            , _.summary['Evil Build Dependency Cluster (EBDC)']
            , boost_icon
            , _.group(license=BSL_1_0)
            [
                self._implementation('*-src')[self._empty_zipball]
                , _.command(name='compile') [

                    _.runner(interface=ryppl_feed_uri('ryppl')) 
                    [
                        _.arg[ '0install-cmake' ]
                      , _.arg[ '--overlay=${BOOST_CMAKELISTS}' ] 

                        # , _.arg[ '--build-type=Debug' ] if component == 'dbg' else []
                        
                        , [ _.arg[x] 
                            for d,c in subdirs.items()
                            for x in ['--add-subdirectory', '${%s_SRCDIR}' % c, d ]
                            ]

                        # Component selection may be too naive here in
                        # general, but hopefully this whole block will
                        # be obsolete as we eliminate clusters
                        , [ _.arg[ d+'/'+component ] for component in 'dev','bin' for d in subdirs ]
                        ]

                    , [
                        _.requires(interface=boost_feed_uri(d+'-src')) [
                            _.environment(insert='.', mode='replace', name=c+'_SRCDIR')
                            ]
                        for d,c in subdirs.items()]

                    , _.requires(interface=boost_feed_uri('CMakeLists'))[
                        _.environment(insert='.', mode='replace', name='BOOST_CMAKELISTS')
                        ]

                    , self._dev_requirements(
                            dep for x in cluster for dep in self._build_dependencies(x)
                            if dep not in cluster
                            )
                    ]
                ]
            ]

        interface.indent()
        feed_path = self.feed_dir/feed_name+'.xml'
        xml_document(interface).write(feed_path, encoding='utf-8', xml_declaration=True)
        sign_feed(feed_path)
Example #2
0
        def _write_feed(self, component, *contents):
            interface = self._interface(component)[ 
                _.group(license=BSL_1_0) [
                    contents 
                ]
            ]
            interface.indent()
            feed_path = self.feed_dir/self._feed_name(component)
            xml_document(interface).write(feed_path, encoding='utf-8', xml_declaration=True)
            sys.stdout.flush()

            sign_feed(feed_path)