agentleFS
ekala-projectekala-project/ekala-claude-skills/skills/meson/SKILL.md

meson

Skill1 starsChanged 9 months agoMITView on GitHub

Package a Meson/Ninja project for corepkgs. Use when a source tree has a meson.build — covers mesonFlags, auto features, cross-compilation, and diagnosing Meson setup failures.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use mesonEntries to specify Meson -D options as a structured attrset.

    line 72
  2. Very specific:

    Use mesonFeatures for Meson feature type options (those that accept enabled/disabled/auto).

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Meson Build System

Minimal Example

{
  lib,
  stdenv,
  fetchFromGitHub,
  meson,
  ninja,
  pkg-config,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "example";
  version = "1.0.0";

  src = fetchFromGitHub {
    owner = "example";
    repo = "example";
    tag = "v${finalAttrs.version}";
    hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
  };

  nativeBuildInputs = [
    meson
    meson.configurePhaseHook  # Required
    ninja                      # Required
    pkg-config
  ];

  meta = {
    description = "Example Meson package";
    license = lib.licenses.mit;
  };
})

Essential Requirements

Always include:

  • meson.configurePhaseHook - Sets up configure phase
  • ninja - Required (Meson generates Ninja files)
  • pkg-config - Usually needed for dependencies

Common Patterns

With Dependencies

nativeBuildInputs = [
  meson
  meson.configurePhaseHook
  ninja
  pkg-config
];

buildInputs = [
  glib
  libcap
];

Meson Entries (Preferred)

Use mesonEntries to specify Meson -D options as a structured attrset. Booleans are automatically converted to true/false.

mesonEntries = {
  docs = false;
  man = true;
  wrap_mode = "nodownload";
};

Meson Features

Use mesonFeatures for Meson feature type options (those that accept enabled/disabled/auto). Booleans are automatically converted to enabled/disabled.

mesonFeatures = {
  introspection = withIntrospection;
  tests = false;
};

Both mesonEntries and mesonFeatures are merged into the same set of -D flags. If a key appears in both, mesonFeatures wins.

Meson Flags (Legacy)

mesonFlags still works for string-based flags and non--D flags:

mesonFlags = [
  "-Ddocs=false"
  "-Dtests=false"
  "-Dsystemd=disabled"
  "-Dman=true"
];

Both can be used together. mesonFlags values override mesonEntries for the same key (meson uses last-wins for -D flags). Use mesonFlags for non--D flags like --cross-file.

Cross-Compilation

strictDeps = true;

nativeBuildInputs = [ meson meson.configurePhaseHook ninja pkg-config ];
buildInputs = [ glib ];
depsBuildBuild = [ pkg-config ];

Troubleshooting

Dependency not found:

mesonFeatures = { optional_feature = false; };

Disable subproject downloads:

mesonEntries = { wrap_mode = "nodownload"; };

Disable documentation:

mesonEntries = {
  docs = false;
  gtk_doc = false;
  man = false;
};

Force library directory:

mesonEntries = { libdir = "lib"; };

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.