Skip to content

How to build a project using MixDown without importing

white238 edited this page Mar 8, 2013 · 5 revisions
  1. Create a MixDown project file; for example, myProject.md.

  2. Create a target for each package that needs to be installed. The format is as follows:

Name: [Name of Project]
Path: [Path of Project]
Aliases: [List of aliases, comma delimited]
DependsOn: [List of dependancies, comma delimited]
Fetch: [Commands to be executed]
Unpack: [Commands to be executed]
Patch: [Commands to be executed]
Preconfig: [Commands to be executed]
Config: [Commands to be executed]
Build: [Commands to be executed]
Install: [Commands to be executed]
Clean: [Commands to be executed]

The 'Name' and 'Path' fields are required and an error will be thrown if they are not present. All other fields are optional. Though obviously some build steps are required if MixDown is to do anything. For more information on Targets, read Targets.

If you want to use MixDown's built-in ability for the 'Fetch' and 'Unpack' steps, use the following commands:

Fetch: steps.fetch(pythonCallInfo)
Unpack: steps.unpack(pythonCallInfo)

You can create custom python functions if straight commands will not suffice for your project. For more information, read Custom Python Functions.

  1. Build targets by running MixDown on the created project file in build mode (default mode). The following command will run with 4 job slot, verbose mode, and install to location 'TestPrefix':

mixdown -j4 -v -pTestPrefix myProject.md

For more information on command line options, read Command Line Options.

  1. (Optional) Clean targets by running MixDown in clean mode with the following command.

mixdown --clean myProject.md

Example of a MixDown project file

Name: Foo
Path: /path/to/foo.1.0.0.tar.gz
DependsOn: Bar
Fetch: steps.fetch(pythonCallInfo) Unpack: steps.unpack(pythonCallInfo) Preconfig: autoreconf -i
Config: ./configure
Patch: mySteps.patchFoo(pythonCallInfo)
Build: make
Install: make install
Clean: make clean

Name: Bar
Path: http://path/to/bar.1.0.0.tar.gz
Fetch: steps.fetch(pythonCallInfo) Unpack: steps.unpack(pythonCallInfo) Preconfig: autoreconf -i
Config: ./configure
Patch: mySteps.patchFoo(pythonCallInfo)
Build: make
Install: make install
Clean: make clean

Custom Python function file

import sys
from md import utilityFunctions

def pathFoo(pythonCallInfo):
    variableList = {}

    filename = pythonCallInfo.currentPath+"/config.py"
    variableList['MPICC'] = "'/Users/test/mpi/bin/mpicc'"
    variableList['CC'] = "'/usr/local/gfortran/bin/gcc'"

    pythonCallInfo.success =  utilityFunctions.setVariables(filename, variableList)

    return pythonCallInfo