A collection of +180 reusable WebAssembly modules for building composable CI/CD pipelines with FluentCI fluentci.io/modules
modules setup macports
2 folders · 15 files

README.md

Setup MacPorts #

Install the official signed MacPorts system package for the current macOS release and verify /opt/local/bin/port. This typed PureScript Wasm component requires FluentCI v0.17.2+.

fluentci run setup-macports setup --version 2.12.7 --packages git,cmake,ninja --sudo
fluentci run setup-macports setup --help

macOS only, on Intel and Apple Silicon. Setup selects the release .pkg matching sw_vers -productVersion, verifies the upstream SHA-256 and package signature, then invokes Apple's installer. A missing matching package or digest fails before installation. Linux and BSD hosts fail before mutation.

The default is latest; exact versions may include v. A new system install requires root or explicit --sudo (noninteractive sudo -n). The official installer fixes the prefix at /opt/local; --install-dir and --package-name are rejected. Existing installations are reused only if they match the selected release; a mismatch fails without replacing the installation. The native package may initialize its ports tree as part of its upstream post-install procedure.

packages optionally installs a comma-separated list of port names, such as git,cmake,ninja,python312, after the CLI is verified. Whitespace around names is trimmed; omitted or blank values retain CLI-only setup. Empty entries and invalid names fail before any host command. Package versions come from the configured ports tree; this argument does not fetch arbitrary historical versions.

Setup invokes /opt/local/bin/port -N install with the requested names. Use --sudo for noninteractive privilege elevation; otherwise the command runs with the current user's permissions. A failed package install fails setup without publishing a successful environment. Already installed files may remain.

Xcode Command Line Tools, accepted licenses, configured sources, and permissions for port installation remain runner prerequisites. This module always verifies and invokes native MacPorts at its fixed path, even if the Rust port implementation is earlier on PATH.

Returns tool, version, bin-dir, and environment; publishes /opt/local/bin for subsequent host tasks, plus /opt/local/sbin when packages are requested. Separate CLI processes must propagate the returned environment. See COMPONENT.md for typed arguments and returns.

MacPorts installation guide · Upstream releases · MIT module license.

Compose this module from code #

Requires FluentCI 0.17.6 or newer for generated pipeline bindings. From your caller module's directory, add the dependency:

fluentci add setup-macports --path /path/to/fluentci-modules/setup/macports

For a published module, use fluentci add @fluentci.io/setup-macports@VERSION with an available version. Commit the caller's manifest and lockfile. FluentCI generates named bindings from the installed component's WIT; no handwritten FFI or CLI subprocess is needed. Include generated source directories in the caller's SDK project. The callee can use a different SDK from the caller.

Provision macports before the build steps that require it. The setup result reports the installed version and executable directory.

Replace the sample organization, paths and identifiers with your own. Configure credentials through your CI secret provider before running authenticated operations. Optional arguments use the callee's defaults, and public list fields use comma-separated strings. See COMPONENT.md for argument descriptions and return types.

These examples use the generated composition API and builder chaining in FluentCI 0.17.6; full cross-SDK compilation and execution coverage is still pending. See composition support and limitations.

PureScript #

module Main where

import Prelude
import Effect (Effect)
import FluentCI.Flow as Flow
import FluentCI.Modules.SetupMacports as SetupMacports

run :: Effect String
run =
  Flow.pipeline "setup-macports-setup"
    # Flow.workdir "."
    # SetupMacports.setup (SetupMacports.setupArgs)
    # Flow.map (\result -> result.version)
    # Flow.run

Gleam #

import fluentci/flow
import fluentci_modules/setup_macports

pub fn run() -> String {
  flow.pipeline("setup-macports-setup")
  |> flow.workdir(".")
  |> setup_macports.setup(setup_macports.setup_args())
  |> flow.map(fn(result) { result.version })
  |> flow.run
}

Use Gleam's JavaScript target for the Wasm guest. BEAM escripts used for repository automation are separate from component guests.

Elixir #

defmodule Main do
  use FluentCI.Plugin
  alias FluentCI.Flow
  alias FluentCI.Modules.SetupMacports

  defplugin run do
    Flow.pipeline("setup-macports-setup")
    |> Flow.workdir(".")
    |> SetupMacports.setup(%{})
    |> Flow.stdout()
  end
end

Elixir compiles this sequence to Rust/Wasm. Its initial Flow API does not yet provide the typed result callbacks or cleanup combinators of the other examples.

ClojureScript #

(ns main.plugin
  (:require [fluentci.flow :as flow]
            [fluentci-modules.setup-macports :as setup_macports]))

(defn run []
  (-> (flow/pipeline "setup-macports-setup")
      (flow/workdir ".")
      (setup_macports/setup {})
      flow/run!))

ReScript #

let run = (): string =>
  Flow.pipeline("setup-macports-setup")
  ->Flow.workdir(".")
  ->FluentciModulesSetupMacports.setup(FluentciModulesSetupMacports.setupArgs)
  ->Flow.map(result => result.version)
  ->Flow.run

Python #

from fluentci.flow import pipeline
from fluentci_modules import setup_macports


def run() -> str:
    return (
        pipeline("setup-macports-setup")
        .workdir(".")
        .pipe(setup_macports.setup, {})
        .map(lambda result: result.version)
        .run()
    )

TypeScript #

import * as flow from "./fluentci_modules/flow";
import * as setup_macports from "./fluentci_modules/setup-macports/index";

export function run(): string {
  return flow.pipeline("setup-macports-setup")
    .workdir(".")
    .pipe(setup_macports.setup, {})
    .map(result => result.version)
    .run();
}

Python and TypeScript use FluentCI builder chains: .pipe(module.function, args) composes generated module functions with .workdir, .env, and .exec. Functions return a pipeline carrying their typed result. Use a generated result callback (With/_with, or a callback argument in TypeScript/Python) when a later module needs a preceding result; use Flow's map operation to select a result field. Execution begins at run (or the Elixir plugin terminal), in declared order.

Exported functions #

Function Purpose
setup Install and verify macports, select its version, and publish its environment for subsequent tasks.