code: def buildRecipe(recipe, basedir, archList):
      """
      Build software using a recipe. This function does the
      'configure;make;make install' dance for C software, with a possibility
      to customize this process, basically a poor-mans DarwinPorts.
      """
      curdir = os.getcwd()
  
      name = recipe["name"]
      THIRD_PARTY_LIBS.append(name)
      url = recipe["url"]
      configure = recipe.get("configure", "./configure")
      buildrecipe = recipe.get("buildrecipe", None)
      install = recipe.get(
          "install",
          "make && make install DESTDIR=%s" % (shellQuote(basedir)),
      )
  
      archiveName = os.path.split(url)[-1]
      sourceArchive = os.path.join(DEPSRC, archiveName)
  
      if not os.path.exists(DEPSRC):
          os.mkdir(DEPSRC)
  
      verifyThirdPartyFile(url, recipe["checksum"], sourceArchive)
      print("Extracting archive for %s" % (name,))
      buildDir = os.path.join(WORKDIR, "_bld")
      if not os.path.exists(buildDir):
          os.mkdir(buildDir)
  
      workDir = extractArchive(buildDir, sourceArchive)
      os.chdir(workDir)
  
      for patch in recipe.get("patches", ()):
          if isinstance(patch, tuple):
              url, checksum = patch
              fn = os.path.join(DEPSRC, os.path.basename(url))
              verifyThirdPartyFile(url, checksum, fn)
          else:
              # patch is a file in the source directory
              fn = os.path.join(curdir, patch)
          runCommand(
              "patch -p%s < %s"
              % (
                  recipe.get("patchlevel", 1),
                  shellQuote(fn),
              )
          )
  
      for patchscript in recipe.get("patchscripts", ()):
          if isinstance(patchscript, tuple):
              url, checksum = patchscript
              fn = os.path.join(DEPSRC, os.path.basename(url))
              verifyThirdPartyFile(url, checksum, fn)
          else:
              # patch is a file in the source directory
              fn = os.path.join(curdir, patchscript)
          if fn.endswith(".bz2"):
              runCommand("bunzip2 -fk %s" % shellQuote(fn))
              fn = fn[:-4]
          runCommand("sh %s" % shellQuote(fn))
          os.unlink(fn)
  
      if "buildDir" in recipe:
          os.chdir(recipe["buildDir"])
  
      if configure is not None:
          configure_args = [
              "--prefix=/usr/local",
              "--enable-static",
              "--disable-shared",
              # "CPP=gcc -arch %s -E"%(' -arch '.join(archList,),),
          ]
  
          if "configure_pre" in recipe:
              args = list(recipe["configure_pre"])
              if "--disable-static" in args:
                  configure_args.remove("--enable-static")
              if "--enable-shared" in args:
                  configure_args.remove("--disable-shared")
              configure_args.extend(args)
  
          if recipe.get("useLDFlags", 1):
              configure_args.extend(
                  [
                      "CFLAGS=%s-mmacosx-version-min=%s -arch %s "
                      "-I%s/usr/local/include"
                      % (
                          recipe.get("extra_cflags", ""),
                          DEPTARGET,
                          " -arch ".join(archList),
                          shellQuote(basedir)[1:-1],
                      ),
                      "LDFLAGS=-mmacosx-version-min=%s -L%s/usr/local/lib -arch %s"
                      % (
                          DEPTARGET,
                          shellQuote(basedir)[1:-1],
                          " -arch ".join(archList),
                      ),
                  ]
              )
          else:
              configure_args.extend(
                  [
                      "CFLAGS=%s-mmacosx-version-min=%s -arch %s "
                      "-I%s/usr/local/include"
                      % (
                          recipe.get("extra_cflags", ""),
                          DEPTARGET,
                          " -arch ".join(archList),
                          shellQuote(basedir)[1:-1],
                      ),
                  ]
              )
  
          if "configure_post" in recipe:
              configure_args = configure_args + list(
                  recipe["configure_post"]
              )
  
          configure_args.insert(0, configure)
          configure_args = [shellQuote(a) for a in configure_args]
  
          print("Running configure for %s" % (name,))
          runCommand(" ".join(configure_args) + " 2>&1")
  
      if buildrecipe is not None:
          # call special-case build recipe, e.g. for openssl
          buildrecipe(basedir, archList)
  
      if install is not None:
          print("Running install for %s" % (name,))
          runCommand("{ " + install + " ;} 2>&1")
  
      print("Done %s" % (name,))
      print("")
  
      os.chdir(curdir)
  
imports: import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd, grp
label_desc: Use image node_id 26 for calling a global function with example usage: buildRecipe(recipe, basedir, archList) without return types