def simple(builder, name, role, checkout, rev=None, branch=None, simpleCheckout=False, config=True, perRoleMakefiles=False, makefileName=DEFAULT_MAKEFILE_NAME): """ Build a package controlled by our simplified C/C++ make rules, called name with role role from the sources in checkout checkout. * simpleCheckout - If True, register the checkout too. * config - If True, we have make config. If false, we don't. * perRoleMakefiles - If True, we run 'make -f Makefile.<rolename>' instead of just make. """ if (simpleCheckout): simple_checkouts.relative(builder, checkout, rev=rev, branch=branch) the_pkg = CxxBuilder(name, role, checkout, config=config, perRoleMakefiles=perRoleMakefiles, makefileName=makefileName) # Add the standard dependencies .. pkg.add_package_rules(builder.ruleset, name, role, the_pkg) # .. and make us depend on the checkout. pkg.package_depends_on_checkout(builder.ruleset, name, role, checkout, the_pkg)
def expanding_package(builder, name, archive_dir, role, co_name, co_dir, makefile=DEFAULT_MAKEFILE_NAME, deps=None, archive_file=None, archive_ext='.tar.bz2',): """Specify how to expand and build an archive file. As normal, 'name' is the package name, 'role' is the role to build it in, 'co_name' is the name of the checkout, and 'co_dir' is the directory in which that lives. We expect to unpack an archive <co_dir>/<co_name>/<archive_dir><archive_ext> into $(MUDDLE_OBJ)/<archive_dir>. (NB: if the archive file does not expand into a directory of the obvious name, you can specify the archive file name separately, using 'archive_file'). So, for instance, all of our X11 "stuff" lives in checkout "X11R7.5" which is put into directory "x11" -- i.e., "src/X11/X11R7.5". That lets us keep stuff together in the repository, without leading to a great many packages that are of no direct interest to anyone else. Within that we then have various muddle makefiles, and a set of .tar.bz archive files. 1. The archive file expands into a directory called 'archive_dir' 2. It is assumed that the archive file is named 'archive_dir' + 'archive_ext'. If this is not so, then specify 'archive_file' (and/or 'archive_ext') appropriately. This function is used to say: take the named archive file, use package name 'name', unpack the archive file into $(MUDDLE_OBJ_OBJ), and build it using the named muddle makefile. This allows various things to be build with the same makefile, which is useful for (for instance) X11 proto[type] archives. Note that in $(MUDDLE_OBJ), 'obj' (i.e., $(MUDDLE_OBJ_OBJ)) will be a soft link to the expanded archive directory. """ if archive_file is None: archive_file = archive_dir + archive_ext # Define how to build our package dep = ExpandingMakeBuilder(name, role, co_name, archive_file, archive_dir, makefile) pkg.add_package_rules(builder.ruleset, name, role, dep) # It depends on the checkout pkg.package_depends_on_checkout(builder.ruleset, name, role, co_name) # And maybe on other packages if deps: pkg.do_depend(builder, name, [role], deps)
def simple(builder, coName, name, roles, depends_on=[], pkgFile=None, debName=None, instrFile=None, postInstallMakefile=None, isDev=False, nonDevCoName=None, nonDevPkgFile=None): """ Build a package called 'name' from co_name / pkg_file with an instruction file called instr_file. 'name' is the name of the muddle package and of the debian package. if you want them different, set deb_name to something other than None. Set isDev to True for a dev package, False for an ordinary binary package. Dev packages are installed into the object directory where MUDDLE_INC_DIRS etc. expects to look for them. Actual packages are installed into the installation directory where they will be transported to the target system. """ if (debName is None): debName = name if (pkgFile is None): pkgFile = debName for r in roles: if isDev: dep = DebDevAction(name, r, coName, debName, pkgFile, instrFile, postInstallMakefile, nonDevCoName=nonDevCoName, nonDevPkgFile=nonDevPkgFile) else: dep = DebAction(name, r, coName, debName, pkgFile, instrFile, postInstallMakefile) pkg.add_package_rules(builder.ruleset, name, r, dep) # We should probably depend on the checkout .. . pkg.package_depends_on_checkout(builder.ruleset, name, r, coName, dep) # .. and some other packages. Y'know, because we can .. pkg.package_depends_on_packages(builder.ruleset, name, r, utils.LabelTag.PreConfig, depends_on)
def build_with_helper(builder, helpers, pkg_name, checkout, roles, makefileName=None, co_dir=None, repoRelative=None, rev=None): """ Builds a package called 'pkg_name' from a makefile in a helpers checkout called 'helpers', involving the use of the checkout 'checkout', which is a relative checkout with optional second level name co_dir, repo relative name repoRelative, and revision rev. In other words, declares that 'pkg_name' in the given 'roles' will be built with the Makefile called: <helpers>/<makefileName> If 'co_dir' is None, this will be checked out using checkouts.simple.relative(), otherwise it will be checked out using checkouts.twolevel.relative(). The 'co_dir', 'repoRelative' and 'rev' arguments will be used in the obvious ways. """ if (makefileName is None): makefileName = os.path.join(pkg_name, "Makefile.muddle") make.medium(builder, name=pkg_name, roles=roles, checkout="helpers", makefileName=makefileName, simpleCheckout=False) # Make sure we actually check out .. if (co_dir is None): co_simple.relative(builder, checkout, repoRelative, rev) else: co_twolevel.relative(builder, co_dir=co_dir, co_name=checkout, repo_relative=repoRelative, rev=rev) # Now depend on any additional checkouts .. for r in roles: pkg.package_depends_on_checkout(builder.ruleset, pkg_name, r, checkout)
def build_with_helper(builder, helpers, pkg_name, checkout, roles, makefileName = None, co_dir = None, repoRelative = None, rev = None): """ Builds a package called 'pkg_name' from a makefile in a helpers checkout called 'helpers', involving the use of the checkout 'checkout', which is a relative checkout with optional second level name co_dir, repo relative name repoRelative, and revision rev. In other words, declares that 'pkg_name' in the given 'roles' will be built with the Makefile called: <helpers>/<makefileName> If 'co_dir' is None, this will be checked out using checkouts.simple.relative(), otherwise it will be checked out using checkouts.twolevel.relative(). The 'co_dir', 'repoRelative' and 'rev' arguments will be used in the obvious ways. """ if (makefileName is None): makefileName = os.path.join(pkg_name, "Makefile.muddle") make.medium(builder, name = pkg_name, roles = roles, checkout = "helpers", makefileName = makefileName, simpleCheckout = False) # Make sure we actually check out .. if (co_dir is None): co_simple.relative(builder, checkout, repoRelative, rev) else: co_twolevel.relative(builder, co_dir = co_dir, co_name = checkout, repo_relative = repoRelative, rev = rev) # Now depend on any additional checkouts .. for r in roles: pkg.package_depends_on_checkout(builder.ruleset, pkg_name, r, checkout)
def simple(builder, coName, name, roles, depends_on = [ ], pkgFile = None, debName = None, instrFile = None, postInstallMakefile = None, isDev = False, nonDevCoName = None, nonDevPkgFile = None): """ Build a package called 'name' from co_name / pkg_file with an instruction file called instr_file. 'name' is the name of the muddle package and of the debian package. if you want them different, set deb_name to something other than None. Set isDev to True for a dev package, False for an ordinary binary package. Dev packages are installed into the object directory where MUDDLE_INC_DIRS etc. expects to look for them. Actual packages are installed into the installation directory where they will be transported to the target system. """ if (debName is None): debName = name if (pkgFile is None): pkgFile = debName for r in roles: if isDev: dep = DebDevAction(name, r, coName, debName, pkgFile, instrFile, postInstallMakefile, nonDevCoName = nonDevCoName, nonDevPkgFile = nonDevPkgFile) else: dep = DebAction(name, r, coName, debName, pkgFile, instrFile, postInstallMakefile) pkg.add_package_rules(builder.ruleset, name, r, dep) # We should probably depend on the checkout .. . pkg.package_depends_on_checkout(builder.ruleset, name, r, coName, dep) # .. and some other packages. Y'know, because we can .. pkg.package_depends_on_packages(builder.ruleset, name, r, utils.LabelTag.PreConfig, depends_on)
def simple(builder, name, role, checkout, rev=None, branch=None, simpleCheckout=False, config=True, perRoleMakefiles=False, makefileName=DEFAULT_MAKEFILE_NAME, usesAutoconf=False, rewriteAutoconf=False, execRelPath=None): """ Build a package controlled by make, called name with role role from the sources in checkout checkout. * simpleCheckout - If True, register the checkout too. * config - If True, we have make config. If false, we don't. * perRoleMakefiles - If True, we run 'make -f Makefile.<rolename>' instead of just make. * usesAutoconf - If True, this package is given access to .la and .pc files from things it depends on. * rewriteAutoconf - If True, we will rewrite .la and .pc files in the output directory so that packages which use autoconf continue to depend correctly. Intended for use with the MUDDLE_PKGCONFIG_DIRS environment variable. * execRelPath - Where, relative to the object directory, do we find binaries for this package? """ if (simpleCheckout): simple_checkouts.relative(builder, checkout, rev=rev, branch=branch) the_pkg = MakeBuilder(name, role, checkout, config=config, perRoleMakefiles=perRoleMakefiles, makefileName=makefileName, usesAutoconf=usesAutoconf, rewriteAutoconf=rewriteAutoconf, execRelPath=execRelPath) # Add the standard dependencies .. pkg.add_package_rules(builder.ruleset, name, role, the_pkg) # .. and make us depend on the checkout. pkg.package_depends_on_checkout(builder.ruleset, name, role, checkout, the_pkg)
def simple(builder, name, role, checkout, rev = None, branch = None, simpleCheckout = False, config = True, perRoleMakefiles = False, makefileName = DEFAULT_MAKEFILE_NAME): """ Build a package controlled by our simplified C/C++ make rules, called name with role role from the sources in checkout checkout. * simpleCheckout - If True, register the checkout too. * config - If True, we have make config. If false, we don't. * perRoleMakefiles - If True, we run 'make -f Makefile.<rolename>' instead of just make. """ if (simpleCheckout): simple_checkouts.relative(builder, checkout, rev=rev, branch=branch) the_pkg = CxxBuilder(name, role, checkout, config = config, perRoleMakefiles = perRoleMakefiles, makefileName = makefileName) # Add the standard dependencies .. pkg.add_package_rules(builder.ruleset, name, role, the_pkg) # .. and make us depend on the checkout. pkg.package_depends_on_checkout(builder.ruleset, name, role, checkout, the_pkg)
def simple(builder, name, role, checkout, rev=None, branch=None, simpleCheckout = False, config = True, perRoleMakefiles = False, makefileName = DEFAULT_MAKEFILE_NAME, usesAutoconf = False, rewriteAutoconf = False, execRelPath = None): """ Build a package controlled by make, called name with role role from the sources in checkout checkout. * simpleCheckout - If True, register the checkout too. * config - If True, we have make config. If false, we don't. * perRoleMakefiles - If True, we run 'make -f Makefile.<rolename>' instead of just make. * usesAutoconf - If True, this package is given access to .la and .pc files from things it depends on. * rewriteAutoconf - If True, we will rewrite .la and .pc files in the output directory so that packages which use autoconf continue to depend correctly. Intended for use with the MUDDLE_PKGCONFIG_DIRS environment variable. * execRelPath - Where, relative to the object directory, do we find binaries for this package? """ if (simpleCheckout): simple_checkouts.relative(builder, checkout, rev=rev, branch=branch) the_pkg = MakeBuilder(name, role, checkout, config = config, perRoleMakefiles = perRoleMakefiles, makefileName = makefileName, usesAutoconf = usesAutoconf, rewriteAutoconf = rewriteAutoconf, execRelPath = execRelPath) # Add the standard dependencies .. pkg.add_package_rules(builder.ruleset, name, role, the_pkg) # .. and make us depend on the checkout. pkg.package_depends_on_checkout(builder.ruleset, name, role, checkout, the_pkg)
def expanding_package( builder, name, archive_dir, role, co_name, co_dir, makefile=DEFAULT_MAKEFILE_NAME, deps=None, archive_file=None, archive_ext='.tar.bz2', ): """Specify how to expand and build an archive file. As normal, 'name' is the package name, 'role' is the role to build it in, 'co_name' is the name of the checkout, and 'co_dir' is the directory in which that lives. We expect to unpack an archive <co_dir>/<co_name>/<archive_dir><archive_ext> into $(MUDDLE_OBJ)/<archive_dir>. (NB: if the archive file does not expand into a directory of the obvious name, you can specify the archive file name separately, using 'archive_file'). So, for instance, all of our X11 "stuff" lives in checkout "X11R7.5" which is put into directory "x11" -- i.e., "src/X11/X11R7.5". That lets us keep stuff together in the repository, without leading to a great many packages that are of no direct interest to anyone else. Within that we then have various muddle makefiles, and a set of .tar.bz archive files. 1. The archive file expands into a directory called 'archive_dir' 2. It is assumed that the archive file is named 'archive_dir' + 'archive_ext'. If this is not so, then specify 'archive_file' (and/or 'archive_ext') appropriately. This function is used to say: take the named archive file, use package name 'name', unpack the archive file into $(MUDDLE_OBJ_OBJ), and build it using the named muddle makefile. This allows various things to be build with the same makefile, which is useful for (for instance) X11 proto[type] archives. Note that in $(MUDDLE_OBJ), 'obj' (i.e., $(MUDDLE_OBJ_OBJ)) will be a soft link to the expanded archive directory. """ if archive_file is None: archive_file = archive_dir + archive_ext # Define how to build our package dep = ExpandingMakeBuilder(name, role, co_name, archive_file, archive_dir, makefile) pkg.add_package_rules(builder.ruleset, name, role, dep) # It depends on the checkout pkg.package_depends_on_checkout(builder.ruleset, name, role, co_name) # And maybe on other packages if deps: pkg.do_depend(builder, name, [role], deps)