Skip to content

ekala-project/corepkgs / .agents/skills/meson

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.

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"; };
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 193kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 193kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 193kUpdated Claude CodeCodexVerifiedInstall